/* 颜色和软件一致：只有暗色，灰阶 R=G=B；琥珀是人的决定，青色是 AI 的建议。 */
:root {
  --canvas: #0f0f0f;
  --surface: #1a1a1a;
  --surface-raised: #262626;
  --line: #737373;
  --line-soft: #333333;
  --ink: #ececec;
  --ink-muted: #a3a3a3;
  --safelight: #f0a43a;
  --on-safelight: #121212;
  --agent: #4fc6bd;
  --danger: #ff5c5c;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: 24px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:lang(zh-CN) body, body:lang(zh-CN) { line-height: 1.8; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--safelight); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.num { font-family: var(--mono); font-size: 0.82em; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

h1, h2 { font-weight: 600; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.2; }
h1 .line { display: inline-block; }
:lang(zh-CN) h1 .line { white-space: nowrap; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.25; }
.lead { color: var(--ink-muted); font-size: clamp(17px, 1.5vw, 19px); max-width: 34em; margin: 20px 0 0; }
.body { color: var(--ink-muted); }
.narrow { max-width: 34em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 22px; border: 0; border-radius: 6px;
  background: var(--safelight); color: var(--on-safelight);
  font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(0.94); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn-ghost { background: var(--surface-raised); color: var(--ink); }

/* 顶栏 */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 15, 15, 0.82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 16px; }
.brand svg { width: 26px; height: 26px; }
.top nav { display: flex; align-items: center; gap: 20px; }
.lang { color: var(--ink-muted); text-decoration: none; font-size: 14px; }
.lang:hover { color: var(--ink); }

/* 首屏：线圈 */
.hero {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px;
  align-items: center; min-height: calc(100svh - 60px); padding-top: 24px; padding-bottom: 48px;
}
.hero-cta { display: flex; align-items: center; gap: 18px; margin: 36px 0 0; }
.note { color: var(--ink-muted); font-size: 14px; }
.coil { position: relative; width: 100%; aspect-ratio: 1; max-width: 640px; justify-self: end; }
.coil-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.coil-line path { fill: none; stroke: var(--line-soft); stroke-width: 3; stroke-linecap: round; }
.coil-photos { position: absolute; inset: 0; }
.coil-card {
  position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity;
  animation-name: coil-turn; animation-timing-function: linear; animation-iteration-count: infinite;
  animation-play-state: paused;
}
.coil.run .coil-card { animation-play-state: running; }
.coil-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--surface); }
.coil-dot {
  position: absolute; left: 50%; top: 50%; width: 3.2%; aspect-ratio: 1;
  border-radius: 50%; background: var(--agent); transform: translate(-50%, -50%);
}

/* 章节 */
.chapter { padding-top: 140px; padding-bottom: 20px; }

.places {
  display: grid; grid-template-columns: minmax(0, 15em) minmax(60px, 1fr) auto;
  align-items: stretch; margin: 56px 0 40px; max-width: 880px;
}
.place-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-rows: repeat(5, 1fr); }
.place-list li {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.place-list li:last-child { border-bottom: 0; }
.place-list li span:first-child { flex: 1; }
.place-list .off { color: var(--ink-muted); }
.tag { font-size: 12px; color: var(--ink-muted); border: 1px solid var(--line-soft); border-radius: 3px; padding: 0 6px; }
.threads-box { position: relative; }
.threads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; clip-path: inset(0 100% 0 0); transition: clip-path 1.4s cubic-bezier(.4, 0, .2, 1) 0.2s; }
.threads path { fill: none; stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.threads path.off { stroke: var(--line-soft); stroke-dasharray: 4 5; }
.in .threads { clip-path: inset(0 0 0 0); }
.archive { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding-left: 16px; min-width: 120px; }
.archive svg { width: 88px; height: 88px; margin-bottom: 8px; }
.archive strong { font-size: 19px; }

/* AI 选片 */
.pick-grid {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: 48px;
}
.tile {
  position: relative; padding: 0; border: 0; background: var(--surface); cursor: pointer;
  aspect-ratio: 3 / 2; outline-offset: 0;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.4s; }
.tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 0 transparent; transition: box-shadow 0.2s;
}
.picked .tile:not(.ai):not(.kept) img { opacity: 0.38; }
.tile.ai::after { box-shadow: inset 0 0 0 2px var(--agent); }
.tile.kept::after { box-shadow: inset 0 0 0 3px var(--safelight); }
.tile .mark {
  position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--agent); opacity: 0; transition: opacity 0.2s, background 0.2s;
}
.tile.ai .mark { opacity: 1; }
.tile.kept .mark { opacity: 1; background: var(--safelight); }
.tile:hover img { opacity: 1 !important; }
.pick-status { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 20px 0 0; font-size: 15px; }
.pick-status .ai { color: var(--agent); }
.pick-status .kept { color: var(--safelight); }
.pick-status .hint { color: var(--ink-muted); margin-left: auto; }

/* 筛选 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 6px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--ink); font-size: 15px;
}
.chip.ai { color: var(--agent); }
.chip[aria-pressed="true"] { background: var(--surface-raised); border-color: var(--ink); }
.chip.ai[aria-pressed="true"] { border-color: var(--agent); }
.find-grid { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; margin-top: 24px; }
.find-grid img { aspect-ratio: 1; object-fit: cover; width: 100%; transition: opacity 0.35s, transform 0.35s; }
.find-grid img.out { opacity: 0.1; transform: scale(0.92); }

/* 修图 */
.edit { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; margin-top: 48px; align-items: start; }
.edit-photo { position: relative; }
.edit-photo img { width: 100%; height: auto; }
.fix {
  position: absolute; inset: 0; transition: opacity 0.5s;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.fix-0 { filter: url(#fx-sky); }
.fix-1 { filter: contrast(1.14) saturate(1.18) brightness(0.97); }
.fx { position: absolute; width: 0; height: 0; }
.fix.off { opacity: 0; }
.pin {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  border: 2px solid var(--agent); background: rgba(15, 15, 15, 0.75); color: var(--agent);
  font: 600 13px/1 var(--sans); cursor: pointer; transition: opacity 0.3s, color 0.2s, border-color 0.2s;
}
.pin.kept { border-color: var(--safelight); color: var(--safelight); }
.pin.off { opacity: 0; pointer-events: none; }
.edit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.edit-list li {
  display: grid; grid-template-columns: 28px 1fr; gap: 4px 12px; padding: 16px;
  background: var(--surface); border-radius: 6px; transition: background 0.2s;
}
.edit-list li.hl { background: var(--surface-raised); }
.pin-n {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--agent); color: var(--agent);
  display: grid; place-items: center; font: 600 12px/1 var(--sans); margin-top: 2px;
}
.edit-list strong { display: block; font-size: 16px; }
.edit-list div span { color: var(--ink-muted); font-size: 15px; }
.acts { grid-column: 2; display: flex; gap: 8px; margin: 10px 0 0; align-items: center; }
.acts .done { font-size: 14px; color: var(--ink-muted); }
li.kept .pin-n { border-color: var(--safelight); color: var(--safelight); }
li.kept .done { color: var(--safelight); }
li.undone { opacity: 0.6; }
li.undone .pin-n { border-color: var(--line); color: var(--line); }

/* 留着 + 名字 */
.keep { padding-top: 160px; }
.keep-photo { position: relative; }
.keep-photo img { width: 100%; height: min(86vh, 900px); object-fit: cover; }
.keep-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--canvas) 0%, transparent 18%, transparent 55%, rgba(15, 15, 15, 0.85) 100%);
}
.keep-quote {
  position: absolute; left: 0; right: 0; bottom: 56px; z-index: 1; margin: 0 auto;
  font-size: clamp(26px, 3.6vw, 44px); line-height: 1.35; font-weight: 600;
}
.name { text-align: center; padding-top: 120px; display: flex; flex-direction: column; align-items: center; }
.name svg { width: 112px; height: 112px; margin-bottom: 28px; }
.name .lead { margin-left: auto; margin-right: auto; }

/* 下载 */
.download { padding-bottom: 120px; }
.download-cta { display: flex; align-items: center; gap: 18px; margin: 36px 0 0; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  padding-top: 32px; padding-bottom: 48px; border-top: 1px solid var(--line-soft);
  color: var(--ink-muted); font-size: 13px;
}
.foot summary { cursor: pointer; list-style: none; }
.foot summary::-webkit-details-marker { display: none; }
.foot summary:hover { color: var(--ink); }
.foot details p { max-width: 640px; margin: 10px 0 0; line-height: 1.9; }
.foot details a { text-decoration: none; }
.foot details a:hover { color: var(--ink); text-decoration: underline; }

/* 进入视口时淡入 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s, transform 0.8s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .hero { grid-template-columns: 1fr; gap: 24px; min-height: 0; padding-top: 40px; }
  .coil { justify-self: center; max-width: 520px; }
  .chapter { padding-top: 96px; }
  .places { grid-template-columns: minmax(0, 1fr) 44px 84px; margin: 40px 0 32px; }
  .place-list li { font-size: 15px; padding: 12px 0; gap: 8px; }
  .place-list .tag { display: none; }
  .archive { min-width: 0; padding-left: 6px; }
  .archive svg { width: 56px; height: 56px; }
  .archive strong { font-size: 16px; }
  .pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .pick-status .hint { margin-left: 0; width: 100%; }
  .find-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .edit { grid-template-columns: 1fr; }
  .keep { padding-top: 96px; }
  .keep-photo img { height: 70vh; }
  .keep-quote { bottom: 32px; }
  .name { padding-top: 80px; }
  .top nav { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .threads { transition: none; clip-path: none; }
}

/* 404 */
.notfound { padding-top: 32px; padding-bottom: 120px; }
.notfound h1 { margin-top: 120px; }
