/* ============================================================
 * 《AI 游戏开发者模拟器》— 像素风主题
 *
 * 视觉基调：掌机 / CRT 时代的 16 色像素游戏
 * 所有边框都是硬边 + 硬阴影，没有圆角，没有模糊
 * 没有一张图片文件，插图全部由 SVG 实时绘制
 * ============================================================ */

:root {
  /* 底色 */
  --bg-0: #0e0d17;
  --bg-1: #141322;
  --panel: #232946;
  --panel-2: #2b3157;
  --slot: #12111c;

  /* 文字 */
  --ink: #FFF1E8;
  --ink-2: #c8c3de;
  --ink-3: #8580a6;

  /* 结构线 */
  --edge: #000000;
  --edge-soft: #3d4270;

  /* 调色板 */
  --yellow: #FFEC27;
  --pink: #FF77A8;
  --cyan: #29ADFF;
  --green: #00E436;
  --red: #FF004D;
  --orange: #FFA300;

  /* 四项数值色 */
  --c-insp: #FF77A8;
  --c-tok: #FFEC27;
  --c-prog: #29ADFF;
  --c-mind: #00E436;

  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
             "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-px: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
             "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background-color: var(--bg-0);
  /* 点阵底纹 + 顶部光晕 */
  background-image:
    radial-gradient(circle at 50% -10%, rgba(41, 173, 255, 0.10), transparent 55%),
    radial-gradient(rgba(255, 241, 232, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 4px 4px;
  background-position: 0 0, 0 0;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  overflow: hidden;
}

/* CRT 扫描线：很淡，只为了让画面「像一块屏」 */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0) 3px
  );
  opacity: 0.35;
}

/* ---------------- 像素图 ---------------- */
.px {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------------- 顶栏 ---------------- */
.hud {
  flex: none;
  position: relative;
  z-index: 2;
  padding: 12px 16px 9px;
  background: linear-gradient(180deg, var(--panel) 0%, #1b1f38 100%);
  border-bottom: 2px solid var(--edge);
  box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.55);
}

.hud::before {
  /* 顶部一条高光，模拟塑料面板 */
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: rgba(255, 241, 232, 0.12);
}

.is-bare .hud { display: none; }

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.day-label {
  font-family: var(--font-px);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--ink-3);
}

.day-num {
  font-family: var(--font-px);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--yellow);
  letter-spacing: -0.02em;
  text-shadow: 2px 2px 0 #000;
  font-variant-numeric: tabular-nums;
}

.day-of {
  font-family: var(--font-px);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
}

.day-of b { font-weight: 700; color: var(--ink-2); }

.phase {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cyan);
  padding: 3px 8px;
  border: 2px solid var(--edge);
  background: var(--slot);
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.5);
}

/* 14 格进度方块 */
.track {
  display: flex;
  gap: 3px;
  margin: 10px 0 11px;
}

.track i {
  flex: 1;
  height: 7px;
  background: #191a2c;
  border: 1px solid #000;
  transition: background 0.25s steps(2), border-color 0.25s;
}

.track i.done {
  background: #8a7f1f;
  border-color: #000;
}

.track i.now {
  background: var(--yellow);
  border-color: #000;
  animation: segBlink 1.1s steps(2) infinite;
}

@keyframes segBlink {
  0%, 49% { background: var(--yellow); }
  50%, 100% { background: #6b641c; }
}

/* 四项数值 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat {
  padding: 2px 3px;
  margin: -2px -3px;
}

.stat[data-k="insp"] { --c: var(--c-insp); }
.stat[data-k="tok"] { --c: var(--c-tok); }
.stat[data-k="prog"] { --c: var(--c-prog); }
.stat[data-k="mind"] { --c: var(--c-mind); }

.stat-head {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-ico {
  flex: none;
  width: 16px;
  height: 16px;
  opacity: 0.95;
}

.stat-name {
  flex: 1;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
}

.stat-val b {
  font-family: var(--font-px);
  font-size: 14px;
  font-weight: 700;
  color: var(--c);
  font-variant-numeric: tabular-nums;
  text-shadow: 1px 1px 0 #000;
  transition: color 0.2s;
}

/* 分段式能量条 */
.stat-bar {
  position: relative;
  height: 8px;
  margin-top: 4px;
  background: var(--slot);
  border: 1px solid #000;
  overflow: hidden;
}

.stat-bar i {
  display: block;
  height: 100%;
  width: 50%;
  background: var(--c);
  transition: width 0.5s steps(8);
}

.stat-bar::after {
  /* 把填充切成 8 段 */
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 7px,
    var(--slot) 7px,
    var(--slot) 9px
  );
  pointer-events: none;
}

.stat.is-low .stat-val b { color: var(--red); }
.stat.is-low .stat-bar i { animation: lowFlash 0.9s steps(2) infinite; }
.stat.is-full .stat-bar i { box-shadow: 0 0 6px rgba(255, 236, 39, 0.5); }

@keyframes lowFlash {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.3; }
}

.stat.flash-up { animation: flashUp 0.9s steps(3); }
.stat.flash-down { animation: flashDown 0.9s steps(3); }

@keyframes flashUp {
  0% { background: rgba(0, 228, 54, 0.35); }
  100% { background: transparent; }
}

@keyframes flashDown {
  0% { background: rgba(255, 0, 77, 0.35); }
  100% { background: transparent; }
}

.stat.flash-up .stat-val b { color: var(--green); }
.stat.flash-down .stat-val b { color: var(--red); }

/* 提示条 */
.ticker {
  height: 13px;
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--yellow);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s, transform 0.2s;
}

.ticker.show { opacity: 1; transform: none; }

/* ---------------- 舞台 ---------------- */
#stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.view {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 26px;
  animation: viewIn 0.28s steps(4) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  font-family: var(--font-px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* ---------------- 标题页 ---------------- */
.view-title {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 24px;
  padding-bottom: 32px;
}

.title-art {
  width: 132px;
  height: 132px;
  padding: 8px;
  border: 2px solid var(--edge);
  background: linear-gradient(180deg, #2b3157, #1a1e35);
  box-shadow: inset 0 0 0 2px var(--edge-soft), 0 5px 0 0 #000;
  animation: floaty 3.2s steps(6) infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.title-kicker {
  margin-top: 16px;
  font-family: var(--font-px);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--cyan);
}

.title {
  margin: 10px 0 0;
  font-size: clamp(30px, 9.2vw, 40px);
  line-height: 1.16;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow:
    3px 3px 0 #000,
    6px 6px 0 rgba(255, 236, 39, 0.16);
}

.title-sub {
  margin: 18px 0 0;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-2);
  max-width: 300px;
}

.title-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 24px;
}

.title-stats span {
  font-family: var(--font-px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  padding: 4px 8px;
  border: 2px solid var(--edge);
  background: var(--slot);
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.6);
}

.title-foot,
.title-unlock {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.title-unlock b { color: var(--yellow); font-weight: 700; }

.title-sign {
  margin: 22px 0 0;
  font-family: var(--font-px);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: #4f4b6d;
}

/* ---------------- 主按钮 ---------------- */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 14px 16px;
  background: var(--yellow);
  color: #141322;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 2px solid var(--edge);
  box-shadow: 0 5px 0 0 #000, inset 0 -3px 0 0 rgba(0, 0, 0, 0.16);
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 0 #000, inset 0 -2px 0 0 rgba(0, 0, 0, 0.16);
}

.btn-primary .arrow {
  font-family: var(--font-px);
  font-size: 15px;
  opacity: 0.75;
}

/* ---------------- 事件 ---------------- */
.view-day { justify-content: center; }

.event {
  padding: 16px 14px 18px;
  background: rgba(35, 41, 70, 0.55);
  border: 2px solid var(--edge);
  box-shadow: inset 0 0 0 2px #2e3459, 0 5px 0 0 rgba(0, 0, 0, 0.5);
}

.art-frame {
  width: 96px;
  height: 96px;
  margin: 2px auto 0;
  padding: 6px;
  border: 2px solid var(--edge);
  background:
    linear-gradient(180deg, #3a4173 0%, #232946 55%, #1a1e35 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 241, 232, 0.09), 0 4px 0 0 #000;
}

.event-eyebrow {
  margin-top: 13px;
  text-align: center;
  font-family: var(--font-px);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--yellow);
}

.event-title {
  margin: 7px 0 0;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.event-text {
  margin: 11px 0 0;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink-2);
}

/* 选项 */
.options {
  margin-top: 0;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px 10px 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--edge);
  box-shadow: 0 4px 0 0 #000, inset 0 0 0 2px rgba(255, 241, 232, 0.06);
  animation: optIn 0.26s steps(3) both;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2), background 0.12s;
}

@keyframes optIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

.opt:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 0 #000, inset 0 0 0 2px rgba(255, 241, 232, 0.06);
  background: var(--panel-2);
}

@media (hover: hover) {
  .opt:hover {
    background: var(--panel-2);
    box-shadow: 0 4px 0 0 #000, inset 0 0 0 2px rgba(255, 236, 39, 0.5);
  }
}

.opt-ico {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slot);
  border: 2px solid #000;
  box-shadow: inset 0 0 0 1px #2c3155;
}

.opt-key {
  flex: none;
  font-family: var(--font-px);
  font-size: 10px;
  font-weight: 700;
  color: var(--yellow);
  opacity: 0.8;
  width: 9px;
}

.opt-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.opt-prefix {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--yellow);
  margin-bottom: 2px;
  font-family: var(--font-px);
  text-shadow: 1px 1px 0 #000;
}

.opt-main {
  font-size: 13.5px;
  line-height: 1.45;
}

.opt-go {
  flex: none;
  font-family: var(--font-px);
  font-size: 13px;
  color: #565b8a;
  transition: color 0.12s, transform 0.12s steps(2);
}

.opt:hover .opt-go { color: var(--yellow); transform: translateX(2px); }

.hint-line {
  min-height: 13px;
  margin-top: 16px;
  text-align: center;
  font-size: 10.5px;
  color: #565b8a;
  letter-spacing: 0.03em;
}

/* ---------------- 结算 ---------------- */
.view-result {
  justify-content: center;
  padding-bottom: 32px;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 2px solid var(--edge);
  box-shadow: 0 2px 0 0 rgba(255, 241, 232, 0.07);
}

.result-ico {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slot);
  border: 2px solid #000;
  box-shadow: inset 0 0 0 1px #2c3155;
}

.result-eyebrow {
  margin-right: auto;
  font-family: var(--font-px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--yellow);
}

.result-day {
  font-family: var(--font-px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.result-outcome {
  margin: 20px 0 0;
  font-size: 16px;
  line-height: 1.9;
  font-weight: 600;
  color: var(--ink);
}

.result-note {
  margin: 12px 0 0;
  padding: 8px 0 8px 11px;
  border-left: 3px solid var(--orange);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-3);
}

.deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 22px 0 26px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-px);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 5px 8px;
  border: 2px solid var(--edge);
  background: var(--slot);
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.6);
}

.chip .chip-ico {
  width: 16px;
  height: 16px;
  flex: none;
}

.chip.up { color: var(--green); }
.chip.down { color: var(--red); }
.chip.flat { color: var(--ink-3); }

.result-tip {
  margin: 12px 0 0;
  text-align: center;
  font-size: 10.5px;
  color: #565b8a;
}

/* ---------------- 救援（广告触发点 A） ---------------- */
.view-rescue {
  justify-content: center;
  padding-top: 22px;
}

.rescue-card {
  padding: 22px 16px 18px;
  text-align: center;
  background: rgba(35, 41, 70, 0.7);
  border: 2px solid var(--edge);
  box-shadow: inset 0 0 0 2px #2e3459, 0 5px 0 0 rgba(0, 0, 0, 0.5);
}

.rescue-art {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  padding: 6px;
  border: 2px solid var(--edge);
  background: linear-gradient(180deg, #3a4173, #1a1e35);
  box-shadow: inset 0 0 0 2px rgba(255, 241, 232, 0.09);
}

.rescue-title {
  margin: 10px 0 0;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.rescue-text {
  margin: 10px 0 22px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-2);
}

.btn-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 13px;
  background: var(--orange);
  color: #201404;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.4;
  border: 2px solid var(--edge);
  box-shadow: 0 5px 0 0 #000, inset 0 -3px 0 0 rgba(0, 0, 0, 0.16);
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

.btn-ad:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 0 #000, inset 0 -2px 0 0 rgba(0, 0, 0, 0.16);
}

.btn-ad-sub {
  font-family: var(--font-px);
  font-size: 10px;
  font-weight: 700;
  opacity: 0.8;
}

.btn-ghost {
  width: 100%;
  margin-top: 11px;
  padding: 12px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  border: 2px solid #343a63;
  box-shadow: 0 3px 0 0 rgba(0, 0, 0, 0.5);
}

.btn-ghost:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.5);
}

/* ---------------- 结局 ---------------- */
.view-end {
  justify-content: center;
  align-items: stretch;
  padding-top: 20px;
  padding-bottom: 28px;
}

.end-art {
  width: 128px;
  height: 128px;
  margin: 0 auto 4px;
  padding: 8px;
  border: 2px solid var(--edge);
  background: linear-gradient(180deg, #3a4173 0%, #232946 60%, #1a1e35 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 241, 232, 0.09), 0 5px 0 0 #000;
}

.end-eyebrow {
  margin-top: 12px;
  text-align: center;
  font-family: var(--font-px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--yellow);
}

.end-eyebrow span { color: var(--ink-3); }

.end-title {
  margin: 10px 0 0;
  text-align: center;
  font-size: clamp(30px, 9.5vw, 42px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-shadow: 3px 3px 0 #000, 6px 6px 0 rgba(255, 0, 77, 0.18);
}

.end-desc {
  margin: 18px 0 0;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink-2);
}

.end-extra {
  margin: 11px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-3);
}

.end-sum {
  margin: 20px 0 0;
  padding: 14px 14px 14px 16px;
  border-left: 4px solid var(--yellow);
  background: rgba(255, 236, 39, 0.07);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 700;
  color: var(--ink);
}

.end-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin: 20px 0 0;
  background: var(--edge);
  border: 2px solid var(--edge);
}

.end-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  background: var(--panel);
}

.end-stat-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.end-stat-val {
  font-family: var(--font-px);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.end-meta {
  margin: 14px 0 16px;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

.end-foot {
  margin: 18px 0 0;
  text-align: center;
  font-family: var(--font-px);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: #4f4b6d;
}

/* ---------------- 广告占位层 ---------------- */
.ad-mask {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(8, 7, 14, 0.9);
  animation: fadeIn 0.16s steps(2) both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ad-box {
  width: 100%;
  max-width: 330px;
  padding: 22px 18px 18px;
  text-align: center;
  background: var(--panel);
  border: 2px solid var(--edge);
  box-shadow: inset 0 0 0 2px var(--edge-soft), 0 6px 0 0 #000;
  animation: viewIn 0.2s steps(3) both;
}

.ad-tag {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-px);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #201404;
  background: var(--yellow);
  border: 2px solid var(--edge);
}

.ad-scene {
  margin-top: 12px;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.ad-line {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-3);
}

.ad-timer {
  margin-top: 18px;
  font-family: var(--font-px);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}

.ad-timer span {
  font-size: 17px;
  color: var(--yellow);
}

.ad-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #4f4b6d;
  background: #1a1d33;
  border: 2px solid var(--edge);
  box-shadow: 0 4px 0 0 #000;
  transition: color 0.2s, background 0.2s steps(2);
}

.ad-btn.ready {
  color: #201404;
  background: var(--yellow);
}

.ad-skip {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- 适配 ---------------- */
@media (max-height: 720px) {
  .view { padding-top: 12px; padding-bottom: 18px; }
  .art-frame { width: 78px; height: 78px; }
  .event-title { font-size: 18px; }
  .event-text { font-size: 13.5px; line-height: 1.85; }
  .opt { padding: 9px 11px 9px 9px; font-size: 13.5px; }
  .title-art { width: 100px; height: 100px; }
  .end-art { width: 100px; height: 100px; }
  .end-title { font-size: 28px; }
}

@media (max-height: 640px) {
  .art-frame { width: 64px; height: 64px; }
  .event { padding: 12px 12px 14px; }
  .event-text { font-size: 13px; }
  .options { padding-top: 12px; gap: 8px; }
  .opt-ico { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
 * PC 宽屏三栏工作台架构 & 音效按钮
 * ============================================================ */

#workspace-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg-0);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  background: #191c30;
  border: 1px solid var(--edge-soft);
  box-shadow: 0 2px 0 0 #000;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s;
}

.sound-toggle:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 0 #000;
}

.sound-toggle.is-muted {
  filter: grayscale(1);
  opacity: 0.5;
}

/* 侧边工作台面板默认在手机/窄屏隐藏 */
.desk-panel {
  display: none;
}

/* 当屏幕宽度 >= 960px 时展开三栏沉浸式 PC 工作台 */
@media (min-width: 960px) {
  .desk-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 320px;
    height: 100%;
    background: #100f1c;
    border: 2px solid var(--edge);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    position: relative;
    z-index: 10;
    overflow: hidden;
  }

  .desk-left {
    border-right: 2px solid var(--edge);
    margin-right: -1px;
  }

  .desk-right {
    border-left: 2px solid var(--edge);
    margin-left: -1px;
  }

  .panel-header {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: linear-gradient(180deg, #1d1b30 0%, #151424 100%);
    border-bottom: 2px solid var(--edge);
  }

  .panel-tag {
    font-size: 10px;
    color: var(--yellow);
    font-family: var(--font-px);
    letter-spacing: 0.15em;
    font-weight: bold;
  }

  .panel-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 2px;
  }

  .panel-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    font-size: 12.5px;
  }

  .desk-item {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #171626;
    border: 1px solid #2e2c4d;
    box-shadow: 0 2px 0 0 #000;
  }

  .desk-label {
    font-size: 11px;
    color: var(--ink-3);
    margin-bottom: 4px;
  }

  .desk-val {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--cyan);
    font-family: var(--font-px);
  }

  .desk-quote-card {
    margin-top: 18px;
    padding: 12px;
    background: #1c1a30;
    border-left: 3px solid var(--pink);
    border-top: 1px solid #2a2845;
    border-right: 1px solid #2a2845;
    border-bottom: 1px solid #2a2845;
  }

  .quote-title {
    font-size: 10.5px;
    color: var(--pink);
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.1em;
  }

  .quote-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--ink-2);
  }

  .panel-footer {
    padding: 10px 14px;
    background: #0d0c17;
    border-top: 1px solid #26243b;
    font-size: 10.5px;
    color: var(--ink-3);
    font-family: var(--font-px);
  }

  .end-counter-wrap b {
    color: var(--yellow);
  }

  /* 终端右侧风格 */
  .terminal-body {
    background: #0a0912;
    padding: 12px;
    font-family: var(--font-px);
  }

  .terminal-logs {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .term-line {
    font-size: 11px;
    line-height: 1.6;
    word-break: break-all;
  }

  .term-line.sys {
    color: var(--ink-3);
  }

  .term-line.prompt {
    color: var(--green);
  }

  .term-line.action {
    color: var(--yellow);
    padding-left: 6px;
    border-left: 2px solid var(--yellow);
  }

  .term-line.bot {
    color: var(--cyan);
  }
}
