/* 《收拢》· 日系冷艳 — 深夜靛蓝 / 银白排版 / 一点暖光留给那个人 */
:root {
  --bg: #0a0e16;
  --ink: #dfe6ee;
  --dim: #97a3b2;
  --faint: #5b6672;
  --accent: #9fc4d6;
  --warm: #e0a279;
  --line: rgba(223, 230, 238, 0.13);
  --line-soft: rgba(223, 230, 238, 0.08);
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "SimSun", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(159, 196, 214, 0.25); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ——— 大气层：光点 / 雾 / 颗粒 / 暗角 ——— */
#dust {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%; display: block;
}
.mist {
  position: fixed; inset: -20%; z-index: 2; pointer-events: none;
  background:
    radial-gradient(42% 34% at 22% 30%, rgba(168, 196, 224, 0.09), transparent 70%),
    radial-gradient(38% 30% at 78% 68%, rgba(232, 168, 128, 0.08), transparent 72%),
    radial-gradient(50% 40% at 55% 85%, rgba(196, 150, 190, 0.07), transparent 75%);
  animation: drift 46s ease-in-out infinite alternate;
}
@keyframes drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(2%, 2%, 0) scale(1.06); }
}
.grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  opacity: 0.055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 39; pointer-events: none;
  background: radial-gradient(125% 100% at 50% 42%, transparent 62%, rgba(6, 8, 14, 0.38) 100%);
}
body.no-canvas #dust { display: none; }

/* ——— 顶栏 / 导航 ——— */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px clamp(22px, 4vw, 48px);
}
.top__brand {
  color: var(--ink); text-decoration: none;
  font-size: 13px; font-weight: 400; letter-spacing: 0.5em;
}
.top__alt {
  color: var(--faint); text-decoration: none;
  font-size: 10px; letter-spacing: 0.3em;
  transition: color 0.3s;
}
.top__alt:hover { color: var(--accent); }

.rail {
  position: fixed; right: clamp(14px, 2.4vw, 34px); top: 50%;
  transform: translateY(-50%); z-index: 50;
}
.rail__list { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.rail__list button {
  display: flex; align-items: baseline; gap: 8px;
  background: none; border: 0; cursor: pointer;
  color: var(--faint); font-family: var(--mono);
  transition: color 0.3s;
}
.rail__list button b { font-size: 9px; font-weight: 400; letter-spacing: 0.14em; }
.rail__list button span {
  font-family: var(--sans); font-size: 10px; letter-spacing: 0.32em;
  opacity: 0; transform: translateX(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.rail__list button:hover, .rail__list button.is-active { color: var(--accent); }
.rail__list button:hover span, .rail__list button.is-active span { opacity: 1; transform: none; }
.rail__list button.is-past { color: rgba(223, 230, 238, 0.18); }

/* ——— 场景 ——— */
#scroll-root { position: relative; z-index: 10; }
.scene {
  min-height: 138vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  pointer-events: none;
}
.scene--hero { min-height: 155vh; }
.scene--figure { min-height: 195vh; }
.scene--end { min-height: 130vh; }
.scene--dark { background: linear-gradient(to bottom, transparent, rgba(5, 7, 12, 0.55) 22%, rgba(5, 7, 12, 0.55) 78%, transparent); }

.scene__in {
  width: min(46rem, 90vw);
  padding: 14vh 4vw;
  pointer-events: auto;
}
.scene__in--narrow { width: min(38rem, 88vw); text-align: center; }

/* ——— 字 ——— */
.eyebrow {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.44em; color: var(--accent);
  text-transform: uppercase; margin-bottom: 4.2vh;
}
.cold {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  letter-spacing: 0.34em; color: var(--dim);
}
.bigtitle {
  margin-top: 3.2vh;
  text-shadow: 0 2px 34px rgba(8, 10, 18, 0.5);
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.4rem, 10.5vw, 8.2rem);
  letter-spacing: 0.22em; text-indent: 0.22em; line-height: 1.1;
  white-space: nowrap;
  color: var(--ink);
  text-shadow: 0 0 60px rgba(159, 196, 214, 0.18);
}
.thesis {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.6vw, 1.85rem);
  letter-spacing: 0.22em; line-height: 2.1; color: var(--ink);
}
.title {
  font-size: clamp(1.95rem, 4.6vw, 3.35rem);
  font-weight: 250; letter-spacing: 0.12em; line-height: 1.55;
  color: var(--ink);
  text-shadow: 0 1px 22px rgba(8, 10, 18, 0.55);
}
.sub {
  margin-top: 3.4vh;
  font-size: clamp(0.98rem, 1.8vw, 1.22rem);
  letter-spacing: 0.12em; line-height: 2.35; color: var(--dim);
  text-shadow: 0 1px 14px rgba(8, 10, 18, 0.5);
}
.sub--left { max-width: 33em; }
.aside {
  margin-top: 4.2vh;
  font-family: var(--serif); font-size: clamp(0.95rem, 1.7vw, 1.15rem);
  letter-spacing: 0.22em; color: var(--warm); opacity: 0.85;
}
.figureline {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  letter-spacing: 0.18em; line-height: 1.9; color: var(--ink);
  text-shadow: 0 1px 26px rgba(20, 10, 16, 0.6);
}
.scene--hero .scene__in { width: min(52rem, 92vw); text-align: center; }
.scene--hero .thesis { margin-top: 4.5vh; letter-spacing: 0.3em; }
.scene--hero .sub { margin-top: 1.2vh; font-family: var(--serif); letter-spacing: 0.34em; color: var(--faint); }
.scene__in--narrow .sub { margin-left: auto; margin-right: auto; max-width: 30em; }

/* 竖排点缀 */
.scene--figure .scene__in::before {
  content: "重 逢 是 另 一 种 出 发";
  position: absolute; left: clamp(8px, 6vw, 90px); top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--serif); font-size: 12px; letter-spacing: 0.55em;
  color: var(--faint); opacity: 0.75;
}
.scene--figure .scene__in {
  position: relative;
  width: min(34rem, 92vw);
  margin-right: auto;
  margin-left: clamp(24px, 10vw, 150px);
  text-align: left;
}
.scene--figure .scene__in--narrow .sub { margin-left: 0; text-align: left; }
.scene--figure .figureline { text-align: left; }

/* ——— 列表 ——— */
.lines { list-style: none; margin-top: 5vh; }
.lines li {
  padding: 1.35vh 0; font-size: clamp(1.02rem, 2vw, 1.32rem);
  letter-spacing: 0.14em; line-height: 2.1; color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.lines li:first-child { border-top: 1px solid var(--line-soft); }
.lines--end li {
  display: grid; grid-template-columns: 84px 1fr; gap: 16px;
  font-size: 0.95rem; letter-spacing: 0.08em; color: var(--dim);
}
.lines--end b {
  font-family: var(--mono); font-weight: 400; font-size: 9.5px;
  letter-spacing: 0.3em; color: var(--accent); padding-top: 6px;
}

.rows { list-style: none; margin-top: 4.6vh; }
.rows li, .rows__row {
  display: grid; grid-template-columns: 52px 128px 1fr; gap: 14px;
  align-items: baseline; padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}
.rows li:last-child, .rows__row:last-child { border-bottom: 1px solid var(--line-soft); }
.rows b, .rows__row b {
  font-family: var(--mono); font-weight: 400; font-size: 10px;
  letter-spacing: 0.22em; color: var(--accent);
}
.rows strong { font-size: 0.98rem; font-weight: 450; letter-spacing: 0.16em; }
.rows span { font-size: 0.88rem; line-height: 2.05; letter-spacing: 0.05em; color: var(--dim); }
.rows--tight li, .rows--tight .rows__row {
  grid-template-columns: 40px 84px 1fr; padding: 12px 0;
}
.rows--tight .rows__row { grid-template-columns: 84px 1fr; }

.props { list-style: none; margin-top: 5.2vh; }
.props li { padding: 3.2vh 0; border-top: 1px solid var(--line-soft); }
.props li:last-child { border-bottom: 1px solid var(--line-soft); }
.props b {
  display: block; font-family: var(--mono); font-weight: 400;
  font-size: 9.5px; letter-spacing: 0.42em; color: var(--accent);
}
.props strong {
  display: block; margin-top: 12px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.35rem, 2.8vw, 1.95rem); letter-spacing: 0.22em;
}
.props span {
  display: block; margin-top: 13px;
  font-size: 0.95rem; line-height: 2.25; letter-spacing: 0.05em; color: var(--dim);
}

/* ——— 哲学题记 ——— */
.phil {
  margin-top: 5.4vh;
  padding: 2px 0 2px 22px;
  border-left: 2px solid rgba(198, 74, 58, 0.55);
  position: relative;
}
.ink {
  display: block; width: 108px; height: 14px;
  margin: 0 0 20px -22px;
  background: linear-gradient(100deg, rgba(223, 230, 238, 0.5), rgba(223, 230, 238, 0.14) 72%, transparent);
  clip-path: polygon(0 55%, 12% 30%, 28% 62%, 47% 22%, 63% 58%, 81% 34%, 100% 66%, 97% 78%, 76% 52%, 58% 80%, 40% 48%, 22% 82%, 8% 60%, 0 74%);
  opacity: 0.75;
}
.phil__q {
  font-family: var(--serif);
  font-size: clamp(1.12rem, 2.3vw, 1.62rem);
  letter-spacing: 0.16em; line-height: 2.15;
  color: var(--ink);
  text-shadow: 0 1px 18px rgba(8, 10, 18, 0.5);
}
.phil__q--2, .phil__src + .phil__q { margin-top: 3.2vh; }
.phil__src {
  margin-top: 14px;
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.34em; color: var(--warm);
}
.phil__note {
  margin-top: 16px;
  font-size: 0.92rem; letter-spacing: 0.12em; line-height: 2.15;
  color: var(--dim);
}
.scene--figure .phil { margin-top: 6vh; }

/* ——— 朱印 ——— */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  margin-left: 0.35em; vertical-align: 0.28em;
  background: rgba(198, 62, 44, 0.88);
  color: #f6ede2;
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  letter-spacing: 0; text-indent: 0;
  border-radius: 6px;
  transform: rotate(-3.5deg);
  box-shadow: 0 2px 14px rgba(120, 30, 20, 0.35);
  -webkit-text-fill-color: #f6ede2;
}
.seal--end {
  display: block; margin: 5.5vh 0 0;
  width: 42px; height: 42px; font-size: 20px;
}
.bigtitle .seal {
  text-shadow: none;
  -webkit-text-fill-color: #f6ede2;
  color: #f6ede2;
}

/* ——— 两栏（信） ——— */
.cols {
  margin-top: 5.4vh; display: grid; gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.cols__block .k {
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.42em; color: var(--faint); margin-bottom: 12px;
  text-transform: uppercase;
}

/* ——— 试聊 ——— */
.screen {
  margin-top: 6.2vh; border: 1px solid var(--line);
  background: rgba(10, 14, 22, 0.55); backdrop-filter: blur(8px);
}
.screen__bar {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.3em; color: var(--faint);
}
.screen__bar #demo-status { color: var(--accent); }
.screen__log {
  height: 280px; overflow-y: auto; padding: 22px 20px;
  display: flex; flex-direction: column; gap: 18px;
  scrollbar-width: thin; scrollbar-color: rgba(159,196,214,0.25) transparent;
}
.msg { max-width: 34em; }
.msg__who {
  font-family: var(--mono); font-size: 8.5px;
  letter-spacing: 0.42em; color: var(--faint); margin-bottom: 7px;
  text-transform: uppercase;
}
.msg--bot .msg__who { color: var(--accent); }
.msg--user { align-self: flex-end; text-align: right; }
.msg__body {
  font-size: 0.92rem; line-height: 2.15; letter-spacing: 0.05em;
  color: var(--dim); white-space: pre-wrap; word-break: break-word;
}
.msg--user .msg__body { color: var(--ink); }
.screen__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 16px 12px; }
.chip {
  background: none; cursor: pointer;
  border: 1px solid var(--line-soft); color: var(--faint);
  font-family: var(--sans); font-size: 10px; letter-spacing: 0.16em;
  padding: 8px 13px; transition: color 0.3s, border-color 0.3s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.screen__form {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-top: 1px solid var(--line-soft);
}
.screen__form input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--ink); font-family: var(--sans); font-size: 0.95rem;
  letter-spacing: 0.06em;
}
.screen__form input::placeholder { color: var(--faint); }
.screen__note {
  padding: 12px 16px 16px; border-top: 1px solid var(--line-soft);
  font-size: 10.5px; line-height: 2; letter-spacing: 0.08em; color: var(--faint);
}

/* ——— 按钮 / 链接 ——— */
.btn {
  appearance: none; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.32em;
  color: var(--ink); background: none;
  padding: 12px 22px; border: 1px solid var(--line);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(159, 196, 214, 0.06); }
.btn--sm { padding: 9px 18px; letter-spacing: 0.26em; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.altlink { margin-top: 5.6vh; display: flex; gap: 26px; justify-content: center; }
.altlink a {
  color: var(--dim); text-decoration: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em;
  border-bottom: 1px solid var(--line-soft); padding-bottom: 3px;
  transition: color 0.3s;
}
.altlink a:hover { color: var(--accent); }

/* ——— 滚动提示 ——— */
.cue {
  position: absolute; left: 50%; bottom: 9vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: var(--serif); font-size: 10px; letter-spacing: 0.5em;
  text-indent: 0.5em; color: var(--faint);
}
.cue i {
  width: 1px; height: 56px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: fall 2.4s ease-in-out infinite;
}
@keyframes fall {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ——— 揭示 ——— */
.rv { opacity: 0; transform: translateY(22px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.scene.is-on .rv { opacity: 1; transform: none; }
.scene.is-on .rv:nth-child(2) { transition-delay: 0.1s; }
.scene.is-on .rv:nth-child(3) { transition-delay: 0.2s; }
.scene.is-on .rv:nth-child(4) { transition-delay: 0.3s; }
.scene.is-on .rv:nth-child(5) { transition-delay: 0.4s; }
.scene.is-on .rv:nth-child(6) { transition-delay: 0.5s; }
.lines .rv:nth-child(1), .rows .rv:nth-child(1), .props .rv:nth-child(1) { transition-delay: 0.12s; }
.lines .rv:nth-child(2), .rows .rv:nth-child(2), .props .rv:nth-child(2) { transition-delay: 0.2s; }
.lines .rv:nth-child(3), .rows .rv:nth-child(3), .props .rv:nth-child(3) { transition-delay: 0.28s; }
.rows .rv:nth-child(4) { transition-delay: 0.36s; }
.rows .rv:nth-child(5) { transition-delay: 0.44s; }

/* ——— mobile ——— */
@media (max-width: 860px) {
  .top { padding: 18px 20px; }
  .top__brand { letter-spacing: 0.36em; font-size: 12px; }
  .rail { right: 8px; }
  .rail__list button span { display: none; }
  .scene { min-height: 118vh; }
  .scene--hero { min-height: 130vh; }
  .scene--figure { min-height: 165vh; }
  .scene__in { padding: 12vh 22px; }
  .rows li, .rows__row { grid-template-columns: 36px 1fr; }
  .rows li span { grid-column: 1 / -1; }
  .rows strong { grid-column: 2; }
  .rows--tight li, .rows--tight .rows__row { grid-template-columns: 36px 1fr; }
  .scene--figure .scene__in::before { display: none; }
  .lines--end li { grid-template-columns: 64px 1fr; }
  .screen__log { height: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .mist { animation: none; }
  .cue i { animation: none; }
}
