/* ============ 《谁主沉浮》 · 深夜党政档案室 ============ */

:root {
  --ink: #141110;
  --ink-2: #1c1815;
  --ink-3: #262019;
  --vermilion: #9e2b25;
  --vermilion-bright: #c0392b;
  --gold: #c9a96a;
  --gold-dim: #8f7a4e;
  --paper: #e8dcc4;
  --paper-dim: #c9b998;
  --text: #d8cfc0;
  --text-dim: #9a8f7d;
  --serif: "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  overflow-x: hidden;
}

/* 噪点纹理 */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

/* ============ 通用 ============ */

.panel-heading {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--gold);
  letter-spacing: 4px;
  padding: 10px 12px 8px;
  border-bottom: 3px double var(--gold-dim);
  display: flex; align-items: center; justify-content: space-between;
}
.heading-note { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; font-family: var(--sans); }
.panel-subheading {
  font-size: 12px; color: var(--text-dim); letter-spacing: 3px;
  padding: 8px 12px 4px; border-top: 1px solid var(--ink-3);
}

.btn-vermilion {
  background: var(--vermilion);
  color: var(--paper);
  border: 1px solid var(--vermilion-bright);
  font-family: var(--serif);
  font-size: 16px; letter-spacing: 6px;
  padding: 10px 34px;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 0 0 1px rgba(192,57,43,.25), 0 4px 14px rgba(0,0,0,.5);
}
.btn-vermilion:hover:not(:disabled) { background: var(--vermilion-bright); box-shadow: 0 0 18px rgba(192,57,43,.4); }
.btn-vermilion:disabled { opacity: .35; cursor: not-allowed; letter-spacing: 6px; }

.btn-plain {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--gold-dim);
  font-family: var(--serif); letter-spacing: 4px; font-size: 14px;
  padding: 9px 24px; cursor: pointer; transition: all .2s;
}
.btn-plain:hover { color: var(--gold); border-color: var(--gold); }

.btn-mini {
  background: transparent; color: var(--gold-dim);
  border: 1px solid var(--ink-3);
  font-size: 11px; letter-spacing: 2px;
  padding: 3px 10px; cursor: pointer; transition: all .2s;
}
.btn-mini:hover { color: var(--gold); border-color: var(--gold-dim); }
.btn-mini-danger:hover { color: var(--vermilion-bright); border-color: var(--vermilion); }

/* ============ 开始界面 · 档案袋 ============ */

.start-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, #241d16 0%, var(--ink) 70%);
}

.dossier {
  position: relative;
  width: 640px; max-height: 92vh; overflow-y: auto;
  background: linear-gradient(160deg, #2a2118 0%, #1e1811 100%);
  border: 1px solid var(--gold-dim);
  box-shadow: 0 30px 80px rgba(0,0,0,.8), inset 0 0 60px rgba(0,0,0,.5);
  padding: 46px 54px 40px;
  animation: dossierIn .8s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes dossierIn { from { opacity: 0; transform: translateY(40px) rotate(-1.2deg); } to { opacity: 1; transform: none; } }

.dossier-string {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 16px; border-radius: 8px;
  background: #3a2f21; border: 1px solid var(--gold-dim);
}
.dossier-tag {
  position: absolute; top: 18px; right: -10px;
  background: var(--vermilion); color: var(--paper);
  font-family: var(--serif); font-size: 12px; letter-spacing: 3px;
  padding: 5px 16px; transform: rotate(3deg);
  box-shadow: 0 4px 10px rgba(0,0,0,.5);
}

.dossier-inner { text-align: center; }

.start-seal {
  width: 74px; height: 74px; margin: 0 auto 18px;
  background: var(--vermilion); color: var(--paper);
  font-family: var(--serif); font-size: 44px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 3px rgba(232,220,196,.55), inset 0 0 0 6px var(--vermilion), 0 6px 18px rgba(0,0,0,.6);
}

.game-title {
  font-family: var(--serif); font-size: 64px; font-weight: bold;
  color: var(--paper); letter-spacing: 18px; text-indent: 18px;
  text-shadow: 0 0 30px rgba(201,169,106,.25);
}
.game-subtitle {
  font-family: var(--serif); color: var(--gold); letter-spacing: 6px;
  margin: 10px 0 22px; font-size: 15px;
}
.game-intro {
  color: var(--text-dim); line-height: 2; font-size: 13.5px;
  border-top: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3);
  padding: 16px 0; margin-bottom: 24px;
}
.start-buttons { display: flex; gap: 16px; justify-content: center; margin-bottom: 26px; }

.how-to { text-align: left; border: 1px dashed var(--gold-dim); padding: 14px 18px; }
.how-to-title { font-family: var(--serif); color: var(--gold); letter-spacing: 3px; font-size: 13px; margin-bottom: 8px; }
.how-to ul { list-style: none; }
.how-to li { color: var(--text-dim); font-size: 12.5px; line-height: 1.9; padding-left: 14px; position: relative; }
.how-to li::before { content: "◆"; position: absolute; left: 0; color: var(--vermilion-bright); font-size: 8px; top: 6px; }
.how-to b { color: var(--gold); }

/* ============ 游戏主界面 ============ */

.game-screen { padding: 0 46px 30px; max-width: 1720px; margin: 0 auto; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px 12px;
  border-bottom: 3px double var(--gold-dim);
  margin-bottom: 16px;
}
.topbar-left { display: flex; align-items: baseline; gap: 14px; }
.topbar-title { font-family: var(--serif); font-size: 26px; color: var(--paper); letter-spacing: 8px; font-weight: bold; }
.topbar-sep { width: 1px; height: 18px; background: var(--gold-dim); align-self: center; }
.topbar-date { font-family: var(--serif); color: var(--gold); letter-spacing: 2px; font-size: 14px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.stat-chip {
  font-size: 12px; color: var(--text-dim); letter-spacing: 1px;
  border: 1px solid var(--ink-3); padding: 4px 12px; background: var(--ink-2);
}
.stat-chip b { color: var(--paper); font-size: 14px; margin-left: 2px; }
.action-chip b { color: var(--gold); }

.main-grid {
  display: grid;
  grid-template-columns: 240px 1fr 380px;
  gap: 18px;
  align-items: start;
}

/* ---------- 左侧：仕途天梯 ---------- */

.ladder-panel {
  background: var(--ink-2); border: 1px solid var(--ink-3);
  display: flex; flex-direction: column; max-height: calc(100vh - 110px);
}
.ladder { overflow-y: auto; flex: 1; padding: 8px 0; scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent; }

.ladder-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; position: relative;
  border-left: 3px solid transparent;
  transition: background .2s;
}
.ladder-item .lv {
  font-family: var(--serif); font-size: 11px; color: var(--text-dim);
  width: 22px; text-align: right; flex-shrink: 0;
}
.ladder-item .nm { font-family: var(--serif); font-size: 14px; color: var(--text-dim); letter-spacing: 2px; }
.ladder-item .tier-mark { margin-left: auto; font-size: 10px; color: #5a5041; letter-spacing: 1px; }
.ladder-item.passed .nm, .ladder-item.passed .lv { color: var(--gold-dim); text-decoration: line-through; text-decoration-color: rgba(201,169,106,.4); }

.ladder-item.current {
  background: linear-gradient(90deg, rgba(158,43,37,.22), transparent);
  border-left-color: var(--vermilion-bright);
}
.ladder-item.current .nm { color: var(--paper); font-weight: bold; }
.ladder-item.current .lv { color: var(--vermilion-bright); }

/* 当前职级印章 */
.rank-seal {
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--vermilion); color: var(--paper);
  font-family: var(--serif); font-size: 15px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px rgba(232,220,196,.5), 0 3px 8px rgba(0,0,0,.5);
  animation: sealPulse 2.6s ease-in-out infinite;
}
@keyframes sealPulse { 0%,100% { box-shadow: inset 0 0 0 2px rgba(232,220,196,.5), 0 3px 8px rgba(0,0,0,.5); } 50% { box-shadow: inset 0 0 0 2px rgba(232,220,196,.7), 0 3px 16px rgba(192,57,43,.5); } }

.ladder-foot { border-top: 3px double var(--gold-dim); padding: 12px 14px; }
.rank-info { font-size: 11.5px; color: var(--text-dim); line-height: 1.8; margin-bottom: 10px; }
.rank-info b { color: var(--gold); }
.btn-promote { width: 100%; padding: 10px 0; font-size: 15px; }
.promote-hint { font-size: 11px; color: var(--text-dim); margin-top: 8px; line-height: 1.7; min-height: 18px; }
.promote-hint.ok { color: var(--gold); }

/* ---------- 中间 ---------- */

.center-panel { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.indicators { background: var(--ink-2); border: 1px solid var(--ink-3); }
.indicator-bars { padding: 14px 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 26px; }

.ind-row { position: relative; }
.ind-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.ind-name { font-family: var(--serif); font-size: 13px; color: var(--text); letter-spacing: 2px; }
.ind-val { font-size: 13px; color: var(--gold); font-weight: bold; }
.ind-val.warn { color: var(--vermilion-bright); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: .35; } }

.ind-track {
  height: 12px; background: var(--ink); border: 1px solid var(--ink-3);
  position: relative; overflow: hidden;
}
/* 刻度线 */
.ind-track::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), rgba(216,207,192,.12) calc(10% - 1px), rgba(216,207,192,.12) 10%);
  pointer-events: none;
}
.ind-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width .6s cubic-bezier(.2,.8,.3,1);
}
.ind-fill.warn { background: linear-gradient(90deg, #6e1d19, var(--vermilion-bright)); }
.ind-delta { position: absolute; right: 0; top: -16px; font-size: 10px; }

.policies { background: var(--ink-2); border: 1px solid var(--ink-3); padding-bottom: 16px; }
.policy-grid {
  padding: 14px 16px 6px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}

.policy-card {
  background: var(--ink-3);
  border: 1px solid #352c21;
  border-top: 3px solid var(--gold-dim);
  padding: 12px 13px 11px;
  cursor: pointer;
  transition: all .18s;
  position: relative;
  user-select: none;
}
.policy-card:hover:not(.disabled):not(.locked) { border-top-color: var(--vermilion-bright); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.45); }
.policy-card.used { opacity: .38; cursor: not-allowed; }
.policy-card.used::after {
  content: "已施行"; position: absolute; top: 8px; right: 8px;
  font-size: 10px; color: var(--vermilion-bright); border: 1px solid var(--vermilion);
  padding: 1px 6px; transform: rotate(6deg); font-family: var(--serif);
}
.policy-card.locked { opacity: .4; cursor: not-allowed; filter: grayscale(.6); }
.policy-card.disabled { opacity: .55; cursor: not-allowed; }

.policy-name { font-family: var(--serif); font-size: 15px; color: var(--paper); letter-spacing: 2px; margin-bottom: 6px; }
.policy-fx { font-size: 11px; line-height: 1.75; color: var(--text-dim); min-height: 38px; }
.policy-fx .up { color: #7d9b6a; }
.policy-fx .down { color: var(--vermilion-bright); }
.policy-cost { margin-top: 7px; font-size: 10.5px; color: var(--gold-dim); letter-spacing: 1px; }
.policy-lock-tip { margin-top: 7px; font-size: 10.5px; color: var(--vermilion-bright); letter-spacing: 1px; }

.btn-end {
  display: block; margin: 12px 16px 0; width: calc(100% - 32px);
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold-dim);
  font-family: var(--serif); font-size: 16px; letter-spacing: 8px;
  padding: 12px 0; cursor: pointer; transition: all .2s;
}
.btn-end:hover { background: rgba(201,169,106,.1); box-shadow: 0 0 16px rgba(201,169,106,.15); }

/* ---------- 右侧 ---------- */

.right-panel { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.cadre-panel { background: var(--ink-2); border: 1px solid var(--ink-3); }
.post-slots { padding: 10px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.post-slot { border: 1px solid var(--ink-3); padding: 7px 9px; background: var(--ink); }
.post-slot .ps-name { font-family: var(--serif); font-size: 12px; color: var(--gold); letter-spacing: 2px; margin-bottom: 5px; }
.post-slot select {
  width: 100%; background: var(--ink-3); color: var(--text);
  border: 1px solid #352c21; font-size: 12px; padding: 4px 5px;
  font-family: var(--sans);
}
.post-slot select:focus { outline: 1px solid var(--gold-dim); }

.cadre-list { max-height: 300px; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent; }
.cadre-card { border: 1px solid var(--ink-3); background: var(--ink); padding: 8px 10px; margin-bottom: 8px; }
.cadre-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.cadre-name { font-family: var(--serif); font-size: 14px; color: var(--paper); letter-spacing: 2px; }
.cadre-post-tag { font-size: 10px; color: var(--vermilion-bright); border: 1px solid var(--vermilion); padding: 0 5px; letter-spacing: 1px; }
.cadre-post-tag.none { color: var(--text-dim); border-color: var(--ink-3); }
.cadre-lian { margin-left: auto; font-size: 10.5px; color: var(--text-dim); }
.cadre-lian.low { color: var(--vermilion-bright); }

.dim-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.dim-label { font-size: 10px; color: var(--text-dim); width: 12px; font-family: var(--serif); }
.dim-track { flex: 1; height: 5px; background: var(--ink-3); }
.dim-fill { height: 100%; background: var(--gold-dim); }
.dim-fill.lian-low { background: var(--vermilion-bright); }
.dim-num { font-size: 10px; color: var(--text-dim); width: 14px; text-align: right; }

.log-panel {
  background: var(--ink-2); border: 1px solid var(--ink-3);
  display: flex; flex-direction: column; max-height: 420px;
}
.log-stream { overflow-y: auto; padding: 10px 14px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent; }
.log-entry { font-size: 12px; line-height: 1.75; margin-bottom: 9px; color: var(--text-dim); }
.log-entry .log-time { color: var(--gold-dim); font-family: var(--serif); font-size: 11px; letter-spacing: 1px; display: block; }
.log-entry.log-policy { color: var(--text); }
.log-entry.log-event { color: #c9a184; }
.log-entry.log-promote { color: var(--gold); }
.log-entry.log-warn { color: var(--vermilion-bright); }
.log-entry.log-good { color: #7d9b6a; }

/* ---------- 竖排标语 ---------- */

.vertical-slogan {
  position: fixed; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--serif); font-size: 30px; letter-spacing: 20px;
  color: rgba(201,169,106,.16);
  pointer-events: none; z-index: 1;
}
.slogan-left { left: 12px; }
.slogan-right { right: 12px; }

/* ---------- 模态通用 ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10,8,6,.82);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}

/* ---------- 加急电报事件 ---------- */

.telegram {
  width: 560px;
  background: linear-gradient(170deg, #efe4cb 0%, #e2d3b2 100%);
  color: #2b2118;
  border: 1px solid #a08c60;
  box-shadow: 0 30px 70px rgba(0,0,0,.85);
  padding: 0 0 14px;
  animation: telegramIn .35s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes telegramIn { from { opacity: 0; transform: translateY(-24px) scale(.96); } to { opacity: 1; transform: none; } }

.telegram-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--vermilion); color: var(--paper);
  padding: 9px 18px;
}
.telegram-class { font-family: var(--serif); letter-spacing: 6px; font-size: 14px; font-weight: bold; }
.telegram-tier { font-size: 11px; letter-spacing: 2px; opacity: .85; }
.telegram-rule { height: 4px; background: repeating-linear-gradient(90deg, var(--vermilion) 0 14px, transparent 14px 20px); margin: 0 18px; margin-top: 10px; }
.telegram-title {
  font-family: var(--serif); font-size: 22px; letter-spacing: 3px;
  padding: 14px 22px 4px; color: #5c1712;
}
.telegram-body { padding: 8px 22px 14px; font-size: 13.5px; line-height: 2; color: #3d3021; }
.telegram-options { display: flex; flex-direction: column; gap: 8px; padding: 0 22px; }
.telegram-opt {
  text-align: left; background: rgba(255,252,244,.6);
  border: 1px solid #b09b6c; padding: 10px 14px;
  cursor: pointer; transition: all .15s; font-family: var(--sans);
}
.telegram-opt:hover { background: #fff8e8; border-color: var(--vermilion); }
.telegram-opt .opt-label { font-size: 13px; color: #33270f; font-weight: bold; letter-spacing: 1px; }
.telegram-opt .opt-hint { font-size: 11px; color: #7a6a4d; margin-top: 3px; line-height: 1.6; }
.telegram-opt .opt-risk { color: var(--vermilion); }
.telegram-foot {
  margin-top: 14px; text-align: center;
  font-family: var(--serif); font-size: 11px; letter-spacing: 6px; color: #8a2b22;
}

/* ---------- 组织部考察 ---------- */

.inspect-box {
  width: 460px; background: var(--ink-2); border: 1px solid var(--gold-dim);
  box-shadow: 0 30px 70px rgba(0,0,0,.85); padding-bottom: 20px;
}
.inspect-text { padding: 18px 22px 12px; font-size: 13.5px; line-height: 2; color: var(--text); }
.inspect-text b { color: var(--gold); }
.inspect-bar-wrap { margin: 6px 22px 0; height: 8px; background: var(--ink); border: 1px solid var(--ink-3); }
.inspect-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width .3s linear; }

/* ---------- 红头任命文件 ---------- */

.decree {
  position: relative;
  width: 620px; min-height: 560px;
  background: linear-gradient(175deg, #f4ecd8 0%, #eadcbc 100%);
  box-shadow: 0 40px 90px rgba(0,0,0,.9);
  padding: 40px 60px 90px;
  animation: decreeIn .6s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes decreeIn { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }

.decree-org {
  font-family: var(--serif); font-size: 40px; font-weight: bold;
  color: #c0392b; text-align: center; letter-spacing: 6px;
}
.decree-no { text-align: center; font-family: var(--serif); font-size: 14px; color: #4a3a26; margin-top: 8px; letter-spacing: 2px; }
.decree-redline { height: 3px; background: #c0392b; margin: 18px 0 26px; box-shadow: 0 2px 0 rgba(192,57,43,.35); }

.decree-title { font-family: var(--serif); font-size: 21px; color: #2b2118; text-align: center; letter-spacing: 2px; margin-bottom: 20px; }
.decree-text { font-family: var(--serif); font-size: 16px; line-height: 2.3; color: #33291c; text-indent: 2em; }
.decree-closing { font-family: var(--serif); font-size: 16px; line-height: 2.3; color: #33291c; text-indent: 2em; margin-top: 8px; }
.decree-sign { text-align: right; font-family: var(--serif); font-size: 15px; color: #33291c; margin-top: 26px; line-height: 2; padding-right: 30px; }

.decree-seal {
  position: absolute; right: 58px; bottom: 74px;
  transform: rotate(-12deg);
  opacity: 0;
}
.decree-seal.stamped { animation: stampIn .55s cubic-bezier(.3,1.4,.4,1) .8s both; }
@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-12deg) translateY(-160px) scale(1.6); }
  60% { opacity: 1; transform: rotate(-12deg) translateY(0) scale(.94); }
  80% { transform: rotate(-12deg) scale(1.04); }
  100% { opacity: 1; transform: rotate(-12deg) scale(1); }
}

.decree-ok {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  font-size: 14px; letter-spacing: 4px; padding: 8px 28px;
}

/* ---------- 结算 ---------- */

.end-box {
  width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--ink-2); border: 1px solid var(--gold-dim);
  box-shadow: 0 40px 90px rgba(0,0,0,.9);
  padding: 36px 44px 32px; text-align: center;
  animation: decreeIn .5s both;
}
.end-title { font-family: var(--serif); font-size: 34px; letter-spacing: 10px; color: var(--paper); }
.end-title.win { color: var(--gold); text-shadow: 0 0 24px rgba(201,169,106,.35); }
.end-title.lose { color: var(--vermilion-bright); }
.end-subtitle { font-family: var(--serif); color: var(--text-dim); letter-spacing: 3px; margin: 10px 0 18px; font-size: 14px; line-height: 1.9; }
.radar { margin: 6px auto 14px; display: block; }
.end-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin-bottom: 16px; }
.end-stat { border: 1px solid var(--ink-3); padding: 8px; font-size: 12px; color: var(--text-dim); background: var(--ink); }
.end-stat b { display: block; font-family: var(--serif); font-size: 19px; color: var(--gold); margin-top: 2px; }
.end-verdict {
  font-family: var(--serif); font-size: 17px; letter-spacing: 3px;
  color: var(--gold); border-top: 3px double var(--gold-dim);
  padding-top: 16px; margin-bottom: 20px; line-height: 1.9;
}

/* ---------- 入场动画 ---------- */

.reveal { animation: reveal .55s cubic-bezier(.2,.8,.3,1) both; }
.reveal:nth-child(1) { animation-delay: .05s; }
.main-grid .reveal:nth-child(1) { animation-delay: .12s; }
.main-grid .reveal:nth-child(2) { animation-delay: .22s; }
.main-grid .reveal:nth-child(3) { animation-delay: .32s; }
.center-panel .reveal:nth-child(1) { animation-delay: .26s; }
.center-panel .reveal:nth-child(2) { animation-delay: .36s; }
.right-panel .reveal:nth-child(1) { animation-delay: .40s; }
.right-panel .reveal:nth-child(2) { animation-delay: .50s; }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   响应式适配
   ≥1280px：桌面三栏（原体验，不回退）
   768–1279px：平板单列居中
   <768px：手机——sticky 顶栏 + 底部 Tab + 底部主操作
   ============================================================ */

/* 移动端专属元素默认隐藏 */
.mobile-rank-row, .mobile-tabs { display: none; }

@media (min-width: 1280px) {
  body { min-width: 1280px; }
}

/* ---------- 平板：768–1279px 单列居中 ---------- */
@media (min-width: 768px) and (max-width: 1279px) {
  .game-screen { padding: 0 24px 30px; }
  .main-grid { grid-template-columns: 1fr; max-width: 880px; margin: 0 auto; }
  .ladder-panel { max-height: none; }
  .ladder { max-height: 340px; }
  .cadre-list { max-height: 380px; }
  .log-panel { max-height: 460px; }
  .vertical-slogan { display: none; }
  .policy-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 手机：<768px ---------- */
@media (max-width: 767px) {
  body { font-size: 14px; padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
  .game-screen { padding: 0 10px 20px; max-width: none; }
  .vertical-slogan { display: none; }
  .grain { opacity: .04; }

  /* --- 顶部 sticky 状态条 --- */
  .topbar {
    position: sticky; top: 0; z-index: 120;
    background: var(--ink);
    flex-wrap: wrap; gap: 6px 10px;
    padding: calc(8px + env(safe-area-inset-top)) 2px 8px;
    margin-bottom: 10px;
  }
  .topbar-title { font-size: 18px; letter-spacing: 4px; }
  .topbar-date { font-size: 12px; }
  .topbar-sep { display: none; }
  .topbar-left { gap: 8px; }
  .topbar-right { gap: 6px; flex-wrap: wrap; }
  .stat-chip { font-size: 11px; padding: 4px 8px; min-height: 28px; }
  .stat-chip b { font-size: 13px; }
  .btn-mini { min-height: 30px; padding: 4px 10px; }

  /* 职级条（第二行） */
  .mobile-rank-row {
    display: flex; align-items: center; gap: 8px;
    width: 100%; margin-top: 4px;
    border-top: 1px solid var(--ink-3); padding-top: 8px;
  }
  .rank-seal-s {
    width: 28px; height: 28px; font-size: 13px;
    animation: none; flex-shrink: 0;
  }
  .m-rank-name { font-family: var(--serif); font-size: 14px; color: var(--paper); letter-spacing: 2px; }
  .m-rank-prog { font-size: 11px; color: var(--text-dim); margin-left: auto; }
  .btn-promote-m {
    font-size: 13px; letter-spacing: 3px; padding: 0 16px;
    min-height: 36px; flex-shrink: 0;
  }

  /* --- 主内容单列 --- */
  .main-grid { display: block; }
  .center-panel { gap: 12px; }

  /* 六维指标：2×3 紧凑网格 */
  .indicator-bars { grid-template-columns: repeat(2, 1fr); gap: 10px 12px; padding: 12px; }
  .ind-name { font-size: 12px; }
  .ind-val { font-size: 12px; }
  .ind-track { height: 10px; }

  /* 政策卡：双列大按钮 */
  .policy-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 12px 4px; }
  .policy-card { min-height: 44px; padding: 11px 11px 10px; }
  .policy-card:hover:not(.disabled):not(.locked) { transform: none; box-shadow: none; }
  .policy-card:active:not(.disabled):not(.locked):not(.used) {
    border-top-color: var(--vermilion-bright); background: #2e2620;
  }
  .policy-name { font-size: 14px; }
  .policy-fx { font-size: 11px; min-height: 0; }
  .policy-fx span[style] { display: none; } /* 手机端隐藏 flavor 文案保紧凑 */

  /* 结束本季度：底部 sticky 大按钮（置于 Tab 之上） */
  .btn-end {
    position: fixed; left: 10px; right: 10px;
    bottom: calc(58px + env(safe-area-inset-bottom));
    z-index: 115; width: auto; margin: 0;
    min-height: 50px;
    background: var(--vermilion); color: var(--paper);
    border: 1px solid var(--vermilion-bright);
    font-size: 16px; letter-spacing: 6px;
    box-shadow: 0 -4px 18px rgba(0,0,0,.55);
  }
  .btn-end:hover { background: var(--vermilion); box-shadow: 0 -4px 18px rgba(0,0,0,.55); }
  .btn-end:active { background: var(--vermilion-bright); }
  .policies { padding-bottom: 12px; }

  /* --- 天梯/干部/要情：底部 Tab 呼出的全幅面板 --- */
  .ladder-panel, .cadre-panel, .log-panel { display: none; }
  body.tab-ladder .ladder-panel,
  body.tab-cadre .cadre-panel,
  body.tab-log .log-panel {
    display: flex; flex-direction: column;
    position: fixed; left: 0; right: 0;
    top: calc(96px + env(safe-area-inset-top));
    bottom: calc(112px + env(safe-area-inset-bottom));
    z-index: 118;
    background: var(--ink-2);
    border-top: 3px double var(--gold-dim);
    max-height: none;
    animation: sheetIn .22s ease-out both;
  }
  body.tab-cadre .cadre-panel .cadre-list { max-height: none; flex: 1; }
  body.tab-log .log-panel .log-stream { flex: 1; }
  @keyframes sheetIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .right-panel { display: contents; }

  /* 底部 Tab 栏 */
  .mobile-tabs {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 119;
    background: var(--ink-2);
    border-top: 1px solid var(--ink-3);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mtab {
    flex: 1; min-height: 52px;
    background: transparent; border: none;
    color: var(--text-dim);
    font-family: var(--serif); font-size: 14px; letter-spacing: 6px;
    cursor: pointer;
    border-top: 2px solid transparent;
  }
  .mtab.active { color: var(--gold); border-top-color: var(--vermilion-bright); background: rgba(201,169,106,.06); }

  /* --- 模态：全屏/近全屏 --- */
  .modal-backdrop { padding: 0; }
  .telegram {
    width: 100%; min-height: 60vh;
    max-height: 96vh; overflow-y: auto;
    margin: 0 8px;
  }
  .telegram-title { font-size: 19px; }
  .telegram-body { font-size: 14px; }
  .telegram-opt { padding: 14px; min-height: 52px; }
  .telegram-opt .opt-label { font-size: 14px; }

  .inspect-box { width: calc(100% - 24px); }
  .inspect-text { font-size: 14px; }

  .decree {
    width: calc(100% - 16px); min-height: 92vh;
    max-height: 96vh; overflow-y: auto;
    padding: 26px 24px 110px;
  }
  .decree-org { font-size: 25px; letter-spacing: 3px; }
  .decree-title { font-size: 18px; }
  .decree-text, .decree-closing { font-size: 15px; }
  .decree-seal { right: 18px; bottom: 96px; }
  .decree-seal svg { width: 130px; height: 130px; }
  .decree-ok { min-height: 48px; font-size: 15px; padding: 10px 34px; }

  .end-box {
    width: calc(100% - 16px); max-height: 96vh;
    padding: 26px 18px 24px;
  }
  .end-title { font-size: 24px; letter-spacing: 6px; }
  .radar { width: 280px; height: 280px; }
  .end-verdict { font-size: 15px; }
  #btnEndRestart { min-height: 48px; }

  /* 开始界面手机适配 */
  .dossier {
    width: calc(100% - 24px); max-height: 96vh;
    padding: 34px 22px 28px;
  }
  .game-title { font-size: 42px; letter-spacing: 10px; text-indent: 10px; }
  .game-intro { font-size: 13px; }
  .start-buttons { flex-direction: column; align-items: stretch; }
  .btn-vermilion, .btn-plain { min-height: 48px; }
}

/* ---------- 通关海报 ---------- */

.end-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.end-actions .btn-plain { min-height: 48px; }

.poster-box {
  width: min(480px, calc(100vw - 24px));
  max-height: 94vh; overflow-y: auto;
  background: var(--ink-2); border: 1px solid var(--gold-dim);
  box-shadow: 0 40px 90px rgba(0,0,0,.9);
  padding-bottom: 18px; text-align: center;
  animation: decreeIn .4s both;
}
.poster-loading {
  padding: 60px 0; color: var(--gold-dim);
  font-family: var(--serif); letter-spacing: 6px; font-size: 14px;
}
.poster-img {
  display: block; width: calc(100% - 32px); margin: 14px auto 0;
  border: 1px solid var(--gold-dim);
  box-shadow: 0 12px 34px rgba(0,0,0,.6);
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.poster-actions { margin-top: 14px; display: flex; justify-content: center; align-items: center; gap: 12px; }
.poster-hint {
  display: none; color: var(--gold); font-size: 13px; letter-spacing: 2px;
  font-family: var(--serif);
}
.poster-dl { text-decoration: none; display: inline-block; min-height: 44px; line-height: 1; padding: 13px 26px; font-size: 14px; letter-spacing: 3px; }
.poster-close { margin-top: 12px; min-height: 40px; }

@media (max-width: 767px) {
  .poster-hint { display: inline; }
  .poster-dl { display: none; }
  .poster-box { width: calc(100vw - 16px); }
  .end-actions .btn-vermilion, .end-actions .btn-plain { min-height: 48px; width: 100%; }
  .end-actions { flex-direction: column; }
}
