:root {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #0f172a;
  background: #f8fafc;
  font-size: 14px;
  --brand: #2563eb;
  --line: #e2e8f0;
  --muted: #64748b;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1440px; margin: auto; min-height: 72px; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 20px; color: #0f172a; text-decoration: none; font-size: 23px; font-weight: 750; letter-spacing: -1px; }
.brand span { border-left: 1px solid var(--line); padding-left: 20px; color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; }
#identity { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #475569; }
main { max-width: 1440px; margin: auto; padding: 36px 32px 64px; }
h1 { margin: 7px 0 0; font-size: 28px; font-weight: 650; line-height: 1.4; letter-spacing: -.8px; }
h2 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.5; }
p { line-height: 1.7; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; }
.alert-pill { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border: 1px solid #e8edf4; border-radius: 9px; background: #f1f5f9; color: #475569; }
.alert-pill svg { width: 17px; height: 17px; flex-shrink: 0; color: #94a3b8; margin-top: 3px; }
.alert-pill p { margin: 0; font-size: 12px; }
.alert-pill span { color: var(--muted); }
.userscript-setup { margin-bottom: 28px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.userscript-setup > p { margin: 7px 0 12px; color: var(--muted); font-size: 12px; }
.userscript-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.userscript-actions a { font-size: 13px; }
.userscript-setup > .hint { margin: 0; font-size: 11px; }
.userscript-token { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; max-width: 620px; margin-top: 16px; }
.userscript-token label { flex: 1; min-width: 180px; margin: 0; }
.layout { display: grid; grid-template-columns: 432px minmax(0, 1fr); gap: 24px; align-items: start; }
.configuration, .monitor, #login { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(15,23,42,.035); }
.configuration { padding: 24px; }
.card-heading { margin-bottom: 24px; }
.card-heading p, .section-description { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
fieldset { min-width: 0; padding: 20px 0 0; margin: 0 0 24px; border: 0; border-top: 1px solid var(--line); }
legend { color: #475569; font-size: 13px; font-weight: 600; padding: 0 12px 0 0; }
legend::before { content: ''; display: inline-block; vertical-align: -1px; width: 3px; height: 12px; border-radius: 2px; margin-right: 8px; background: #334e7d; }
label, .field-label { display: block; color: #334155; font-size: 12px; font-weight: 500; }
label, .field { margin-bottom: 16px; }
label input, label select, label textarea { margin-top: 7px; }
.field > label { margin: 0 0 7px; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; color: #0f172a; transition: border-color .15s, box-shadow .15s; }
input, select { height: 38px; padding: 0 10px; }
select { padding-right: 5px; font-size: 12px; }
textarea { padding: 10px 12px; resize: vertical; min-height: 130px; line-height: 1.7; font-size: 12px; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
button:focus-visible, a:focus-visible { outline: 2px solid #3b82f6; outline-offset: 3px; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--brand); border-radius: 6px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; }
button:hover { background: #1d4ed8; border-color: #1d4ed8; }
button:disabled { opacity: .55; cursor: wait; }
button svg { width: 15px; height: 15px; flex-shrink: 0; }
.secondary { background: #fff; border-color: var(--line); color: #475569; }
.secondary:hover { background: #f1f5f9; border-color: #cbd5e1; }
.pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.password-field { position: relative; }
.password-field input { padding-right: 36px; }
.icon-button { position: absolute; right: 3px; top: 3px; width: 32px; height: 32px; min-height: 0; padding: 0; background: transparent; border: 0; color: #94a3b8; }
.icon-button:hover { background: #f1f5f9; color: #475569; }
.icon-button svg { width: 17px; height: 17px; }
.eye-slash { display: none; }
.icon-button[aria-pressed=true] .eye-slash { display: block; }
.film { margin: 2px 0 20px; padding: 15px 14px; border: 1px solid #edf1f6; border-radius: 8px; background: #f8fafc; }
.timeline-labels, .sample-captions { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--muted); }
.timeline-labels b { font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; font-weight: 400; color: #94a3b8; margin-left: 3px; }
.timeline-track { display: block; width: 100%; height: 10px; margin: 13px 0; overflow: hidden; border-radius: 999px; }
.track-base { fill: #e2e8f0; }
.sample-a { fill: #3b82f6; background: #3b82f6; }
.sample-b { fill: #0d9488; background: #0d9488; }
.sample-captions > span { display: inline-flex; align-items: center; gap: 5px; }
.sample-captions b { color: #475569; font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 6px; height: 6px; border-radius: 2px; }
.range { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.unit-input { position: relative; min-width: 0; flex: 1; }
.unit-input input { padding: 0 21px 0 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.unit-input > span { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); pointer-events: none; color: #94a3b8; font-size: 11px; }
.range-to { flex: 0 0 auto; color: #94a3b8; font-size: 11px; }
.hint { margin: -4px 0 0; color: #94a3b8; font-size: 11px; line-height: 1.8; }
.retry-settings { border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 20px; }
.retry-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.retry-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
input:disabled { background: #f8fafc; color: #94a3b8; cursor: not-allowed; }
.form-action { border-top: 1px solid var(--line); padding-top: 20px; }
#start { width: 100%; height: 42px; }
#start span { margin-left: auto; }
.monitor { min-height: 520px; padding: 24px; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; scrollbar-width: thin; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
#refresh { flex-shrink: 0; }
#refresh[aria-busy=true] svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tasks { display: grid; gap: 8px; margin: 20px 0; }
.tasks:empty { display: none; }
.task { display: block; text-align: left; width: 100%; color: #334155; background: #fff; border: 1px solid var(--line); padding: 12px 14px; font-weight: 500; line-height: 1.6; }
.task:hover { border-color: #cbd5e1; background: #f8fafc; }
.task.selected { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.task small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 5px; }
.empty-state { min-height: 405px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 32px 12px; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; background: #f8fafc; border: 1px solid #edf1f6; border-radius: 16px; color: #94a3b8; margin-bottom: 18px; }
.empty-icon svg { width: 36px; height: 36px; }
.empty-state h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: #334155; }
.empty-state p { color: #94a3b8; font-size: 12px; max-width: 360px; margin: 0; line-height: 1.9; }
#detail { border-top: 1px solid var(--line); padding-top: 20px; }
#taskTitle { font-size: 14px; }
#taskStatus { font-size: 12px; color: var(--muted); }
progress { width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden; accent-color: var(--brand); background: #f1f5f9; }
progress::-webkit-progress-bar { background: #f1f5f9; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); }
.exports { display: flex; gap: 18px; margin: 18px 0; font-size: 12px; }
a { color: var(--brand); cursor: pointer; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 10px; overflow-wrap: anywhere; }
th { background: #f8fafc; color: var(--muted); font-weight: 500; white-space: nowrap; }
td button { min-height: 28px; padding: 3px 9px; font-size: 11px; }
.error { color: #dc2626; font-size: 12px; overflow-wrap: anywhere; }
pre { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 16px; white-space: pre-wrap; max-height: 500px; overflow: auto; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; line-height: 1.8; }
#login { max-width: 420px; margin: 7vh auto; padding: 28px; }
#login h1 { font-size: 24px; }
#login p { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
#login button { width: 100%; }
#notice:not(:empty) { background: #eff6ff; color: #1e40af; border-bottom: 1px solid #dbeafe; padding: 12px max(24px, calc((100vw - 1376px)/2)); font-size: 13px; }
footer { max-width: 1440px; margin: auto; padding: 20px 32px; color: #94a3b8; font-size: 11px; border-top: 1px solid var(--line); }
footer span { padding: 0 8px; color: #cbd5e1; }
[hidden] { display: none !important; }
@media (max-width: 1050px) { .layout { grid-template-columns: 400px minmax(0,1fr); } .heading { align-items: flex-start; } .alert-pill { max-width: 330px; } .desktop-break { display: none; } }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0,1fr); } .monitor { position: static; max-height: none; } .heading { flex-direction: column; gap: 18px; } .alert-pill { max-width: none; } .configuration, .monitor { padding: 24px; } .header-inner, main { padding-left: 24px; padding-right: 24px; } }
@media (max-width: 480px) { .header-inner { padding: 14px 16px; } .brand { font-size: 20px; gap: 10px; } .brand span { font-size: 11px; padding-left: 10px; } #identity { gap: 8px; } #identity > span { display: none; } #identity button { font-size: 11px; padding: 0 9px; } main { padding: 24px 16px 40px; } h1 { font-size: 24px; } .configuration, .monitor { padding: 20px; } .pair { gap: 10px; } .interval-pair { grid-template-columns: 1fr; gap: 0; } .range { gap: 12px; } .monitor { min-height: 480px; } .empty-state { min-height: 360px; } .sample-captions { gap: 6px; } footer { padding: 20px 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
