/* 高原施工现场：沿用六套主题，人物与路基保持清晰的材质色。 */
.rp-operation {
  --rp-earth: #d5c4a6;
  --rp-earth-deep: #b5a187;
  --rp-rock: #9c998a;
  --rp-snow: #f4f6ed;
  --rp-roadbed: #a7957e;
  --rp-slab: #b4bba8;
  --rp-slab-side: #89957f;
  --rp-post: #6e7563;
  --rp-grass: #7b906c;
  --rp-shadow: rgba(64, 68, 52, .18);
}
:root[data-theme="classic"] .rp-operation {
  --rp-earth: #646655;
  --rp-earth-deep: #444e41;
  --rp-rock: #89907c;
  --rp-snow: #ced9cb;
  --rp-roadbed: #353f35;
  --rp-slab: #9fae91;
  --rp-slab-side: #6a8060;
  --rp-post: #c4c7a9;
  --rp-grass: #a0af7e;
  --rp-shadow: rgba(9, 18, 12, .3);
}
.conduct-operation.rp-operation { grid-template-rows: minmax(42px, max-content) minmax(0, 1fr); }
.rp-operation .game-heading { grid-template-columns: minmax(0, 1fr) max-content; padding-bottom: 6px; }
.rp-operation .game-heading-title { color: var(--theme-text); }
.rp-operation .game-timer { color: var(--theme-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-operation .game-timer .timer-label { color: var(--theme-secondary); font-size: 12px; }
.rp-operation .game-timer .timer-value { font-size: 24px; line-height: 1.2; }
.rp-operation .game-timer .timer-unit { font-size: 12px; }
.rp-operation .game-timer.urgent { color: var(--theme-danger); }
:root .rp-operation .game-board {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.road-worksite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(206px, 27%, 320px);
  gap: clamp(10px, 1.8vw, 24px);
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 660px;
  align-self: center;
  color: var(--theme-text);
}
.rp-scene {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--theme-line);
  border-radius: 24px;
  background: var(--theme-sky);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  isolation: isolate;
}
.rp-landscape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rp-tile-top { fill: var(--rp-slab); }
.rp-tile-side { fill: var(--rp-slab-side); }
.rp-tile-shine { stroke: var(--rp-snow); opacity: .48; }
.rp-tile-pending .rp-tile-top, .rp-tile-current .rp-tile-top { fill: var(--rp-roadbed); }
.rp-tile-pending .rp-tile-side, .rp-tile-current .rp-tile-side { opacity: .25; }
.rp-tile-pending .rp-tile-shine, .rp-tile-current .rp-tile-shine { opacity: 0; }
.rp-rubble { fill: var(--rp-rock); }
.rp-tile-laid .rp-rubble, .rp-tile-cracked .rp-rubble { display: none; }
.rp-crack { stroke: #75483c; display: none; }
.rp-tile-cracked .rp-crack { display: block; }
.rp-tile-cracked .rp-tile-top { fill: #c9947c; }
.rp-tile-cracked .rp-tile-side { fill: #97695a; }
.rp-target { stroke: var(--theme-primary); }
.rp-milepost text { fill: #53614e; font-size: 8px; font-weight: 700; }
.rp-impact { color: #d8c795; pointer-events: none; }
.rp-impact-break { color: #946752; }
.rp-worker { pointer-events: none; }
.rp-controls {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  min-height: 0;
  gap: clamp(16px, 3vh, 28px);
  padding: 16px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* 自动外边距只分配剩余空间，矮屏时归零，进度不会再因居中而向上溢出。 */
.rp-controls > * { flex: 0 0 auto; }
.rp-progress { margin-top: auto; }
.rp-action-panel, .rp-event-panel { margin-bottom: auto; }
.rp-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rp-progress-head strong { color: var(--theme-primary); font-size: clamp(32px, 3vw, 42px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.4; white-space: nowrap; }
.rp-progress-head small { margin-left: 2px; font-size: 16px; }
.rp-mistakes { color: var(--theme-secondary); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-mistakes b { color: var(--theme-text); font-weight: 650; }
.rp-damage-count, .rp-damage-count b { color: var(--theme-danger); }
.rp-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.rp-section { height: 6px; overflow: hidden; border-radius: 4px; background: rgba(var(--theme-primary-rgb), .12); }
.rp-section b { display: block; width: 100%; height: 100%; transform-origin: left center; background: var(--theme-primary); transition: transform .18s ease-out; }
.rp-section.done b { background: var(--theme-success); }
.rp-feedback { display: flex; min-height: 52px; align-items: center; gap: 9px; padding: 12px; border: 1px solid rgba(var(--theme-primary-rgb), .13); border-radius: 14px; background: rgba(var(--theme-surface-rgb), .72); }
.rp-feedback-light { flex: 0 0 7px; height: 7px; border-radius: 50%; background: var(--theme-primary); box-shadow: 0 0 0 4px rgba(var(--theme-primary-rgb), .09); }
.rp-tone-ready .rp-feedback-light, .rp-tone-pass .rp-feedback-light { background: var(--theme-success); box-shadow: 0 0 0 4px rgba(var(--theme-success-rgb), .1); }
.rp-tone-damage .rp-feedback-light { background: var(--theme-danger); box-shadow: 0 0 0 4px rgba(var(--theme-danger-rgb), .1); }
.rp-tone-damage .rp-feedback { border-color: rgba(var(--theme-danger-rgb), .25); background: rgba(var(--theme-danger-rgb), .07); }
.rp-tone-event .rp-feedback-light { background: var(--theme-warning); box-shadow: 0 0 0 4px rgba(var(--theme-warning-rgb), .12); }
.rp-feedback strong { display: block; min-width: 0; font-size: 15px; line-height: 1.4; font-weight: 650; }
.rp-action-panel { display: grid; gap: 10px; }
.rp-cadence { height: 6px; border-radius: 5px; overflow: hidden; background: rgba(var(--theme-primary-rgb), .12); }
.rp-cadence > span { display: block; width: 100%; height: 100%; transform-origin: left center; background: var(--theme-primary); }
.rp-cadence.ready > span { background: var(--theme-success); }
.rp-pave-button, .rp-event-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 55px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--theme-primary);
  color: var(--theme-on-primary);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background-color .12s ease;
}
.rp-pave-button svg { width: 25px; height: 25px; flex: 0 0 25px; }
.rp-pave-button:not(.is-ready) { background: var(--theme-secondary); }
.rp-pave-button.is-repair.is-ready { background: var(--theme-warning); }
.rp-pave-button:disabled, .rp-event-action:disabled { opacity: .65; cursor: default; }
.rp-pave-button:active:not(:disabled), .rp-event-action:active:not(:disabled) { transform: scale(.97); }
.rp-pave-button:focus-visible, .rp-event-action:focus-visible { outline: 3px solid var(--theme-primary); outline-offset: 4px; }
.rp-event-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-event-action { min-width: 0; padding-inline: 6px; }
.rp-event-risk { background: rgba(var(--theme-surface-rgb), .65); color: var(--theme-secondary); border-color: var(--theme-line); }
.rp-completion-banner { position: absolute; top: 20%; right: 10%; left: 10%; display: flex; flex-direction: column; gap: 10px; text-align: center; color: var(--theme-text); }
.rp-completion-banner > span { color: var(--theme-success); font-size: 12px; font-weight: 700; letter-spacing: 3px; }
.rp-completion-banner strong { font-size: clamp(20px, 3vw, 34px); font-weight: 800; }
.rp-completion-banner strong span { display: inline-block; white-space: nowrap; }

@media (min-height: 750px) and (min-width: 1100px) {
  .road-worksite { max-height: 620px; }
}
@media (max-height: 600px), (max-width: 1050px) {
  .road-worksite { grid-template-columns: minmax(0, 1fr) 215px; gap: 14px; }
  .rp-scene { border-radius: 18px; }
  .rp-controls { padding: 0; gap: 16px; }
  .rp-progress-head strong { font-size: 32px; }
  .rp-mistakes { font-size: 13px; }
  .rp-feedback { padding: 10px; min-height: 44px; border-radius: 10px; }
  .rp-feedback strong { font-size: 14px; }
  .rp-pave-button, .rp-event-action { min-height: 48px; font-size: 15px; border-radius: 10px; }
  .rp-pave-button svg { width: 21px; height: 21px; flex-basis: 21px; }
  .rp-cadence { height: 5px; }
  .rp-action-panel { gap: 8px; }
  .rp-completion-banner { left: 7%; right: 47%; top: 20%; gap: 6px; text-align: left; }
  .rp-completion-banner strong { font-size: clamp(18px, 3vw, 25px); line-height: 1.35; }
}
@media (max-height: 420px) {
  .conduct-operation.rp-operation { grid-template-rows: minmax(34px, max-content) minmax(0, 1fr); }
  .rp-operation .game-timer .timer-value { font-size: 22px; }
  .road-worksite { grid-template-columns: minmax(0, 1fr) 204px; gap: 12px; }
  .rp-controls { gap: 12px; }
  .rp-progress-head strong { font-size: 28px; }
  .rp-feedback { min-height: 40px; padding: 8px 10px; }
  .rp-pave-button, .rp-event-action { min-height: 44px; font-size: 14px; }
}
@media (max-width: 690px), (max-height: 330px) {
  .road-worksite { grid-template-columns: minmax(0, 1fr) 184px; gap: 10px; }
  .rp-progress-head { gap: 6px; }
  .rp-progress-head strong { font-size: 26px; }
  .rp-progress-head small { font-size: 14px; }
  .rp-feedback { gap: 7px; padding: 8px; }
  .rp-pave-button { gap: 6px; padding: 8px; }
  .rp-scene { border-radius: 12px; }
}
@media (max-height: 330px) {
  .rp-controls { gap: 6px; }
  .rp-progress-head strong { font-size: 24px; }
  .rp-sections { margin-top: 6px; }
  .rp-section, .rp-cadence { height: 4px; }
  .rp-action-panel { gap: 6px; }
  .rp-feedback { min-height: 28px; padding: 2px 8px; }
}
@media (max-height: 280px) {
  .rp-operation .game-heading { padding-bottom: 4px; }
  .rp-feedback { padding-block: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-section b, .rp-pave-button, .rp-event-action { transition: none; }
}
.reduced .rp-section b, .reduced .rp-pave-button, .reduced .rp-event-action { transition: none; }
