/* ============ 打工人盲盒 · 样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #14110d;
  --card: #1e1a15;
  --card-2: #241f18;
  --line: #2e2820;
  --ink: #e9e2d5;
  --ink-dim: #9a8f7d;
  --amber: #e6a23c;
  --amber-deep: #c9762b;
  --danger: #d9634e;
  --ok: #7fb069;
  --paper: #f4ecdc;
  --paper-ink: #3a332a;
  --paper-dim: #6b6152;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}

#app {
  max-width: 470px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(230,162,60,.07), transparent 60%),
    var(--bg);
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ============ 通用 ============ */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
  text-align: center;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--amber); color: #241a08; font-weight: 700; }
.btn-ghost { background: transparent; color: var(--ink-dim); border: 1px solid var(--line); }
.btn-big { padding: 17px; font-size: 18px; border-radius: 14px; }

.disclaimer {
  text-align: center;
  color: #5c5445;
  font-size: 12px;
  padding: 26px 20px 18px;
}

.section-title {
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: .06em;
  margin: 20px 0 10px;
  text-align: center;
}

/* ============ 开始屏 ============ */
.start-inner {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 26px 20px;
  text-align: center;
}
.start-emoji { font-size: 62px; animation: floaty 3.4s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.game-title {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: .12em;
  margin: 14px 0 12px;
  color: var(--ink);
}
.game-sub { color: var(--ink-dim); font-size: 15px; margin-bottom: 38px; }
.start-hint { color: #6e6552; font-size: 13px; margin-top: 18px; }
.start-hint::before { content: "· "; }
.start-hint::after { content: " ·"; }

.past-lives { width: 100%; max-width: 340px; margin-top: 30px; }
.past-lives-title { color: var(--ink-dim); font-size: 12.5px; text-align: center; margin-bottom: 10px; letter-spacing: .05em; }
.past-chip {
  display: flex; justify-content: space-between; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 6px;
  font-size: 12.5px; color: var(--ink-dim);
}
.past-chip b { color: var(--ink); font-weight: 600; }

/* ============ 工牌卡（分配/结局共用） ============ */
.badge-card {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 18px;
  padding: 44px 24px 22px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  box-shadow: 0 18px 50px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.6);
  text-align: center;
  animation: badgeIn .55s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes badgeIn { from { transform: rotateY(84deg) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.badge-hole {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.55);
}
.badge-emoji { font-size: 52px; margin-top: 6px; }
.badge-name { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 25px; font-weight: 900; margin-top: 6px; }
.badge-job { font-size: 16px; font-weight: 700; color: var(--amber-deep); margin-top: 2px; }
.badge-meta { font-size: 12.5px; color: var(--paper-dim); margin-top: 6px; }
.badge-stats {
  margin-top: 14px; padding-top: 13px; border-top: 1.5px dashed #d8cbb2;
  font-size: 13px; color: var(--paper-ink); line-height: 2;
}
.badge-stats .hl { color: var(--amber-deep); font-weight: 700; }
.badge-footnote { margin-top: 12px; font-size: 11px; color: #97896e; line-height: 1.6; text-align: left; }

/* ============ 分配屏 ============ */
.assign-inner { padding: 34px 26px 10px; text-align: center; }
.assign-tip { color: var(--ink-dim); font-size: 13.5px; letter-spacing: .15em; margin-bottom: 22px; }
.assign-inner .btn-big { max-width: 340px; margin: 26px auto 0; }

.coworker-brief { max-width: 340px; margin: 0 auto; }
.coworker-chips { display: flex; flex-direction: column; gap: 7px; }
.coworker-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 13px; text-align: left;
}
.coworker-chip .ce { font-size: 21px; }
.coworker-chip .cn { font-size: 13.5px; color: var(--ink); }
.coworker-chip .cn small { color: var(--ink-dim); font-size: 12px; }

/* ============ 人生屏 ============ */
.stats-bar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: rgba(20,17,13,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 9px 8px 7px;
}
.stat { text-align: center; min-width: 0; }
.stat-k {
  display: block; font-size: 13.5px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-k.warn { color: var(--danger); }
.stat-label { font-size: 10.5px; color: #6e6552; }

.job-strip {
  padding: 10px 16px 2px;
  color: var(--ink-dim); font-size: 12.5px;
  display: flex; gap: 7px; align-items: center;
}
.job-strip b { color: var(--amber); font-weight: 700; }

.timeline { padding: 10px 16px 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  margin: 11px 0;
  animation: fadeUp .38s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card-year-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.card-year-head .y {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 19px; font-weight: 900; color: var(--amber);
}
.card-year-head .a { font-size: 12px; color: var(--ink-dim); }

.card-tag {
  display: inline-block; font-size: 11px; color: var(--amber);
  border: 1px solid rgba(230,162,60,.35); border-radius: 99px;
  padding: 1px 9px; margin-bottom: 7px;
}
.ev { font-size: 14px; margin: 7px 0; color: var(--ink); }
.ev .ev-ico { margin-right: 6px; }
.ev.pos { color: #cfe3bd; }
.ev.neg { color: #efb3a5; }
.ev.sys { color: var(--ink-dim); font-size: 13px; }

.year-foot {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--ink-dim);
}
.year-foot b { color: var(--ink); font-weight: 600; }
.year-foot b.warn { color: var(--danger); }

/* 选择题卡 */
.card.choice { border-color: rgba(230,162,60,.45); }
.choice-q { font-size: 15px; margin: 4px 0 12px; }
.choice-opts { display: flex; flex-direction: column; gap: 9px; }
.choice-opt {
  background: var(--card-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 11px; padding: 12px 14px;
  font-size: 14px; font-family: inherit; cursor: pointer; text-align: left;
  transition: border-color .12s;
}
.choice-opt:hover { border-color: var(--amber); }
.choice-opt:disabled { opacity: .4; cursor: not-allowed; }
.choice-result { margin-top: 11px; font-size: 13px; color: var(--amber); }

/* 反思卡 */
.card.reflect { border-color: rgba(217,99,78,.4); background: linear-gradient(160deg, #241b17, var(--card)); }
.reflect-q {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px; line-height: 1.8; margin: 4px 0 12px; color: var(--ink);
}
.reflect-input {
  width: 100%; background: #171310; border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink);
  font-family: inherit; font-size: 14px; padding: 10px 12px;
  min-height: 74px; resize: vertical; outline: none;
}
.reflect-input:focus { border-color: var(--danger); }
.reflect-note { margin-top: 7px; font-size: 11.5px; color: #6e6552; }

/* 同事对照卡 */
.card.coworkers { background: var(--card-2); }
.cw-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 2px; border-bottom: 1px dashed var(--line);
}
.cw-row:last-child { border-bottom: none; }
.cw-emoji { font-size: 21px; margin-top: 1px; }
.cw-body { flex: 1; min-width: 0; }
.cw-name-line { font-size: 13.5px; }
.cw-name-line b { color: var(--ink); }
.cw-name-line small { color: var(--ink-dim); font-size: 11.5px; }
.cw-status { font-size: 12.5px; color: var(--ink-dim); margin-top: 1px; }
.cw-status.gone { color: #b0776a; }
.cw-salary { font-size: 12px; color: var(--amber); white-space: nowrap; margin-top: 1px; }

/* 快进聚合卡 */
.card.ff { background: #191510; }
.ff-years { color: var(--ink-dim); font-size: 12px; margin-bottom: 6px; }
.ff .ev { font-size: 13px; margin: 5px 0; }

/* 终局年卡片 */
.card.final-year { border-color: var(--danger); }

.controls {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 34%);
}
.controls .btn-primary { flex: 1; }

/* ============ 结局屏 ============ */
.end-inner { padding: 44px 26px 10px; text-align: center; }
.end-lead { color: var(--ink-dim); font-size: 13.5px; letter-spacing: .2em; }
.end-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 30px; font-weight: 900; margin: 10px 0 26px;
  color: #fdf8ec;
  text-shadow: 0 2px 14px rgba(230,162,60,.25);
}
.end-extra { max-width: 340px; margin: 18px auto 0; text-align: left; }
.end-extra .ex-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 9px; font-size: 13px; color: var(--ink-dim);
}
.end-extra .ex-block b { color: var(--ink); font-size: 13.5px; display: block; margin-bottom: 4px; }
.end-extra .ex-quote { font-family: "Noto Serif SC", "Songti SC", serif; color: var(--ink); }
.end-actions { max-width: 340px; margin: 22px auto 0; display: flex; flex-direction: column; gap: 9px; }
.end-tribute {
  margin-top: 30px; color: var(--ink-dim); font-size: 13.5px;
  font-family: "Noto Serif SC", "Songti SC", serif; letter-spacing: .08em;
}

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: #2c261e; color: var(--ink); border: 1px solid var(--line);
  padding: 9px 18px; border-radius: 99px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99;
}
#toast.show { opacity: 1; }
