/* 海角社区 - 海角社区 - 用户互动与原创内容聚集地 CSS 样式表 */

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

:root {
  --primary-green: #1a5d3a;
  --accent-orange: #ff6b35;
  --light-gray: #f5f5f5;
  --dark-gray: #333333;
  --border-color: #e0e0e0;
  --text-color: #333333;
  --link-color: #1a5d3a;
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #ffffff;
}

/* ===== 容器与布局 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-fluid {
  width: 100%;
  padding: 0 20px;
}

/* ===== 头部导航 ===== */
header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: bold;
  font-size: 24px;
  color: var(--primary-green);
}

.logo img {
  height: 50px;
  width: auto;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

nav a:hover {
  color: var(--accent-orange);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-orange);
  transition: width 0.3s ease;
}

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

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  background-color: var(--light-gray);
  border-radius: 20px;
  padding: 8px 15px;
  gap: 10px;
}

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

.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-green);
  font-size: 16px;
}

/* ===== Banner 区域 ===== */
.banner {
  position: relative;
  height: 400px;
  background: linear-gradient(135deg, var(--primary-green) 0%, #2d8659 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.banner-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  max-width: 800px;
}

.banner h1 {
  font-size: 48px;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: bold;
}

.banner p {
  font-size: 18px;
  margin-bottom: 30px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.cta-button {
  display: inline-block;
  background-color: var(--accent-orange);
  color: white;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.cta-button:hover {
  background-color: #ff5722;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* ===== 视频卡片 ===== */
.video-section {
  padding: 60px 0;
}

.section-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-green);
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  padding-bottom: 20px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--accent-orange);
}

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

.video-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--light-gray);
  transition: var(--transition);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.video-thumbnail {
  position: relative;
  width: 100%;
  padding-bottom: 66.67%;
  background-color: #000;
  overflow: hidden;
}

.video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background-color: rgba(255, 107, 53, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  z-index: 10;
}

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

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

.video-info {
  padding: 15px;
}

.video-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.video-views, .video-likes {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== 内容模块 ===== */
.content-section {
  padding: 60px 0;
  background-color: var(--light-gray);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.content-text h2 {
  font-size: 28px;
  color: var(--primary-green);
  margin-bottom: 20px;
}

.content-text p {
  margin-bottom: 15px;
  color: #555;
  line-height: 1.8;
}

.content-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.content-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== FAQ 区域 ===== */
.faq-section {
  padding: 60px 0;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.faq-question {
  background-color: var(--light-gray);
  padding: 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  color: var(--primary-green);
  transition: var(--transition);
}

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

.faq-toggle {
  font-size: 20px;
  transition: var(--transition);
}

.faq-item.active .faq-toggle {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: var(--transition);
  background-color: #fafafa;
}

.faq-item.active .faq-answer {
  padding: 20px;
  max-height: 500px;
}

/* ===== 用户评论 ===== */
.reviews-section {
  padding: 60px 0;
  background-color: var(--light-gray);
}

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

.review-card {
  background-color: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.review-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.review-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 20px;
}

.review-author {
  font-weight: bold;
  color: var(--text-color);
}

.review-date {
  font-size: 12px;
  color: #999;
}

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

.review-text {
  color: #555;
  line-height: 1.6;
  font-size: 14px;
}

/* ===== 页脚 ===== */
footer {
  background-color: var(--primary-green);
  color: white;
  padding: 40px 0 20px;
  margin-top: 60px;
}

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

.footer-section h3 {
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: bold;
}

.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: var(--transition);
}

.footer-section a:hover {
  color: var(--accent-orange);
}

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

.footer-qr img {
  width: 100px;
  height: 100px;
  margin-bottom: 10px;
}

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

.update-time {
  color: var(--accent-orange);
  font-weight: bold;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    gap: 15px;
  }

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

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

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

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

  .section-title {
    font-size: 24px;
  }

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

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

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  header {
    padding: 10px 0;
  }

  .logo {
    font-size: 18px;
  }

  .logo img {
    height: 40px;
  }

  nav ul {
    gap: 10px;
    font-size: 14px;
  }

  .banner {
    height: 250px;
  }

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

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

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

  .section-title {
    font-size: 20px;
  }

  .play-button {
    width: 50px;
    height: 50px;
  }

  .play-button::after {
    font-size: 18px;
  }
}

/* ===== 打印样式 ===== */
@media print {
  header, footer, .cta-button {
    display: none;
  }

  body {
    font-size: 12pt;
  }
}

/* ===== 性能优化 ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 图片懒加载支持 */
img[loading="lazy"] {
  background-color: var(--light-gray);
}

/* 平滑过渡 */
* {
  transition-property: background-color, color, border-color, box-shadow, transform;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* 禁用不必要的动画 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
