/* 遷移 · MIGRATION
   基礎版《14.7 版》是綠色（生長）。這一版偏冷、偏灰 —— 因為它的動詞是減。 */

:root {
  --bg: #0d1512;
  --panel: #14201c;
  --panel-2: #1a2823;
  --line: #2b3d36;
  --ink: #dfe9e4;
  --mut: #8ba098;
  --faint: #5d6f68;
  --accent: #4bbf8a;
  --warn: #d98a4a;
  --bad: #d9615f;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg); color: var(--ink);
  font-family: 'Noto Sans TC', system-ui, sans-serif;
  font-size: 15px; line-height: 1.85;
  padding-bottom: 60px;
}

.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(13,21,18,.94); backdrop-filter: blur(6px); z-index: 20;
}
.topnav a { color: var(--mut); text-decoration: none; font-size: 13px; }
.topnav a:hover { color: var(--accent); }
.topnav .tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  border: 1px solid var(--accent); color: var(--accent);
  padding: 2px 8px; border-radius: 4px;
}

main { max-width: 720px; margin: 0 auto; padding: 20px 16px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px; margin-bottom: 14px;
}
.card.sticky { position: sticky; top: 49px; z-index: 10; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  color: var(--faint); text-transform: uppercase; margin-bottom: 8px;
}
h1 { font-size: 26px; line-height: 1.4; margin-bottom: 12px; }
h2 { font-size: 20px; margin-bottom: 8px; }

.lines p { margin-bottom: 10px; }
.lines p:last-child { margin-bottom: 0; }

.note { color: var(--mut); font-size: 14px; }
.hint { color: var(--faint); font-size: 13px; margin-top: 10px; }
.hint a { color: var(--accent); }

.asknote {
  color: var(--faint); font-size: 12px; margin: 0 0 12px; padding: 0 4px;
}

/* 繼承來源的色帶：一眼看出你上一輪選了什麼 */
.inherit { border-left: 3px solid var(--faint); }
.inherit.museum { border-left-color: #b08d57; }
.inherit.silicon { border-left-color: #4bbf8a; }
.inherit.equilibrium { border-left-color: #7ea8c4; }
.inherit.erased { border-left-color: #8a6a8f; }

/* ── 預算 ────────────────────────────────────────── */
.budget .bar {
  height: 8px; background: var(--panel-2); border-radius: 4px;
  overflow: hidden; margin-bottom: 10px;
}
.budget .fill { height: 100%; background: var(--accent); transition: width .2s, background .2s; }
.budget .fill.over { background: var(--bad); }

.budget-row {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-family: var(--mono); font-size: 12px; color: var(--mut);
}
.budget-row b { color: var(--ink); }
.budget-row .over, .budget-row .over b { color: var(--bad); }

.warn {
  margin-top: 8px; font-size: 13px; color: var(--warn);
  border-left: 2px solid var(--warn); padding-left: 8px;
}

/* ── 模組 ────────────────────────────────────────── */
.mods { display: grid; gap: 8px; margin-bottom: 16px; }

.mod {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px;
  align-items: start;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px;
  transition: opacity .15s, border-color .15s;
}
.mod.off { opacity: .42; }
.mod.bad { border-color: var(--bad); }

.mod-toggle {
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--bg); font-weight: 700; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.mod.on .mod-toggle { background: var(--accent); border-color: var(--accent); }
.mod-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.mod-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.mod-head b { font-size: 15px; }
.mod-head .size {
  font-family: var(--mono); font-size: 11px; color: var(--bg);
  background: var(--mut); border-radius: 4px; padding: 1px 6px;
}
.mod-head .who { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.mod-why { font-size: 13px; color: var(--mut); margin-top: 4px; }
.mod-why.stripped { color: var(--faint); font-style: italic; }
.mod-wish {
  font-size: 12px; color: var(--warn); margin-top: 4px;
  border-left: 2px solid var(--warn); padding-left: 8px;
}
.mod-deps { font-size: 12px; color: var(--faint); margin-top: 4px; }
.mod-deps .dep-missing { color: var(--bad); text-decoration: line-through; }
.mod-ask {
  font-size: 13px; color: var(--ink); margin-top: 8px;
  background: var(--panel-2); border-radius: 6px; padding: 8px 10px;
}

.ask {
  font-size: 12px; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--mut);
  font-family: inherit; white-space: nowrap;
}
.ask:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ask:disabled { opacity: .35; cursor: not-allowed; }

/* ── 按鈕 ────────────────────────────────────────── */
.row, .row2 { display: grid; gap: 8px; margin-bottom: 10px; }
.row2 { grid-template-columns: 1fr 1fr; }

button, .btn {
  display: block; width: 100%; padding: 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font: inherit; font-size: 14px; cursor: pointer; text-align: center; text-decoration: none;
  transition: background .12s, border-color .12s;
}
button:hover:not(:disabled), .btn:hover { background: #21332c; border-color: var(--accent); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: #1d5a44; border-color: var(--accent); font-weight: 700; }
button.primary:disabled { background: var(--panel-2); border-color: var(--line); }

/* ── 結局 ────────────────────────────────────────── */
.ending h1 { font-size: 28px; }
.cutlist { display: grid; gap: 6px; margin-top: 8px; }
.cut {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  border-bottom: 1px dashed var(--line); padding-bottom: 5px;
}
.cut b { font-size: 14px; }
.cut span { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.foot {
  max-width: 720px; margin: 0 auto; padding: 20px 16px;
  border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 13px;
}
.foot a { color: var(--mut); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot .credit {
  width: 100%; font-family: var(--mono); font-size: 11px; color: var(--faint);
}

@media (max-width: 520px) {
  .mod { grid-template-columns: 32px 1fr; }
  .ask { grid-column: 2; justify-self: start; margin-top: 6px; }
}

/* 讀過小說才看得到的真實理由。跟一般 why 分開，因為它會改變決定。 */
.mod-deep {
  font-size: 13px; color: var(--ink); margin-top: 6px;
  border-left: 2px solid var(--accent); padding-left: 8px;
}
.mod-locked {
  display: inline-block; font-size: 12px; color: var(--faint);
  margin-top: 6px; text-decoration: none; border-bottom: 1px dashed var(--faint);
}
.mod-locked:hover { color: var(--accent); border-bottom-color: var(--accent); }

.readnote { border-left: 3px solid var(--accent); }
.readnote p { margin-bottom: 6px; }
.readnote p:last-child { margin-bottom: 0; }

/* 回頭看：跨輪比對 */
.cmp { display: grid; gap: 6px; margin-top: 4px; }
.cmp-row {
  display: grid; grid-template-columns: 76px 1fr; gap: 10px;
  align-items: baseline; font-size: 13px;
  border-bottom: 1px dashed var(--line); padding-bottom: 5px;
}
.cmp-k { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.cmp-cut { color: var(--bad); }
.cmp-keep { color: var(--accent); }
.cmp-note { font-size: 13px; margin-top: 12px; line-height: 1.7; }
