/* ========================================
   海角社区 - 全站CSS样式文件
   ======================================== */

/* 1. 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, -apple-system, BlinkMacSystemFont, '微软雅黑', 'Microsoft YaHei';
  color: #333;
  background-color: #f5f5f5;
  line-height: 1.6;
}

/* 2. 头部样式 */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.site-title {
  font-size: 24px;
  font-weight: bold;
  color: #d4af37;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-title:hover {
  color: #e8c547;
}

/* 3. 导航栏样式 */
nav {
  display: flex;
  gap: 30px;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

nav a:hover {
  color: #d4af37;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #d4af37;
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* 4. 搜索框样式 */
.search-box {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  padding: 8px 15px;
  gap: 10px;
}

.search-box input {
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  width: 150px;
  outline: none;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-box button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
}

/* 5. 主容器样式 */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 6. 面包屑导航 */
.breadcrumb {
  background-color: white;
  padding: 15px 0;
  margin: 20px 0;
  font-size: 14px;
}

.breadcrumb a {
  color: #d4af37;
  text-decoration: none;
  margin: 0 5px;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: #999;
  margin: 0 5px;
}

/* 7. 主内容区域 */
main {
  background-color: white;
  padding: 40px 0;
  min-height: calc(100vh - 300px);
}

/* 8. 轮播图/Banner */
.banner {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 40px;
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: zoomIn 0.5s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(1.1);
  }
  to {
    transform: scale(1);
  }
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

.banner-overlay h1 {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #d4af37;
}

.banner-overlay p {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9);
}

/* 9. 模块样式 */
.module {
  margin-bottom: 50px;
}

.module-title {
  font-size: 28px;
  font-weight: bold;
  color: #1a1a2e;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 3px solid #d4af37;
  display: inline-block;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* 10. 卡片样式 */
.card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-image {
  width: 100%;
  height: 200px;
  background-color: #e0e0e0;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background-color: rgba(212, 175, 55, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-image:hover .card-play-button {
  opacity: 1;
}

.card-play-button::after {
  content: '▶';
  color: white;
  font-size: 24px;
  margin-left: 3px;
}

.card-content {
  padding: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: bold;
  color: #1a1a2e;
  margin-bottom: 10px;
  line-height: 1.4;
}

.card-description {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #999;
}

.card-tag {
  display: inline-block;
  background-color: #f0f0f0;
  color: #666;
  padding: 5px 10px;
  border-radius: 4px;
  margin-right: 5px;
  margin-bottom: 5px;
  font-size: 12px;
}

/* 11. 按钮样式 */
.btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: #d4af37;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
  background-color: #c9a227;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: #16213e;
  color: white;
}

.btn-secondary:hover {
  background-color: #0f1621;
}

/* 12. 专家展示 */
.expert-card {
  text-align: center;
  padding: 20px;
}

.expert-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 15px;
  object-fit: cover;
  border: 3px solid #d4af37;
}

.expert-name {
  font-size: 16px;
  font-weight: bold;
  color: #1a1a2e;
  margin-bottom: 5px;
}

.expert-title {
  font-size: 14px;
  color: #d4af37;
  margin-bottom: 10px;
}

.expert-bio {
  font-size: 13px;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.5;
}

.expert-links {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.expert-links a {
  font-size: 12px;
  color: white;
  background-color: #d4af37;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.expert-links a:hover {
  background-color: #c9a227;
}

/* 13. FAQ样式 */
.faq-item {
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.faq-question {
  background-color: #f5f5f5;
  padding: 15px;
  cursor: pointer;
  font-weight: bold;
  color: #1a1a2e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}

.faq-question:hover {
  background-color: #efefef;
}

.faq-toggle {
  font-size: 18px;
  color: #d4af37;
}

.faq-answer {
  padding: 15px;
  color: #666;
  display: none;
  background-color: white;
  line-height: 1.6;
}

.faq-answer.active {
  display: block;
}

/* 14. 用户评论 */
.review-item {
  padding: 20px;
  border-left: 4px solid #d4af37;
  background-color: #f9f9f9;
  margin-bottom: 15px;
  border-radius: 4px;
}

.review-author {
  font-weight: bold;
  color: #1a1a2e;
  margin-bottom: 5px;
}

.review-rating {
  color: #d4af37;
  font-size: 14px;
  margin-bottom: 10px;
}

.review-text {
  color: #666;
  line-height: 1.6;
}

/* 15. 底部样式 */
footer {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 40px 0 20px;
  margin-top: 50px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h3 {
  color: #d4af37;
  margin-bottom: 15px;
  font-size: 16px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: #d4af37;
}

.footer-qrcode {
  text-align: center;
  margin-bottom: 20px;
}

.footer-qrcode img {
  width: 100px;
  height: 100px;
  margin: 0 10px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom p {
  margin-bottom: 10px;
}

/* 16. 社交分享 */
.social-share {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.social-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #d4af37;
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.social-share a:hover {
  background-color: #c9a227;
  transform: scale(1.1);
}

/* 17. 响应式设计 */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    gap: 15px;
  }

  nav {
    gap: 15px;
    font-size: 12px;
  }

  .search-box input {
    width: 100px;
  }

  .banner {
    height: 250px;
  }

  .banner-overlay h1 {
    font-size: 32px;
  }

  .banner-overlay p {
    font-size: 16px;
  }

  .module-title {
    font-size: 22px;
  }

  .module-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }

  .card-image {
    height: 150px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-qrcode {
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  .footer-qrcode img {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 480px) {
  .header-container {
    flex-direction: column;
    gap: 10px;
  }

  .logo-section {
    width: 100%;
    justify-content: center;
  }

  nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }

  .banner {
    height: 200px;
  }

  .banner-overlay h1 {
    font-size: 24px;
  }

  .banner-overlay p {
    font-size: 14px;
  }

  .module-title {
    font-size: 18px;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .card-content {
    padding: 15px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 12px;
  }
}

/* 18. 懒加载优化 */
img[loading="lazy"] {
  background-color: #f0f0f0;
}

video {
  max-width: 100%;
  height: auto;
}

/* 19. 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

/* 20. 工具类 */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.pt-20 {
  padding-top: 20px;
}

.pb-20 {
  padding-bottom: 20px;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}
