/* ==========================================
   香蕉社区 - 完整样式表
   风格: 清爽活力 + 柔和渐变 + 毛玻璃
   ========================================== */

/* ---------- CSS变量 ---------- */
:root {
  --primary: #2b4f6e;
  --primary-light: #3a6b8f;
  --primary-lighter: #4a7fa8;
  --accent: #f2c94c;
  --accent-hover: #ffd75e;
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --text: #1a2b3c;
  --text-secondary: #4a5a6a;
  --text-muted: #7a8a9a;
  --border-light: rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 15px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 30px;
  --transition: all .3s cubic-bezier(.25,.8,.25,1);
  --nav-height: 60px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 暗色模式变量 ---------- */
body.dark {
  --bg: #121a24;
  --bg-card: #1e2a38;
  --text: #d0d8e4;
  --text-secondary: #b0c0d0;
  --text-muted: #7a8a9a;
  --border-light: rgba(255,255,255,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 15px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --primary: #4a7fa8;
  --primary-light: #5a8fb8;
  --primary-lighter: #6a9fc8;
  color-scheme: dark;
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background .3s, color .3s;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
}

input {
  font-family: inherit;
  outline: none;
}

/* ---------- 容器 ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ---------- 吸顶导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(43, 79, 110, 0.88);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 2px 20px rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

body.dark .site-header {
  background: rgba(18, 26, 36, 0.9);
  border-bottom-color: rgba(255,255,255,0.05);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  text-decoration: none;
  letter-spacing: 1px;
  white-space: nowrap;
}

.logo svg {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.logo span {
  background: linear-gradient(135deg, #fff 40%, #f2c94c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 导航链接 */
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 2px;
  position: relative;
  transition: color .2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s;
}

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

.nav-links a:hover::after {
  width: 100%;
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.search-box:focus-within {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.25);
}

.search-box input {
  border: none;
  outline: none;
  width: 140px;
  font-size: 0.88rem;
  background: transparent;
  color: #fff;
  transition: width .3s;
}

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

.search-box:focus-within input {
  color: var(--text);
  width: 170px;
}

.search-box:focus-within input::placeholder {
  color: var(--text-muted);
}

.search-box button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  line-height: 1;
  padding: 0;
  transition: transform .2s;
}

.search-box button:hover {
  transform: scale(1.15);
}

.search-box:focus-within button {
  color: var(--primary);
}

/* 主题切换按钮 */
.theme-toggle {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 6px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

body.dark .theme-toggle {
  border-color: rgba(242, 201, 76, 0.5);
  color: var(--accent);
  background: rgba(242, 201, 76, 0.1);
}

body.dark .theme-toggle:hover {
  background: rgba(242, 201, 76, 0.2);
}

/* 汉堡按钮 */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
}

.hamburger:hover {
  background: rgba(255,255,255,0.1);
}

/* 移动菜单 */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  background: rgba(43, 79, 110, 0.97);
  backdrop-filter: blur(12px);
  padding: 16px 24px 24px;
  flex-direction: column;
  gap: 4px;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  animation: slideDown .3s ease;
}

body.dark .mobile-nav {
  background: rgba(18, 26, 36, 0.97);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 1.05rem;
  font-weight: 500;
  transition: all .2s;
}

.mobile-nav a:hover {
  color: var(--accent);
  padding-left: 14px;
}

.mobile-nav a:last-child {
  border-bottom: none;
}

/* ---------- Banner 轮播 ---------- */
.banner {
  position: relative;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.15);
  margin-bottom: 0;
}

.slides {
  display: flex;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}

.slide {
  min-width: 100%;
  padding: 80px 30px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
}

.slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(242, 201, 76, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
  pointer-events: none;
}

.slide h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 12px;
  font-weight: 800;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
  animation: fadeInUp .6s ease;
}

.slide p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  opacity: .92;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  animation: fadeInUp .6s ease .1s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.banner-btn {
  background: var(--accent);
  color: var(--primary);
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(242, 201, 76, 0.4);
  transition: var(--transition);
  animation: fadeInUp .6s ease .2s both;
}

.banner-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(242, 201, 76, 0.5);
  background: var(--accent-hover);
}

.banner-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* 轮播指示器（可选） */
.banner-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.banner-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all .3s;
}

.banner-dots span.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

/* ---------- 章节标题 ---------- */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 48px 0 24px;
  color: var(--primary);
  position: relative;
  padding-bottom: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 64px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
}

/* ---------- 卡片网格 ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity .3s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  color: var(--primary);
  font-weight: 700;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.card .badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--primary);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
  margin-top: 10px;
}

/* ---------- 文章卡片 ---------- */
article.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

article.card h3 {
  font-size: 1.05rem;
  line-height: 1.4;
  transition: color .2s;
}

article.card h3:hover {
  color: var(--accent-hover);
}

.article-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.btn-text {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s;
  margin-top: auto;
}

.btn-text:hover {
  gap: 8px;
  color: var(--accent-hover);
}

/* ---------- 数字统计区 ---------- */
.stats-section {
  background: linear-gradient(135deg, #e9f0f6 0%, #f0f4fa 100%);
  border-radius: 24px;
  padding: 36px 30px;
  margin: 40px 0;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  border: 1px solid var(--border-light);
}

body.dark .stats-section {
  background: linear-gradient(135deg, #1e2a38 0%, #16202c 100%);
}

.stat-item {
  text-align: center;
  padding: 10px 24px;
}

.stat-number {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--primary), var(--primary-lighter));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark .stat-number {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border-light);
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
}

.faq-question {
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--text);
  user-select: none;
  gap: 12px;
}

.faq-question span {
  color: var(--primary);
  font-size: 1.2rem;
  transition: transform .3s;
  flex-shrink: 0;
}

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

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s ease, opacity .3s;
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.7;
  opacity: 0;
  padding-top: 0;
}

.faq-item.active {
  border-color: rgba(242, 201, 76, 0.4);
}

.faq-item.active .faq-answer {
  max-height: 400px;
  padding-top: 12px;
  opacity: 1;
}

/* ---------- HowTo 步骤 ---------- */
.howto-step {
  background: linear-gradient(135deg, #f0f4fa 0%, #e9f0f6 100%);
  border-left: 4px solid var(--accent);
  padding: 14px 22px;
  margin: 12px 0;
  border-radius: 0 12px 12px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

body.dark .howto-step {
  background: linear-gradient(135deg, #1e2a38 0%, #1a2430 100%);
}

.howto-step:hover {
  transform: translateX(4px);
  border-left-width: 6px;
}

.howto-step strong {
  color: var(--primary);
  margin-right: 6px;
}

/* ---------- 联系区块 ---------- */
.contact-section {
  background: linear-gradient(135deg, #e4edf5 0%, #edf3f9 100%);
  border-radius: 20px;
  padding: 36px 30px;
  margin: 40px 0;
  border: 1px solid var(--border-light);
}

body.dark .contact-section {
  background: linear-gradient(135deg, #1e2a38 0%, #1a2430 100%);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.contact-grid div {
  padding: 16px;
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  backdrop-filter: blur(4px);
  transition: var(--transition);
}

body.dark .contact-grid div {
  background: rgba(255,255,255,0.04);
}

.contact-grid div:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

body.dark .contact-grid div:hover {
  background: rgba(255,255,255,0.08);
}

.contact-grid strong {
  color: var(--primary);
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.contact-grid div:not(strong) {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ---------- 页脚 ---------- */
.footer {
  background: linear-gradient(135deg, #1f3447 0%, #1a2b3c 100%);
  color: #b0c0d0;
  padding: 48px 0 24px;
  margin-top: 60px;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}

.footer a {
  color: #d0e0f0;
  text-decoration: none;
  transition: color .2s;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
}

.footer-grid h4 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 600;
}

.footer-grid div {
  font-size: 0.9rem;
  line-height: 1.8;
}

.copyright {
  text-align: center;
  margin-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  font-size: 0.85rem;
  color: #8a9aaa;
}

/* ---------- 回到顶部 ---------- */
#backTop {
  position: fixed;
  bottom: 40px;
  right: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--primary);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  display: none;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(242, 201, 76, 0.4);
  transition: var(--transition);
  line-height: 1;
}

#backTop:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 30px rgba(242, 201, 76, 0.5);
}

#backTop:active {
  transform: translateY(-2px) scale(0.95);
}

/* ---------- 滚动动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all .7s cubic-bezier(.25, .8, .25, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 延迟动画 */
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .container {
    padding: 0 16px;
  }

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

  .search-box:focus-within input {
    width: 130px;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .search-box {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .theme-toggle {
    padding: 5px 12px;
    font-size: 0.8rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .logo svg {
    width: 30px;
    height: 30px;
  }

  .slide {
    padding: 50px 20px;
  }

  .slide h2 {
    font-size: 1.6rem;
  }

  .slide p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.4rem;
    margin: 36px 0 18px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 20px;
  }

  .stats-section {
    padding: 24px 16px;
    gap: 16px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .contact-section {
    padding: 24px 16px;
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .contact-grid div {
    padding: 12px;
  }

  .footer {
    padding: 32px 0 16px;
  }

  #backTop {
    bottom: 24px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 1.4rem;
  }
}

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

  .logo span {
    display: none;
  }

  .logo svg {
    width: 32px;
    height: 32px;
  }

  .nav-wrap {
    gap: 10px;
  }

  .theme-toggle {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .slide {
    padding: 40px 16px;
  }

  .slide h2 {
    font-size: 1.4rem;
  }

  .slide p {
    font-size: 0.9rem;
  }

  .banner-btn {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.3rem;
  }

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

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

  .howto-step {
    padding: 12px 16px;
    font-size: 0.88rem;
  }

  .faq-item {
    padding: 14px 16px;
  }

  .faq-question {
    font-size: 0.93rem;
  }
}

/* ---------- 打印样式 ---------- */
@media print {
  .site-header,
  .banner,
  #backTop,
  .footer,
  .search-box,
  .theme-toggle,
  .hamburger,
  .mobile-nav {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .faq-item,
  .howto-step,
  .contact-section {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ---------- 无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-radius: 6px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

body.dark::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
}

/* ---------- 选中颜色 ---------- */
::selection {
  background: var(--accent);
  color: var(--primary);
}

/* ---------- 焦点可见性 ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 小工具类 ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }