/* =========================================================
   Buildathon 2026 · 现场倒计时
   Faithful to the brand spec — acrylic-cut plates on blueprint
   ========================================================= */

@font-face {
  font-family: "Phonic";
  src: url("assets/fonts/Phonic-MonospacedRegular.otf") format("opentype");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "Advent Pro";
  src: url("assets/fonts/AdventPro-VariableFont_wdth,wght.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: block;
}

:root {
  /* Palette — v2 "orange chip" keyvisual variant, sampled from build-mark.png */
  --bg:            #0a0a0a;
  --grid:          rgba(90, 130, 200, 0.14);   /* blueprint blue */
  --grid-major:    rgba(90, 130, 200, 0.24);

  /* MDF / cardboard-cut cream letter plates */
  --mdf:           #c8b591;     /* main letter face */
  --mdf-2:         #b09e7c;     /* seam under-half */
  --mdf-edge:      #6b5b3d;
  --mdf-hole:      #201a10;

  --white:         #ffffff;
  --grey:          #b6b6b6;     /* brand grey — Pantone Cool Gray, spec p13 */
  --ink:           #000000;     /* brand black — spec p13 */
  --offwhite:      #f9f9f7;     /* brand off-white knockout — spec p13 */

  --orange:        #ff6f1f;     /* brand orange — Pantone 1585 C, spec p13 */
  --lime:          #f7ffbd;     /* brand pale yellow — Pantone yellow 0131 C, spec p13 */
  --green:         #07772a;     /* brand green — Pantone 3522 C, spec p13 */
  --sky:           #1a44c4;     /* brand blue — Pantone 2145 C, spec p13 */
  --pink:          #f290d3;
  --xhs:           #ff2442;

  --f-mono: "Phonic", "SFMono-Regular", Menlo, monospace;
  --f-disp: "Advent Pro", "Phonic", system-ui, sans-serif;
  --f-cn:   "PingFang SC", "Microsoft YaHei", sans-serif;

  --grid-pitch: 40px;
  --ease-out: cubic-bezier(.22,1,.36,1);

  /* Golden-ratio layout tokens — φ = 1.618, φ⁻³ ≈ 0.236, φ⁻⁴ ≈ 0.146 */
  --safe-x:  clamp(44px, 3.4vw, 78px);   /* horizontal safe area — brand ~2.7% */
  --safe-y:  clamp(38px, 4.2vh, 60px);   /* vertical safe area — brand ~4.8% */
  --stage-shift-y: -2vh;                 /* nudge stage upward to counter top visual weight */
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--white);
  font-family: var(--f-mono);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
body { position: relative; }

/* =========================================================
   Blueprint grid — pinned, does not shift on resize
   ========================================================= */
.grid-bg {
  position: fixed; inset: 0; z-index: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-major) 1px, transparent 1px);
  background-size:
    var(--grid-pitch) var(--grid-pitch),
    var(--grid-pitch) var(--grid-pitch),
    calc(var(--grid-pitch) * 5) calc(var(--grid-pitch) * 5),
    calc(var(--grid-pitch) * 5) calc(var(--grid-pitch) * 5);
  pointer-events: none;
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

/* diagonal watermark strip — subtle, references print marks */
.watermark {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      -25deg,
      transparent 0, transparent 220px,
      rgba(255,255,255,0.018) 220px, rgba(255,255,255,0.018) 260px
    );
}

/* =========================================================
   XHS badge (top-left) — real asset extracted from brand spec p22
   Uses mix-blend-mode: lighten so the dark bg blends against page
   ========================================================= */
.xhs-badge {
  position: fixed;
  top: calc(var(--safe-y) + 34px); left: var(--safe-x);   /* nudged down to share optical center-line with the 铭牌 */
  z-index: 5;
  width: clamp(178px, 16vw, 300px);     /* enlarged for top-corner balance */
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* =========================================================
   BUILDATHON 2026 plate (top-right) — ORANGE with black text, 4 holes
   ========================================================= */
/* Real 铭牌 asset — vector-extracted from brand spec p24 (orange plate 2.70:1) */
.brand-plate {
  position: fixed;
  top: var(--safe-y); right: var(--safe-x);
  z-index: 5;
  width: clamp(244px, 23vw, 384px);
  height: auto;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}

/* =========================================================
   Ruler on the left (with 15/17/06 date-style readouts)
   ========================================================= */
.ruler {
  position: fixed;
  left: var(--safe-x);
  top: 50%;
  transform: translateY(calc(-50% + var(--stage-shift-y)));
  z-index: 4;
  width: 60px;
  height: 300px;
}
.ruler-line {
  position: absolute;
  left: 30px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: rgba(255,255,255,0.55);
}
.ruler-tick {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ruler-tick.top { top: 8%; }
.ruler-tick.mid { top: 40%; }
.ruler-tick.bot { top: 82%; }
.ruler-num {
  font-family: var(--f-mono);
  font-size: 16px;
  color: var(--white);
  line-height: 1;
  width: 26px;
  text-align: right;
}
.ruler-bar {
  height: 1px;
  width: 22px;
  background: var(--white);
  display: inline-block;
  margin-left: 4px;
}

/* =========================================================
   Right-side vertical tool chips (4 stacked)
   ========================================================= */
/* Real tool cluster asset — vector-extracted from brand spec p24.
   Anchored to the bottom-right (matches brand's lower-right placement) to
   balance the wordmark on the bottom-left after removing the LIVE chip. */
.tool-column {
  position: fixed;
  right: var(--safe-x);
  bottom: var(--safe-y);
  z-index: 4;
  height: clamp(240px, 46vh, 480px);
  width: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* =========================================================
   Bottom-left wordmark stack — Phonic Mono, only "BUILD" highlighted
   ========================================================= */
/* Brand spec p22 — 1:1 lockup: text left, FIXED-width green highlight block
   (green block width = 6.33× font, per p22: 209px block @ 33px font),
   thin green rule on the right at a small gap, spanning the full 4-line stack. */
.wordmark-stack {
  --wm-f: clamp(15px, 1.05vw, 24px);
  position: fixed;
  bottom: var(--safe-y);
  left: var(--safe-x);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-right: calc(var(--wm-f) * 0.42);   /* gap between block and rule (p22) */
}
.wordmark-rule {
  position: absolute;
  right: 0; top: 0; bottom: 0;               /* full stack height (p22) */
  width: max(2px, calc(var(--wm-f) * 0.12));
  background: var(--green);
}
.wordmark-line {
  width: calc(var(--wm-f) * 6.33);           /* p22 green-block width ratio */
  box-sizing: border-box;
  font-family: var(--f-mono);
  font-size: var(--wm-f);
  line-height: 1.27;                          /* p22 line-box ratio (42px @ 33px) */
  color: var(--grey);
  letter-spacing: 0.06em;
  padding: 0 0 0 calc(var(--wm-f) * 0.18);    /* text left inset inside block */
  transition: color .2s var(--ease-out), background .2s var(--ease-out);
}
.wordmark-line.active {
  background: var(--green);
  color: var(--offwhite);
}

/* =========================================================
   Bottom-right status plate
   ========================================================= */
.status-plate {
  position: fixed;
  bottom: var(--safe-y);
  right: var(--safe-x);
  z-index: 5;
  background: var(--orange);
  color: var(--ink);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);       /* Phonic Mono — matches BUILDATHON 铭牌 */
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.2em;
  line-height: 1;
}
.status-plate .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
}
.stage-running  .status-plate .dot { background: var(--ink); animation: dotpulse 1s ease-in-out infinite; }
.stage-paused   .status-plate .dot { background: var(--ink); }
.stage-finished .status-plate { background: var(--green); color: var(--white); }
.stage-finished .status-plate .dot { background: var(--white); }
@keyframes dotpulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.5; transform: scale(1.35); }
}

/* =========================================================
   Stage — center countdown
   ========================================================= */
.stage {
  position: relative;
  z-index: 3;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 2.4vh, 34px);
  padding: 0 clamp(40px, 5vw, 80px);
  transform: translateY(var(--stage-shift-y));
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
}
.meta-mid #phase-label {
  color: var(--mdf);
}

/* -------- Digits: acrylic-cut plates -------- */
.digits {
  display: grid;
  grid-template-columns:
    auto auto  auto  auto auto  auto  auto auto;
  gap: 10px;
  align-items: center;
}
.d-plate {
  position: relative;
  color: var(--ink);
  width: clamp(90px, 8vw, 148px);
  aspect-ratio: 0.72 / 1;
  font-family: var(--f-disp);
  font-variation-settings: "wdth" 100;
  font-weight: 700;
  font-size: clamp(140px, 12.5vw, 220px);
  line-height: 0.9;
  box-shadow:
    0 3px 0 #8a8884,
    0 6px 14px rgba(0,0,0,0.55);
  transition: none;
}

/* Flip animation only when a digit CHANGES */
/* -------------------------------------------------------------
   Real split-flap animation
   Structure inside each .d-plate:
     .flap-static-top   ← shows next digit's top half (revealed as flip finishes)
     .flap-static-bot   ← shows current digit's bottom half (visible until flip lands)
     .flap-anim-top     ← shows current digit's top half, rotates -90deg to reveal
     .flap-anim-bot     ← shows next digit's bottom half, rotates from 90deg to 0
     .flap-seam         ← horizontal line at 50% (etched)
   ------------------------------------------------------------- */
.d-plate {
  position: relative;
  overflow: visible;   /* allow shadow to spill during flip */
  background: transparent;  /* the four halves paint the surface */
  perspective: 700px;
}
.flap-half {
  position: absolute;
  left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  background: var(--mdf);
  display: grid;
  place-items: center;
  color: var(--ink);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}
.flap-half .glyph {
  position: absolute;
  left: 0; right: 0;
  height: 200%;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.flap-half.top {
  top: 0;
  border-bottom: 1px solid rgba(0,0,0,0.55);
  transform-origin: bottom;
  box-shadow: inset 0 -6px 8px -6px rgba(0,0,0,0.15);
}
.flap-half.top .glyph { top: 0; }

.flap-half.bot {
  bottom: 0;
  background: var(--mdf-2);
  transform-origin: top;
  box-shadow: inset 0 6px 8px -6px rgba(255,255,255,0.12);
}
.flap-half.bot .glyph { bottom: 0; }

.flap-anim-top {
  z-index: 3;
  transform: rotateX(0deg);
}
.flap-anim-bot {
  z-index: 2;
  transform: rotateX(90deg);
}

.d-plate.flip .flap-anim-top {
  animation: flap-top-down 420ms cubic-bezier(.42,0,.58,1) forwards;
}
.d-plate.flip .flap-anim-bot {
  animation: flap-bot-down 420ms cubic-bezier(.42,0,.58,1) 210ms forwards;
}

@keyframes flap-top-down {
  0%   { transform: rotateX(0deg);   background: var(--mdf); }
  100% { transform: rotateX(-90deg); background: #a99374;    }
}
@keyframes flap-bot-down {
  0%   { transform: rotateX(90deg);  background: #a99374; }
  100% { transform: rotateX(0deg);   background: var(--mdf-2); }
}

/* Colon column — 2 vertically stacked dots */
.dot-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4vw;
  padding: 0 4px;
}
.dot-col .dc {
  width: 1.4vw;
  height: 1.4vw;
  min-width: 12px;
  min-height: 12px;
  max-width: 22px;
  max-height: 22px;
  border-radius: 50%;
  background: var(--mdf);
  box-shadow: 0 2px 0 rgba(0,0,0,0.35);
}
.stage-running .dot-col { animation: dot-blink 1s steps(2, jump-none) infinite; }
@keyframes dot-blink { 50% { opacity: 0.28; } }

/* (dial plate removed — all six digit slots are identical flap plates now) */

/* -------- Unit line under digits (aligned to each digit-pair) -------- */
.unit-line {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: min(72vw, 1000px);
  font-family: var(--f-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.22em;
  text-align: center;
  margin-top: -6px;
}

/* -------- Progress rail -------- */
.rail {
  position: relative;
  width: min(78vw, 1200px);
  height: 20px;
  display: flex;
  align-items: center;
}
.rail-track {
  position: absolute;
  inset: 9px 0;
  height: 2px;
  background: rgba(255,255,255,0.25);
}
.rail-fill {
  position: absolute;
  left: 0; top: 6px;
  height: 8px;
  width: 0%;
  background: var(--mdf);
  transition: width .18s linear, background .35s var(--ease-out);
}
.rail-marks {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
}
.rail-marks span {
  border-left: 1px solid rgba(255,255,255,0.35);
  height: 100%;
}
.rail-marks span:first-child { border-left: 0; }
.rail-cap {
  position: absolute;
  top: -18px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
}
.rail-cap.left  { left: 0; }
.rail-cap.right { right: 0; }

/* =========================================================
   Stage-based color shifts
   ========================================================= */
.stage-warm .rail-fill { background: var(--lime); }

.stage-hot .rail-fill  { background: var(--orange); }
.stage-hot .flap-half.top { background: #ffb377; }
.stage-hot .flap-half.bot { background: #e79860; }

.stage-crit .rail-fill { background: var(--orange); }
.stage-crit .flap-half.top { background: var(--orange); }
.stage-crit .flap-half.bot { background: #c04c10; }
.stage-crit .digits    { animation: crit-shake .5s ease-in-out infinite; }
@keyframes crit-shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-2px); }
  75%     { transform: translateX(2px); }
}

/* =========================================================
   Final countdown ritual (≤10s) — one giant flap plate, single digit
   ========================================================= */
.final-count {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3vh;
  background: rgba(6,6,6,0.94);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.stage-crit .final-count { display: flex; }

.final-top,
.final-bottom {
  font-family: var(--f-disp);
  font-weight: 700;
  letter-spacing: 0.4em;
  font-size: 22px;
  color: var(--mdf);
}
.final-top {
  padding: 8px 26px;
  border: 1px solid var(--mdf);
}
.final-bottom {
  display: flex;
  align-items: center;
  gap: 20px;
}
.final-bottom .tick-strip {
  width: 90px;
  height: 1px;
  background: var(--mdf);
  display: inline-block;
}
.final-bottom .tick-word {
  color: var(--ink);
  background: var(--orange);
  padding: 6px 18px;
  letter-spacing: 0.5em;
  font-size: 20px;
}

.final-plate {
  position: relative;
  width: 60vh;
  height: 76vh;
  max-width: 720px;
  max-height: 900px;
  background:
    linear-gradient(to bottom,
      var(--mdf) 0%, var(--mdf) 49.6%,
      rgba(0,0,0,0.35) 49.6%, rgba(0,0,0,0.35) 50.4%,
      var(--mdf-2) 50.4%, var(--mdf-2) 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.55),
    inset 0 -12px 0 rgba(0,0,0,0.08),
    0 8px 0 var(--mdf-edge),
    0 24px 60px rgba(0,0,0,0.6);
}
/* four screw holes on the plate */
.final-plate::before {
  content: "";
  position: absolute;
  top: 16px; left: 16px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--mdf-hole);
  box-shadow:
    calc(60vh - 44px) 0 0 0 var(--mdf-hole),
    0 calc(76vh - 32px) 0 0 var(--mdf-hole),
    calc(60vh - 44px) calc(76vh - 32px) 0 0 var(--mdf-hole);
}
.final-plate #final-digit {
  font-family: var(--f-disp);
  font-weight: 700;
  font-variation-settings: "wdth" 100;
  font-size: 60vh;
  line-height: 0.88;
  color: var(--ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
  z-index: 2;
  padding-bottom: 4vh;   /* optical center */
}
.final-plate.flip #final-digit {
  animation: final-flip 260ms cubic-bezier(.2,.8,.2,1);
}
@keyframes final-flip {
  0%   { transform: translateY(-30%) scaleY(0.7); opacity: 0; filter: blur(4px); }
  60%  { transform: translateY(6%)   scaleY(1.02); opacity: 1; filter: blur(0); }
  100% { transform: translateY(0)    scaleY(1); }
}


.stage-finished .rail-fill { width: 100% !important; background: var(--green); }
.stage-finished .flap-half { background: var(--lime); }

/* =========================================================
   Panel toggle — subtle, bottom-center as a hairline chip
   Only meaningful on mouse hover; never blocks the stage.
   ========================================================= */
.panel-toggle {
  position: fixed;
  z-index: 40;
  bottom: calc(var(--safe-y) * 0.6);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  height: 26px;
  border-radius: 2px;
  background: transparent;
  color: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  transition: all .15s var(--ease-out);
}
.panel-toggle svg { width: 12px; height: 12px; }
.panel-toggle:hover {
  color: var(--mdf);
  border-color: var(--mdf);
  background: rgba(200,181,145,0.08);
}
.panel-toggle.active {
  color: var(--orange);
  border-color: var(--orange);
}

/* =========================================================
   Control panel — opens via toggle, closes via × or ESC.
   NOT auto-hide.
   ========================================================= */
.controls {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: min(560px, 92vw);
  background: var(--mdf);
  color: var(--ink);
  padding: 24px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.65),
    0 0 0 1px rgba(0,0,0,0.35);
}
/* four screw holes on the panel — echo the BUILDATHON plate */
.controls::before,
.controls::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px; background: var(--ink); border-radius: 50%;
}
.controls::before { top: 10px; left: 12px; box-shadow: 0 0 0 0 var(--ink),
  calc(100vw - 100vw + 528px) 0 0 0 var(--ink); }
.controls::after { bottom: 10px; left: 12px; box-shadow: 528px 0 0 0 var(--ink); }

.controls.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  pointer-events: none;
}
/* dim backdrop behind the panel when open */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease-out);
}
.panel-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.ctl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.4);
  padding-bottom: 12px;
}

/* Mode tabs (Deadline vs Duration) */
.ctl-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(0,0,0,0.06);
  border: 1px solid var(--ink);
}
.ctl-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--f-cn);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.06em;
  transition: background .12s var(--ease-out), color .12s var(--ease-out);
}
.ctl-tab:hover { background: rgba(0,0,0,0.08); }
.ctl-tab.active {
  background: var(--ink);
  color: var(--mdf);
}
.ctl-pane { display: flex; flex-direction: column; gap: 10px; }
.ctl-pane.hidden { display: none; }
.ctl-input.wide {
  width: auto;
  flex: 1;
  min-width: 200px;
  font-size: 18px;
  letter-spacing: 0.02em;
  padding: 0 10px;
}
.ctl-title {
  font-family: var(--f-disp);
  font-weight: 700;
  letter-spacing: 0.24em;
  font-size: 14px;
  color: var(--ink);
}
.ctl-close {
  width: 32px; height: 32px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
  transition: background .12s var(--ease-out), color .12s var(--ease-out);
}
.ctl-close:hover { background: var(--ink); color: var(--mdf); }

.ctl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctl-row.ctl-time { gap: 8px; justify-content: center; }
.ctl-row.presets { gap: 8px; justify-content: center; }
.ctl-row.ctl-main { gap: 12px; justify-content: center; }

.ctl-label {
  font-family: var(--f-cn);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.ctl-input {
  font-family: var(--f-mono);
  font-size: 26px;
  color: var(--ink);
  background: rgba(0,0,0,0.08);
  border: 1px solid var(--ink);
  border-radius: 0;
  width: 68px;
  height: 48px;
  text-align: center;
  outline: none;
  font-variant-numeric: tabular-nums;
  caret-color: var(--orange);
}
.ctl-input:focus { background: var(--orange); color: var(--ink); }
.ctl-sep {
  font-family: var(--f-mono);
  font-size: 26px;
  color: rgba(0,0,0,0.55);
}

.ctl-btn {
  font-family: var(--f-cn);
  font-weight: 500;
  letter-spacing: 0.1em;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 18px;
  height: 44px;
  cursor: pointer;
  transition: all .12s var(--ease-out);
}
.ctl-btn:hover { background: var(--ink); color: var(--mdf); }
.ctl-btn:active { transform: translateY(1px); }
.ctl-btn.big { min-width: 110px; height: 52px; font-size: 15px; }
.ctl-btn.primary { background: var(--orange); border-color: var(--ink); }
.ctl-btn.primary:hover { background: var(--ink); color: var(--orange); }
.ctl-btn.ctl-set { background: var(--green); color: var(--white); border-color: var(--ink); }
.ctl-btn.ctl-set:hover { background: var(--ink); color: var(--green); }

.ctl-preset {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 8px 14px;
  cursor: pointer;
  transition: all .12s var(--ease-out);
}
.ctl-preset:hover { background: var(--ink); color: var(--mdf); }
.ctl-preset.active { background: var(--orange); }

.ctl-hint {
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(0,0,0,0.7);
  letter-spacing: 0.02em;
  padding-top: 8px;
  border-top: 1px dashed rgba(0,0,0,0.3);
  text-align: center;
}

/* =========================================================
   Chrome-off mode — H toggles a total blackout of chrome
   ========================================================= */
body.chrome-off .xhs-pill,
body.chrome-off .ruler,
body.chrome-off .tool-column,
body.chrome-off .wordmark-stack,
body.chrome-off .status-plate,
body.chrome-off .controls,
body.chrome-off .meta-line,
body.chrome-off .sub-line,
body.chrome-off .rail {
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease-out);
}

/* Fullscreen: hide the SETTINGS toggle chip entirely */
body.fs .panel-toggle { display: none !important; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1200px) {
  .ruler, .tool-column { display: none; }
}
@media (max-width: 900px) {
  .d-plate { min-width: 78px; }
  .controls { min-width: 92vw; }
}

/* =========================================================
   Big-screen adaptation — 老市府赛区大屏 2880×960 (3:1 ultra-wide)
   On ultra-wide/short canvases the HEIGHT is the binding dimension,
   so the hero clock and furniture scale with vh for a full, balanced fit.
   ========================================================= */
@media (min-aspect-ratio: 2 / 1) {
  :root {
    --safe-x: clamp(56px, 2.4vw, 100px);
    --safe-y: clamp(40px, 5vh, 66px);
    --stage-shift-y: -1vh;
  }
  .d-plate {
    width: clamp(120px, 21vh, 220px);
    font-size: clamp(180px, 27vh, 300px);
  }
  .digits { gap: 1.1vh; }
  .dot-col { gap: 2.2vh; padding: 0 0.6vh; }
  .dot-col .dc {
    width: 2.1vh; height: 2.1vh;
    min-width: 0; min-height: 0; max-width: none; max-height: none;
  }
  .unit-line { width: min(74vw, 1700px); font-size: clamp(13px, 1.7vh, 20px); margin-top: 0.4vh; }
  .rail { width: min(80vw, 2100px); height: 2.2vh; }
  .xhs-badge   { width: clamp(220px, 12vw, 360px); top: calc(var(--safe-y) + 6vh); }
  .brand-plate { width: clamp(320px, 17vw, 500px); }
  .tool-column { height: clamp(300px, 48vh, 470px); }
  .wordmark-stack { --wm-f: clamp(20px, 2.2vh, 30px); }
}
