/* ==========================================================================
   军训像素小人 · 样式表
   - 军事 / 迷彩 / 像素风主题
   - 所有动画使用 CSS keyframes，纯 CSS 绘制天空、太阳、云、山、地面、雨
   - 无任何外部字体或图片资源（离线也能正常显示）
   ========================================================================== */

/* ------------------------------- 基础变量 ------------------------------- */
:root {
  --khaki-900: #16200f;
  --khaki-800: #1d2a16;
  --khaki-700: #26361c;
  --khaki-600: #2f4222;
  --khaki-500: #3d5629;
  --khaki-400: #557336;
  --khaki-300: #7d9a54;
  --khaki-200: #a9bf85;

  --paper: #e9e4cf;
  --paper-dim: #cfc9ad;

  --gold: #e6bf4d;
  --gold-deep: #b8912c;
  --red: #c0473a;
  --red-deep: #8e3027;
  --blue: #4b86b4;
  --green: #6aa84f;

  --ink: #10160c;
  --text: #eef3e4;

  --radius: 14px;
  --radius-sm: 9px;
  --border: 2px solid rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.35);
  --shadow-hard: 4px 4px 0 rgba(0, 0, 0, 0.45);

  --font-num: ui-monospace, "SFMono-Regular", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;          /* 防止任何长文本造成横向滚动 */
  background-color: var(--khaki-900);
  /* 迷彩底纹：多层径向渐变叠加，零图片依赖 */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(125, 154, 84, 0.30) 0 46px, transparent 47px),
    radial-gradient(circle at 68% 8%,  rgba(61, 86, 41, 0.55) 0 66px, transparent 67px),
    radial-gradient(circle at 88% 42%, rgba(125, 154, 84, 0.22) 0 52px, transparent 53px),
    radial-gradient(circle at 32% 62%, rgba(61, 86, 41, 0.50) 0 74px, transparent 75px),
    radial-gradient(circle at 78% 82%, rgba(169, 191, 133, 0.16) 0 58px, transparent 59px),
    radial-gradient(circle at 8% 90%,  rgba(47, 66, 34, 0.60) 0 70px, transparent 71px),
    linear-gradient(160deg, #1b2614 0%, #202d18 45%, #16200f 100%);
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
}

/* 禁止画布被浏览器平滑放大，保持像素锐利 */
.pixel-lock .pixel-canvas {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

button { font-family: inherit; }

/* ------------------------------- 顶部栏 ------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(22, 32, 15, 0.96), rgba(29, 42, 22, 0.92));
  border-bottom: 3px solid var(--khaki-500);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(4px);
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-badge {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 22px;
  color: var(--gold);
  background: radial-gradient(circle at 35% 30%, #5a2f2a, #2a1512);
  border: 2px solid var(--gold-deep);
  border-radius: 50%;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.7), 0 0 12px rgba(230, 191, 77, 0.25);
  animation: badge-pulse 3.2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: inset 0 0 8px rgba(0,0,0,.7), 0 0 10px rgba(230,191,77,.2); }
  50%      { transform: scale(1.06); box-shadow: inset 0 0 8px rgba(0,0,0,.7), 0 0 18px rgba(230,191,77,.45); }
}

.brand-text h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 2px;
  color: var(--paper);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}
.brand-text p {
  margin: 0;
  font-size: 12px;
  color: var(--khaki-200);
  letter-spacing: 1px;
}

.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  border: var(--border);
  background: linear-gradient(180deg, var(--khaki-400), var(--khaki-600));
  color: var(--text);
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  box-shadow: var(--shadow-hard);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.chip:hover  { filter: brightness(1.15); transform: translateY(-1px); }
.chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0,0,0,.45); }
.chip-danger { background: linear-gradient(180deg, #b6503f, #7d2f24); }
.chip.is-off  { filter: grayscale(0.7) brightness(0.8); }

/* ------------------------------- 主布局 ------------------------------- */
.app-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

.panel {
  background: linear-gradient(180deg, rgba(38, 54, 28, 0.95), rgba(29, 42, 22, 0.95));
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px 14px;
  position: relative;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px dashed rgba(169, 191, 133, 0.28);
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--paper);
}

.pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--khaki-600);
  border: 1px solid rgba(0, 0, 0, 0.5);
  color: var(--khaki-200);
  white-space: nowrap;
}
.pill-rank  { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #2a1f06; font-weight: 700; }
.pill-watch { background: #4a2b23; color: #ffd9c9; border-color: #7d3a2b; }
.pill-watch.is-near { background: #7d2f24; color: #fff; animation: watch-blink 0.7s steps(2, end) infinite; }
@keyframes watch-blink { 50% { background: #c0473a; } }

.side { display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------- 舞台 ------------------------------- */
.stage {
  position: relative;
  height: 380px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45);
  transition: filter 0.5s ease;
  isolation: isolate;
}

/* 天空：随 data-time 变化 */
.sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #7fb6d9 0%, #b7d8e8 55%, #d9e6c9 100%);
  transition: background 1.2s ease, filter 1.2s ease;
}
.stage[data-time="dawn"] .sky  { background: linear-gradient(180deg, #f0a868 0%, #f6cf9a 50%, #e8e2c0 100%); }
.stage[data-time="noon"] .sky  { background: linear-gradient(180deg, #6fb0e8 0%, #a9d6f0 55%, #dcecd2 100%); }
.stage[data-time="dusk"] .sky  { background: linear-gradient(180deg, #c96f4a 0%, #e5a877 50%, #dfd3ae 100%); }
.stage[data-time="night"] .sky { background: linear-gradient(180deg, #101a33 0%, #22305a 55%, #2f3a4d 100%); }
.stage[data-time="rain"]  .sky { background: linear-gradient(180deg, #6b7c8a 0%, #8c9aa4 55%, #aeb8ad 100%); }

/* 太阳 */
.sun {
  position: absolute;
  top: 24px; right: 46px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fff6c9, #ffd45e 55%, #f2a93b);
  box-shadow: 0 0 26px rgba(255, 214, 94, 0.75);
  animation: sun-float 6s ease-in-out infinite;
  transition: opacity 0.8s ease, transform 1s ease;
}
.stage[data-time="night"] .sun { opacity: 0; transform: translateY(-16px); }
.stage[data-time="rain"]  .sun { opacity: 0.18; }
@keyframes sun-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* 云 */
.cloud {
  position: absolute;
  height: 26px; width: 84px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  filter: blur(0.4px);
  box-shadow: 22px -12px 0 -4px rgba(255,255,255,.92), -22px -8px 0 -6px rgba(255,255,255,.85);
  animation: cloud-move 34s linear infinite;
}
.cloud-a { top: 52px; left: -100px; animation-duration: 42s; }
.cloud-b { top: 96px; left: -160px; transform: scale(0.72); animation-duration: 58s; animation-delay: 6s; }
@keyframes cloud-move {
  from { transform: translateX(0); }
  to   { transform: translateX(140vw); }
}
.stage[data-time="night"] .cloud { opacity: 0.22; }

/* 远山 */
.far-hills {
  position: absolute;
  left: 0; right: 0; bottom: 84px;
  height: 96px;
  background:
    radial-gradient(ellipse at 18% 100%, #6d8a5c 0 42%, transparent 43%),
    radial-gradient(ellipse at 44% 100%, #5d7a4d 0 36%, transparent 37%),
    radial-gradient(ellipse at 76% 100%, #6f8c5e 0 46%, transparent 47%);
  opacity: 0.85;
}

/* 地面 */
.ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 96px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.10) 0 3px, transparent 3px 14px),
    linear-gradient(180deg, #7c9a56 0%, #5f7d40 45%, #47602f 100%);
  box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.28);
}
.ground::after {
  /* 操场白线 */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 26px;
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.65) 0 26px, transparent 26px 48px);
  opacity: 0.7;
}

/* 画布浮层 */
.stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.stage-clock {
  align-self: flex-start;
  margin: 10px 0 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(16, 22, 12, 0.72);
  border: 2px solid rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--font-num);
  font-size: 15px;
  letter-spacing: 1px;
}

.warn-banner {
  align-self: center;
  margin-top: -14px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #d9603f, #8e2f22);
  border: 3px solid #3a120c;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 0 0 rgba(217, 96, 63, 0.7), var(--shadow-soft);
  opacity: 0;
  transform: translateY(-14px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.warn-banner.is-show {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: warn-pulse 0.85s ease-out infinite;
}
@keyframes warn-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(217, 96, 63, 0.75), var(--shadow-soft); }
  100% { box-shadow: 0 0 0 18px rgba(217, 96, 63, 0), var(--shadow-soft); }
}

/* 浮动数字层 */
.float-layer { position: absolute; inset: 0; overflow: hidden; }
.float-num {
  position: absolute;
  font-family: var(--font-num);
  font-weight: 800;
  font-size: 20px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
  animation: float-up 1.25s ease-out forwards;
  white-space: nowrap;
}
@keyframes float-up {
  0%   { opacity: 0; transform: translateY(6px) scale(0.8); }
  18%  { opacity: 1; transform: translateY(-4px) scale(1.12); }
  100% { opacity: 0; transform: translateY(-52px) scale(1); }
}

/* 人物站位 */
.stage-figures {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 46px;
  padding: 0 26px 14px 0;
}
.figure-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.cadet-slot { padding-bottom: 4px; }

.cadet-canvas  { width: 128px; height: 192px; }
.instructor-canvas { width: 72px; height: 132px; }

/* 教官：平时站在较远处并隐身，靠近时淡入 */
.instructor-canvas {
  opacity: 0;
  transform: translateX(26px) scale(0.94);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.stage.instructor-near .instructor-canvas { opacity: 1; transform: translateX(0) scale(1); }
.stage.instructor-close .instructor-canvas { opacity: 1; transform: translateX(-8px) scale(1.04); }

.cadet-canvas { transition: transform 0.35s cubic-bezier(.34,1.56,.64,1); }
.cadet-canvas.face-back { transform: scaleX(1); }

/* 小人影子 */
.shadow {
  width: 84px; height: 12px;
  margin-top: -8px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45), transparent 70%);
  animation: shadow-breathe 2.4s ease-in-out infinite;
}
@keyframes shadow-breathe { 0%,100% { transform: scaleX(1); opacity: .85; } 50% { transform: scaleX(0.9); opacity: .65; } }

/* 指令气泡（挂在教官头上） */
.order-bubble {
  position: relative;
  min-height: 34px;
  max-width: 240px;
  margin-bottom: 10px;
  padding: 7px 13px;
  background: var(--paper);
  color: #23200f;
  border: 3px solid #3a3520;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.order-bubble::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -11px;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #3a3520;
}
.order-bubble.is-show { opacity: 1; transform: translateY(0) scale(1); }
.order-bubble.is-order { animation: bubble-pop 0.34s cubic-bezier(.34,1.6,.64,1); }
.order-bubble.is-correct { background: #cdeec2; border-color: #2f6b23; }
.order-bubble.is-wrong   { background: #f5c9bf; border-color: #8e3027; animation: shake 0.4s ease; }
@keyframes bubble-pop { 0% { transform: scale(0.8) rotate(-3deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px) rotate(-2deg); }
  75% { transform: translateX(5px) rotate(2deg); }
}

/* 天气：雨 */
.weather-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  background-image:
    repeating-linear-gradient(101deg, rgba(226, 240, 255, 0.75) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(101deg, rgba(200, 222, 240, 0.5) 0 1px, transparent 1px 17px);
  background-size: 100% 120px, 100% 180px;
  animation: rain-fall 0.55s linear infinite;
  pointer-events: none;
}
.stage[data-weather="rain"] .weather-layer { opacity: 0.85; }
.stage[data-weather="rain"] { filter: saturate(0.75) brightness(0.94); }
@keyframes rain-fall {
  from { background-position: 0 0, 40px 0; }
  to   { background-position: -14px 120px, 26px 180px; }
}

/* 夜晚压暗层 */
.weather-night {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 16, 40, 0.55), rgba(10, 16, 40, 0.12));
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.stage[data-time="night"] .weather-night { opacity: 1; }

/* 训练进度 */
.train-progress { margin-top: 12px; }
.bar-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--khaki-200);
  margin-bottom: 5px;
}
.bar-value { font-family: var(--font-num); color: var(--paper); }

.bar {
  position: relative;
  height: 13px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}
.bar .fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.4s ease;
  background-image: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 55%);
}
.bar-progress .fill { background-color: var(--gold); }
.bar-exp      .fill { background-color: var(--blue); }
.bar-hunger   .fill { background-color: #d9a441; }
.bar-stamina  .fill { background-color: #5fbf6a; }
.bar-will     .fill { background-color: #d2604f; }

/* 数值告急时闪烁 */
.stat.is-low .stat-value { color: #ff8f7a; animation: low-blink 1s steps(2, end) infinite; }
.stat.is-low .bar .fill  { background-color: var(--red); }
@keyframes low-blink { 50% { opacity: 0.35; } }

/* 属性面板 */
.exp-block { margin-bottom: 12px; }
.rank-tip { margin: 6px 0 0; font-size: 12px; color: var(--khaki-200); }

.stat-list { display: flex; flex-direction: column; gap: 9px; }
.stat-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--paper); margin-bottom: 4px;
}
.stat-value { font-family: var(--font-num); color: var(--khaki-200); }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.mini {
  text-align: center;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
}
.mini b { display: block; font-family: var(--font-num); font-size: 17px; color: var(--gold); }
.mini span { font-size: 11px; color: var(--khaki-200); }

/* 早饭面板 */
.meal-panel {
  border-color: rgba(230, 191, 77, 0.55);
  box-shadow: 0 0 0 2px rgba(230, 191, 77, 0.18), var(--shadow-soft);
  animation: fade-slide 0.3s ease;
}
.meal-tip {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--khaki-200);
}
.meal-tip b { color: var(--gold); }
.meal-actions { display: flex; flex-direction: column; gap: 8px; }
.meal-actions .btn { width: 100%; }
.meal-actions .btn-ghost {
  background: rgba(233, 228, 207, 0.92);
  color: #23200f;
  border-color: rgba(0, 0, 0, 0.5);
}
.meal-actions .btn:disabled { filter: grayscale(0.7) brightness(0.7); cursor: not-allowed; }

/* 指令面板 */
.order-box {
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(169, 191, 133, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 84px;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.order-box.is-active { border-color: var(--gold); background: rgba(230, 191, 77, 0.12); animation: order-glow 1.1s ease-in-out infinite; }
@keyframes order-glow {
  0%, 100% { box-shadow: inset 0 0 0 rgba(230, 191, 77, 0); }
  50%      { box-shadow: inset 0 0 22px rgba(230, 191, 77, 0.28); }
}
.order-main { margin: 0; font-size: 16px; font-weight: 700; color: var(--paper); }
.order-sub  { margin: 6px 0 0; font-size: 12px; color: var(--khaki-200); }

/* 动作按钮 */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.act {
  position: relative;
  padding: 13px 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1b2410;
  border: 3px solid rgba(0, 0, 0, 0.55);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-hard);
  transition: transform 0.1s ease, filter 0.12s ease, box-shadow 0.1s ease;
  background-image: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0) 60%);
}
.act:hover:not(:disabled) { filter: brightness(1.08); }
.act:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.act:disabled { filter: grayscale(0.75) brightness(0.72); cursor: not-allowed; }

.act-stand  { background-color: #9fbf7a; }
.act-standup { background-color: #8fc99b; }
.act-salute { background-color: #e0c069; }
.act-turn   { background-color: #8fb8d8; }
.act-march  { background-color: #b0d2a1; }
.act-slack  { background-color: #d59a86; grid-column: span 2; }

/* 正在偷懒时，把「立正 / 恢复」高亮闪烁，提示玩家要先站起来 */
body.slacking .act-standup {
  animation: standup-blink 0.8s steps(2, end) infinite;
}
@keyframes standup-blink {
  50% { filter: brightness(1.35) saturate(1.4); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), var(--shadow-hard); }
}

.turn-menu {
  margin-top: 11px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.32);
  border: 2px solid rgba(230, 191, 77, 0.5);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  animation: fade-slide 0.25s ease;
}
@keyframes fade-slide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.turn-title { font-size: 12px; color: var(--khaki-200); width: 100%; }
.turn-btn {
  flex: 1 1 auto;
  min-width: 92px;
  padding: 9px 8px;
  font-size: 14px;
  font-weight: 700;
  color: #1b2410;
  background: linear-gradient(180deg, #cfd8c0, #a7b795);
  border: 2px solid rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
  transition: filter 0.12s ease, transform 0.1s ease;
}
.turn-btn:hover  { filter: brightness(1.1); }
.turn-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.turn-cancel { background: linear-gradient(180deg, #e2b3a8, #c07f70); }

.action-hint {
  margin: 11px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--khaki-200);
  border-left: 3px solid var(--khaki-400);
  padding-left: 9px;
}

/* 日志 */
.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 210px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
}
.log-list li {
  font-size: 12.5px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.26);
  border-left: 3px solid var(--khaki-400);
  color: #dfe6d2;
  animation: log-in 0.28s ease;
}
.log-list li.is-good { border-left-color: var(--green); }
.log-list li.is-bad  { border-left-color: var(--red); color: #ffd9d1; }
.log-list li.is-warn { border-left-color: var(--gold); color: #ffeec2; }
@keyframes log-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* ------------------------------- 页脚 ------------------------------- */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--khaki-300);
  padding: 14px 12px 26px;
  letter-spacing: 1px;
}
.app-footer .dot { opacity: 0.5; margin: 0 6px; }

/* ------------------------------- 弹窗 ------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 12, 6, 0.78);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: fade-in 0.25s ease;
}
.modal[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: min(520px, 100%);
  background: linear-gradient(180deg, #f3efdd, #ddd7bd);
  color: #23200f;
  border: 4px solid #2b3a1d;
  border-radius: 16px;
  padding: 22px 20px 20px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  animation: card-in 0.32s cubic-bezier(.34,1.5,.64,1);
}
.modal-card-wide { width: min(700px, 100%); }
@keyframes card-in { from { opacity: 0; transform: translateY(22px) scale(0.96); } to { opacity: 1; transform: none; } }

.modal-band {
  height: 12px;
  margin: -22px -20px 16px;
  border-radius: 12px 12px 0 0;
  background: repeating-linear-gradient(45deg, #3d5629 0 10px, #557336 10px 20px, #2f4222 20px 30px);
}
.modal-band.band-gold { background: repeating-linear-gradient(45deg, #e6bf4d 0 12px, #b8912c 12px 24px); }

.modal-card h3 { margin: 0 0 10px; font-size: 20px; letter-spacing: 2px; color: #22300f; }
.modal-desc { margin: 0 0 14px; font-size: 13.5px; line-height: 1.75; color: #3b3a26; }

.field { margin-bottom: 12px; flex: 1 1 140px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; color: #3b3a26; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: #23200f;
  background: #fffdf3;
  border: 3px solid #7f8f6b;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field input:focus, .field select:focus {
  border-color: #3d5629;
  box-shadow: 0 0 0 4px rgba(85, 115, 54, 0.25);
}
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 3px solid rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, filter 0.12s ease;
  color: #23200f;
  background: #ddd7bd;
}
.btn:hover  { filter: brightness(1.06); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-primary { background: linear-gradient(180deg, #86ab5c, #4e6b32); color: #fdfbe9; }
.btn-ghost   { background: transparent; color: #3b3a26; border-color: #8b9478; }
.btn-block   { display: block; width: 100%; margin-top: 10px; }

.rules { margin-top: 14px; font-size: 12.5px; color: #3b3a26; }
.rules summary { cursor: pointer; font-weight: 700; color: #3d5629; }
.rules ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.85; }

.summary-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.summary-list li {
  background: rgba(61, 86, 41, 0.12);
  border: 2px solid rgba(61, 86, 41, 0.28);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13px;
}
.summary-list li b { color: #2f4a1c; }

/* 结算 */
.end-kicker { text-align: center; letter-spacing: 6px; font-size: 12px; margin: 0 0 4px; color: #6b6a4d; }
.end-name   { text-align: center; font-size: 30px; margin: 0 0 2px; letter-spacing: 4px; color: #22300f; }
.end-rank   { text-align: center; margin: 0 0 6px; font-size: 15px; color: #3b3a26; }
.end-rank b { font-size: 20px; color: #8a6a12; letter-spacing: 2px; }
.end-medal  { text-align: center; font-size: 62px; line-height: 1; margin: 6px 0 14px; animation: medal-pop 1.6s ease-in-out infinite; }
@keyframes medal-pop { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.09) rotate(2deg); } }

.end-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}
.end-item {
  text-align: center;
  background: rgba(61, 86, 41, 0.12);
  border: 2px solid rgba(61, 86, 41, 0.3);
  border-radius: 10px;
  padding: 8px 4px;
}
.end-item b { display: block; font-family: var(--font-num); font-size: 20px; color: #2f4a1c; }
.end-item span { font-size: 11.5px; color: #4b4a35; }

.end-sub { margin: 0 0 8px; font-size: 14px; color: #22300f; letter-spacing: 1px; }
.table-wrap { max-height: 210px; overflow-y: auto; border: 2px solid rgba(61, 86, 41, 0.3); border-radius: 10px; }
.end-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.end-table th, .end-table td { padding: 6px 8px; text-align: center; border-bottom: 1px solid rgba(61, 86, 41, 0.2); }
.end-table th { position: sticky; top: 0; background: #cfd3b4; color: #22300f; font-weight: 700; }
.end-table tr:nth-child(even) td { background: rgba(61, 86, 41, 0.07); }
.end-table td.pos { color: #2f6b23; font-weight: 700; }
.end-table td.neg { color: #a8341f; font-weight: 700; }

.end-comment {
  margin: 12px 0 0;
  padding: 11px 13px;
  background: rgba(230, 191, 77, 0.2);
  border-left: 4px solid var(--gold-deep);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #3b3a26;
}
.end-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.end-actions .btn { flex: 1 1 auto; }

.board-list { margin: 0 0 14px; padding-left: 22px; font-size: 13.5px; }
.board-list li { margin-bottom: 5px; }
.board-list li b { color: #2f4a1c; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  padding: 11px 20px;
  background: rgba(16, 22, 12, 0.95);
  color: var(--paper);
  border: 2px solid var(--khaki-400);
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow-soft);
  animation: toast-in 0.28s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------- 响应式 ------------------------------- */
@media (max-width: 980px) {
  .app-main { grid-template-columns: minmax(0, 1fr); }
  .stage { height: 330px; }
  .stage-figures { gap: 26px; padding-right: 14px; }
  .cadet-canvas { width: 104px; height: 156px; }
  .instructor-canvas { width: 58px; height: 106px; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .brand-text h1 { font-size: 16px; }
  .brand-text p { display: none; }
  .stage { height: 290px; }
  .stage-figures { justify-content: center; gap: 12px; padding: 0 8px 10px; }
  .cadet-canvas { width: 88px; height: 132px; }
  .instructor-canvas { width: 48px; height: 88px; }
  .order-bubble { max-width: 150px; font-size: 12px; padding: 5px 9px; }
  .summary-list { grid-template-columns: minmax(0, 1fr); }
  .end-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .end-name { font-size: 24px; }
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 尊重系统「减少动画」偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.05s !important;
  }
}
