:root {
  --bg-deep: #050b18;
  --bg-mid: #0a162d;
  --bg-elevated: rgba(13, 27, 54, 0.62);
  --bg-elevated-strong: rgba(15, 31, 61, 0.82);
  --border-ice: rgba(168, 218, 255, 0.22);
  --border-ice-bright: rgba(196, 232, 255, 0.45);
  --silver: #eef6ff;
  --silver-soft: #bfd5ee;
  --muted: #84a0c4;
  --ice: #8fd3ff;
  --ice-glow: rgba(143, 211, 255, 0.32);
  --ice-deep: #4c9be8;
  --danger: #ff94a8;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --shadow-moon: 0 22px 54px rgba(2, 8, 22, 0.62), inset 0 1px 0 rgba(226, 243, 255, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--silver);
  background:
    radial-gradient(circle at 82% 8%, rgba(154, 212, 255, 0.16), transparent 36%),
    radial-gradient(circle at 18% 30%, rgba(76, 155, 232, 0.12), transparent 44%),
    linear-gradient(180deg, #040915 0%, #091429 48%, #071022 100%);
  line-height: 1.65;
  overflow-x: hidden;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.moon-aura {
  position: fixed;
  top: -140px;
  right: -120px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 242, 255, 0.24) 0%, rgba(125, 196, 255, 0.08) 45%, transparent 72%);
  filter: blur(18px);
  z-index: -1;
  pointer-events: none;
}

/* 顶部导航 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(6, 13, 28, 0.72);
  border-bottom: 1px solid rgba(168, 218, 255, 0.14);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--silver);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-moon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(215, 240, 255, 0.28), rgba(92, 168, 240, 0.14));
  border: 1px solid var(--border-ice-bright);
  color: var(--ice);
  font-size: 15px;
  box-shadow: 0 0 18px rgba(143, 211, 255, 0.28);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.nav-links a {
  color: var(--silver-soft);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.nav-pill {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-ice);
  background: rgba(143, 211, 255, 0.08);
}

.nav-pill:hover {
  border-color: var(--border-ice-bright);
  background: rgba(143, 211, 255, 0.16);
}

/* 主容器 */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* Hero 欢迎区 */
.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-ice);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-moon);
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  min-height: 410px;
}

.hero-media {
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  cursor: zoom-in;
  transition: transform 0.6s ease;
}

.hero-media:hover .hero-img {
  transform: scale(1.03);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 13, 28, 0.08) 55%, rgba(10, 22, 45, 0.92) 100%),
    linear-gradient(180deg, rgba(6, 13, 28, 0.1) 0%, rgba(6, 13, 28, 0.45) 100%);
  pointer-events: none;
}

.hero-badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(7, 15, 32, 0.72);
  border: 1px solid var(--border-ice);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--silver-soft);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 10px var(--ice);
}

.hero-content {
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(160deg, rgba(12, 26, 52, 0.88), rgba(7, 15, 32, 0.94));
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ice);
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.22;
  font-weight: 700;
  background: linear-gradient(120deg, #ffffff 10%, #cceaff 60%, #8fd3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-welcome {
  margin: 0 0 22px;
  font-size: 16px;
  color: var(--silver-soft);
  min-height: 52px;
  transition: opacity 0.25s ease;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.tag {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  color: #d6ecff;
  background: rgba(143, 211, 255, 0.1);
  border: 1px solid rgba(168, 218, 255, 0.24);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #051225;
  background: linear-gradient(135deg, #e5f5ff 0%, #9ad9ff 52%, #6ec0fa 100%);
  box-shadow: 0 8px 24px rgba(110, 192, 250, 0.32);
}

.btn-primary:hover {
  box-shadow: 0 10px 28px rgba(143, 211, 255, 0.46);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--silver);
  background: rgba(143, 211, 255, 0.08);
  border-color: var(--border-ice);
}

.btn-ghost:hover {
  background: rgba(143, 211, 255, 0.16);
  border-color: var(--border-ice-bright);
}

.btn-small {
  padding: 7px 13px;
  font-size: 13px;
  border-radius: 10px;
}

/* 三联状态条 */
.info-strip {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.glass-mini,
.glass-panel {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-ice);
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-moon);
}

.glass-mini {
  padding: 18px 20px;
}

.mini-label {
  display: block;
  font-size: 12px;
  color: var(--ice);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.mini-value {
  display: block;
  font-size: 17px;
  color: var(--silver);
  margin-bottom: 6px;
}

.mini-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* 章节通用 */
.section {
  margin-top: 44px;
  scroll-margin-top: 84px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ice);
}

.section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--silver);
}

.section-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* 画廊 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.gallery-card {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-ice);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-moon);
  cursor: zoom-in;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-ice-bright);
}

.gallery-img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #081226;
}

.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-img-wrap img {
  transform: scale(1.04);
}

.gallery-card figcaption {
  padding: 14px 16px;
}

.gallery-card figcaption strong {
  display: block;
  font-size: 15px;
  color: var(--silver);
  margin-bottom: 4px;
}

.gallery-card figcaption span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

/* 记忆同步库 */
.memory-head-actions {
  display: flex;
  gap: 8px;
}

.vault-lock {
  padding: 36px 24px;
  text-align: center;
}

.lock-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--ice);
  background: rgba(143, 211, 255, 0.12);
  border: 1px solid var(--border-ice-bright);
  box-shadow: 0 0 24px rgba(143, 211, 255, 0.22);
}

.vault-lock h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.vault-lock p {
  max-width: 520px;
  margin: 0 auto 20px;
  font-size: 14px;
  color: var(--muted);
}

.unlock-form {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.unlock-form input,
.vault-controls input[type="search"] {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-ice);
  background: rgba(5, 11, 24, 0.78);
  color: var(--silver);
  font-size: 14px;
  outline: none;
  min-width: 240px;
}

.unlock-form input:focus,
.vault-controls input[type="search"]:focus {
  border-color: var(--ice);
  box-shadow: 0 0 0 3px rgba(143, 211, 255, 0.16);
}

.error-text {
  color: var(--danger) !important;
  margin-top: 12px !important;
  margin-bottom: 0 !important;
  font-size: 13px !important;
}

.vault-toolbar {
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.vault-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(143, 211, 255, 0.1);
  border: 1px solid rgba(168, 218, 255, 0.2);
  color: var(--silver-soft);
}

.vault-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.toggle-test {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.vault-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 16px;
  align-items: start;
}

.doc-list {
  padding: 10px;
  max-height: 560px;
  overflow-y: auto;
}

.doc-item {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--silver-soft);
  cursor: pointer;
  display: block;
  margin-bottom: 6px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.doc-item:hover {
  background: rgba(143, 211, 255, 0.08);
  color: var(--silver);
}

.doc-item.active {
  background: rgba(143, 211, 255, 0.15);
  border-color: var(--border-ice-bright);
  color: var(--silver);
}

.doc-item-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.doc-item-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.doc-viewer {
  padding: 22px 26px;
  min-height: 420px;
  max-height: 620px;
  overflow-y: auto;
}

.doc-viewer-head {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(168, 218, 255, 0.16);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-viewer-head h3 {
  margin: 0;
  font-size: 19px;
  color: var(--silver);
}

.viewer-meta {
  font-size: 12px;
  color: var(--muted);
}

/* 轻量 Markdown 排版 */
.md-body {
  font-size: 14.5px;
  color: var(--silver-soft);
}

.md-body h1,
.md-body h2,
.md-body h3 {
  color: var(--silver);
  margin: 18px 0 8px;
  line-height: 1.35;
}

.md-body h1 { font-size: 20px; }
.md-body h2 { font-size: 17px; border-bottom: 1px solid rgba(168, 218, 255, 0.12); padding-bottom: 5px; }
.md-body h3 { font-size: 15.5px; color: var(--ice); }

.md-body p { margin: 8px 0; }
.md-body ul { margin: 8px 0; padding-left: 20px; }
.md-body li { margin: 4px 0; }

.md-body blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--ice);
  background: rgba(143, 211, 255, 0.08);
  border-radius: 0 8px 8px 0;
  color: var(--silver);
}

.md-body code {
  font-family: Consolas, "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(5, 11, 24, 0.72);
  color: var(--ice);
}

.md-body pre {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(4, 9, 20, 0.85);
  border: 1px solid rgba(168, 218, 255, 0.14);
  overflow-x: auto;
}

.md-body pre code {
  padding: 0;
  background: transparent;
}

.muted {
  color: var(--muted);
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 26px 20px 42px;
  border-top: 1px solid rgba(168, 218, 255, 0.12);
  color: var(--silver-soft);
  font-size: 13px;
}

.footer p {
  margin: 4px 0;
}

.footer-sub {
  color: var(--muted);
  font-size: 12px;
}

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 8, 18, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-inner {
  margin: 0;
  max-width: 960px;
  width: 100%;
  text-align: center;
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-ice-bright);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.lightbox-inner figcaption {
  margin-top: 12px;
  color: var(--silver-soft);
  font-size: 14px;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-ice);
  background: rgba(10, 22, 45, 0.8);
  color: var(--silver);
  font-size: 18px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* 响应式适配 */
@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
  }
  .hero-vignette {
    background: linear-gradient(180deg, rgba(6, 13, 28, 0.08) 45%, rgba(10, 22, 45, 0.96) 100%);
  }
  .hero-content {
    padding: 26px 22px 28px;
  }
  .info-strip,
  .gallery-grid,
  .vault-layout {
    grid-template-columns: 1fr;
  }
  .doc-list {
    max-height: 240px;
  }
}

@media (max-width: 600px) {
  .topbar-inner {
    padding: 11px 14px;
  }
  .nav-links {
    gap: 10px;
    font-size: 13px;
  }
  .nav-pill {
    padding: 5px 10px;
  }
  .container {
    padding: 18px 14px 48px;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
