@font-face {
  font-family: "GNU Unifont";
  src: url("/fonts/unifont-18.0.01.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root {
  color-scheme: dark;
  --accent: #bb2649;
  --accent-text: #dd778e;
  --button-ink: #fff5df;
  --ink: #f5f1db;
  --muted: #b5a9b5;
  --edge: color-mix(in srgb, var(--accent) 32%, #554b54);
  --faint: color-mix(in srgb, var(--accent) 12%, #100d11);
  --surface: #0c090d;
  background: #050505;
  color: var(--ink);
  font: 16px/1.6 "GNU Unifont", "Microsoft YaHei UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden], .symbols { display: none !important; }
body { margin: 0; min-height: 100vh; padding-bottom: 28px; }
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
a, button, input, select { touch-action: manipulation; }
button, select { cursor: pointer; }
button, select, input::file-selector-button {
  min-height: 40px;
  border: 1px solid var(--edge);
  border-radius: 3px;
  background: var(--surface);
  padding: 7px 13px;
}
button:hover:enabled, select:hover:enabled { border-color: var(--accent); background-color: var(--faint); }
button:disabled, input:disabled, select:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; flex: none; }
.led-icon { stroke: none; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 12px; background: #050505; }
.wrap { width: min(1080px, calc(100% - 64px)); margin-inline: auto; }
.mast { min-height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--edge); }
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand img { width: 38px; height: 38px; }
.wordmark { display: grid; gap: 3px; }
.wordmark strong { font-size: 24px; font-weight: 400; line-height: 1.1; letter-spacing: .06em; }
.wordmark small { font-size: 10px; line-height: 1.4; letter-spacing: .22em; color: var(--muted); }
.settings-link { width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); border-radius: 4px; }
.settings-link svg { width: 28px; height: 28px; }
.settings-link:hover, .settings-link.active { color: var(--accent-text); background: var(--faint); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 0 22px; }
.section-en { display: block; font-size: 10px; line-height: 1.5; letter-spacing: .16em; color: var(--muted); }
.page-head .section-en { color: var(--accent-text); margin-bottom: 5px; }
h1 { color: var(--accent-text); font-size: 28px; font-weight: 400; line-height: 1.3; letter-spacing: .04em; }
h2 { font-size: 16px; font-weight: 400; line-height: 1.5; }
.page-head > span, .page-context { font-size: 12px; color: var(--muted); }
.service { display: inline-flex; align-items: center; gap: 7px; }
.service i { width: 5px; height: 5px; border: 1px solid var(--muted); border-radius: 50%; }
.service.live i { border-color: var(--accent); background: var(--accent); }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.preview-panel { min-width: 0; padding: 0 20px; border: 1px dashed var(--edge); border-radius: 10px; }
.screen { position: relative; background: #000; display: flex; flex-direction: column; height: 370px; }
.display-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; border-bottom: 1px dashed var(--edge); }
.display-bar h2 { min-width: 0; font-size: 14px; }
#screen-name { color: var(--accent-text); }
.separator { color: var(--muted); margin-inline: 2px; }
#footer-state, #link-label { font-size: 12px; color: var(--muted); }
#link-label { flex: none; }
.art { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; }
.art > img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: contain; }
.blank { display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.blank img { width: 48px; height: 48px; }
.display-foot { display: flex; align-items: center; gap: 18px; position: relative; min-height: 44px; margin: 12px 10px 0; border: 2px dotted var(--edge); border-radius: 14px; padding-inline: 17px; }
.pixel-flower { width: 4px; height: 4px; background: var(--edge); flex: none; box-shadow: 0 -6px var(--edge), 0 6px var(--edge), -6px 0 var(--edge), 6px 0 var(--edge); }
#empty-message { flex: 1; text-align: center; font-size: 14px; letter-spacing: .08em; color: var(--muted); }
#ticker { display: flex; align-items: center; flex: 1; min-width: 0; overflow: hidden; font-size: 14px; }
#ticker span { display: block; flex: none; width: max-content; padding-inline: 4px; white-space: pre; }
#ticker.overflow { mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent); }
.face .display-bar, .face .display-foot { display: none; }
.face .art img { object-fit: contain; }
#event-dot { position: absolute; right: 0; top: 12px; display: grid; place-items: center; color: var(--accent-text); }
.preview-meta { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 48px; font-size: 11px; color: var(--muted); }
.preview-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.preview-meta svg { width: 14px; height: 14px; }
.motion-controls { display: flex; gap: 8px; }
.motion-controls button { min-height: 32px; padding: 2px 5px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.motion-controls button[aria-pressed="true"] { color: var(--accent-text); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 5px; }
.side { min-height: 100%; padding-left: 28px; border-left: 1px dashed var(--edge); }
.role-control { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 83px; padding-bottom: 18px; border-bottom: 1px solid var(--edge); }
.role-control > label { flex: none; }
.role-control label .section-en, .control-heading .section-en { margin-bottom: 4px; font-size: 9px; }
.role-picker { flex: 1; min-width: 0; position: relative; }
.role-picker select { width: 100%; min-height: 44px; appearance: none; padding: 4px 24px 4px 8px; border-color: transparent; background: transparent; color: var(--accent-text); font-size: 22px; }
.role-picker select option { color: var(--ink); background: var(--surface); font-size: 16px; }
.role-picker > span { pointer-events: none; position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; font-size: 0; color: var(--muted); }
.role-picker svg { width: 16px; height: 16px; transform: rotate(90deg); }
.mode-control { padding: 23px 0 22px; border-bottom: 1px solid var(--edge); }
.control-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.control-heading > span { color: var(--muted); font-size: 11px; }
.mode-slider { display: grid; grid-template-columns: 1fr 1fr; position: relative; padding: 4px; margin-top: 16px; border: 1px dotted var(--edge); border-radius: 4px; isolation: isolate; }
.mode-slider-thumb { position: absolute; left: 4px; top: 4px; bottom: 4px; width: calc(50% - 4px); border: 1px dotted var(--accent); background: var(--faint); border-radius: 2px; transition: transform 180ms cubic-bezier(.2,.8,.2,1); z-index: -1; }
.mode-slider:has(#face-mode[aria-pressed="true"]) .mode-slider-thumb { transform: translateX(100%); }
.mode-slider button { display: grid; justify-items: center; gap: 0; min-height: 49px; padding: 5px 8px; border: 0; background: transparent; color: var(--muted); }
.mode-slider button small { font-size: 9px; letter-spacing: .1em; }
.mode-slider button[aria-pressed="true"] { color: var(--accent-text); }
.mode-slider button:hover:enabled { background: transparent; color: var(--ink); }
.hint { margin-top: 11px; font-size: 12px; color: var(--muted); }
.sound-control { padding-top: 23px; }
.sound-toggle { display: flex; align-items: center; gap: 14px; margin: 12px 0 8px; }
#sound-status { width: 3em; font-size: 13px; color: var(--muted); }
#sound-label { margin-left: auto; color: var(--muted); font-size: 11px; }
.led-switch { position: relative; width: 76px; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; flex: none; }
.led-switch::before { content: ""; position: absolute; inset: 7px 0; border: 2px dotted var(--edge); border-radius: 4px; background: var(--surface); }
.led-switch i { position: absolute; left: 6px; top: 12px; width: 24px; height: 20px; background: radial-gradient(circle, var(--muted) 1.2px, transparent 1.4px) center / 5px 5px; transition: transform 180ms cubic-bezier(.2,.8,.2,1); }
.led-switch[aria-checked="true"]::before { border-color: var(--accent); background: var(--faint); }
.led-switch[aria-checked="true"] i { transform: translateX(40px); background-image: radial-gradient(circle, var(--accent-text) 1.2px, transparent 1.4px); }
.led-switch:hover:enabled { background: transparent; }
.led-switch:hover:enabled::before { border-color: var(--accent-text); }
.volume-control { display: flex; align-items: center; gap: 12px; }
.volume-control svg { width: 16px; height: 16px; color: var(--muted); }
.volume-control output { min-width: 3ch; color: var(--muted); font-size: 11px; text-align: right; }
input[type="range"] { appearance: none; width: 100%; min-width: 0; height: 36px; padding: 0; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: radial-gradient(circle, var(--edge) 1.2px, transparent 1.5px) center / 6px 6px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 18px; margin-top: -6px; border: 1px dotted var(--accent-text); border-radius: 2px; background: var(--accent); }
input[type="range"]::-moz-range-track { height: 6px; background: radial-gradient(circle, var(--edge) 1.2px, transparent 1.5px) center / 6px 6px; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 18px; border: 1px dotted var(--accent-text); border-radius: 2px; background: var(--accent); }
.slogan { text-align: center; margin-top: 34px; padding: 26px 0 10px; border-top: 1px solid var(--edge); }
.slogan p:first-child { color: var(--ink); font-size: 15px; letter-spacing: .08em; }
.slogan p[lang="en"] { margin-top: 7px; font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.current-message { padding: 16px 0; border-top: 1px dashed var(--edge); font-size: 14px; }
.current-message p { overflow-wrap: anywhere; white-space: pre-wrap; }
.current-message .actions { margin-top: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 22px; color: var(--muted); font-size: 12px; min-height: 30px; }
.back-link svg { width: 14px; height: 14px; transform: rotate(180deg); }
.back-link:hover { color: var(--accent-text); }
.back-link + .page-head { padding-top: 14px; }
.settings-gateways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-bottom: 28px; }
.settings-entry { display: flex; align-items: center; gap: 18px; padding: 18px 0; border-top: 1px dashed var(--edge); border-bottom: 1px dashed var(--edge); }
.settings-entry > div { min-width: 100px; }
.settings-entry h2 { color: var(--accent-text); }
.entry-purpose { color: var(--muted); font-size: 11px; }
.settings-entry p { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.settings-entry:hover { background: var(--faint); }
.settings-entry > svg { width: 16px; height: 16px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.panel { border: 1px dashed var(--edge); border-radius: 8px; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px dashed var(--edge); }
.card-head > span { color: var(--muted); font-size: 11px; }
.body { padding: 20px; }
.body p { margin-bottom: 20px; }
.subtle, .empty { color: var(--muted); font-size: 14px; }
.body label { display: flex; justify-content: space-between; margin: 20px 0 7px; font-size: 14px; }
.body label:first-child { margin-top: 0; }
.body input:not([type="checkbox"]), .body select { width: 100%; }
.body input[type="file"] { font-size: 12px; margin: 4px 0 20px; }
input::file-selector-button { font: inherit; color: var(--ink); margin-right: 10px; }
.records { list-style: none; margin: 0; padding: 0; }
.records li { padding: 18px 20px; border-bottom: 1px dashed var(--edge); }
.records li:last-child { border-bottom: 0; }
.records p { overflow-wrap: anywhere; white-space: pre-wrap; margin-bottom: 10px; }
.records small { color: var(--muted); font-size: 12px; }
.role-row, .record-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.record-actions { flex-wrap: wrap; }
.role-row strong, .role-row small { display: block; }
.role-row strong { font-weight: 400; }
.role-row[aria-current="true"] { background: var(--faint); }
.role-row[aria-current="true"] strong { color: var(--accent-text); }
.role-note { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px dashed var(--edge); color: var(--muted); font-size: 11px; }
.role-note strong { font-weight: 400; }
.body dl { display: grid; grid-template-columns: 82px 1fr; gap: 8px; font-size: 13px; }
.body dt { color: var(--muted); }
.body dd { overflow-wrap: anywhere; }
.body .check-row { justify-content: flex-start; align-items: center; gap: 9px; font-size: 13px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.actions button, .records button { font-size: 13px; }
#feedback { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 5; max-width: min(520px, 90vw); width: max-content; padding: 10px 16px; background: #181118; border: 1px solid var(--accent); border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }
#font-warning { padding: 10px; text-align: center; font-size: 14px; }

@media (max-width: 900px) {
  .dashboard { gap: 24px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .side { padding-left: 22px; }
  .preview-panel { padding-inline: 16px; }
  .screen { height: 350px; }
  .preview-meta { flex-wrap: wrap; gap: 8px 12px; padding-block: 6px; }
  .role-control { gap: 10px; }
  .role-picker select { font-size: 20px; }
  .control-heading > span { font-size: 10px; }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .mast { min-height: 76px; }
  .brand img { width: 34px; height: 34px; }
  .wordmark strong { font-size: 22px; }
  .wordmark small { font-size: 9px; }
  .page-head { padding: 24px 0 18px; gap: 12px; }
  h1 { font-size: 26px; }
  .service { font-size: 11px !important; gap: 5px; }
  .dashboard, .two-col { grid-template-columns: 1fr; gap: 24px; }
  .preview-panel { padding-inline: 15px; }
  .screen { height: clamp(290px, 85vw, 390px); }
  .display-bar { min-height: 42px; gap: 8px; }
  .display-bar h2 { font-size: 14px; }
  #footer-state, #link-label { font-size: 11px; }
  .display-foot { min-height: 42px; margin-inline: 4px; gap: 14px; }
  .preview-meta { justify-content: center; gap: 8px 14px; min-height: 45px; }
  .side { padding-left: 0; border-left: 0; }
  .role-control { min-height: 67px; padding-bottom: 16px; }
  .role-picker { max-width: 190px; }
  .role-picker select { font-size: 22px; padding-left: 12px; }
  .mode-control { padding: 20px 0; }
  .control-heading > span { font-size: 12px; }
  .mode-slider { margin-top: 14px; }
  .mode-slider button { min-height: 52px; }
  .sound-control { padding-top: 20px; }
  .sound-toggle { margin-block: 10px 6px; }
  .slogan { margin-top: 26px; padding-top: 23px; }
  .slogan p:first-child { font-size: 13px; letter-spacing: .025em; }
  .slogan p[lang="en"] { font-size: 10px; letter-spacing: .015em; }
  .settings-gateways { grid-template-columns: 1fr; gap: 0; margin-bottom: 22px; }
  .settings-entry + .settings-entry { border-top: 0; }
  .settings-entry { padding: 15px 0; }
  .card-head, .body, .records li { padding: 16px; }
  .role-note { flex-wrap: wrap; padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .mode-slider-thumb, .led-switch i { transition: none; }
}

.device-controls-grid { margin-top: 28px; }
.device-controls-grid textarea { width: 100%; box-sizing: border-box; resize: vertical; color: inherit; background: transparent; border: 1px solid currentColor; padding: 10px; font: inherit; }
.device-controls-grid p { overflow-wrap: anywhere; }
.device-controls-grid button { margin-top: 12px; }
.device-controls-grid textarea:disabled { opacity: .5; }
