/* ==========================================================================
   吞针地狱 —— 视觉
   近黑底 + 灰白字 + 血红强调。等宽字体（控制台冷感），数字用衬线（碑文感）。
   不做圆角、不做阴影、不做渐变。
   ========================================================================== */

:root {
  --bg:      #0b0b0d;
  --bg2:     #111114;
  --line:    #232329;
  --fg:      #c8c8cc;
  --fg-dim:  #6c6c74;
  --fg-hi:   #ffffff;
  --blood:   #b3121a;
  --pain:    #b9b9c0;   /* 痛苦：灰白 */
  --malice:  #d8232c;   /* 怨念：血红 */
  --regret:  #4fb8b0;   /* 悔恨：青蓝 */

  /* ★ 全局关键字色：整个游戏里所有「罪人」和「针」都用这两个色 */
  --sinner:  #c8202a;   /* 罪人：红 */
  --needle:  #c3c9d4;   /* 针：银灰 */
  --mono: "Cascadia Mono", "Consolas", "DejaVu Sans Mono", "Courier New", monospace;
  --serif: "Songti SC", "SimSun", "Noto Serif SC", "Georgia", serif;

  /* 让浏览器自带的控件（滚动条、输入框）也用深色，否则会冒出白色滚动条 */
  color-scheme: dark;
}

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

/* 全局深色滚动条 */
* {
  scrollbar-width: thin;                       /* Firefox */
  scrollbar-color: #2a2a32 transparent;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a32; }
::-webkit-scrollbar-thumb:hover { background: #3a3a44; }
::-webkit-scrollbar-corner { background: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

/* ------------------------------------------------------------------ 顶栏 */
#topbar {
  flex: 0 0 auto;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: .06em;
}
#roundLabel { color: var(--fg); }
#bar {
  flex: 1;
  height: 3px;
  background: var(--line);
  position: relative;
}
#barFill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--blood);
  transition: width .2s linear;
}
#speedTag { color: var(--blood); }
#resetBtn {
  color: var(--fg-dim);
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 2px 9px;
  letter-spacing: .1em;
  user-select: none;
}
#resetBtn:hover { color: var(--fg-hi); border-color: var(--blood); }

/* ------------------------------------------------------------------ 中央 */
#stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

#headline {
  text-align: center;
  line-height: 1.9;
  z-index: 2;
}
#headline .hl-line {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--fg-dim);
  letter-spacing: .04em;
}
/* 数字比文字大两级，衬线上下文里用等宽，碑文感 */
#headline .num {
  font-family: var(--mono);
  font-size: 30px;
  color: var(--fg-hi);
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  padding: 0 3px;
  vertical-align: -3px;
}

/* ★ 全局关键字色 */
.k-sinner { color: var(--sinner); }
.k-needle { color: var(--needle); }

/* ★ 右下角 HUD */
#hud {
  position: absolute;
  right: 14px;
  bottom: 10px;
  text-align: right;
  font-size: 11px;
  line-height: 1.7;
  color: var(--fg-dim);
  letter-spacing: .06em;
  z-index: 3;
  pointer-events: none;
}
#hud .v {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

#popline {
  margin-top: 26px;
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: .08em;
  z-index: 2;
  text-align: center;
}
#popline .popnum {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
#popline .delta { color: var(--fg-dim); }
#popline .delta.up   { color: #4a7a55; }
#popline .delta.down { color: var(--blood); }

/* ------------------------------------------------------------------ 浮字 */
#floaters {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.floater {
  position: absolute;
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: .05em;
  opacity: 0;
  animation: rise 3.2s linear forwards;
  will-change: transform, opacity;
}
.floater.pain   { color: var(--pain); }
.floater.malice { color: var(--malice); }
.floater.regret { color: var(--regret); }
@keyframes rise {
  0%   { opacity: 0;   transform: translateY(0)     scale(.96); }
  12%  { opacity: .95; }
  70%  { opacity: .7; }
  100% { opacity: 0;   transform: translateY(-120px) scale(1.02); }
}

/* ------------------------------------------------------------------ 按钮 */
#clickBtn {
  margin-top: 34px;
  z-index: 2;
  background: transparent;
  border: 1px solid var(--blood);
  color: var(--fg-hi);
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: .12em;
  padding: 12px 40px;
  cursor: pointer;
  transition: background .08s, color .08s;
}
#clickBtn:hover  { background: #1a0507; }
#clickBtn:active { background: var(--blood); }
#clickBtn:disabled { opacity: .25; cursor: default; }

.hint {
  margin-top: 14px;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: .08em;
  z-index: 2;
}

/* ------------------------------------------------------------------ 面板 */
#panel {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  height: 300px;
}
#tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.tab {
  flex: 1;
  padding: 9px 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--fg-dim);
  cursor: pointer;
  border-right: 1px solid var(--line);
  user-select: none;
}
.tab:last-child { border-right: none; }
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg-hi); background: #17171b; box-shadow: inset 0 -2px 0 var(--blood); }
.tab .dot { color: var(--blood); font-size: 11px; }

#tabBody {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 0;
}
#tabBody::-webkit-scrollbar { width: 8px; }
#tabBody::-webkit-scrollbar-thumb { background: #26262c; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-bottom: 1px solid #17171b;
}
.row.locked { opacity: .3; }
.row.passed { opacity: .45; }
.row.passed .cnt { color: var(--fg-dim); letter-spacing: .1em; }
.row .emoji { font-size: 17px; width: 22px; text-align: center; flex: 0 0 auto; }
.row .nm { flex: 1 1 auto; min-width: 0; }
.row .nm b { font-weight: normal; color: var(--fg); }
.row .nm small { display: block; color: var(--fg-dim); font-size: 11px; margin-top: 2px; }
.row .cnt { color: var(--fg-dim); font-size: 12px; width: 62px; text-align: right; flex: 0 0 auto; }
.row .buy {
  flex: 0 0 auto;
  min-width: 108px;
  text-align: right;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 9px;
  cursor: pointer;
}
.row .buy:hover:not(:disabled) { border-color: var(--blood); color: var(--fg-hi); }
.row .buy:disabled { opacity: .28; cursor: default; }
.row .buy.afford { border-color: #3a3a44; }
.row .buy.fire { border-color: var(--blood); color: var(--blood); letter-spacing: .16em; }
.row .buy.fire:hover:not(:disabled) { background: #1a0507; color: #ff5b63; }
.row .buy.fire:disabled { border-color: var(--line); color: var(--fg-dim); }

.secTitle {
  padding: 12px 14px 5px;
  color: var(--fg-dim);
  font-size: 11px;
  letter-spacing: .16em;
}

/* ------------------------------------------------------------------ 结局 */
#ending {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  z-index: 50;
}
#ending.on { display: flex; }
#ending .etext {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 2.1;
  color: var(--fg);
  white-space: pre-wrap;
  max-width: 620px;
}
#ending .etext .hl { color: var(--blood); }
#ending .ebtns { margin-top: 40px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
#ending .ebtn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .12em;
  padding: 11px 34px;
  cursor: pointer;
}
#ending .ebtn:hover { border-color: var(--blood); color: var(--fg-hi); }
#ending .esplit { height: 22px; }

.secTitle.warn { color: var(--blood); letter-spacing: .08em; }

/* ------------------------------------------------------------------ 事件 */
#tabs .dot {
  color: var(--blood);
  font-size: 10px;
  margin-left: 3px;
  vertical-align: super;
  animation: dotflash 1.2s ease-in-out infinite;
}
@keyframes dotflash { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.evbar { height: 2px; background: var(--line); margin: 2px 0 0; overflow: hidden; }
.evfill { height: 100%; background: #3a3a44; transition: width .2s linear; }
.row.evrow b { font-weight: normal; }

/* 事件：两列四格（压缩过高度，四格要在面板 300px 里全部放下） */
.evgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 4px 0 8px;
}
.evcell {
  border: 1px solid var(--line);
  padding: 6px 8px 6px 10px;
  display: flex;
  flex-direction: row;          /* 左：文字区　右：领按钮 */
  align-items: center;
  gap: 8px;
  background: #0e0e10;
}
.evgrid .evleft {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.evcell.ready { border-color: #5a1a1f; background: #120a0b; }
.evhead { display: flex; align-items: baseline; gap: 5px; }
.evemoji { font-size: 13px; }
.evname { font-size: 12px; color: var(--fg); letter-spacing: .04em; }
.evcell.ready .evname { color: var(--fg-hi); }
.evsub { font-size: 11px; color: var(--fg-dim); min-height: 16px; line-height: 16px; }
.evcell.ready .evsub { color: var(--needle); }
.evcell .buy {
  flex: 0 0 auto;
  width: 46px;
  margin-top: 0;
  padding: 8px 0;
  font-size: 11px;
}

/* ------------------------------------------------------------------ 幕的转折 */
.actcard {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 150;
  transition: opacity .9s linear;
}
.actcard.out { opacity: 0; }
.actcard .actn {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: .6em;
  text-indent: .6em;
}
.actcard .actname {
  font-family: var(--serif);
  font-size: 52px;
  color: var(--fg-hi);
  letter-spacing: .22em;
  text-indent: .22em;
  margin: 16px 0 0;
}

/* ------------------------------------------------------------------ 提示 */
.toast {
  position: fixed;
  left: 50%; top: 14px;
  transform: translateX(-50%);
  background: #000;
  border: 1px solid var(--blood);
  color: var(--fg);
  font-size: 12px;
  padding: 8px 16px;
  letter-spacing: .06em;
  z-index: 200;
}

/* ------------------------------------------------------------------ 调试 */
#debug {
  position: fixed;
  right: 10px; bottom: 10px;
  background: #000;
  border: 1px solid var(--line);
  padding: 10px;
  font-size: 11px;
  display: none;
  z-index: 90;
}
#debug.on { display: block; }
#debug button {
  background: transparent; border: 1px solid var(--line); color: var(--fg);
  font-family: var(--mono); font-size: 11px; padding: 3px 7px; margin: 2px; cursor: pointer;
}
#debug button:hover { border-color: var(--blood); }

/* ------------------------------------------------------------------ 法案提问弹窗 */
#choiceModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.84);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 130;
}
#choiceModal.hidden { display: none; }
#choiceBox {
  width: min(580px, 88vw);
  border: 1px solid #2a2a30;
  background: var(--bg);
  padding: 34px 38px 30px;
}
#cBill {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: .22em;
}
#cQ {
  font-family: var(--serif);
  font-size: 23px;
  color: var(--fg-hi);
  margin: 20px 0 10px;
  line-height: 1.7;
  letter-spacing: .06em;
}

#cBtns { display: flex; gap: 14px; }
#cBtns button {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: .16em;
  padding: 12px 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
}
#cBtns button:hover:not(:disabled) { border-color: var(--blood); color: var(--fg-hi); }
#cBtns button:disabled { color: #3a3a42; border-color: #1a1a1e; cursor: default; }
/* ------------------------------------------------------------------ 批量操作 */
.batchbar {
  display: flex;
  gap: 8px;
  margin: 12px 0 4px;
}
.batchbar button {
  flex: 1;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .14em;
  padding: 9px 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
}
.batchbar button.buy.afford { border-color: #3a3a44; }
.batchbar button.buy.afford:hover:not(:disabled) { border-color: var(--fg-dim); color: var(--fg-hi); }
.batchbar button.buy.fire { border-color: var(--blood); color: var(--blood); }
.batchbar button.buy.fire:hover:not(:disabled) { background: #1a0507; color: #ff5b63; }
.batchbar button:disabled { color: #33333a; border-color: #1a1a1e; cursor: default; }
/* 行内「批量」小按钮 */
.row .buy.mini {
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: .08em;
  margin-right: 6px;
  border-color: #2a2a32;
  color: var(--fg-dim);
}
.row .buy.mini:hover:not(:disabled) { border-color: var(--fg-dim); color: var(--fg-hi); }
.row .buy.mini:disabled { color: #2f2f36; border-color: #1a1a1e; }
#cEx {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--fg-dim);
  letter-spacing: .08em;
  margin: 18px 0 0 2px;
  padding-left: 14px;
  border-left: 2px solid #2a2a32;
  line-height: 1.8;
}
/* ------------------------------------------------------------------ 开始页 */
#startPage {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: none;
  align-items: center;
  justify-content: center;
  background: #070708;
  opacity: 0;
  transition: opacity .45s ease;
}
#startPage.on { display: flex; opacity: 1; }

#startBox {
  text-align: center;
  padding: 0 24px;
  max-width: 520px;
}

#startTitle {
  font-size: 40px;
  letter-spacing: .34em;
  color: var(--sinner);
  text-indent: .34em;
  margin-bottom: 26px;
}

#startSub {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .22em;
  color: var(--fg-dim);
  text-indent: .22em;
  margin-bottom: 64px;
}

#startBtns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  width: 240px;
  margin: 0 auto;
}
#startBtns button {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .26em;
  text-indent: .26em;
  padding: 13px 0;
  background: transparent;
  border: 1px solid #2a2a32;
  color: var(--fg);
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
#startBtns button:hover:not(:disabled) {
  border-color: #5a1a1f;
  color: var(--fg-hi);
  background: #120a0b;
}
#startBtns button:disabled {
  color: #2f2f36;
  border-color: #17171b;
  cursor: default;
}

#startHint {
  margin-top: 22px;
  font-size: 11px;
  letter-spacing: .16em;
  color: #4a4a52;
  min-height: 16px;
}
/* ------------------------------------------------------------------ 确认弹窗 */
#confirmModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.86);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;            /* 要盖在开始页（260）上面 */
}
#confirmModal.hidden { display: none; }

#confirmBox {
  width: min(440px, 86vw);
  border: 1px solid #2a2a30;
  background: var(--bg);
  padding: 28px 32px 24px;
}
#confirmTitle {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: .22em;
}
#confirmQ {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--fg-hi);
  margin: 16px 0 24px;
  line-height: 1.7;
  letter-spacing: .06em;
  white-space: pre-line;
}
#confirmBtns { display: flex; gap: 12px; }
#confirmBtns button {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: .18em;
  text-indent: .18em;
  padding: 11px 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
}
#confirmBtns button:hover { border-color: var(--blood); color: var(--fg-hi); }
#confirmYes:hover { background: #120a0b; }
/* ==========================================================================
   移动端 / 触摸
   ========================================================================== */

/* 触摸设备：干掉长按菜单、点击高亮、文字选中 */
#app, button, .tab, #resetBtn, #startBtns button {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
button, .tab, #resetBtn { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; }

/* 手机地址栏会伸缩，用动态视口高度；不支持的浏览器退回 100% */
@supports (height: 100dvh) {
  #app { height: 100dvh; }
}
/* 刘海屏底部安全区 */
@supports (padding: env(safe-area-inset-bottom)) {
  #app { padding-bottom: env(safe-area-inset-bottom); }
}

/* —— 触摸设备：把触点放大到指头能点准 —— */
@media (hover: none) {
  .desk-only { display: none; }
  .row .buy { min-width: 96px; padding: 9px 10px; }
  .row .buy.mini { padding: 8px 10px; }
  .evcell .buy { width: 58px; padding: 13px 0; }
  #resetBtn { padding: 6px 9px; }
  .tab { padding: 13px 0; }
  #btnContinue, #btnNew { padding: 15px 0; }
}

/* —— 窄屏手机 —— */
@media (max-width: 520px) {
  #app { border-left: 0; border-right: 0; max-width: none; }
  #panel { height: min(300px, 40dvh); }
  #topbar { padding: 8px 10px 7px; gap: 8px; font-size: 11px; }
  #stage { padding: 12px; }
  #headline .hl-line { font-size: 14px; line-height: 1.8; }
  #headline .num { font-size: 24px; }
  #popline { margin-top: 18px; font-size: 11px; }
  #clickBtn { font-size: 18px; padding: 15px 34px; margin-top: 22px; }
  #hud { font-size: 10px; right: 8px; bottom: 6px; line-height: 1.6; }
  #hud .v { font-size: 11px; }
  .row { gap: 6px; padding: 8px 10px; }
  .row .emoji { width: 18px; font-size: 15px; }
  .row .buy { min-width: 84px; font-size: 11px; }
  .row .buy.mini { padding: 7px 6px; font-size: 10px; letter-spacing: 0; }
  .row .cnt { font-size: 11px; }
  .secTitle { padding: 10px 10px 4px; letter-spacing: .1em; }
  .evgrid { gap: 5px; }
  .evcell { padding: 6px 6px 6px 8px; gap: 6px; }
  .evcell .buy { width: 46px; }
  .evsub { font-size: 10px; }
  #startTitle { font-size: 30px; letter-spacing: .26em; text-indent: .26em; margin-bottom: 18px; }
  #startSub { font-size: 12px; letter-spacing: .16em; text-indent: .16em; margin-bottom: 42px; }
  #startBtns { width: 210px; }
  #choiceBox { padding: 24px 22px 20px; }
  #cBill { font-size: 11px; }
  #cQ { font-size: 19px; margin: 16px 0 8px; }
  #cEx { font-size: 13px; padding-left: 10px; }
  #confirmBox { padding: 22px 20px 18px; }
  #confirmQ { font-size: 17px; }
  #ending .etext { font-size: 17px; }
}

/* —— 手机横过来：面板别把画面吃光 —— */
@media (max-height: 520px) {
  #panel { height: 46dvh; }
  #stage { padding: 8px; }
  #headline .hl-line { font-size: 13px; }
  #headline .num { font-size: 21px; }
  #clickBtn { margin-top: 12px; padding: 10px 28px; font-size: 16px; }
  #popline { margin-top: 10px; }
  #hud { font-size: 9px; }
  #startTitle { font-size: 26px; margin-bottom: 12px; }
  #startSub { margin-bottom: 22px; }
  #startBtns button { padding: 10px 0; }
  #startBtns { gap: 8px; }
}
/* ------------------------------------------------------------------ 战绩图 */
#etext .ecard {
  display: block;
  max-width: min(340px, 82vw);
  max-height: 62vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border: 1px solid #2a2a30;
}
#etext .ecardhint {
  margin-top: 12px;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: .12em;
}
/* ------------------------------------------------------------------ 成就解锁提示 */
#achToast {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;              /* 在弹窗 / 结局下面 */
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.acht {
  min-width: 220px;
  padding: 11px 22px 12px;
  background: rgba(10,10,12,.94);
  border: 1px solid #3a1a1e;
  border-left: 2px solid var(--sinner);
  text-align: center;
  animation: achtIn .45s ease-out both;
}
.acht .achtk { font-size: 10px; letter-spacing: .3em; text-indent: .3em; color: var(--sinner); }
.acht .achtn { font-family: var(--serif); font-size: 17px; color: var(--fg-hi); letter-spacing: .1em; margin-top: 5px; }
.acht .achtd { font-size: 11px; color: var(--fg-dim); margin-top: 4px; letter-spacing: .04em; }
@keyframes achtIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 520px) {
  #achToast { top: 44px; }
  .acht { min-width: 0; padding: 9px 16px 10px; }
  .acht .achtn { font-size: 15px; }
}

/* ------------------------------------------------------------------ 成就页 */
#achBtn {
  position: absolute;
  right: 26px;
  bottom: 26px;
  font-size: 12px;
  letter-spacing: .2em;
  text-indent: .2em;
  color: var(--fg-dim);
  padding: 9px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}
#achBtn:hover { color: var(--fg); border-color: var(--line); }

#achPage {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: rgba(0,0,0,.9);
  display: flex;
  align-items: center;
  justify-content: center;
}
#achPage.hidden { display: none; }

#achBox {
  width: min(560px, 88vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid #2a2a30;
  background: var(--bg);
  padding: 24px 0 20px;
}

#achHead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 26px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--fg-dim);
}
#achCount { font-family: var(--mono); letter-spacing: .05em; color: var(--fg); }

#achList {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: #2a2a32 transparent;
}

.achrow {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 26px;
  font-size: 13px;
}
.achrow .mark { flex: 0 0 auto; width: 16px; color: #33333a; font-family: var(--mono); }
.achrow .an { flex: 0 0 auto; min-width: 104px; color: #3a3a42; letter-spacing: .06em; }
.achrow .ad { color: #2f2f36; font-size: 12px; }
.achrow.got .mark { color: var(--sinner); }
.achrow.got .an { color: var(--fg-hi); }
.achrow.got .ad { color: var(--fg-dim); }

#achClose {
  flex: 0 0 auto;
  margin: 12px 26px 0;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .24em;
  text-indent: .24em;
  padding: 11px 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
}
#achClose:hover { border-color: var(--blood); color: var(--fg-hi); }

@media (max-width: 520px) {
  #achBox { max-height: 84vh; padding: 18px 0 16px; }
  .achrow { padding: 8px 16px; gap: 8px; font-size: 12px; }
  .achrow .an { min-width: 88px; }
  .achrow .ad { font-size: 11px; }
  #achHead, #achClose { padding-left: 16px; padding-right: 16px; }
  #achClose { margin-left: 16px; margin-right: 16px; }
  #achBtn { right: 14px; bottom: 14px; font-size: 11px; padding: 8px 10px; }
}