/* ==========================================================================
   ONE LIFE — base
   设计基调：Film Archive / 胶片档案
   米纸底、墨黑文字、朱砂印强调、0.5px 细线、无圆角、无渐变高饱和
   变量名保持旧称（--black=页面底，--paper=标题色），便于全站换肤
   ========================================================================== */

:root {
  --black: #efe9d9;        /* 页面底：米纸 */
  --near-black: #e9e2cf;   /* 次底：旧纸 */
  --surface: #f6f2e7;      /* 纸面 */
  --surface-2: #ebe5d4;    /* 次级纸面 */
  --line: #d9d1bc;
  --line-soft: #e4ddca;

  --ink: #1c1a17;          /* 墨 */
  --ink-soft: #4a453b;
  --ink-mute: #8a8578;

  --paper: #1c1a17;        /* 标题色（沿用旧变量名） */
  --gold: #b5442a;         /* 朱砂印 */
  --gold-soft: rgba(181, 68, 42, 0.07);
  --gold-line: rgba(181, 68, 42, 0.38);

  --serif: Georgia, "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;

  --reading: 34em; /* 正文最佳阅读宽度 */
  --pad-x: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 胶片颗粒 —— 全站唯一的"视觉特效"，极低透明度 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 400;
  line-height: 1.25;
  color: var(--paper);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: var(--gold);
  color: #f6f2e7;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c6bda4;
}
::-webkit-scrollbar-thumb:hover {
  background: #b0a68c;
}

/* ---------- 排版原子类 ---------- */

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
}

.eyebrow--mute {
  color: var(--ink-mute);
}

.serif {
  font-family: var(--serif);
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--paper);
  line-height: 1.14;
  letter-spacing: -0.012em;
}

.reading {
  max-width: var(--reading);
}

.muted {
  color: var(--ink-mute);
}

.soft {
  color: var(--ink-soft);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease),
    background-color 0.4s var(--ease), transform 0.4s var(--ease);
}

.btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn:active {
  transform: translateY(1px);
}

.btn--solid {
  background: var(--gold);
  border-color: var(--gold);
  color: #f6f2e7;
}

.btn--solid:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #f6f2e7;
}

.btn--ghost {
  border-color: transparent;
  color: var(--ink-mute);
  padding: 12px 4px;
  letter-spacing: 0.18em;
}

.btn--ghost:hover {
  color: var(--ink-soft);
}

.btn--small {
  padding: 10px 20px;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.btn:disabled:hover {
  border-color: var(--line);
  color: var(--ink);
}

/* ---------- 通用容器 ---------- */

.page {
  display: none;
  min-height: 100vh;
}

.page.is-active {
  display: block;
  animation: pageIn 0.55s var(--ease);
}

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad-x);
  background: linear-gradient(
    to bottom,
    rgba(239, 233, 217, 0.96) 0%,
    rgba(239, 233, 217, 0.55) 60%,
    transparent 100%
  );
  backdrop-filter: blur(2px);
}

.topbar__brand {
  font-size: 10px;
  letter-spacing: 0.52em;
  color: var(--gold);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar__link {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 6px 0;
  transition: color 0.3s;
}

.topbar__link:hover {
  color: var(--gold);
}

/* ---------- 模态 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 4, 4, 0.86);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.35s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--near-black);
  border: 1px solid var(--line);
  padding: clamp(24px, 4vw, 48px);
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--ink-mute);
  transition: color 0.3s;
}

.modal__close:hover {
  color: var(--gold);
}

.modal__title {
  font-family: var(--serif);
  font-size: 1.55rem;
  margin-bottom: 8px;
}

.modal__sub {
  font-size: 0.8rem;
  color: var(--ink-mute);
  margin-bottom: 28px;
}

.modal__body p {
  font-size: 0.88rem;
  line-height: 1.95;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.modal__body p:last-child {
  margin-bottom: 0;
}

/* ---------- 数据标注 ---------- */

.data-flag {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-line);
  padding: 3px 8px;
  white-space: nowrap;
}

.data-flag--mute {
  color: var(--ink-mute);
  border-color: var(--line);
}

/* ---------- 工具 ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.fade-up {
  animation: fadeUp 0.7s var(--ease) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
