/* White Screen - shared styles */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --line: #e4e4e4;
  --soft: #f6f6f6;
  --dark: #111111;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: inherit; }
img, canvas, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.cap { text-transform: capitalize; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #111;
  color: #fff;
  padding: 8px 12px;
  z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border: 1px solid #111;
  background: linear-gradient(90deg, #111 50%, #fff 50%);
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link,
.nav-drop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  background: none;
  font-size: 14px;
  color: #222;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover,
.nav-drop:hover { background: var(--soft); }

.nav-drop::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #777;
}

.nav-group { position: relative; }

.nav-panel {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  min-width: 236px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  display: none;
  z-index: 120;
}
.nav-group.open .nav-panel { display: block; }

.nav-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font-size: 14px;
  text-decoration: none;
  border-radius: 2px;
}
.nav-panel a:hover { background: var(--soft); }

.swatch {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
}

.lang-panel {
  right: 0;
  left: auto;
  min-width: 200px;
}

.menu-toggle {
  display: none;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
}

/* Hero / headings */
.hero {
  padding: 52px 0 8px;
}
body[data-page="home"] .hero { padding-top: 18px; }
body[data-page="home"] .hero h2 { margin-top: 0; }

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 800;
}

.lead {
  margin: 0 0 18px;
  max-width: 660px;
  font-size: 18px;
  color: #333;
}

.page-head { padding: 34px 0 20px; }
.page-head h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 800;
}
.page-head .lead { font-size: 17px; margin-bottom: 12px; }

.crumbs {
  padding: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { margin: 0 6px; color: #bbb; }

/* Screen areas */
.home-screen,
.color-stage {
  position: relative;
  width: 100%;
  height: min(60vh, 520px);
  border: 1px solid var(--line);
  background: #fff;
  cursor: zoom-in;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.home-screen { margin-top: 30px; }

.stage-hint {
  margin-bottom: 10px;
  padding: 4px 10px;
  font-size: 12px;
  color: #555;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.color-stage.dark .stage-hint {
  color: #eee;
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.2);
}

:fullscreen .stage-hint,
.pseudo-fullscreen .stage-hint { display: none; }

.home-screen:fullscreen,
.color-stage:fullscreen,
.tool-stage:fullscreen,
.dm-stage:fullscreen,
.pseudo-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: 0;
  margin: 0;
  cursor: default;
}

.pseudo-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
}

body.fs-lock { overflow: hidden; }

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.chip {
  border: 1px solid var(--line);
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid #111;
  border-radius: 2px;
  background: #111;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #333; border-color: #333; }

.btn.secondary {
  background: #fff;
  color: #111;
  border-color: #d0d0d0;
}
.btn.secondary:hover { background: var(--soft); border-color: #111; }

.btn.small { padding: 6px 10px; font-size: 13px; }

.select,
.input {
  padding: 8px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  background: #fff;
  font-size: 14px;
}

.input[type="number"] { width: 96px; }
input[type="color"] {
  width: 42px;
  height: 36px;
  padding: 2px;
  border: 1px solid #d0d0d0;
  background: #fff;
  cursor: pointer;
}

.tool-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
}

.tool-bar .spacer { flex: 1 1 auto; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid #d0d0d0;
}
.seg button {
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid #d0d0d0;
  background: #fff;
  font-size: 13px;
}
.seg button:last-child { border-right: 0; }
.seg button.active { background: #111; color: #fff; }

.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Sections */
.section {
  padding: 46px 0;
  border-top: 1px solid var(--line);
  margin-top: 44px;
}
.section:first-of-type { margin-top: 0; }

.section h2 {
  margin: 0 0 8px;
  font-size: clamp(21px, 3vw, 26px);
}
.section .sub {
  margin: 0 0 22px;
  color: var(--muted);
  max-width: 680px;
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
}
.card:hover { border-color: #111; }
.card h3 { margin: 0; font-size: 15px; }
.card p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.color-card .swatch-lg {
  height: 64px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.mini-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.mini-color {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 13px;
}
.mini-color:hover { border-color: #111; }

.use-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.use-list li { border-left: 2px solid #111; padding-left: 14px; }
.use-list h3 { margin: 0 0 4px; font-size: 15px; }
.use-list p { margin: 0; font-size: 14px; color: var(--muted); }

.why-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 20px;
}
.why-grid h3 { margin: 0 0 4px; font-size: 15px; }
.why-grid p { margin: 0; color: var(--muted); font-size: 14px; }

.steps {
  margin: 14px 0 0;
  padding-left: 20px;
}
.steps li { margin-bottom: 8px; }

.faq { margin-top: 8px; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}
.faq details p {
  margin: 10px 0 0;
  color: #444;
  font-size: 14px;
}

/* Footer */
.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  padding: 40px 0 28px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
}
.footer-brand p { color: var(--muted); max-width: 300px; margin-top: 10px; }
.site-footer h3 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { text-decoration: none; color: #333; }
.site-footer a:hover { text-decoration: underline; }
.footer-bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* Tool stage shared */
.tool-stage {
  position: relative;
  width: 100%;
  height: min(62vh, 520px);
  background: #000;
  border: 1px solid #d5d5d5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: default;
}

.stage-tip {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Screensaver */
.ss-layer {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}
.ss-layer.active { display: flex; }

#ss-dvd { background: #000; }
.dvd-logo {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 110px;
  height: 62px;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 3px;
  font-size: 18px;
  color: #fff;
}

#ss-clock { background: #000; }
.clock-wrap { text-align: center; }
.clock-time {
  font-size: clamp(54px, 12vw, 120px);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: #fff;
}
.clock-date { font-size: 15px; color: #bbb; margin-top: 6px; }

#ss-matrix { background: #000; }
#ss-matrix canvas { width: 100%; height: 100%; }

#ss-nosignal { background: #000; flex-direction: column; }
.bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  height: 72%;
}
.bars span:nth-child(1) { background: #c0c0c0; }
.bars span:nth-child(2) { background: #c0c000; }
.bars span:nth-child(3) { background: #00c0c0; }
.bars span:nth-child(4) { background: #00c000; }
.bars span:nth-child(5) { background: #c000c0; }
.bars span:nth-child(6) { background: #c00000; }
.bars span:nth-child(7) { background: #0000c0; }
.nosignal-text {
  height: 28%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 4vw, 38px);
  letter-spacing: 6px;
  color: #fff;
  background: #000;
  width: 100%;
}

#ss-quotes { background: #000; padding: 8%; }
.quote-wrap { max-width: 720px; text-align: center; }
.quote-wrap blockquote {
  margin: 0;
  font-size: clamp(20px, 3.4vw, 34px);
  line-height: 1.45;
  color: #f2f2f2;
}
.quote-wrap cite {
  display: block;
  margin-top: 18px;
  font-size: 13px;
  font-style: normal;
  color: #999;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Update screen simulation */
.update-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.update-screen h2 { margin: 0 0 10px; font-size: 22px; font-weight: 400; }
.update-screen p { margin: 0; font-size: 14px; }

.win10 { background: #0078d7; color: #fff; }
.win10 .spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 26px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.winxp { background: #5a7edc; color: #fff; flex-direction: column; }
.winxp .xp-bar {
  width: min(340px, 70%);
  height: 16px;
  border: 1px solid #fff;
  margin: 22px auto 0;
  padding: 2px;
}
.xp-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, #fff 0 12px, transparent 12px 16px);
  transition: width 0.4s linear;
}
.winxp .xp-logo { font-size: 30px; font-weight: 700; margin-bottom: 18px; letter-spacing: 1px; }

.mac { background: #000; color: #fff; flex-direction: column; }
.mac .apple { width: 46px; height: 54px; margin-bottom: 28px; fill: #fff; }
.mac .mac-bar {
  width: min(280px, 64%);
  height: 5px;
  background: #333;
  margin: 22px auto 0;
  border-radius: 3px;
  overflow: hidden;
}
.mac .mac-bar span { display: block; height: 100%; width: 0; background: #fff; transition: width 0.4s linear; }
.mac small { color: #aaa; margin-top: 12px; display: block; font-size: 12px; }

.ubuntu { background: #2c001e; color: #fff; flex-direction: column; }
.ubuntu .dots { display: flex; gap: 10px; margin-bottom: 24px; }
.ubuntu .dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e95420;
  animation: pulse 1.2s infinite ease-in-out;
}
.ubuntu .dots i:nth-child(2) { animation-delay: 0.2s; }
.ubuntu .dots i:nth-child(3) { animation-delay: 0.4s; }
.ubuntu .dots i:nth-child(4) { animation-delay: 0.6s; }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.chromeos { background: #f1f3f4; color: #202124; flex-direction: column; }
.chromeos .chrome-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(#ea4335 0 33%, #fbbc05 0 66%, #34a853 0 100%);
  margin-bottom: 24px;
  position: relative;
}
.chromeos .chrome-logo::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #f1f3f4;
  border: 4px solid #4285f4;
}
.chromeos .chrome-bar {
  width: min(260px, 64%);
  height: 4px;
  background: #dadce0;
  margin: 20px auto 0;
  overflow: hidden;
}
.chromeos .chrome-bar span { display: block; height: 100%; width: 0; background: #1a73e8; transition: width 0.4s linear; }

/* Prank layers */
.prank-layer {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.prank-layer.active { display: flex; }

.bsod {
  width: 100%;
  height: 100%;
  background: #0000aa;
  color: #fff;
  font-family: "Lucida Console", "Courier New", monospace;
  padding: 6% 8%;
  font-size: clamp(11px, 1.6vw, 15px);
  line-height: 1.55;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bsod h2 { font-size: 18px; margin: 0 0 14px; background: #aaa; color: #0000aa; display: inline-block; padding: 0 6px; align-self: flex-start; }
.bsod p { margin: 0 0 12px; }

#prank-broken { background: #dfe4ea; }
#prank-broken #cracks { position: absolute; inset: 0; }
#prank-broken svg { width: 100%; height: 100%; }
.broken-note {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

#prank-radar { background: #04160c; }
#prank-radar canvas { width: 100%; height: 100%; }

#prank-hacker { background: #000; align-items: flex-start; justify-content: flex-start; }
.hacker-pane {
  width: 100%;
  height: 100%;
  padding: 18px;
  color: #33ff66;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: hidden;
}

#prank-noise { background: #111; }
#prank-noise canvas { width: 100%; height: 100%; }

#prank-call { background: #202124; }
.call-wrap { text-align: center; color: #e8eaed; }
.call-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #3c4043;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #9aa0a6;
}
.call-wrap h3 { margin: 0 0 6px; font-size: 19px; font-weight: 500; }
.call-wrap p { margin: 0; color: #9aa0a6; font-size: 13px; }

/* Screen check */
.check-stage {
  position: relative;
  height: min(62vh, 520px);
  border: 1px solid #d5d5d5;
  background: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
}
.check-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.check-stage canvas[hidden] { display: none; }
.check-stage.testing {
  display: block;
  border: 0;
  background: #000;
  cursor: default;
}
.check-stage.testing .check-label { display: none; }
.check-stage:fullscreen,
.check-stage.pseudo-fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
}
.check-label {
  margin-bottom: 10px;
  padding: 3px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;
}
.test-hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  pointer-events: none;
}
.test-hud[hidden] { display: none; }
.test-hud-top,
.test-hud-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.test-hud-top { justify-content: space-between; }
.test-hud-bottom { justify-content: center; flex-wrap: wrap; }
.test-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
}
.test-hud button {
  pointer-events: auto;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
}
.test-hud button:hover { background: rgba(0, 0, 0, 0.8); }
.test-done {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
}
.test-done[hidden] { display: none; }
.test-done-card {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}
.test-done-card h2 { margin: 0 0 8px; font-size: 22px; }
.test-done-card p { margin: 0 0 16px; color: #555; font-size: 14px; }
.test-done-card .tool-bar { justify-content: center; margin: 0; }


/* Danmaku */
.dm-stage {
  position: relative;
  height: min(28vh, 280px);
  background: #000;
  border: 1px solid #d5d5d5;
  overflow: hidden;
  cursor: pointer;
}
.dm-stage:fullscreen,
.dm-stage.pseudo-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: 0;
  margin: 0;
  cursor: default;
}
.dm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.dm-marquee {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.dm-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
  padding: 20px;
  text-align: center;
  pointer-events: none;
}
.dm-share {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}
.dm-share[hidden] { display: none; }
.dm-share-box {
  position: relative;
  width: min(380px, 100%);
  padding: 26px 22px 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.dm-share-box h2 {
  margin: 0 0 8px;
  font-size: 19px;
}
.dm-share-tip {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #666;
}
.dm-share-qr {
  display: block;
  width: 220px;
  height: 220px;
  max-width: 100%;
  margin: 0 auto 16px;
  border-radius: 8px;
}
.dm-share-link {
  width: 100%;
  margin-bottom: 12px;
  font-size: 12px;
}
.dm-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.dm-share-close {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 4px;
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #888;
  cursor: pointer;
}
.dm-share-close:hover { color: #111; }
.dm-emoji {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.dm-emoji button {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 16px;
  line-height: 1.2;
}
.dm-emoji button:hover { background: var(--soft); border-color: #111; }

.dm-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.dm-controls .input { flex: 1 1 240px; }

.dm-text {
  flex: 1 1 100%;
  min-height: 56px;
  resize: vertical;
  line-height: 1.4;
}

.dm-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
}
.dm-size input[type="range"] { width: 110px; }
.dm-size b { min-width: 40px; font-weight: 600; text-align: right; }

.dm-advanced {
  margin-top: 10px;
  border: 1px solid var(--line);
}
.dm-advanced summary {
  padding: 8px 12px;
  background: var(--soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.dm-advanced summary::-webkit-details-marker { display: none; }
.dm-advanced summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  color: #777;
}
.dm-advanced[open] summary::before { content: "\2013"; }
.dm-adv-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 12px;
}
.dm-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333;
}
.dm-field .select { padding: 6px 8px; }
.dm-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}
.dm-check input { width: 15px; height: 15px; margin: 0; }
.dm-presets {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333;
}
.dm-presets .btn { padding: 5px 10px; font-size: 12px; }

/* Background downloader */
.bg-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.4fr 1fr;
  align-items: start;
}
.bg-preview {
  height: min(52vh, 420px);
  border: 1px solid #d5d5d5;
  background: #ffffff;
}
.bg-controls { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: #555; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0;
}
.preset:hover { outline: 2px solid #111; outline-offset: 1px; }
.hex-output {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #555;
}

/* Color picker */
.picker-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.35fr 1fr;
  align-items: start;
}
.pick-panel { min-width: 0; }
.pick-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(58vh, 520px);
  min-height: 320px;
  border: 1px solid var(--line);
  background: #fafafa;
  overflow: hidden;
}
.pick-stage.dragover { border-color: #111; background: #f0f0f0; }
.pick-stage canvas {
  max-width: 100%;
  max-height: 100%;
  cursor: crosshair;
}
.pick-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: #777;
  font-size: 14px;
  pointer-events: none;
}
.pick-drop[hidden] { display: none; }
.pick-drop strong { color: #111; font-size: 16px; }
.pick-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.pick-marker[hidden] { display: none; }
.pick-panel .tool-bar { margin-top: 10px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.color-panel {
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}
.color-panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: #555;
}
.color-big {
  height: 120px;
  margin-bottom: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
}
.color-values {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}
.color-values div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.color-values dt { font-size: 13px; color: #666; }
.color-values dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
.color-panel .tool-bar { margin-top: 0; }
.color-panel h3 { margin: 20px 0 10px; font-size: 14px; color: #555; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.recent button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
.recent button:hover { outline: 2px solid #111; outline-offset: 1px; }
.recent-empty { font-size: 13px; color: #999; }

@media (max-width: 880px) {
  .picker-layout { grid-template-columns: 1fr; }
  .pick-stage { height: min(50vh, 420px); min-height: 260px; }
}

@media (max-width: 760px) {
  .bg-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 880px) {
  .menu-toggle { display: inline-block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 6px 12px 14px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .site-nav.open { display: flex; }
  .nav-link, .nav-drop { width: 100%; justify-content: space-between; padding: 11px 8px; font-size: 15px; }
  .nav-group { position: static; }
  .nav-panel {
    position: static;
    display: none;
    border: 0;
    padding: 0 0 6px 8px;
    min-width: 0;
  }
  .nav-group.open .nav-panel { display: block; }
  .lang-panel { min-width: 0; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .hero { padding-top: 34px; }
  .home-screen, .color-stage { height: 54vh; }
  .tool-stage, .check-stage { height: 56vh; }
  .dm-stage { height: 26vh; }
  .section { padding: 34px 0; margin-top: 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .mini-grid { grid-template-columns: 1fr 1fr; }
  .btn { padding: 9px 12px; }
  .tool-bar > .btn, .tool-bar > .select { flex: 0 1 auto; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 auto; }
}

@media print {
  @page { margin: 14mm; }
  .site-header, .site-footer, .tool-bar, .stage-hint { display: none !important; }

  /* 记分屏导出 PDF：仅打印 #sb-print，其余全部隐藏 */
  body.sb-printing { background: #fff !important; }
  body.sb-printing > *:not(#sb-print) { display: none !important; }
  #sb-print {
    display: block !important;
    color: #111 !important;
    background: #fff !important;
  }
  .sb-print-head h1 {
    margin: 0 0 4px;
    font-size: 24px;
    color: #111 !important;
  }
  .sb-print-sub { margin: 0 0 2px; font-size: 12px; color: #555 !important; }
  .sb-print-meta { margin: 0 0 16px; font-size: 11px; color: #888 !important; }
  .sb-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #111 !important;
  }
  .sb-print-table th,
  .sb-print-table td {
    padding: 7px 10px;
    border: 1px solid #ccc !important;
    text-align: left;
    white-space: nowrap;
    color: #111 !important;
    background: #fff !important;
  }
  .sb-print-table th {
    background: #f0f0f0 !important;
    font-weight: 700;
    color: #111 !important;
  }
  .sb-print-table .sb-print-total td {
    background: #fafafa !important;
    font-weight: 700;
    color: #111 !important;
  }
}

/* Hero orbit: 白屏圆角悬浮 + 暖色光晕 + 颜色环绕 */
.hero-orbit {
  position: relative;
  margin: 28px 0 0;
  height: min(58vh, 540px);
  min-height: 440px;
  isolation: isolate;
}

.hero-orbit::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(52%, 500px);
  aspect-ratio: 16 / 10;
  transform: translate(-50%, -50%);
  border-radius: 34px;
  background: radial-gradient(closest-side, rgba(255, 168, 92, 0.62), rgba(255, 196, 138, 0.22) 62%, rgba(255, 255, 255, 0) 78%);
  filter: blur(16px);
  z-index: 0;
  animation: hero-glow 7s ease-in-out infinite;
}

.hero-orbit .home-screen {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(34%, 340px);
  height: auto;
  aspect-ratio: 16 / 10;
  margin: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 1px rgba(17, 17, 17, 0.05),
    0 26px 54px -22px rgba(17, 17, 17, 0.3),
    0 42px 90px -40px rgba(255, 148, 64, 0.55);
  animation: hero-float 7s ease-in-out infinite;
  z-index: 2;
}

.hero-orbit .home-screen .stage-hint {
  margin: 0 12px 12px;
  padding: 4px 10px;
  font-size: 11px;
  color: #8a8a8a;
  background: #f7f7f7;
  border: 0;
  border-radius: 999px;
}

@keyframes hero-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-12px); }
}

@keyframes hero-glow {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.hero-orbit .home-screen:fullscreen,
.hero-orbit .home-screen.pseudo-fullscreen {
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  transform: none !important;
  animation: none;
  box-shadow: none;
  border: 0;
}

.orbit-chips { display: contents; }

.orbit-chip {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: #111;
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
  z-index: 3;
}

.orbit-chip span {
  display: block;
  width: 100px;
  height: 54px;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 12px 22px -12px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.orbit-chip em {
  font-style: normal;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.orbit-chip:hover span {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px -12px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* 自定义颜色页 */
.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
}

/* 课堂屏 */
.classroom-stage { background: #0f1115; }

.cs-widget {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cs-widget.active { display: flex; }

.cs-clock {
  font-size: clamp(62px, 13vw, 168px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}
.cs-date { margin-top: 12px; font-size: 15px; color: #9aa0a6; }

.cs-timer {
  font-size: clamp(54px, 11vw, 140px);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cs-timer-track {
  width: min(420px, 72%);
  height: 6px;
  margin-top: 24px;
  background: #2a2d34;
}
.cs-timer-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transition: width 0.3s linear;
}

.cs-name {
  font-size: clamp(32px, 7vw, 86px);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  word-break: break-word;
}

.cs-names {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 14px;
}
.cs-names .field { flex: 1 1 320px; }
.cs-names textarea { width: 100%; resize: vertical; }

/* 屏幕录制 */
.recorder-stage { background: #0f1115; }
.rec-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: none;
  z-index: 1;
}
.rec-placeholder { position: relative; z-index: 0; font-size: 14px; color: #8a9099; }
.rec-status { font-size: 13px; color: #666; }

.btn.disabled { opacity: 0.5; pointer-events: none; }

/* 屏幕信息（屏检查） */
.screen-info {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfb;
}
.screen-info h2 {
  margin: 0 0 14px;
  font-size: 16px;
}
.info-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.info-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.info-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}
.info-item strong {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

@media (max-width: 880px) {
  .hero-orbit {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
  }
  .hero-orbit::before { display: none; }
  .hero-orbit .home-screen {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    border-radius: 16px;
    transform: none;
    animation: none;
    box-shadow: 0 22px 36px -22px rgba(0, 0, 0, 0.32);
    order: -1;
  }
  .orbit-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .orbit-chip {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    justify-content: center;
    gap: 6px;
    padding: 0;
    font-size: 12px;
  }
  .orbit-chip span {
    width: 100%;
    max-width: 150px;
    height: auto;
    aspect-ratio: 2 / 1;
  }
  .cs-names { flex-direction: column; align-items: stretch; }
}

@media (max-width: 560px) {
  .orbit-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-clock { font-size: clamp(46px, 15vw, 96px); }
  .cs-timer { font-size: clamp(40px, 13vw, 84px); }
}

@media (max-width: 1000px) and (min-width: 881px) {
  .orbit-chip {
    font-size: 11.5px;
    gap: 5px;
  }
  .orbit-chip span { width: 84px; height: 46px; }
}

/* Prominent color picker + palette */
input[type="color"] {
  width: 56px;
  height: 44px;
  padding: 3px;
  border: 2px solid #111;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfb;
}
.palette button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.palette button:hover { transform: scale(1.12); }
.palette button:focus-visible { outline: 2px solid #111; outline-offset: 3px; }

/* Notice screen */
.notice-stage { background: #000; color: #fff; }
.notice-stage.light { background: #fff; color: #111; border-color: #e3e3e3; }
.notice-text {
  padding: 0 28px;
  font-size: clamp(30px, 7vw, 92px);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  word-break: break-word;
}

/* Meeting screen */
.meeting-stage { background: #101114; color: #fff; }
.meeting-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  text-align: center;
}
.meeting-status {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7ee2a8;
}
.meeting-title {
  font-size: clamp(24px, 4.6vw, 52px);
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}
.meeting-clock {
  font-size: clamp(58px, 12vw, 150px);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.meeting-elapsed {
  font-size: clamp(20px, 3vw, 32px);
  color: #9aa0a6;
  font-variant-numeric: tabular-nums;
}

/* 比赛记分屏 */
.score-stage {
  position: relative;
  background: #0b0b0b;
  border: 1px solid #d5d5d5;
  padding: 22px 16px;
  color: #fff;
  overflow: hidden;
}
.score-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.score-team { text-align: center; min-width: 0; }
.score-name {
  font-size: clamp(13px, 1.6vw, 18px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b9b9b9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.score-value {
  font-size: clamp(52px, 11vw, 104px);
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.team-a .score-value { color: #ff6b6b; }
.team-b .score-value { color: #5aa9ff; }
.score-btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.score-btns button {
  min-width: 38px;
  padding: 5px 8px;
  border: 1px solid #3d3d3d;
  border-radius: 2px;
  background: #191919;
  color: #e8e8e8;
  font-size: 13px;
}
.score-btns button:hover { background: #2c2c2c; border-color: #777; }
.score-middle { text-align: center; padding: 0 clamp(4px, 2vw, 26px); }
.score-timer {
  font-size: clamp(30px, 5.4vw, 58px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score-round { margin-top: 6px; font-size: 13px; color: #9a9a9a; }
.score-status {
  margin-top: 4px;
  min-height: 16px;
  font-size: 12px;
  color: #ffd166;
}

.score-stage:fullscreen,
.score-stage.pseudo-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-stage:fullscreen .score-teams,
.score-stage.pseudo-fullscreen .score-teams { width: 100%; }
.score-stage:fullscreen .score-name,
.score-stage.pseudo-fullscreen .score-name { font-size: clamp(16px, 2vw, 30px); }
.score-stage:fullscreen .score-value,
.score-stage.pseudo-fullscreen .score-value { font-size: clamp(90px, 18vw, 280px); }
.score-stage:fullscreen .score-timer,
.score-stage.pseudo-fullscreen .score-timer { font-size: clamp(48px, 9vw, 140px); }
.score-stage:fullscreen .score-round,
.score-stage.pseudo-fullscreen .score-round { font-size: clamp(14px, 1.8vw, 24px); }

/* 全屏专属：比赛名称 + 控制条（默认隐藏，全屏时显示） */
.sb-fs-matchname,
.sb-fs-bar { display: none; }
.sb-print { display: none; }

.score-stage:fullscreen .sb-fs-matchname,
.score-stage.pseudo-fullscreen .sb-fs-matchname {
  display: block;
  position: absolute;
  top: clamp(18px, 4vh, 56px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(20px, 3vw, 46px);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.score-stage:fullscreen .sb-fs-bar,
.score-stage.pseudo-fullscreen .sb-fs-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  position: absolute;
  bottom: clamp(18px, 4vh, 56px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.sb-fs-btn {
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #e6e6e6);
  color: #111;
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.sb-fs-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.inline-field .input[type="text"] { width: 130px; }
.inline-field .input[type="number"] { width: 72px; }

.sb-history {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.sb-history h2 { margin: 0 0 12px; font-size: clamp(19px, 2.6vw, 24px); }
.sb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sb-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.sb-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.sb-table th,
.sb-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.sb-table th {
  background: var(--soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #666;
}
.sb-table tr:last-child td { border-bottom: 0; }
.sb-table .sb-win { font-weight: 700; }
.sb-table tbody tr:hover td { background: #fafafa; }

