/* =========================================
   宦海浮沉录 · 现代极简风
   ========================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "SF Pro Display", -apple-system, "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #F4F2EE;
  color: #1A1A1A;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* ---------- 通用 ---------- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px;
}
.container.narrow { max-width: 560px; }

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px; font-weight: 600;
  transition: all .18s ease;
}
.btn-primary {
  background: #1A1A1A;
  color: #fff;
  margin-top: 24px;
}
.btn-primary:hover { background: #E8654F; transform: translateY(-1px); }
.btn-primary:disabled { background: #D8D5CE; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: #777;
  font-size: 13px;
  padding: 8px 14px;
}
.btn-ghost:hover { color: #1A1A1A; }

/* ---------- 开场 ---------- */
#screen-intro {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.brand {
  font-size: 13px;
  letter-spacing: 8px;
  color: #E8654F;
  font-weight: 700;
  text-transform: uppercase;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: 3px;
  color: #aaa;
  margin-top: 6px;
}
#screen-intro h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -1px;
  margin: 30px 0 24px;
  color: #1A1A1A;
}
.lead {
  font-size: 16px;
  color: #555;
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.8;
}
.form {
  background: #fff;
  padding: 32px 28px;
  border-radius: 16px;
  text-align: left;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.06);
}
.lbl {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  color: #888;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}
.lbl.mt { margin-top: 24px; }
/* ---------- 身份卡（B站昵称，禁止自填） ---------- */
.account-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px;
  border: 1.5px solid #1A1A1A;
  border-radius: 10px;
  background: #FAF9F6;
}
.account-info { min-width: 0; }
.account-name {
  font-size: 17px; font-weight: 700; color: #1A1A1A;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-name.loading { color: #B0432F; font-weight: 600; font-size: 15px; }
.account-sub {
  margin-top: 4px; font-size: 12px; color: #888;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.start-tip {
  margin-top: 12px; font-size: 12px; color: #999; text-align: center;
}
.origin-list { display: grid; gap: 10px; margin-bottom: 8px; }
.origin-item {
  padding: 14px 16px;
  border: 1.5px solid #e5e2dc;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  display: flex; justify-content: space-between; align-items: center;
  background: #FAF9F6;
}
.origin-item:hover { border-color: #1A1A1A; }
.origin-item.selected { border-color: #1A1A1A; background: #fff; }
.origin-name { font-weight: 600; }
.origin-bonus { font-size: 12px; color: #888; }

/* ---------- 主游戏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid #ECE9E2;
}
.brand-mini {
  font-size: 14px; font-weight: 700; letter-spacing: 4px;
  color: #E8654F;
  flex-shrink: 0;
}
.progress-wrap { flex: 1; }
.progress-info {
  display: flex; justify-content: space-between;
  font-size: 12px; color: #888;
  margin-bottom: 6px;
}
.progress-info #phase-label {
  color: #1A1A1A; font-weight: 600; letter-spacing: 2px;
}
.progress-bar {
  height: 4px;
  background: #ECE9E2;
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #E8654F 0%, #C9A961 100%);
  width: 0%;
  transition: width .4s ease;
}

.game-main {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- 状态面板 ---------- */
.stats-panel {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  height: fit-content;
  position: sticky; top: 24px;
}
.player-card {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ECE9E2;
  margin-bottom: 20px;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #F4F2EE;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar svg { width: 100%; height: 100%; }
.pname { font-size: 16px; font-weight: 700; }
.ptitle { font-size: 12px; color: #888; letter-spacing: 1px; margin-top: 2px; }

.stat-list { display: grid; gap: 14px; }
.stat-row {
  display: grid;
  grid-template-columns: 50px 1fr 30px;
  align-items: center;
  gap: 10px;
}
.stat-label { font-size: 13px; color: #555; font-weight: 600; }
.stat-bar {
  height: 8px;
  background: #F4F2EE;
  border-radius: 4px;
  overflow: hidden;
}
.stat-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.stat-num {
  font-size: 12px;
  color: #1A1A1A;
  font-weight: 600;
  text-align: right;
}

/* 各指标配色 */
.bar-贪腐 { background: #C73E3A; }
.bar-财富 { background: #C9A961; }
.bar-民心 { background: #5A7A8F; }
.bar-健康 { background: #6BA67C; }
.bar-人脉 { background: #8E6BB5; }
.bar-事业 { background: #1A1A1A; }

/* 危险闪烁 */
.stat-row.danger .stat-fill { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.legend {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed #ECE9E2;
}
.legend-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #888;
  margin-bottom: 4px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-贪腐 { background: #C73E3A; }
.dot-健康 { background: #6BA67C; }
.dot-财富 { background: #C9A961; }

/* ---------- 题目卡 ---------- */
.question-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 44px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 24px rgba(0,0,0,.04);
  min-height: 480px;
  display: flex; flex-direction: column;
}
.question-meta {
  display: flex; justify-content: space-between;
  margin-bottom: 20px;
}
.q-id { font-size: 11px; color: #C9A961; letter-spacing: 2px; font-weight: 700; }
.q-tag {
  font-size: 11px; padding: 3px 10px;
  border: 1px solid #ECE9E2; border-radius: 100px;
  color: #888;
}
.q-title {
  font-size: 26px; font-weight: 700; line-height: 1.35;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.q-desc {
  font-size: 16px; line-height: 1.85; color: #444;
  margin-bottom: 32px;
  flex: 1;
}

.options { display: grid; gap: 12px; }
.option {
  text-align: left;
  padding: 18px 20px;
  border: 1.5px solid #ECE9E2;
  border-radius: 12px;
  background: #FAF9F6;
  font-size: 15px;
  line-height: 1.6;
  color: #1A1A1A;
  transition: all .15s ease;
  position: relative;
  overflow: hidden;
}
.option:hover {
  border-color: #1A1A1A;
  background: #fff;
  transform: translateX(2px);
}
.option:active { transform: translateX(0); }
.option-key {
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #1A1A1A;
  color: #fff;
  text-align: center;
  line-height: 22px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
}
.option-text-wrap { display: flex; align-items: flex-start; }
.option-text { flex: 1; }

.hint-toast {
  position: fixed; left: 50%; bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: #1A1A1A; color: #fff;
  padding: 14px 28px; border-radius: 100px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  opacity: 0; pointer-events: none;
  transition: all .25s ease;
  max-width: 80%;
  text-align: center;
}
.hint-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 结局 ---------- */
#screen-ending {
  justify-content: center; align-items: center;
  background: #F4F2EE;
}
.ending {
  text-align: center;
  padding: 56px 24px;
}
.ending-grade {
  display: inline-block;
  width: 80px; height: 80px;
  line-height: 80px;
  border-radius: 50%;
  background: #1A1A1A;
  color: #fff;
  font-size: 38px; font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: 2px;
}
.ending-grade.s { background: linear-gradient(135deg, #C9A961, #E0BC6E); }
.ending-grade.a { background: #1A1A1A; }
.ending-grade.b { background: #5A7A8F; }
.ending-grade.c { background: #888; }
.ending-grade.f { background: #C73E3A; }
.ending-title {
  font-size: 42px; font-weight: 800; letter-spacing: -1px;
  margin-bottom: 8px;
}
.ending-byline {
  font-size: 13px; color: #888; letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.ending-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 700px;
  margin: 0 auto 32px;
}
.ending-stat {
  background: #fff;
  padding: 14px;
  border-radius: 10px;
}
.ending-stat-label { font-size: 11px; color: #888; letter-spacing: 1px; }
.ending-stat-val { font-size: 22px; font-weight: 700; margin-top: 4px; }
.ending-text {
  max-width: 600px;
  margin: 0 auto 36px;
  font-size: 16px;
  line-height: 1.9;
  color: #333;
  text-align: left;
}

.ending-flags {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed #ECE9E2;
}
.flags-title {
  font-size: 11px;
  color: #888;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
  text-align: center;
}
.flag-chip {
  display: inline-block;
  margin: 4px 6px;
  padding: 6px 14px;
  background: #FAF9F6;
  border: 1px solid #ECE9E2;
  border-radius: 100px;
  font-size: 13px;
  color: #555;
}
.ending-actions {
  display: flex; gap: 16px; justify-content: center;
}
.ending-journey {
  background: #FAF9F6;
  border: 1px dashed #E5E2DC;
}
.ending-journey .ending-stat-val { color: #888; }

.rank-section {
  margin-top: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.rank-title {
  font-size: 12px;
  letter-spacing: 4px;
  color: #888;
  text-transform: uppercase;
  font-weight: 700;
}
.btn-submit {
  padding: 8px 18px;
  font-size: 13px;
  background: #1A1A1A;
  color: #fff;
  border-radius: 8px;
}
.btn-submit:hover:not(:disabled) { background: #E8654F; }
.btn-submit:disabled { background: #CCC; cursor: not-allowed; }

.my-rank {
  display: none;
  background: #FFF6E8;
  border: 1px solid #F0DFC0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #666;
}
.my-rank-inner b { color: #E8654F; font-weight: 700; }

.rank-list {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}
.rank-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid #F4F2EE;
  font-size: 14px;
}
.rank-item:last-child { border-bottom: none; }
.rank-item.me { background: #FFFBF2; }
.rank-no {
  text-align: center;
  font-weight: 700;
  color: #aaa;
  font-size: 13px;
}
.rank-item.me .rank-no { color: #E8654F; }
.rank-name {
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-score {
  font-weight: 700;
  color: #1A1A1A;
  font-size: 13px;
}
.rank-empty {
  padding: 28px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}

/* ---------- 关注引导条 ---------- */
.follow-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 520px;
  margin: 32px auto 0;
  padding: 16px 20px;
  background: #fff;
  border: 1.5px solid #E8654F;
  border-radius: 12px;
}
.follow-bar.followed {
  border-color: #6BA67C;
  background: #F6FBF7;
}
.follow-info { text-align: left; }
.follow-title {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
}
.follow-sub {
  font-size: 13px;
  color: #E8654F;
  margin-top: 2px;
}
.follow-bar.followed .follow-sub { color: #6BA67C; }
.btn-follow {
  padding: 10px 26px;
  background: #E8654F;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-follow:hover:not(:disabled) { background: #D5523C; }
.btn-follow:disabled {
  background: #6BA67C;
  cursor: default;
}

/* ---------- 海报弹窗 ---------- */
.poster-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(0,0,0,.7);
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.poster-modal.show { display: flex; }
.poster-wrap {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
}
.poster-close {
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 30px;
  color: #999;
  line-height: 1;
  z-index: 2;
}
.poster-close:hover { color: #1A1A1A; }
#poster-img {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.poster-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.poster-actions .btn { margin-top: 0; flex-shrink: 0; }
.poster-tip {
  font-size: 12px;
  color: #aaa;
}

/* ============ 全屏 toyid 水印 ============ */
.watermark {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
  background-repeat: repeat;
  background-position: 0 0;
}
.watermark.show { opacity: 1; }

/* ============ 免责声明（强制 5 秒） ============ */
.disclaimer-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18,18,18,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity .3s ease;
}
.disclaimer-mask.hide { opacity: 0; pointer-events: none; }
.disclaimer-card {
  background: #fff;
  border-radius: 18px;
  padding: 32px 30px 28px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
  animation: disclaimer-in .32s cubic-bezier(.2,.9,.3,1);
}
@keyframes disclaimer-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.disclaimer-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 700;
  color: #B0432F;
  background: rgba(176,67,47,.09);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.disclaimer-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: 1px;
}
.disclaimer-body p {
  font-size: 14.5px;
  line-height: 1.85;
  color: #444;
  margin: 0 0 8px;
}
.disclaimer-body p:last-child { margin-bottom: 0; }
.disclaimer-body b { color: #1A1A1A; }
.disclaimer-toyid {
  margin-top: 20px;
  padding: 12px 14px;
  background: #F4F2EE;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dt-label { font-size: 12px; color: #888; flex-shrink: 0; }
.dt-value {
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #1A1A1A;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.disclaimer-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: #AAA;
  text-align: right;
}
#btn-accept { margin-top: 22px; }
#btn-accept:disabled {
  background: #D8D5CE;
  color: #fff;
  cursor: not-allowed;
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .game-main { grid-template-columns: 1fr; }
  .stats-panel { position: static; }
  .stats-panel .stat-row { grid-template-columns: 40px 1fr 24px; }
  .question-card { padding: 28px 24px; }
  .q-title { font-size: 22px; }
  #screen-intro h1 { font-size: 32px; }
  .ending-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .progress-wrap { order: 3; flex-basis: 100%; }
  .game-main { padding: 16px; gap: 16px; }
}