:root {
  color-scheme: light dark;
  --bg: #f2f3ee; --panel: #fff; --text: #192822; --muted: #51645b;
  --border: #ccd7d0; --accent: #095940; --accent-text: #fff; --soft: #e5f1e9;
  --alert: #802c29; --alert-bg: #fbeae9;
  font: 16px/1.55 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15201c; --panel: #1c2b24; --text: #eef8ef; --muted: #adcbba;
    --border: #4a6658; --accent: #a7e6bc; --accent-text: #11251b; --soft: #263e31;
    --alert: #ffb8af; --alert-bg: #4c2524;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
.site-header { background: var(--panel); border-bottom: 1px solid var(--border); }
.shell { width: min(1100px, calc(100% - 2.5rem)); margin-inline: auto; }
.bar, nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.bar { justify-content: space-between; padding: .8rem 0; }
nav a, .text-button { min-height: 44px; display: inline-flex; align-items: center; }
.brand { display: flex; align-items: center; gap: .35rem; font-weight: 750; color: var(--text); text-decoration: none; }
.brand-mark { color: var(--accent-text); background: var(--accent); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; margin-right: .35rem; }
main { padding: clamp(1.5rem, 4vw, 4rem) 0 4rem; }
.narrow { max-width: 650px; }
h1 { margin: .35em 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.16; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 1.16rem; }
p { margin: 0; }
main > p + *, main > h1 + form, main > h1 + section, main > h1 + div { margin-top: 1.25rem; }
.lead { color: var(--muted); font-size: 1.08rem; }
.grid, .columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.card { padding: clamp(1rem, 3vw, 1.55rem); border: 1px solid var(--border); border-radius: 1rem; background: var(--panel); min-width: 0; }
.channel-card { display: flex; align-items: center; justify-content: space-between; min-height: 6.5rem; gap: 1rem; text-decoration: none; }
.channel-card:hover { border-color: var(--accent); }
.channel-card strong { color: var(--text); font-size: 1.4rem; }
.stack { display: grid; gap: 1rem; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); align-items: end; gap: .85rem; }
.results { margin-top: 1rem; }
.feedback-row, .compact-row { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; justify-content: space-between; }
.feedback-row { text-decoration: none; color: var(--text); }
.feedback-row:hover { border-color: var(--accent); }
.badge { background: var(--soft); color: var(--accent); border-radius: 1rem; padding: .2rem .7rem; }
label { display: block; min-width: 0; font-weight: 620; }
label > input:not([type=checkbox]), label > select, label > textarea { display: block; width: 100%; margin-top: .3rem; }
input, select, textarea, button { min-height: 44px; padding: .55rem .75rem; font: inherit; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: .54rem; }
input[type=file] { max-width: 100%; }
textarea { resize: vertical; }
button { cursor: pointer; font-weight: 650; }
button:disabled { cursor: progress; opacity: .6; }
button.primary { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
button.text-button { padding: 0; border: 0; color: var(--accent); text-decoration: underline; }
.checkbox { display: flex; align-items: center; gap: .55rem; min-height: 44px; }
input[type=checkbox] { min-height: auto; width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.subtle { color: var(--muted); font-weight: 400; font-size: .9rem; }
.notice { color: var(--alert); background: var(--alert-bg); padding: .9rem; border-radius: .6rem; }
.preserve, pre, .token { white-space: pre-wrap; overflow-wrap: anywhere; }
.preview { max-height: 15rem; overflow: auto; padding: .7rem; background: var(--soft); margin: 0; }
.qr { max-width: 100%; height: auto; border: .5rem solid #fff; border-radius: .5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
fieldset { min-width: 0; border: 1px solid var(--border); border-radius: .7rem; padding: .8rem; }
@media (max-width: 620px) {
  .shell { width: calc(100% - 1.5rem); }
  .grid, .columns { grid-template-columns: minmax(0, 1fr); }
  .feedback-row strong { width: 100%; }
}
