:root {
  color-scheme: light;
  --ink: #162033;
  --muted: #687386;
  --line: #dfe5ec;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --navy: #15243a;
  --blue: #2864d7;
  --blue-dark: #1e4eae;
  --green: #1f936b;
  --red: #c84d55;
  --shadow: 0 12px 30px rgba(22, 32, 51, .07);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font: 14px/1.5 "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; color: #a9c8ff; font-weight: 700; }
.brand-name { font-weight: 700; letter-spacing: .02em; }
.brand-subtitle { color: #aeb8c9; font-size: 11px; margin-top: 1px; }
.connection-pill { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #c6cfdd; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #aeb8c9; }
.connection-pill[data-state="online"] .status-dot { background: #5fd6a4; box-shadow: 0 0 0 3px rgba(95,214,164,.15); }
.connection-pill[data-state="online"] { color: #e7fff5; }
.page-shell { width: min(1400px, 90vw); margin: 0 auto; padding: 46px 0 72px; }
.hero-row { display: grid; grid-template-columns: 1.2fr .8fr; align-items: end; gap: 42px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(28px, 3vw, 42px); line-height: 1.12; letter-spacing: -.02em; }
h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.hero-copy { max-width: 640px; margin-bottom: 0; color: var(--muted); font-size: 15px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.device-connect { padding: 17px; }
.device-connect label, .field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.connect-form { display: flex; gap: 8px; }
input[type="url"], input[type="number"], select { width: 100%; height: 40px; border: 1px solid #ccd5e0; border-radius: 5px; background: #fff; color: var(--ink); padding: 0 11px; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,100,215,.12); }
.helper { margin-top: 8px; color: var(--muted); font-size: 12px; }
.button { min-height: 38px; border: 1px solid transparent; border-radius: 5px; padding: 0 14px; font-weight: 700; transition: background .15s ease, border-color .15s ease, transform .15s ease; white-space: nowrap; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { border-color: #cbd5e2; background: #fff; color: var(--ink); }
.button.secondary:hover { border-color: var(--blue); color: var(--blue); }
.button.danger { border-color: #efc4c7; background: #fff; color: var(--red); }
.button.wide { width: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-card { padding: 17px 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.metric-label, .metric-note { color: var(--muted); font-size: 12px; }
.metric-value { margin: 5px 0 1px; font-size: 23px; font-weight: 750; letter-spacing: -.02em; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 18px; }
.files-panel, .control-panel, .config-panel, .help-panel { padding: 22px; }
.side-column { display: grid; gap: 18px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading.compact { margin-bottom: 17px; }
.upload-zone { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px dashed #b8c8dc; border-radius: 7px; background: #f8fbff; }
.upload-zone.dragover { border-color: var(--blue); background: #edf4ff; }
.upload-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: #e0ebff; color: var(--blue); font-size: 25px; line-height: 1; }
.upload-zone strong { display: block; }
.upload-zone p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.upload-zone .button { margin-left: auto; }
.progress-wrap { margin-top: 13px; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #e6ebf1; }
.progress-bar { width: 0; height: 100%; background: var(--blue); transition: width .15s ease; }
.table-wrap { overflow-x: auto; margin-top: 22px; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
th, td { padding: 13px 9px; border-bottom: 1px solid #edf0f4; }
td { color: #334056; }
.file-name { color: var(--ink); font-weight: 700; }
.file-meta { color: var(--muted); font-size: 12px; }
.actions-column { width: 210px; text-align: right; }
.row-actions { display: flex; justify-content: end; gap: 7px; }
.row-actions .button { min-height: 31px; padding: 0 10px; font-size: 12px; }
.empty-state { padding: 34px 10px; color: var(--muted); text-align: center; }
.now-playing { min-height: 48px; display: flex; align-items: center; padding: 0 13px; margin-bottom: 12px; border: 1px solid #e1e7ef; border-radius: 5px; background: #f8fafc; color: var(--muted); }
.control-row { margin-top: 18px; padding-top: 16px; border-top: 1px solid #edf0f4; }
.inline-controls { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.inline-controls input { min-width: 0; }
.inline-controls span { color: var(--muted); font-size: 12px; }
.range-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.range-row .field-label { margin-bottom: 0; }
output { color: var(--blue); font-size: 12px; font-weight: 800; }
input[type="range"] { width: 100%; accent-color: var(--blue); }
.toggle-row { display: flex; align-items: center; gap: 9px; margin: 18px 0; color: #435069; font-size: 13px; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle { width: 35px; height: 20px; position: relative; flex: none; border-radius: 99px; background: #cbd5e1; transition: background .15s ease; }
.toggle::after { content: ""; width: 16px; height: 16px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .15s ease; }
.toggle-row input:checked + .toggle { background: var(--blue); }
.toggle-row input:checked + .toggle::after { transform: translateX(15px); }
.help-panel ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.help-panel li + li { margin-top: 8px; }
code { padding: 1px 4px; border-radius: 3px; background: #eef2f6; color: #3f5067; font-family: Consolas, monospace; }
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 5; display: grid; gap: 8px; width: min(360px, calc(100vw - 44px)); }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 6px; background: #fff; box-shadow: var(--shadow); color: var(--ink); }
.toast.error { border-left-color: var(--red); }
@media (max-width: 1020px) { .hero-row, .content-grid { grid-template-columns: 1fr; } .side-column { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .topbar { padding: 0 5vw; } .page-shell { width: 90vw; padding-top: 30px; } .metric-grid { grid-template-columns: repeat(2, 1fr); } .side-column { grid-template-columns: 1fr; } .upload-zone { align-items: start; flex-wrap: wrap; } .upload-zone .button { margin-left: 48px; } .actions-column { width: 175px; } }
@media (max-width: 460px) { .connect-form { display: grid; grid-template-columns: 1fr; } .metric-value { font-size: 20px; } .files-panel, .control-panel, .config-panel, .help-panel { padding: 17px; } .row-actions { flex-wrap: wrap; } }
