/* Theme base, inlined from the shared app-style.css. App pages load only
   their own stylesheet, so the variables and base rules must live here. */
:root {
  color-scheme: light;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  --canvas: #f5f5f7;
  --surface: #fff;
  --recessed: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #65656b;
  --line: rgb(0 0 0 / .06);
  --control-line: rgb(0 0 0 / .14);
  --selected: rgb(0 0 0 / .075);
  --accent: #0071e3;
  --accent-hover: #0065cc;
  --accent-ink: #fff;
  --motion: .2s cubic-bezier(.16, 1, .3, 1);
  color: var(--ink);
  background: var(--canvas);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #161618;
  --surface: #1e1e20;
  --recessed: #242426;
  --ink: #f5f5f7;
  --muted: #ababaf;
  --line: rgb(255 255 255 / .08);
  --control-line: rgb(255 255 255 / .19);
  --selected: rgb(255 255 255 / .10);
  --accent: #5aaaf9;
  --accent-hover: #7bbaff;
  --accent-ink: #101820;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; transition: background-color var(--motion), color var(--motion); }
main { width: min(896px, calc(100% - 32px)); margin: clamp(32px, 7vw, 80px) auto; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
h1 { font-size: clamp(2.25rem, 5vw, 4rem); font-weight: 600; line-height: 1.12; letter-spacing: -.045em; margin: 16px 0 8px; }
p { color: var(--muted); margin: 0; }
a { color: var(--ink); text-underline-offset: .2em; }
.panel { display: grid; gap: 24px; margin-block-start: 32px; border: 1px solid var(--line); border-radius: 24px; padding: clamp(16px, 4vw, 32px); background: var(--surface); }
label { min-width: 0; font-size: 14px; font-weight: 500; display: grid; gap: 8px; }
label:has(output) { grid-template-columns: 1fr auto; }
label input[type=range] { grid-column: 1 / -1; accent-color: var(--accent); }
input, select, textarea { min-width: 0; width: 100%; color: inherit; background: var(--recessed); border: 1px solid var(--control-line); border-radius: 8px; font: inherit; padding: 8px 12px; }
.of-url-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
button, .button { display: inline-flex; justify-content: center; align-items: center; background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: 8px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 500; padding: 8px 16px; text-decoration: none; cursor: pointer; transition: background-color var(--motion), transform var(--motion); }
button:not(:disabled):hover, .button:hover { background: var(--accent-hover); }
button:not(:disabled):active, .button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: wait; }
.secondary { color: var(--ink); background: var(--recessed); }
.secondary:not(:disabled):hover, a.secondary:hover { background: var(--selected); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; gap: 4px; background: var(--recessed); border: 1px solid var(--control-line); border-radius: 10px; padding: 4px; }
.seg button { background: transparent; color: var(--ink); border: 0; min-height: 36px; border-radius: 7px; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand-line { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .14em; padding: 20px 0 calc(28px + env(safe-area-inset-bottom, 0px)); margin: 0; }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } :active { transform: none !important; } }

/* ---- sampling-theorem （折频） ---- */
main h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; }
.panel > p { margin: 0; }
label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
label.check input[type="checkbox"] { width: auto; accent-color: var(--accent); }
output { font-variant-numeric: tabular-nums; font-weight: 600; }
#time-plot, #freq-plot { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 12px; }
#wheel { display: block; width: min(420px, 100%); height: auto; margin-inline: auto; border: 1px solid var(--line); border-radius: 12px; }
#verdict { font-size: 1.05rem; font-weight: 600; color: var(--ink); min-height: 1.55em; }
#verdict[data-verdict="alias"] { color: #e5484d; }
#verdict[data-verdict="critical"] { color: #b25e00; }
:root[data-theme="dark"] #verdict[data-verdict="alias"] { color: #ff6961; }
:root[data-theme="dark"] #verdict[data-verdict="critical"] { color: #ffb224; }
#wheel-status, #audio-status, #share-status { min-height: 1.4em; }
#share-status:empty, #audio-status:empty { display: none; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.stats > div { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stats strong { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stats .muted { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: minmax(0, 1fr); } }
