/* ===== 全局样式 & 主题变量 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,600&family=Cinzel:wght@400;600;700;900&display=swap');

:root {
  /* 深色主题（默认） */
  --bg-primary: #0d0d0d;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --bg-elevated: #242424;
  --bg-hover: #2a2a2a;
  --text-primary: #e8e4dd;
  --text-secondary: #a8a49d;
  --text-muted: #6b6760;
  --accent-gold: #c9a96e;
  --accent-gold-light: #d4b87a;
  --accent-bronze: #8b7355;
  --accent-ink: #1c1c1c;
  --accent-red: #a04040;
  --accent-blue: #5a7a8a;
  --border-color: #2a2a2a;
  --border-light: #333;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-gold: 0 4px 20px rgba(201,169,110,0.15);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-display: 'Cinzel', 'Noto Serif SC', serif;
  --font-heading: 'Playfair Display', 'Noto Serif SC', serif;
  --font-body: 'Noto Serif SC', 'Noto Sans SC', serif;
  --font-ui: 'Noto Sans SC', sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1320px;
}

[data-theme="light"] {
  --bg-primary: #f5f0e8;
  --bg-secondary: #ede6d8;
  --bg-card: #ffffff;
  --bg-elevated: #f8f4ed;
  --bg-hover: #efe8db;
  --text-primary: #2c2416;
  --text-secondary: #5c5444;
  --text-muted: #8c8474;
  --accent-gold: #8b6914;
  --accent-gold-light: #a07818;
  --accent-bronze: #6b5030;
  --accent-ink: #f8f4ed;
  --accent-red: #8b3a3a;
  --accent-blue: #3a6070;
  --border-color: #d4c8b0;
  --border-light: #e0d6c4;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-gold: 0 4px 20px rgba(139,105,20,0.1);
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background var(--transition-smooth), color var(--transition-smooth);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201,169,110,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(160,100,60,0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(90,120,140,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

[data-theme="light"] .navbar {
  background: rgba(245,240,232,0.85);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px rgba(201,169,110,0.5));
}

.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
}

.logo-sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-link {
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--accent-gold);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-gold);
  border-radius: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== 按钮 ===== */
.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-user {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gold);
  border: none;
  color: var(--bg-primary);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.btn-user:hover {
  background: var(--accent-gold-light);
  transform: scale(1.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--accent-gold);
  color: #1a1a1a;
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  background: var(--accent-gold-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201,169,110,0.25);
}

.btn-outline {
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.btn-outline:hover {
  background: rgba(201,169,110,0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

/* ===== 搜索浮层 ===== */
.search-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 10;
}

.search-overlay.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.search-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 14px 48px 14px 52px;
  font-family: var(--font-ui);
  font-size: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.1);
}

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

.search-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.search-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.search-results {
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: none;
}

.search-results.active {
  display: block;
}

/* ===== 移动端菜单 ===== */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

/* ===== 页面容器 ===== */
#app {
  padding-top: 64px;
  min-height: calc(100vh - 64px);
  position: relative;
  z-index: 1;
}

.page {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.page.active {
  display: block;
  opacity: 1;
}

.page.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

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

/* ===== 通用区块 ===== */
.section {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-sm {
  padding: 48px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-smooth);
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-bronze);
}

/* ===== 标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.tag-gold {
  background: rgba(201,169,110,0.15);
  color: var(--accent-gold);
}

.tag-blue {
  background: rgba(90,122,138,0.15);
  color: var(--accent-blue);
}

.tag-red {
  background: rgba(160,64,64,0.15);
  color: var(--accent-red);
}

.tag-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
}

.toast.success { border-left: 3px solid #4a9; }
.toast.error { border-left: 3px solid var(--accent-red); }

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ===== 认证弹窗 ===== */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}

.auth-tab.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.auth-form.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  padding: 12px 16px;
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.form-group input:focus {
  border-color: var(--accent-gold);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .nav-links {
    gap: 0;
  }
  .nav-link {
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    gap: 4px;
    display: none;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-link {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
  }
  .menu-toggle {
    display: flex;
  }
  .section {
    padding: 48px 16px;
  }
  .logo-sub {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    padding: 0 16px;
  }
  .section-title {
    font-size: 24px;
  }
}
