:root {
  color-scheme: light;
  --ink: #0b1220;
  --muted: #505c6f;
  --paper: #edf2f8;
  --surface: #fff;
  --line: #c9d4e1;
  --accent: #096b65;
  --accent-2: #0d9488;
  --danger: #a12336;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); line-height: 1.5; }
main { width: min(100% - 2rem, 1180px); margin-inline: auto; padding-block: 1.5rem 3rem; }
header p, .muted, .hint, small { color: var(--muted); }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin: .35em 0 .1em; line-height: 1.2; }
h2, h3 { line-height: 1.25; margin: 0 0 .7rem; }
p { margin: .3rem 0 1rem; }
a { color: var(--accent); }
.back, .back-link { font-weight: 650; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid #087e75; outline-offset: 3px; }
.panel, .card {
  min-width: 0;
  padding: clamp(.9rem, 2vw, 1.35rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}
.stack, .grid, .columns, .split { display: grid; align-items: start; gap: 1rem; }
.stack { grid-template-columns: minmax(0, 1fr); }
.columns, .split, .grid.two, .grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row, .toolbar, .actions, .tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.toolbar, .actions { margin-block: .6rem; }
label, legend { font-weight: 600; }
.stack > *, .grid > *, .columns > *, .split > *, .row > *, .toolbar > *, label { min-width: 0; }
input[type='file'] { width: 100%; }
label { overflow-wrap: anywhere; }
label:not(:has(input[type='checkbox'], input[type='radio'])) > :is(input, textarea, select) { margin-top: .25rem; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .6rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button, .btn, select, input:not([type='range'], [type='color'], [type='checkbox'], [type='radio']), textarea {
  max-width: 100%;
  padding: .5rem .7rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--surface);
}
button, .button, .btn { cursor: pointer; text-decoration: none; font-weight: 650; }
button:hover:not(:disabled), .button:hover, .btn:hover { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: not-allowed; }
.primary, button[aria-pressed='true'], button[aria-selected='true'] { background: var(--accent); border-color: var(--accent); color: #fff; }
input[type='checkbox'], input[type='radio'], input[type='range'] { accent-color: var(--accent); }
textarea { display: block; width: 100%; min-height: 10rem; resize: vertical; }
textarea, pre, code, .mono { font-family: var(--mono); }
pre, .output { min-width: 0; max-width: 100%; overflow: auto; }
pre { margin: .5rem 0; padding: .75rem; background: #f4f7fb; border-radius: .55rem; tab-size: 2; }
.output { overflow-wrap: anywhere; }
img, canvas, video, iframe { max-width: 100%; }
iframe { border: 1px solid var(--line); background: white; }
.error, [role='alert'] { color: var(--danger); overflow-wrap: anywhere; }
.status:empty, .error:empty { display: none; }
.scroll, .table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .4rem .55rem; text-align: start; border-bottom: 1px solid var(--line); }
.dropzone { padding: 1.25rem; border: 2px dashed var(--line); border-radius: .8rem; }
.dropzone.dragover { border-color: var(--accent); background: #e2f7f2; }
mark { background: #fef0b4; color: #472a05; }
@media (max-width: 720px) {
  .columns, .split, .grid.two, .grid.two-cols { grid-template-columns: minmax(0, 1fr); }
  main { width: min(100% - 1.25rem, 1180px); }
}
