/* 县城人生履历 · 试玩版样式
 * 旧档案 / 粮票质感：米白纸 + 墨黑字 + 朱红印章，宋体/仿宋标题。
 * 竖屏手机优先，390px 宽不横向溢出；桌面居中显示。
 * 禁止：系统默认字体、灰色方框占位、1px 细边当主分隔、纯文字教程墙、emoji 当图标。
 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --paper: #F4EDDC;
  --paper2: #EAE0C8;
  --paper3: #FBF6EA;
  --ink: #2B2A26;
  --ink-dim: #6B6657;
  --seal: #B03A2E;
  --seal-deep: #8E2C23;
  --teal: #6B7A63;
  --gold: #C9A86A;
  --stroke: rgba(43, 42, 38, 0.18);
  --serif: "Songti SC", "SimSun", "STSong", "Noto Serif SC", serif;
  --kai: "FangSong", "STFangsong", "仿宋", "SimSun", serif;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: #d9d2bf;
  color: var(--ink);
  font-family: var(--serif);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(130% 90% at 50% 0%, #fbf6ea 0%, var(--paper) 55%, var(--paper2) 100%);
  position: relative;
}
/* 纸张噪点质感（可平铺，无大图） */
#app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(43, 42, 38, 0.05) 1px, transparent 1px);
  background-size: 3px 3px;
  z-index: 0;
}
#app > * { position: relative; z-index: 1; }

/* ---------- 顶栏 ---------- */
#topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(44px + 10px) 24px 8px;
}
#topbar .title { font-family: var(--kai); font-size: 14px; letter-spacing: 4px; color: var(--ink); }
#round-indicator { font-size: 12px; color: var(--ink-dim); letter-spacing: 2px; }

/* ---------- 页面通用 ---------- */
.screen { flex: 1 1 auto; padding: 16px 24px 28px; }
.screen.hidden { display: none; }

h1 { font-family: var(--kai); font-size: 30px; margin: 8px 0 10px; text-align: center; font-weight: 700; letter-spacing: 2px; }
h2 { font-family: var(--kai); font-size: 24px; margin: 8px 0 12px; text-align: center; color: var(--ink); font-weight: 700; letter-spacing: 4px; }
.sub { font-size: 14px; color: var(--ink-dim); text-align: center; line-height: 1.7; margin-bottom: 16px; }

/* ---------- 首页 hero ---------- */
.hero { text-align: center; margin-top: 22px; }
.hero-seal {
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  border: 3px solid var(--seal);
  border-radius: 6px;
  color: var(--seal);
  font-family: var(--kai);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-6deg);
  opacity: 0.92;
}
.hero h1 { font-size: 42px; letter-spacing: 8px; line-height: 1.1; margin: 0 0 12px; }
.hero .sub { font-size: 15px; letter-spacing: 1px; margin-bottom: 0; }
.rule {
  width: 200px;
  height: 2px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- 档案卡片（粮票虚线内框） ---------- */
.file {
  margin-top: 30px;
  background: var(--paper3);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 22px 20px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
  position: relative;
}
.file::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  pointer-events: none;
}
.file h2 { font-family: var(--kai); font-size: 20px; letter-spacing: 6px; margin: 0; }
.file .cap { text-align: center; font-size: 11px; color: var(--ink-dim); margin-top: 8px; letter-spacing: 3px; }
.steps { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.step { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); letter-spacing: 1px; }
.step i { width: 6px; height: 6px; border-radius: 50%; background: var(--seal); display: inline-block; }
.sep { color: var(--gold); font-size: 13px; }

/* ---------- 朱红印章（通用装饰） ---------- */
.seal {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 2px solid var(--seal);
  border-radius: 4px;
  color: var(--seal);
  font-family: var(--kai);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-6deg);
  opacity: 0.85;
}

/* ---------- 按钮（克制的纸质钮） ---------- */
button {
  border: none;
  border-radius: 10px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 4px;
  padding: 0 20px;
  cursor: pointer;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
}
button:active { transform: translateY(1px); }
.primary {
  background: var(--seal);
  color: #f8f1e2;
  box-shadow: 0 2px 0 var(--seal-deep);
}
.primary:active { box-shadow: 0 0 0 var(--seal-deep); }
.primary.ink { background: var(--ink); color: #f4eddc; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.primary.ink:active { box-shadow: 0 0 0 rgba(0, 0, 0, 0.3); }
.primary-big { font-size: 18px; min-height: 56px; }
.ghost {
  background: var(--paper3);
  color: var(--ink);
  border: 1px solid var(--stroke);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.ghost.dark { background: var(--paper2); color: var(--ink); }
button:disabled { opacity: 0.55; }

/* ---------- 出生卡片 ---------- */
.birth-card {
  background: var(--paper3);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  margin: 12px 0;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
  position: relative;
}
.birth-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  pointer-events: none;
}
.birth-county { font-family: var(--kai); font-size: 34px; font-weight: 700; color: var(--ink); margin-bottom: 12px; letter-spacing: 2px; }
.birth-line { font-size: 17px; color: var(--ink); margin-bottom: 6px; }
.birth-note { font-size: 14px; color: var(--ink-dim); line-height: 1.7; margin-top: 8px; }
#birth-reroll-count { font-size: 13px; color: var(--ink-dim); margin-top: 12px; min-height: 16px; }

/* ---------- 选择点 ---------- */
#choice-question {
  font-family: var(--kai);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 22px 0 18px;
  line-height: 1.6;
  letter-spacing: 1px;
}
#choice-options { display: flex; flex-direction: column; }
.choice-btn {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 1px;
  border-radius: 10px;
  min-height: 52px;
  padding: 0 18px;
  margin-top: 12px;
  background: var(--paper3);
  color: var(--ink);
  border: 1px solid var(--stroke);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}
.choice-btn:active { border-color: var(--seal); }
.choice-btn .idx {
  font-family: var(--kai);
  color: var(--seal);
  font-weight: 700;
  margin-right: 14px;
  font-size: 18px;
}

/* ---------- 履历卡 ---------- */
#round-label { margin-bottom: 4px; letter-spacing: 2px; }
.card-wrap { text-align: center; margin: 8px 0; }
#card-img {
  width: 100%;
  max-width: 330px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  background: var(--paper3);
  border: 1px solid var(--stroke);
}

/* ---------- 履历册 ---------- */
#history-box { margin-top: 20px; text-align: left; }
.history-title { font-family: var(--kai); font-size: 13px; color: var(--ink-dim); margin-bottom: 10px; letter-spacing: 2px; }
.history-item {
  font-size: 13px;
  color: var(--ink);
  background: var(--paper3);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  line-height: 1.6;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ---------- 遮罩 / 面板 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 42, 38, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.overlay.hidden { display: none; }
.panel {
  width: 100%;
  max-width: 320px;
  background: var(--paper3);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 26px 22px;
  text-align: center;
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  position: relative;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  pointer-events: none;
}
.panel.ad { background: var(--paper3); }
.ad-title { font-family: var(--kai); font-size: 20px; letter-spacing: 3px; font-weight: 700; }
.sub-ad { font-size: 13px; color: var(--ink-dim); margin-top: 6px; line-height: 1.7; }
#ad-countdown { font-family: var(--kai); font-size: 46px; font-weight: 700; margin: 14px 0; color: var(--seal); }

.hint { font-size: 12px; color: var(--ink-dim); margin-top: 12px; text-align: center; line-height: 1.6; }
.foot-note { font-size: 11px; color: var(--ink-dim); margin-top: 16px; text-align: center; letter-spacing: 1px; }

/* ---------- 离屏画布 ---------- */
#card-canvas { position: absolute; left: -9999px; top: 0; }
