/* ============================================================================
 *  军训偷懒模拟器 · 样式表 (public/css/style.css)
 * ----------------------------------------------------------------------------
 *  风格基调：军绿迷彩 + 作训服布料质感 + 档案铁牌字
 *  结构：1) 变量与基础  2) 顶部状态栏  3) 通用组件（按钮/面板/表格）
 *        4) 屏幕容器与转场  5) 各屏专属样式  6) 反馈动画  7) 响应式
 * ========================================================================== */

/* =========================== 1. 变量与基础 =============================== */

:root {
  /* 军绿迷彩主色板 */
  --camo-darkest: #1b2113;
  --camo-dark: #26301a;
  --camo-base: #33401f;
  --camo-mid: #47552b;
  --camo-light: #5f6f38;
  --camo-sand: #8d9159;
  --camo-tan: #b9a86a;

  /* 强调色 */
  --accent: #cfe06a;        /* 荧光军绿，用于主按钮 */
  --accent-deep: #8aa02f;
  --danger: #d9534f;
  --danger-deep: #a12f2b;
  --warn: #e2a13a;
  --info: #7fb2d9;
  --good: #8ed07a;

  /* 数值条颜色 */
  --stamina: #f0c341;
  --mood: #7fd1e8;
  --endurance: #f08a5d;
  --satisfaction: #b6e26b;

  /* 文本 */
  --text: #f2f4e6;
  --text-dim: #c3c9ab;
  --text-mute: #8f9877;

  /* 容器 */
  --panel-bg: rgba(24, 30, 15, 0.82);
  --panel-bg-solid: #232c16;
  --panel-border: rgba(180, 196, 120, 0.28);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);

  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Consolas", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--camo-dark);
  /* 迷彩斑块：用多层径向渐变模拟布料迷彩 */
  background-image:
    radial-gradient(ellipse 220px 120px at 12% 18%, rgba(95, 111, 56, 0.85) 0 60%, transparent 61%),
    radial-gradient(ellipse 280px 150px at 78% 12%, rgba(27, 33, 19, 0.9) 0 60%, transparent 61%),
    radial-gradient(ellipse 200px 260px at 62% 62%, rgba(71, 85, 43, 0.75) 0 60%, transparent 61%),
    radial-gradient(ellipse 320px 170px at 18% 78%, rgba(141, 145, 89, 0.35) 0 60%, transparent 61%),
    radial-gradient(ellipse 180px 200px at 92% 84%, rgba(38, 48, 26, 0.9) 0 60%, transparent 61%),
    linear-gradient(160deg, #33401f 0%, #222b16 55%, #1b2113 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 屏幕上的细扫描线，增加“作训服/铁牌”质感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

.is-hidden { display: none !important; }

/* =========================== 2. 顶部状态栏 =============================== */

.app {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 14px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hud {
  position: sticky;
  top: 8px;
  z-index: 30;
  background: linear-gradient(180deg, rgba(30, 38, 18, 0.96), rgba(22, 28, 14, 0.94));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  backdrop-filter: blur(6px);
  animation: slideDown 0.45s ease both;
}

.hud-row { display: flex; align-items: center; gap: 10px; }
.hud-row + .hud-row { margin-top: 8px; }

.hud-row-top { justify-content: space-between; }

.hud-who { display: flex; align-items: center; gap: 8px; min-width: 0; }

.hud-rank {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(207, 224, 106, 0.16);
  border: 1px solid rgba(207, 224, 106, 0.4);
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
}

.hud-nickname {
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.hud-clock { text-align: center; line-height: 1.1; }
.hud-clock-time {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--camo-tan);
  display: block;
}
.hud-clock-label { font-size: 10px; color: var(--text-mute); letter-spacing: 1px; }

.hud-tools { display: flex; align-items: center; gap: 8px; }

.hud-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(217, 83, 79, 0.14);
  border: 1px solid rgba(217, 83, 79, 0.5);
  color: #ffd9d7;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: default;
  font-family: inherit;
  transition: transform 0.15s ease;
}
.hud-badge b { font-family: var(--font-num); font-size: 14px; color: #ff9d99; }
.hud-badge-label { opacity: 0.85; }
.hud-badge.bump { animation: badgeBump 0.5s ease; }

.hud-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 10px;
  width: 34px;
  height: 32px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.hud-icon-btn:hover { background: rgba(255, 255, 255, 0.14); }
.hud-icon-btn:active { transform: scale(0.92); }
.hud-icon-btn.is-muted { opacity: 0.45; }

/* ---- 数值条 ---- */
.hud-row-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.stat { min-width: 0; }
.stat-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.stat-head b {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 14px;
  color: #fff;
}
.stat-icon { font-size: 12px; }

.stat-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.stat-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--stamina);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s;
}
.stat[data-stat="stamina"] .stat-fill { background: linear-gradient(90deg, #b58a10, var(--stamina)); }
.stat[data-stat="mood"] .stat-fill { background: linear-gradient(90deg, #2f7f96, var(--mood)); }
.stat[data-stat="endurance"] .stat-fill { background: linear-gradient(90deg, #a84a26, var(--endurance)); }
.stat[data-stat="satisfaction"] .stat-fill { background: linear-gradient(90deg, #5d8b1f, var(--satisfaction)); }

.stat.is-low .stat-bar { animation: lowPulse 1.1s ease-in-out infinite; border-color: rgba(217, 83, 79, 0.7); }
.stat.is-low .stat-head b { color: #ff9d99; }

/* ---- 进度条 ---- */
.hud-row-progress { gap: 8px; font-size: 11px; color: var(--text-mute); }
.hud-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.hud-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(115deg, var(--accent-deep) 0 8px, #6f8326 8px 16px);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.hud-progress-round { font-family: var(--font-num); white-space: nowrap; }

/* =========================== 3. 通用组件 ================================ */

.screens { position: relative; flex: 1; margin-top: 14px; }

.screen { display: none; }
.screen.is-active { display: block; animation: screenIn 0.45s ease both; }

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}
.panel + .panel { margin-top: 14px; }

.panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: var(--camo-tan);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-note { font-size: 11px; color: var(--text-mute); font-weight: 400; letter-spacing: 0; }

.scene-title { margin: 0; font-size: 17px; letter-spacing: 2px; color: var(--camo-tan); }
.scene-desc { margin: 8px 0 16px; font-size: 13px; color: var(--text-dim); line-height: 1.7; }

.field-label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.field-row { display: flex; gap: 8px; }

.text-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.text-input::placeholder { color: var(--text-mute); }
.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(207, 224, 106, 0.16);
}

/* ---- 按钮 ---- */
.btn {
  position: relative;
  overflow: hidden;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  color: #131a0c;
  background: var(--accent);
  transition: transform 0.12s ease, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }

.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: #141a0b; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--panel-border);
  color: var(--text);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}
.btn-warn { background: linear-gradient(180deg, #f3bb5c, #cf8a1c); color: #221703; }
.btn-danger { background: linear-gradient(180deg, #ec7671, var(--danger-deep)); color: #fff; }
.btn-small { font-size: 13px; padding: 10px 14px; letter-spacing: 0; }
.btn-block { display: block; width: 100%; margin-top: 14px; }
.btn kbd {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 4px;
  font-family: var(--font-num);
}

/* 按钮点击涟漪 */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.55);
  animation: ripple 0.55s ease-out forwards;
  pointer-events: none;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline dotted;
  padding: 0;
}
.link-btn:hover { color: #fff; }

/* ---- 榜单表格 ---- */
.rank-table-wrap { overflow-x: auto; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank-table th, .rank-table td { padding: 8px 6px; text-align: left; white-space: nowrap; }
.rank-table th {
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 500;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--panel-border);
}
.rank-table tbody tr { border-bottom: 1px dashed rgba(255, 255, 255, 0.07); }
.rank-table tbody tr:last-child { border-bottom: none; }
.rank-table tbody tr.is-me { background: rgba(207, 224, 106, 0.1); }
.rank-table .rank-no { font-family: var(--font-num); color: var(--camo-tan); }
.rank-table .rank-score { font-family: var(--font-num); color: #fff; font-weight: 700; }
.rank-empty td { color: var(--text-mute); text-align: center; padding: 18px 0; font-size: 12px; }
.grade-pill {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 5px;
  font-family: var(--font-num);
  font-weight: 700;
  background: rgba(207, 224, 106, 0.16);
  color: var(--accent);
}
.grade-pill.grade-S { background: rgba(240, 195, 65, 0.22); color: #ffd75e; }
.grade-pill.grade-D { background: rgba(217, 83, 79, 0.2); color: #ff9d99; }

/* ---- 计时条 ---- */
.timer-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.timer-bar i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #8ed07a, #e2a13a 65%, #d9534f);
  transition: none;
}

/* ---- 底部 ---- */
.site-footer {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
}
.footer-dot { margin: 0 6px; }

/* =========================== 4. 开始界面 ================================ */

.boot-camo {
  position: absolute;
  inset: -20px -14px auto;
  height: 220px;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(207, 224, 106, 0.12), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(185, 168, 106, 0.12), transparent 50%);
  filter: blur(6px);
}

.start-wrap { position: relative; }

.game-title {
  margin: 10px 0 0;
  text-align: center;
  line-height: 0.98;
  letter-spacing: 4px;
  animation: dropIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.title-line { display: block; font-size: clamp(34px, 9vw, 62px); font-weight: 900; text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35); }
.title-line-accent {
  color: var(--accent);
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.25);
}
.game-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 2px;
  margin: 12px 0 20px;
  animation: fadeUp 0.7s 0.15s ease both;
}

.panel-start { animation: fadeUp 0.6s 0.1s ease both; }
.panel-howto { animation: fadeUp 0.3s ease both; }
.panel-rank { animation: fadeUp 0.6s 0.25s ease both; }

.start-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-mute);
}

.howto-list { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.9; color: var(--text-dim); }
.howto-list b { color: var(--accent); }
.howto-hotkey {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-mute);
  border-top: 1px dashed var(--panel-border);
  padding-top: 12px;
}
kbd {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text);
}

/* =========================== 5. 起床界面 ================================ */

.wake-wrap { text-align: center; padding: 10px 0; }
.wake-clock-box { animation: fadeUp 0.5s ease both; }
.wake-clock {
  font-family: var(--font-num);
  font-size: clamp(52px, 16vw, 96px);
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--camo-tan);
  text-shadow: 0 0 26px rgba(185, 168, 106, 0.35);
}
.wake-clock.tick { animation: clockTick 0.6s ease; }
.wake-date { font-size: 12px; letter-spacing: 3px; color: var(--text-mute); margin-top: 4px; }

.wake-scene {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 26px;
  font-size: 54px;
  margin: 18px 0;
  animation: fadeUp 0.6s 0.1s ease both;
}
.wake-alarm { animation: alarmShake 0.7s ease-in-out infinite; }
.wake-sun { animation: floatY 3.2s ease-in-out infinite; }
.wake-bunk { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }

.wake-hint { font-size: 14px; color: var(--text-dim); margin: 10px 0 12px; }
.wake-hint b { color: var(--danger); font-family: var(--font-num); font-size: 17px; }

.timer-bar-wake { max-width: 460px; margin: 0 auto 20px; height: 12px; }

.wake-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wake-actions .btn { min-width: 190px; }

/* =========================== 6. 着装界面 ================================ */

.dress-wrap { max-width: 620px; margin: 0 auto; }
.dress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dress-head-right { display: flex; gap: 8px; align-items: center; }
.dress-progress {
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--camo-tan);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 3px 10px;
}
.dress-wrong {
  font-size: 12px;
  color: #ff9d99;
  background: rgba(217, 83, 79, 0.14);
  border: 1px solid rgba(217, 83, 79, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
}
.dress-wrong.bump { animation: badgeBump 0.5s ease; }

.dress-card {
  position: relative;
  margin: 6px 0 14px;
  padding: 26px 18px 22px;
  text-align: center;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(52, 64, 31, 0.95), rgba(28, 35, 18, 0.95));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.dress-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 10px, transparent 10px 20px);
  pointer-events: none;
}
.dress-card.enter { animation: cardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
.dress-card.good { border-color: rgba(142, 208, 122, 0.8); box-shadow: 0 0 0 3px rgba(142, 208, 122, 0.18), var(--shadow); }
.dress-card.bad { border-color: rgba(217, 83, 79, 0.85); box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.22), var(--shadow); animation: shakeX 0.4s ease; }

.dress-emoji { font-size: 58px; line-height: 1; animation: floatY 2.4s ease-in-out infinite; }
.dress-name { font-size: 22px; font-weight: 800; letter-spacing: 2px; margin-top: 10px; }
.dress-tip { font-size: 12px; color: var(--text-mute); margin-top: 8px; line-height: 1.6; }

.timer-bar-dress { height: 12px; margin-bottom: 16px; }

.dress-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-dress { padding: 16px 12px; font-size: 15px; }

.dress-feedback {
  min-height: 44px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  text-align: center;
}
.dress-feedback.good { color: var(--good); }
.dress-feedback.bad { color: #ff9d99; }

.dress-bag {
  margin-top: 14px;
  border-top: 1px dashed var(--panel-border);
  padding-top: 12px;
}
.dress-bag-title { font-size: 12px; color: var(--text-mute); margin-bottom: 8px; }
.dress-bag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.bag-item {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(142, 208, 122, 0.14);
  border: 1px solid rgba(142, 208, 122, 0.4);
  color: #d6f0cc;
  animation: popIn 0.3s ease both;
}
.bag-item.bag-bad {
  background: rgba(217, 83, 79, 0.14);
  border-color: rgba(217, 83, 79, 0.5);
  color: #ffc9c6;
}
.bag-empty { font-size: 12px; color: var(--text-mute); }

/* =========================== 7. 田径场 ================================== */

.field-wrap { display: flex; flex-direction: column; gap: 12px; }

.instructor {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(35, 44, 22, 0.95), rgba(24, 30, 15, 0.95));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.instructor.talking { animation: instTalk 0.5s ease; }
.instructor.angry { border-color: rgba(217, 83, 79, 0.65); }
.instructor.pleased { border-color: rgba(142, 208, 122, 0.6); }

.inst-avatar {
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}
.inst-info { min-width: 120px; }
.inst-line { display: flex; align-items: center; gap: 8px; }
.inst-name { font-weight: 800; letter-spacing: 2px; }
.mood-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--panel-border);
}
.mood-tag.mood-rage { background: rgba(217, 83, 79, 0.2); border-color: rgba(217, 83, 79, 0.6); color: #ffb3b0; }
.mood-tag.mood-happy { background: rgba(142, 208, 122, 0.18); border-color: rgba(142, 208, 122, 0.55); color: #cdf0c2; }
.inst-satisfaction { font-size: 11px; color: var(--text-mute); margin-top: 5px; }
.inst-satisfaction b { color: var(--camo-tan); font-family: var(--font-num); font-size: 13px; }

.bubble {
  position: relative;
  flex: 1;
  min-width: 200px;
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #1d2411;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.bubble::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 20px;
  width: 14px;
  height: 14px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
}
.bubble.say { animation: bubblePop 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
.bubble.shout { background: #ffe1de; color: #8c1b17; animation: bubblePop 0.25s ease both, shoutShake 0.35s ease 0.25s; }
.bubble.praise { background: #e6ffdf; color: #1f5716; }

.react-timer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}
.react-timer.active { opacity: 1; }
.react-timer i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #8ed07a, #e2a13a 60%, #d9534f);
}

.phase-banner {
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--accent);
  background: rgba(207, 224, 106, 0.08);
  border: 1px dashed rgba(207, 224, 106, 0.32);
  border-radius: 999px;
  padding: 7px 12px;
}
.field-hint { text-align: center; font-size: 12px; color: var(--text-mute); min-height: 17px; }

/* ---- 动作考核 4 选 1 ---- */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.quiz-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(60, 73, 36, 0.95), rgba(34, 42, 21, 0.95));
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.32);
  transition: transform 0.12s ease, border-color 0.2s, background 0.2s;
  animation: popIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}
.quiz-btn:hover { border-color: var(--accent); }
.quiz-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.quiz-btn .quiz-emoji { font-size: 22px; }
.quiz-btn .quiz-key {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text-mute);
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  padding: 1px 5px;
}
.quiz-btn.correct { background: linear-gradient(180deg, #6fbe57, #3f7a2d); border-color: #a8e694; color: #08210a; animation: correctPop 0.45s ease; }
.quiz-btn.wrong { background: linear-gradient(180deg, #d9534f, #8c2521); border-color: #ff9d99; color: #fff; animation: shakeX 0.4s ease; }
.quiz-btn.dim { opacity: 0.35; }

/* ---- 联动动作播报条 ---- */
.combo-strip { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 0; }
.combo-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(207, 224, 106, 0.12);
  border: 1px solid rgba(207, 224, 106, 0.4);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  animation: popIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.combo-chip.answered { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }
.combo-chip .combo-index { font-family: var(--font-num); font-size: 11px; color: var(--camo-tan); }

/* ---- 站军姿 ---- */
.stance-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 10px;
  border-radius: var(--radius);
  border: 1px dashed rgba(207, 224, 106, 0.35);
  background: rgba(0, 0, 0, 0.18);
}
.stance-ring {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) 0deg, rgba(255, 255, 255, 0.08) 0deg);
  transition: background 0.1s linear;
}
.stance-ring::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: #232c16;
  border: 1px solid var(--panel-border);
}
.stance-ring-text {
  position: relative;
  z-index: 1;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--accent);
}
.stance-temptations { position: relative; width: 100%; height: 96px; }
.tempt-btn {
  position: absolute;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(226, 161, 58, 0.6);
  background: rgba(226, 161, 58, 0.16);
  color: #ffe0ac;
  cursor: pointer;
  animation: popIn 0.3s ease both, floatY 3s ease-in-out infinite;
  transition: transform 0.12s;
}
.tempt-btn:active { transform: scale(0.94); }

/* ---- 偷懒 ---- */
.slack-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(226, 161, 58, 0.5);
  background: radial-gradient(circle at 50% 0%, rgba(226, 161, 58, 0.16), rgba(0, 0, 0, 0.25));
  animation: popIn 0.3s ease both;
}
.slack-eye { font-size: 40px; animation: peek 1.6s ease-in-out infinite; }
.slack-text { font-size: 13px; color: #ffe0ac; letter-spacing: 1px; }
.timer-bar-slack { width: 100%; max-width: 420px; height: 9px; }
.btn-slack {
  background: linear-gradient(180deg, #f3bb5c, #cf8a1c);
  color: #221703;
  font-size: 17px;
  padding: 15px 30px;
  animation: slackPulse 0.9s ease-in-out infinite;
}

/* ---- 底部操作区 ---- */
.field-actions { display: flex; gap: 12px; align-items: stretch; }
.btn-report {
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px;
  border-radius: var(--radius);
  border: 2px solid rgba(207, 224, 106, 0.6);
  background: linear-gradient(180deg, #46551f, #262f14);
  color: var(--accent);
  font-family: inherit;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 6px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.1s ease, box-shadow 0.15s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-report:hover { background: linear-gradient(180deg, #55661f, #2d3817); }
.btn-report:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.btn-report.urgent { animation: urgentGlow 0.5s ease-in-out infinite; border-color: #ffd75e; }
.btn-report.pressed { background: linear-gradient(180deg, #8aa02f, #47551f); }
.btn-report-key { font-size: 11px; letter-spacing: 0; color: var(--text-mute); border: 1px solid var(--panel-border); border-radius: 5px; padding: 2px 6px; }
.btn-report-main { pointer-events: none; }

.btn-slack-quick {
  min-width: 120px;
  background: linear-gradient(180deg, #f3bb5c, #cf8a1c);
  color: #221703;
  font-size: 15px;
  animation: slackPulse 0.9s ease-in-out infinite;
}

/* ---- 战报 ---- */
.event-log {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  padding: 10px 12px;
  max-height: 132px;
  overflow-y: auto;
}
.event-log-title { font-size: 11px; letter-spacing: 1px; color: var(--text-mute); margin-bottom: 6px; }
.event-log-list { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.log-item { animation: fadeUp 0.25s ease both; color: var(--text-dim); line-height: 1.5; }
.log-item.log-good { color: #b8e5a8; }
.log-item.log-scold { color: #ffd0a0; }
.log-item.log-punish { color: #ffab9d; }
.log-item.log-deduct { color: #ff9d99; font-weight: 700; }
.log-item.log-defeat { color: #fff; font-weight: 800; }

/* =========================== 8. 结算界面 ================================ */

.result-wrap { max-width: 720px; margin: 0 auto; text-align: center; }

.result-stamp {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  border: 4px double rgba(217, 83, 79, 0.85);
  color: #ffb3b0;
  transform: rotate(-9deg);
  box-shadow: 0 0 0 6px rgba(217, 83, 79, 0.1), 0 10px 26px rgba(0, 0, 0, 0.5);
  animation: stampIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.result-stamp.is-victory { border-color: rgba(142, 208, 122, 0.9); color: #cdf0c2; box-shadow: 0 0 0 6px rgba(142, 208, 122, 0.12), 0 10px 26px rgba(0, 0, 0, 0.5); }
.stamp-grade { font-family: var(--font-num); font-size: 54px; font-weight: 900; line-height: 1; }
.stamp-title { font-size: 12px; letter-spacing: 3px; margin-top: 4px; }

.result-headline { font-size: 26px; letter-spacing: 6px; margin: 18px 0 6px; }
.result-comment { font-size: 13px; color: var(--text-dim); margin: 0 0 16px; line-height: 1.7; }

.result-score-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 30px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--panel-border);
  margin-bottom: 16px;
}
.result-score { font-family: var(--font-num); font-size: 46px; font-weight: 900; color: var(--accent); line-height: 1; }
.result-score-label { font-size: 11px; letter-spacing: 2px; color: var(--text-mute); margin-top: 4px; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.result-cell {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.result-cell span { font-size: 11px; color: var(--text-mute); }
.result-cell b { font-family: var(--font-num); font-size: 19px; color: #fff; }

.result-tallies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-bottom: 18px;
}
.tally {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}
.tally b { color: #fff; font-family: var(--font-num); }

.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }

/* =========================== 9. 反馈动画层 ============================== */

.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }

.float-text {
  position: absolute;
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  animation: floatUp 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  white-space: nowrap;
}
.float-text.up { color: #a8e694; }
.float-text.down { color: #ff9d99; }

.deduct-pop {
  position: absolute;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(140, 27, 23, 0.94);
  border: 2px solid #ff9d99;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  animation: deductPop 1.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  white-space: nowrap;
}

.toast-layer {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(20, 25, 12, 0.96);
  border: 1px solid var(--panel-border);
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  text-align: center;
}
.toast.is-out { animation: toastOut 0.35s ease forwards; }
.toast.tone-good { border-color: rgba(142, 208, 122, 0.6); color: #d6f0cc; }
.toast.tone-bad { border-color: rgba(217, 83, 79, 0.65); color: #ffc9c6; }
.toast.tone-warn { border-color: rgba(226, 161, 58, 0.65); color: #ffe0ac; }

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 4, 0.72);
  backdrop-filter: blur(3px);
  padding: 18px;
}
.modal-layer.is-open { display: flex; animation: fadeIn 0.25s ease both; }
.modal {
  width: min(94vw, 520px);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel-bg-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
  animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: 2px; color: var(--camo-tan); }
.modal p { font-size: 13px; color: var(--text-dim); line-height: 1.8; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* 全屏效果：倒下 / 闪光 / 抖动 */
.screen-shake { animation: shakeX 0.45s ease; }
.screen-flash::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(217, 83, 79, 0.05), rgba(160, 20, 16, 0.5));
  pointer-events: none;
  z-index: 55;
  animation: flashOut 0.5s ease forwards;
}

.blackout {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.86);
  animation: fadeIn 0.8s ease both;
}
.blackout-inner { text-align: center; }
.blackout-title {
  font-size: clamp(44px, 14vw, 88px);
  font-weight: 900;
  letter-spacing: 12px;
  color: #ff9d99;
  text-shadow: 0 0 30px rgba(217, 83, 79, 0.6);
  animation: fallDown 1.1s cubic-bezier(0.5, 0, 0.75, 0) both;
}
.blackout-sub { font-size: 14px; color: var(--text-dim); margin-top: 12px; letter-spacing: 2px; }

/* =========================== 10. 关键帧动画 ============================= */

@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-26px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: scale(1); } }
@keyframes cardIn { from { opacity: 0; transform: scale(0.9) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes correctPop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(7px); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}
/* 注意：这里必须带上 translateX(-50%)，否则关键帧的 transform 会覆盖
   .float-text 内联的水平居中，飘字会从锚点右侧铺开、贴边的“满意度”被裁掉。 */
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.9); }
  18% { opacity: 1; transform: translate(-50%, -6px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -64px) scale(1); }
}
@keyframes deductPop {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6) rotate(-6deg); }
  20% { opacity: 1; transform: translate(-50%, -14px) scale(1.12) rotate(2deg); }
  40% { transform: translate(-50%, -20px) scale(1) rotate(-1deg); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1.05); }
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px); } }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes badgeBump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes lowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 83, 79, 0); } 50% { box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.3); } }
@keyframes bubblePop { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes shoutShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes instTalk { 0% { transform: none; } 50% { transform: translateY(-3px); } 100% { transform: none; } }
@keyframes alarmShake { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes clockTick { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes peek { 0%, 100% { transform: translateX(-6px) rotate(-6deg); } 50% { transform: translateX(6px) rotate(6deg); } }
@keyframes slackPulse {
  0%, 100% { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(226, 161, 58, 0.55); }
  50% { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 0 12px rgba(226, 161, 58, 0); }
}
@keyframes urgentGlow {
  0%, 100% { box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(255, 215, 94, 0.5); border-color: rgba(207, 224, 106, 0.6); }
  50% { box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 22px 4px rgba(255, 215, 94, 0.35); border-color: #ffd75e; }
}
@keyframes stampIn {
  0% { opacity: 0; transform: scale(2.6) rotate(-26deg); }
  60% { opacity: 1; transform: scale(0.94) rotate(-9deg); }
  100% { opacity: 1; transform: scale(1) rotate(-9deg); }
}
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fallDown {
  0% { opacity: 0; transform: translateY(-40px) rotate(-6deg); }
  60% { opacity: 1; transform: translateY(0) rotate(-3deg); }
  100% { opacity: 1; transform: translateY(6px) rotate(-3deg); }
}

/* =========================== 11. 响应式 ================================= */

@media (max-width: 720px) {
  .app { padding: 8px 10px 18px; }
  .hud-row-bars { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hud-nickname { max-width: 90px; font-size: 14px; }
  .hud-clock-time { font-size: 18px; }
  .quiz-grid { grid-template-columns: 1fr; gap: 8px; }
  .quiz-btn { font-size: 15px; padding: 13px 12px; }
  .bubble { font-size: 15px; min-width: 100%; }
  .bubble::before { display: none; }
  .btn-report { font-size: 20px; letter-spacing: 3px; padding: 16px 12px; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .wake-actions .btn { min-width: 140px; flex: 1; }
  .dress-actions { grid-template-columns: 1fr; }
  .stat-head { font-size: 11px; }
  .result-stamp { width: 112px; height: 112px; }
  .stamp-grade { font-size: 42px; }
}

@media (max-width: 400px) {
  .hud-row-bars { grid-template-columns: repeat(2, 1fr); }
  .hud-badge-label { display: none; }
}

/* 减少动画偏好：尊重系统设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
