/* 启明轩 - 公共样式 v11 (Mobile First) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* 隐藏Cloudflare Cookie横幅 */
[id*="cookie"], [class*="cookie-banner"], [class*="cookie-notice"], [class*="consent-banner"], iframe[src*="cookie"], iframe[src*="consent"] { display: none !important; }

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --gold: #d4a853;
  --gold-light: #e8c97a;
  --gold-dark: #b8922f;
  --gold-a10: var(--gold-a10);
  --gold-a15: var(--gold-a15);
  --gold-a30: rgba(212, 168, 83, 0.3);
  --gold-a35: var(--gold-a35);
  --gold-a40: var(--gold-a40);
  --gold-a50: var(--gold-a50);
  --bg-a70: rgba(10, 14, 26, 0.7);
  --bg-a85: var(--bg-a85);
  --bg-a90: rgba(10, 14, 26, 0.9);
  --bg-a92: var(--bg-a92);
  --bg-a95: var(--bg-a95);
  --shadow-dark: var(--shadow-dark);
  --shadow-dark-heavy: var(--shadow-dark-heavy);
  --text-primary: #e8e0d0;
  --text-secondary: #8a7e6b;
  --text-muted: #5a5347;
  --border: var(--gold-a15);
  --border-hover: var(--gold-a35);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 30px var(--gold-a15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --font-title: 'Noto Serif SC', serif;
  --font-body: 'Noto Sans SC', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
.btn:active, .tag:active, .mobile-tab:active { transform: scale(0.97) !important; }
@media (hover: none) and (pointer: coarse) {
  .btn:active { transform: scale(0.97) !important; }
  .card:active { opacity: 0.9; }
  .tag:active { transform: scale(0.96); }
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
}

a { color: var(--gold); text-decoration: none; transition: var(--transition); }

/* === 移动端禁用hover === */
@media (hover: none) and (pointer: coarse) {
  a:hover { color: var(--gold); }
  .card:hover { background: var(--bg-card); border-color: var(--border); box-shadow: none; transform: none; }
  .btn-primary:hover { box-shadow: 0 4px 15px rgba(212, 168, 83, 0.3); transform: none; color: var(--bg-primary); }
  .btn-secondary:hover { border-color: var(--border); background: var(--bg-card); color: var(--gold); }
  .tag:hover, .tag.active { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
  .nav-avatar:hover { box-shadow: none; }
}

@media (hover: hover) {
  a:hover { color: var(--gold-light); }
}

/* === 导航栏 (移动端: 56px) === */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: var(--bg-a85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 56px;
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-title);
  font-size: 1.2rem; font-weight: 700;
  color: var(--gold);
  display: flex; align-items: center; gap: 6px;
}

.nav-logo svg { width: 24px; height: 24px; }

.nav-links {
  display: flex; align-items: center; gap: 6px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
  background: var(--bg-card);
}

.nav-user {
  display: flex; align-items: center; gap: 8px;
}

.nav-points {
  color: var(--gold);
  font-size: 0.8rem;
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.8rem; font-weight: 600;
  color: var(--bg-primary);
}

.nav-avatar:hover { box-shadow: 0 0 15px var(--gold-a40); }

/* 语言切换器 */
.lang-switcher { position: relative; }
.lang-switch-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.8rem;
  padding: 4px 10px; cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; gap: 4px;
}
.lang-switch-btn:hover { border-color: var(--gold); color: var(--gold); }
.lang-switch-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; margin-top: 4px;
  min-width: 140px; z-index: 1000;
  box-shadow: var(--shadow-dark-heavy);
}
.lang-switch-dropdown.show { display: block; }
.lang-option {
  padding: 8px 12px; border-radius: 6px; cursor: pointer;
  font-size: 0.85rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.lang-option:hover { background: var(--gold-a10); color: var(--gold); }
.lang-option.active { color: var(--gold); font-weight: 500; }

/* 移动端菜单按钮 - 默认显示 */
.nav-menu-btn {
  display: block;
  background: none; border: none;
  color: var(--text-primary); font-size: 1.5rem;
  cursor: pointer;
}

/* 移动端导航链接默认隐藏 */
.nav-links {
  display: none;
}
.nav-links.show {
  display: flex; flex-direction: column;
  position: absolute; top: 56px; left: 0; right: 0;
  background: var(--bg-a95);
  padding: 16px;
  border-bottom: 1px solid var(--border);
  gap: 4px;
}

/* === 底部Tab导航栏 === */
.mobile-tabs {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  height: 56px;
  background: var(--bg-a92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--gold-a10);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.mobile-tab .tab-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.mobile-tab .tab-label {
  font-size: 10px;
  line-height: 1;
  font-weight: 400;
  transition: color 0.25s ease;
}

.mobile-tab.active {
  color: var(--gold);
}

.mobile-tab.active .tab-icon {
  transform: translateY(-2px) scale(1.1);
}

.mobile-tab.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 0 0 2px 2px;
}

/* === 星空粒子背景 === */
#starfield {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* === 页面容器 === */
.page-container {
  position: relative; z-index: 1;
  padding-top: 56px;
  padding-bottom: 56px;
  min-height: 100vh;
  animation: pageFadeIn 0.3s ease;
  display: flex; flex-direction: column;
}

main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 16px;
  padding-bottom: 70px;
  width: 100%;
}

/* === 卡片 === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}

@media (hover: hover) {
  .card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
}

/* === 按钮 === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 500;
  border: none; cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(212, 168, 83, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px var(--gold-a50);
  transform: translateY(-1px);
  color: var(--bg-primary);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--gold);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--gold);
  background: var(--gold-a10);
  color: var(--gold);
}

.btn-sm { padding: 10px 18px; font-size: 0.85rem; min-height: 44px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* === 输入框 (16px防止iOS缩放) === */
.input-group { margin-bottom: 20px; }

.input-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  transition: var(--transition);
  outline: none;
  min-height: 44px;
}

.input-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-a10);
}

.input-field::placeholder { color: var(--text-muted); }

/* === 标签 === */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.tag:hover, .tag.active {
  background: var(--gold-a15);
  color: var(--gold);
  border-color: var(--gold);
}

/* === 底部footer (移动端给tab留空间) === */
.footer {
  position: relative; z-index: 1;
  background: rgba(10, 14, 26, 0.9);
  border-top: 1px solid var(--border);
  padding: 24px 16px 80px;
  text-align: center;
}

.footer-disclaimer {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto 16px;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* === 标题 === */
.section-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.85rem;
  margin-bottom: 30px;
}

/* === 分割线 === */
.divider {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 24px;
}

/* === 模态框 === */
.modal-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px; width: 90%;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.show .modal { transform: scale(1); }

.modal h3 {
  font-family: var(--font-title);
  color: var(--gold);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.modal p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.9rem; }
.modal .btn-group { display: flex; gap: 12px; justify-content: flex-end; }

/* === Toast提示 === */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  z-index: 3000;
  color: var(--text-primary);
  font-size: 0.88rem;
  box-shadow: var(--shadow-dark);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 320px;
  width: 90%;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(74, 222, 128, 0.5); background: rgba(74, 222, 128, 0.1); }
.toast.error { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.1); }

/* === 太极旋转 === */
.taiji-container {
  position: relative;
  width: 70px; height: 70px;
  margin: 0 auto;
}

.taiji {
  width: 70px; height: 70px;
  animation: rotate 20s linear infinite;
}

@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.taiji::before {
  content: '';
  position: absolute;
  width: 33px; height: 33px;
  background: var(--gold);
  border-radius: 50%;
  top: 1px; left: 50%;
  transform: translateX(-50%);
}

.taiji::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  background: var(--bg-primary);
  border-radius: 50%;
  top: 15px; left: 50%;
  transform: translateX(-50%);
}

/* === 动画 === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.6s ease forwards; }
.fade-in { animation: fadeIn 0.5s ease forwards; }

/* === 网格 (移动端: 单列) === */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* === 工具类 === */
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* === Quiz Banner (移动端竖向) === */
.quiz-banner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin: 0 auto 24px; max-width: 600px; padding: 24px 20px;
  background: linear-gradient(135deg, var(--gold-a15) 0%, rgba(142,68,173,0.1) 50%, rgba(212,168,83,0.08) 100%);
  border: 2px solid var(--gold-a50); border-radius: var(--radius-lg); cursor: pointer;
  gap: 12px; transition: var(--transition);
  animation: fadeInUp 0.8s ease 0.3s both;
  box-shadow: 0 0 40px var(--gold-a10);
}

.quiz-banner .quiz-arrow { display: none; }

/* ============================================
   桌面端样式 @media (min-width: 768px)
   ============================================ */
@media (min-width: 768px) {
  body { font-size: 16px; }

  /* 隐藏底部tab */
  .mobile-tabs { display: none; }

  /* 恢复顶部导航 */
  .navbar { height: 64px; padding: 0 24px; z-index: 1000; }
  .nav-logo { font-size: 1.4rem; }
  .nav-logo svg { width: 28px; height: 28px; }
  .nav-links {
    display: flex; flex-direction: row;
    position: static;
    background: none;
    padding: 0;
    border-bottom: none;
    gap: 6px;
  }
  .nav-links.show { display: flex; flex-direction: row; position: static; background: none; padding: 0; border-bottom: none; }
  .nav-menu-btn { display: none; }
  .nav-user { gap: 12px; }
  .nav-points { font-size: 0.85rem; padding: 6px 12px; }
  .nav-avatar { width: 36px; height: 36px; font-size: 0.85rem; }

  /* 页面容器 */
  .page-container { padding-top: 64px; padding-bottom: 0; }
  main { padding: 40px 24px; }

  /* 卡片 */
  .card { padding: 28px; border-radius: var(--radius-lg); }

  /* 按钮 */
  /* 所有按钮触屏友好 */
  button, a[class*="btn"], [role="button"] { min-height: 36px; min-width: 36px; }
  .btn { padding: 12px 28px; min-height: auto; }
  .btn-lg { padding: 16px 36px; font-size: 1.05rem; }
  .btn-sm { padding: 8px 16px; min-height: auto; }

  /* 输入框 */
  .input-field { font-size: 0.95rem; min-height: auto; }

  /* Footer */
  .footer { padding: 30px 24px; }

  /* 标题 */
  .section-title { font-size: 1.8rem; }
  .section-subtitle { font-size: 0.95rem; margin-bottom: 40px; }
  .divider { margin-bottom: 30px; }

  /* 网格 - 桌面端多列 */
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  /* 太极 */
  .taiji-container { width: 120px; height: 120px; }
  .taiji { width: 120px; height: 120px; }
  .taiji::before { width: 56px; height: 56px; top: 2px; }
  .taiji::after { width: 10px; height: 10px; top: 25px; }

  /* Toast */
  .toast { top: 80px; right: 20px; max-width: 320px; left: auto; transform: translateX(120%); width: auto; text-align: left; max-width: 340px; }
  .toast.show { transform: translateX(0); }

  /* 模态框 */
  .modal { padding: 32px; }
  .modal h3 { font-size: 1.2rem; }

  /* Quiz banner 横向 */
  .quiz-banner {
    flex-direction: row; text-align: left;
    padding: 36px 32px;
    gap: 20px;
    margin-bottom: 32px;
  }
  .quiz-banner .quiz-arrow { display: block; }
}

@media (max-width: 480px) {
  .btn-lg { padding: 12px 20px; font-size: 0.95rem; }
}
