/* 视觉：借 gal 的界面结构——标题画面、选择支、结局画面。设计稿在 design/mockup.html */

:root {
  --paper: #f7f3ec;
  --ink: #23263a;
  --muted: #6b6f80;
  --line: #e2dacd;
  --card: #fffdf9;
  --accent: #c94f78;
  --accent-soft: #fbeaf0;
  --box: #2c2f45;
  --box-ink: #f3f1f7;
  --box-muted: #b9b6c9;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161826;
    --ink: #e9e6f0;
    --muted: #9a9cb0;
    --line: #2c2f45;
    --card: #1e2132;
    --accent: #ed93b1;
    --accent-soft: #3a2030;
    --box: #0e0f1a;
    --box-ink: #f3f1f7;
    --box-muted: #a9a6bb;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.loading, .error { text-align: center; color: var(--muted); padding: 30vh 0; }

/* 每个画面占满一屏，底部留给页脚 */
.screen {
  min-height: calc(100dvh - 56px);
  display: flex;
  flex-direction: column;
  padding: 24px 0 16px;
}

.kicker { font-size: 12px; letter-spacing: 0.3em; color: var(--accent); }

/* ---------- 开始页 ---------- */

.title-screen { justify-content: center; padding: 0 20px; }
.title-screen h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1.25;
  margin: 14px 0 12px;
}
.title-screen .lead { color: var(--muted); margin: 0 0 40px; max-width: 26em; }

.menu { border-top: 1px solid var(--line); padding-top: 16px; display: grid; }
.menu button {
  font-family: var(--serif);
  font-size: 20px;
  text-align: left;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.menu button::before { content: "▸"; color: var(--accent); font-size: 13px; width: 0; overflow: hidden; transition: width 0.15s; }
.menu button:hover, .menu button:focus-visible { color: var(--accent); }
.menu button:hover::before, .menu button:focus-visible::before, .menu button.first::before { width: 1.4em; }
.menu button.first { color: var(--accent); }
.menu .label { flex: 1; }
.menu small { font-family: var(--sans); font-size: 13px; color: var(--muted); }

/* ---------- 答题 ---------- */

.top { display: flex; align-items: center; gap: 12px; }
.top .count { font-family: var(--serif); font-size: 15px; }
.top .count span { color: var(--muted); }
.bar { flex: 1; height: 2px; background: var(--line); }
.bar i { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }

.textbox {
  position: relative;
  margin-top: 32px;
  background: var(--box);
  color: var(--box-ink);
  border-radius: 6px;
  padding: 26px 20px 16px;
  cursor: default;
}
.name {
  position: absolute;
  top: -13px;
  left: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 3px 14px;
  border-radius: 3px;
}
@media (prefers-color-scheme: dark) { .name { color: #2a1520; } }
.textbox .q { font-family: var(--serif); font-size: 21px; line-height: 1.6; margin: 0; min-height: 1.6em; }
.textbox .hint { margin: 12px 0 0; font-size: 12px; color: var(--box-muted); }

.choices {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 32px 12px;
}
.choice {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 4px;
  padding: 13px 16px;
  text-align: center;
  font-size: 15px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--accent); }
.choice.picked { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.choice kbd { display: none; }
@media (hover: hover) {
  .choice { position: relative; }
  .choice kbd {
    display: block;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font: 11px var(--sans);
    color: var(--muted);
  }
}

.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.nav button:hover:not(:disabled) { color: var(--accent); }
.nav button:disabled { visibility: hidden; }

.btn {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 18px;
  text-align: center;
  background: var(--card);
  color: var(--ink);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { opacity: 0.88; }

/* ---------- 结果 ---------- */

.result { padding-top: 32px; }
.ending { text-align: center; margin-bottom: 22px; }
.ending .kicker { font-size: 11px; }
.ending h2 { font-family: var(--serif); font-weight: 600; font-size: 32px; margin: 8px 0 4px; }
.ending p { margin: 0; color: var(--muted); font-size: 14px; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.pills span { font-size: 12px; border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; color: var(--muted); }

.notice {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.notice p { margin: 0 0 8px; }
.notice .relax { display: flex; flex-wrap: wrap; gap: 8px; }
.notice .relax button { font-size: 13px; color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 3px 12px; }

.cards { display: grid; gap: 12px; }
.card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  animation: rise 0.45s both;
}
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.cover { display: block; position: relative; width: 96px; aspect-ratio: 3 / 4; border-radius: 4px; overflow: hidden; background: var(--line); align-self: start; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.text {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--line);
}
.cover.text span { font-family: var(--serif); font-size: 40px; font-weight: 600; color: var(--accent); }
.card.mini .cover.text span { font-size: 28px; }

.card h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 0; line-height: 1.4; }
.card .orig { margin: 1px 0 4px; font-size: 12px; color: var(--muted); }
.card .meta { margin: 0; font-size: 12px; color: var(--muted); }
.card .why { margin: 8px 0 6px; padding-left: 9px; border-left: 2px solid var(--accent); font-size: 14px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; padding: 0; list-style: none; }
.chips li { font-size: 11.5px; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 1px 8px; }
.card .row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.card .row button:hover { color: var(--accent); }
.card .row .on { color: var(--accent); }
.card .row .links { display: flex; gap: 12px; margin-left: auto; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.actions .full { grid-column: 1 / -1; }
.restart { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted); }
.restart button:hover { color: var(--accent); }

/* ---------- 想玩清单 ---------- */

.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 18px; }
.list-head h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0; }
.list-head button { font-size: 14px; color: var(--muted); }
.list-head button:hover { color: var(--accent); }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }
.card.mini { grid-template-columns: 64px minmax(0, 1fr); animation: none; }
.card.mini .cover { width: 64px; }
.card.mini h3 { font-size: 16px; }
.reset { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.reset button { color: var(--accent); }

.site-footer {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 20px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 720px) {
  .card { grid-template-columns: 120px minmax(0, 1fr); }
  .cover { width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
