/* ============================================
   theme.css  ——  奏桃园 主题变量 / 全局基础
   深色（主推） + 浅色（神秘白底）
   ============================================ */

:root {
  /* —— 深色（默认） —— */
  --bg: #080810;
  --bg-2: #0f0f1e;
  --bg-grad: radial-gradient(ellipse at 20% -10%, rgba(196, 168, 240, 0.08) 0%, transparent 55%),
             radial-gradient(ellipse at 80% 110%, rgba(94, 207, 178, 0.05) 0%, transparent 55%),
             #080810;

  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.05);

  --border: rgba(196, 168, 240, 0.10);
  --border-hover: rgba(196, 168, 240, 0.24);
  --border-strong: rgba(196, 168, 240, 0.4);

  --purple: #c4a8f0;
  --purple-rgb: 196, 168, 240;
  --purple-dim: rgba(196, 168, 240, 0.55);
  --purple-ghost: rgba(196, 168, 240, 0.08);

  --teal: #5ecfb2;
  --teal-rgb: 94, 207, 178;
  --teal-dim: rgba(94, 207, 178, 0.5);
  --teal-ghost: rgba(94, 207, 178, 0.08);

  --text: #e8e5f0;
  --text-2: #7a7898;
  --text-3: #3e3c54;

  --glow-p: rgba(196, 168, 240, 0.14);
  --glow-t: rgba(94, 207, 178, 0.10);

  --nav-bg: rgba(8, 8, 16, 0.72);
  --overlay-bg: rgba(8, 8, 16, 0.94);

  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 0 0.5px var(--border-hover),
    0 0 24px var(--glow-p),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  --serif: 'Noto Serif SC', 'LXGW WenKai', 'PingFang SC', serif;
  --mono: 'DM Mono', 'JetBrains Mono', ui-monospace, monospace;

  --radius-card: 14px;
  --radius-pill: 40px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition: 200ms var(--ease);
}

body.light-mode {
  --bg: #f5f3f0;
  --bg-2: #ebe8e4;
  --bg-grad: radial-gradient(ellipse at 20% -10%, rgba(90, 63, 168, 0.05) 0%, transparent 55%),
             radial-gradient(ellipse at 80% 110%, rgba(42, 138, 114, 0.04) 0%, transparent 55%),
             #f5f3f0;

  --surface: rgba(255, 255, 255, 0.55);
  --surface-hover: rgba(255, 255, 255, 0.78);

  --border: rgba(90, 63, 168, 0.12);
  --border-hover: rgba(90, 63, 168, 0.28);
  --border-strong: rgba(90, 63, 168, 0.45);

  --purple: #5a3fa8;
  --purple-rgb: 90, 63, 168;
  --purple-dim: rgba(90, 63, 168, 0.6);
  --purple-ghost: rgba(90, 63, 168, 0.07);

  --teal: #2a8a72;
  --teal-rgb: 42, 138, 114;
  --teal-dim: rgba(42, 138, 114, 0.55);
  --teal-ghost: rgba(42, 138, 114, 0.08);

  --text: #1a1820;
  --text-2: #6b6878;
  --text-3: #a09daa;

  --glow-p: rgba(90, 63, 168, 0.10);
  --glow-t: rgba(42, 138, 114, 0.07);

  --nav-bg: rgba(245, 243, 240, 0.78);
  --overlay-bg: rgba(245, 243, 240, 0.95);

  --shadow-card: 0 6px 24px rgba(60, 50, 90, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --shadow-card-hover: 0 12px 36px rgba(60, 50, 90, 0.12),
    0 0 0 0.5px var(--border-hover),
    0 0 18px var(--glow-p),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* —— Utility: 禁止文字在词内断开 —— */
.no-break {
  white-space: nowrap;
  word-break: keep-all;
}

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

html {
  font-family: var(--mono), -apple-system, sans-serif;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 350ms ease, color 350ms ease;
  position: relative;
}

/* 浅色模式纸感微噪点 */
body.light-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(0, 0, 0, 0.012) 1px, transparent 1px);
  background-size: 3px 3px;
  z-index: 0;
}

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

::selection {
  background: rgba(var(--purple-rgb), 0.3);
  color: var(--text);
}

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

button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

/* —— Page wrapper —— */
.page {
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 40px;
}

/* —— Section 通用 —— */
.section {
  padding: 60px 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
}
.section-label::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--text-3);
}

.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-top: 6px;
}

.section-more {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--purple-dim);
  font-family: var(--mono);
  white-space: nowrap;
  transition: color var(--transition);
}
.section-more:hover {
  color: var(--purple);
}

/* —— Divider —— */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 40px;
}

/* —— Nav —— */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 54px;
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  transition: background 350ms ease, border-color 350ms ease;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.06em;
  user-select: none;
  white-space: nowrap;
}
.nav-logo span {
  color: var(--purple);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a,
.nav-links .nav-more {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 180ms ease;
}
.nav-links a:hover,
.nav-links .nav-more:hover {
  color: var(--purple);
}
.nav-links a.active {
  color: var(--purple);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--purple);
  opacity: 0.6;
}

.nav-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  padding: 18px 0; /* 增加热区，hover 不中断 */
}
.more-dropdown {
  position: absolute;
  top: 100%;
  right: -8px;
  min-width: 180px;
  margin-top: 0;
  padding: 6px 0;
  background: var(--bg-2);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 24px var(--glow-p);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: all 180ms ease;
}
/* 透明桥接区，让鼠标从 nav-more 移到 dropdown 不会丢失 hover */
.more-dropdown::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
  background: transparent;
}
.more-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.more-dropdown a {
  display: block;
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-2);
}
.more-dropdown a:hover {
  color: var(--purple);
  background: var(--purple-ghost);
}

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

.theme-btn,
.hamburger {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-2);
  backdrop-filter: blur(8px);
  transition: all 180ms ease;
  flex-shrink: 0;
}
.theme-btn:hover,
.hamburger:hover {
  border-color: var(--border-hover);
  color: var(--purple);
  box-shadow: 0 0 12px var(--glow-p);
}
.hamburger {
  display: none;
}

.mobile-overlay {
  position: fixed;
  inset: 54px 0 0 0;
  z-index: 99;
  background: var(--overlay-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 40px 24px;
}
.mobile-overlay.open {
  display: flex;
}
.mobile-overlay a {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--text);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.06em;
  transition: all 180ms ease;
}
.mobile-overlay a:hover,
.mobile-overlay a.active {
  color: var(--purple);
  background: var(--purple-ghost);
}
.mobile-divider {
  width: 30px;
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* —— Footer —— */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  margin-top: 60px;
}
.footer-left {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  line-height: 1.8;
}
.footer-left span {
  color: var(--purple-dim);
}
.footer-right {
  display: flex;
  gap: 20px;
}
.footer-link {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.footer-link:hover {
  color: var(--purple);
}

/* —— Buttons —— */
.btn-primary,
.btn-ghost {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 200ms var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--purple);
}
.btn-primary {
  border: 1px solid rgba(var(--purple-rgb), 0.3);
  color: var(--purple);
  background: rgba(var(--purple-rgb), 0.06);
}
.btn-primary:hover {
  background: rgba(var(--purple-rgb), 0.14);
  box-shadow: 0 0 20px var(--glow-p);
}

/* —— Pills / Tags —— */
.pill {
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
  font-family: var(--mono);
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
  display: inline-block;
}
.pill:hover {
  border-color: var(--border-hover);
  color: var(--text);
  box-shadow: 0 0 12px var(--glow-p);
}
.pill.active {
  background: var(--purple-ghost);
  border-color: rgba(var(--purple-rgb), 0.35);
  color: var(--purple);
}

.tag {
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-family: var(--mono);
  white-space: nowrap;
  display: inline-block;
}

/* —— Scrollbar —— */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--purple-rgb), 0.18);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--purple-rgb), 0.4);
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .container {
    padding: 0 24px;
  }
  .section {
    padding: 44px 0;
  }
  .nav {
    padding: 0 20px;
  }
  .nav-links {
    gap: 16px;
  }
  .divider {
    margin: 0 24px;
  }
  .footer {
    padding: 24px 24px;
  }
}
@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: inline-flex;
  }
  .footer {
    flex-direction: column;
    text-align: center;
  }
  .container {
    padding: 0 18px;
  }
}
