:root {
  color-scheme: light dark;
  --page: #f8f6f6;
  --panel: #fff;
  --line: #eae2e3;
  --ink: #252024;
  --muted: #64585e;
  --accent: #ac2e4b;
  --accent-ink: #fff;
  --shade: #f8eaee;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 Inter, "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #191719;
    --panel: #242124;
    --line: #40363c;
    --ink: #f4eef1;
    --muted: #c2b4bd;
    --accent: #ff9cb0;
    --accent-ink: #350d19;
    --shade: #432634;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
main, section, div { min-width: 0; }
h1, h2, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(22px, 4vw, 31px); letter-spacing: -.025em; }
h2 { font-size: 17px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button, .file-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600;
  min-height: 38px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none;
}
button:hover, .button:hover, .file-button:hover, button[aria-pressed=true] { background: var(--shade); }
button:disabled { opacity: .48; cursor: default; }
button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
button.danger, .error { color: var(--accent); }
button.quiet { min-height: 32px; padding: 4px 9px; }
:is(a, button, input, textarea):focus-visible, .file-button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
input:not([type=checkbox], [type=file]), textarea {
  min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel);
}
textarea { resize: vertical; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
label { display: grid; gap: 5px; }
.file-button { position: relative; }
.file-button input { position: absolute; opacity: 0; inset: 0; width: 100%; cursor: pointer; }
.frame { width: min(100% - 32px, 1280px); margin-inline: auto; }
.mobile-frame { width: min(100% - 28px, 560px); margin-inline: auto; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-inner { min-height: 62px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.top-inner > button { margin-left: auto; }
.top-inner > span, .hint, small { color: var(--muted); font-size: 13px; }
.brand { color: var(--accent); font-size: 20px; font-weight: 750; text-decoration: none; }
.dashboard { display: grid; grid-template-columns: 155px minmax(0, 1fr); align-items: start; gap: 24px; padding: 22px 0 48px; }
.rail h2 { padding: 8px 0; }
.rail nav { display: grid; gap: 7px; }
.rail button { justify-content: flex-start; overflow-wrap: anywhere; text-align: left; }
.panel { margin-bottom: 14px; padding: clamp(14px, 2vw, 22px); border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.panel > .heading, #workspace > .heading { margin-bottom: 12px; }
.heading, .item { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; }
.heading p { color: var(--muted); }
.status { margin-bottom: 9px; white-space: pre-wrap; color: var(--muted); }
.status.error { color: var(--accent); }
.status:empty { display: none; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.inset { padding: 12px; margin: 10px 0; background: var(--page); border: 1px solid var(--line); border-radius: 8px; }
.inset .actions { margin-top: 8px; }
.table-wrap { overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 645px; border-collapse: collapse; }
td, th { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--page); font-size: 12px; }
td:last-child { min-width: 104px; }
td input[type=checkbox] { margin-top: 7px; }
td:nth-child(3) { width: 23%; }
td:nth-child(4) { width: 33%; }
td:nth-child(5) { width: 20%; }
tr:last-child td { border-bottom: 0; }
.editing-actions { margin-top: 12px; align-items: end; }
.compact { min-width: 150px; flex: 1 1 160px; max-width: 330px; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.item { border-bottom: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
.item a { color: var(--accent); overflow-wrap: anywhere; }
.item:last-child { border-bottom: 0; }
.check-line { display: flex; gap: 8px; align-items: center; }
.pair-code { display: inline-block; font: 700 22px/1.5 ui-monospace, monospace; letter-spacing: .07em; margin: 5px 10px 5px 0; }
.dispatch { display: flex; flex-direction: column; align-items: start; gap: 9px; }
.dispatch label { width: 100%; }
dialog {
  width: min(100% - 30px, 575px); border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--ink); padding: 21px;
}
dialog::backdrop { background: #21161f70; }
dialog form, #pair-form { display: grid; gap: 12px; }
dialog .actions { margin-top: 10px; }
.file-row { align-items: center; }
.chip { border-radius: 5px; background: var(--shade); color: var(--accent); padding: 3px 7px; }
#empty p { margin: 7px 0 14px; }
#device-empty { margin-bottom: 12px; }
summary { cursor: pointer; font-weight: 650; }
.folder-list { display:grid; gap:6px; max-height:18rem; overflow:auto; margin:10px 0; }
.folder-list button { justify-content:flex-start; text-align:left; overflow-wrap:anywhere; }
#folder-current, #folder-status { margin-block:5px; }
details form { margin-block: 8px; align-items: end; }
select { max-width:100%; padding: 7px 10px; border:1px solid var(--line); border-radius:8px; background:var(--panel); }
.mobile-workspace { padding: 16px 0 40px; }
.space-filter { margin: 10px 0; }
.batch { margin-top: 10px; }
.note-link { margin-top: 8px; width: 100%; justify-content: space-between; gap: 12px; text-align: left; overflow-wrap: anywhere; }
#detail h1 { margin: 12px 0 7px; }
.copy, .topics { white-space: pre-wrap; user-select: text; margin-bottom: 9px; }
.topics { color: var(--accent); }
.assets-heading { margin: 18px 0 8px; }
.save-location { margin-bottom:9px; color:var(--muted); }
.save-location p { font-size:13px; margin-top:6px; }
.asset { padding: 8px 0; }
.asset img, .asset video { display: block; width: 100%; max-height: 495px; object-fit: contain; border-radius: 8px; background: var(--page); }
@media (max-width: 750px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .rail nav { display: flex; flex-wrap: wrap; }
  .columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (pointer: coarse) { button, .button, .file-button { min-height: 44px; } }
