/* 工作台 — calm, paper-and-ink palette; mobile first */
:root {
  --bg: #f5f3ee; --bg2: #efece5; --card: #fffdf9; --ink: #1d1f22; --ink2: #3a3e44; --muted: #737880; --line: #e5e0d6;
  --accent: #2f6f62; --accent-ink: #fff; --accent-soft: #e2eee8;
  --ok: #2e7d57; --ok-soft: #e1f0e7; --warn: #a86a12; --warn-soft: #f7ecd6; --bad: #b8402f; --bad-soft: #f7e1dc;
  --run: #2c63a6; --run-soft: #e0eaf6; --idle: #8a8f96; --idle-soft: #ecebe7;
  --shadow: 0 1px 2px rgba(40, 35, 25, .05), 0 4px 16px rgba(40, 35, 25, .05);
  --radius: 14px; --radius-s: 9px;
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Microsoft YaHei UI", monospace;
  --tabbar: 62px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121416; --bg2: #171a1d; --card: #1b1e21; --ink: #e9e6e0; --ink2: #c9c6c0; --muted: #959aa1; --line: #2a2e33;
  --accent: #6cc3a8; --accent-ink: #0f1a17; --accent-soft: #1d322c;
  --ok: #6cc796; --ok-soft: #1c2f25; --warn: #e3b25c; --warn-soft: #33291a; --bad: #ef8a78; --bad-soft: #3a211d;
  --run: #7fb0ec; --run-soft: #1b2838; --idle: #8b9097; --idle-soft: #24272b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416; --bg2: #171a1d; --card: #1b1e21; --ink: #e9e6e0; --ink2: #c9c6c0; --muted: #959aa1; --line: #2a2e33;
    --accent: #6cc3a8; --accent-ink: #0f1a17; --accent-soft: #1d322c;
    --ok: #6cc796; --ok-soft: #1c2f25; --warn: #e3b25c; --warn-soft: #33291a; --bad: #ef8a78; --bad-soft: #3a211d;
    --run: #7fb0ec; --run-soft: #1b2838; --idle: #8b9097; --idle-soft: #24272b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: .01em; }
.sprite { display: none; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot-mark { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons / chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-weight: 550; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink2); cursor: pointer; }
.icon-btn:hover { background: var(--bg2); }
.count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 17px; font-weight: 700; text-align: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 550; white-space: nowrap; background: var(--idle-soft); color: var(--idle); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.running { background: var(--run-soft); color: var(--run); }
.chip.running::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.spin { animation: spin 1s linear infinite; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 14px; text-align: left; }
.login-logo { border-radius: 14px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 26px; margin-top: 6px; }
.login-sub { margin: -8px 0 8px; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink2); font-weight: 550; display: flex; justify-content: space-between; align-items: center; }
.field input, .field textarea, .input { width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#login-code, .code-input { letter-spacing: .35em; font-family: var(--mono); font-size: 18px; }
#login-code::placeholder, .code-input::placeholder { letter-spacing: normal; font-family: var(--font); font-size: 15px; }
.totp-hint { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.ring { width: 14px; height: 14px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-dasharray: 50.27; stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.login-error { min-height: 1.2em; margin: 0; color: var(--bad); font-size: 13.5px; }
.login-foot { margin: 4px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 650; font-size: 16.5px; }
.brand img { border-radius: 8px; }
.topbar-actions { margin-left: auto; display: flex; gap: 2px; }
.tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabs a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 5px 0 3px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 550; }
.tabs a .ic { width: 23px; height: 23px; }
.tabs a.active { color: var(--accent); }
.tabs a.active .ic { stroke-width: 2; }
.tabs .dot { position: absolute; top: 4px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--card); }
.view { padding: 14px 14px calc(var(--tabbar) + 26px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 210px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; padding: 10px 22px; }
  .tabs { position: sticky; top: 58px; align-self: start; grid-template-columns: 1fr; gap: 2px; padding: 16px 12px; background: transparent; border: 0; backdrop-filter: none; height: calc(100dvh - 58px); align-content: start; }
  .tabs a { grid-auto-flow: column; justify-content: start; gap: 11px; padding: 10px 12px; font-size: 14.5px; }
  .tabs a:hover { background: var(--bg2); }
  .tabs a.active { background: var(--accent-soft); }
  .tabs .dot { position: static; margin-left: auto; }
  .view { padding: 22px 28px 40px; margin: 0; width: 100%; }
}

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(2, 1fr); } .span-2 { grid-column: span 2; } }
@media (min-width: 1240px) { .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.three .span-2 { grid-column: span 2; } .grid.three .span-3 { grid-column: 1 / -1; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.card-head h3 { font-size: 14px; color: var(--ink2); font-weight: 600; }
.card-head .ic { color: var(--accent); width: 18px; height: 18px; }
.card-head .aside { margin-left: auto; font-size: 12px; color: var(--muted); }
.card .err { color: var(--bad); font-size: 13.5px; }
.big { font-size: 30px; font-weight: 680; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.big small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--bg2), var(--line), var(--bg2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin: 8px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* hero */
.hero { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin: 4px 2px 16px; }
.hero h1 { font-size: 23px; }
.hero .status-line { margin-top: 3px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero .actions { margin-left: auto; display: flex; gap: 8px; }
.alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 10px 13px; border-radius: 11px; background: var(--bad-soft); color: var(--bad); font-weight: 550; font-size: 14px; border: 1px solid color-mix(in srgb, var(--bad) 18%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 18%, transparent); }
.alert button { margin-left: auto; }

/* lists */
.list { display: grid; }
.li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; padding-top: 2px; }
.li .main { min-width: 0; flex: 1; }
.li .title { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .sub { font-size: 12.5px; color: var(--muted); }
.li.clickable { cursor: pointer; }
.li.clickable:hover .title { color: var(--accent); }

/* bars */
.bar { height: 7px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }
.stat { display: grid; gap: 5px; margin-top: 10px; }
.stat .row { justify-content: space-between; font-size: 13px; }
.spark { display: flex; align-items: flex-end; gap: 5px; height: 54px; margin-top: 12px; }
.spark .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.spark .col i { display: block; width: 100%; max-width: 26px; min-height: 2px; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--accent) 35%, var(--bg2)); }
.spark .col.today i { background: var(--accent); }
.spark .col span { font-size: 10.5px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* needs-human */
.ask-item { padding: 10px 0; border-top: 1px solid var(--line); }
.ask-item:first-child { border-top: 0; padding-top: 0; }
.ask-item .q { font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.ask-item .q b { color: var(--warn); }
.ask-item.strong .q b { color: var(--bad); }
.ask-item .t { font-size: 13px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ask-item.open .t { -webkit-line-clamp: unset; }

/* ---------- actions ---------- */
.section-title { font-size: 13px; color: var(--muted); font-weight: 600; margin: 20px 4px 9px; letter-spacing: .04em; }
.section-title:first-child { margin-top: 4px; }
.action { display: grid; grid-template-columns: auto 1fr; gap: 4px 13px; align-items: start; }
.action .badge { grid-row: span 3; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.action .badge.side { background: var(--warn-soft); color: var(--warn); }
.action h3 { font-size: 15.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.action p { margin: 0; font-size: 13.5px; color: var(--muted); }
.action .foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.dots { display: flex; gap: 5px; align-items: center; }
.dots button { width: 11px; height: 11px; padding: 0; border: 0; border-radius: 50%; background: var(--idle); cursor: pointer; }
.dots button.ok { background: var(--ok); } .dots button.fail, .dots button.timeout, .dots button.lost { background: var(--bad); } .dots button.running { background: var(--run); }
.action.unavailable { opacity: .6; }

/* ---------- sheet (run log) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 17, 20, .38); animation: fade .18s; }
.sheet-panel { position: relative; max-height: 88dvh; display: grid; grid-template-rows: auto auto 1fr; background: var(--card); border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); animation: rise .22s cubic-bezier(.2, .8, .2, 1); min-height: 0; }
.sheet-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: 17px; }
.sheet-result:empty { display: none; }
.sheet-result { margin-bottom: 10px; max-height: 50dvh; overflow: auto; }
.confirm-panel { grid-template-rows: auto; gap: 10px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 960px) {
  .sheet { align-items: stretch; justify-items: end; }
  .sheet-panel { width: min(680px, 92vw); max-height: none; height: 100dvh; border-radius: 18px 0 0 18px; animation: slide .22s cubic-bezier(.2, .8, .2, 1); }
  .confirm-panel { height: auto; align-self: center; justify-self: center; border-radius: 16px; width: 420px; }
  @keyframes slide { from { transform: translateX(40px); opacity: 0; } }
}
.log { margin: 0; min-height: 120px; overflow: auto; padding: 12px; border-radius: 11px; background: #15181b; color: #d9dcd6; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.log .err { color: #f0a493; }
.log .sys { color: #8fb8a9; }
.log .text { color: #f3efe6; font-family: var(--font); font-size: 14px; }
.log:empty::before { content: "等待输出…"; color: #7b8087; }
.qr-box { display: grid; justify-items: center; gap: 8px; padding: 10px; }
.qr-box img { width: min(280px, 70vw); image-rendering: pixelated; border-radius: 10px; background: #fff; padding: 8px; }
.checks { display: grid; gap: 7px; }
.check { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--bg2); font-size: 14px; }
.check .label { font-weight: 600; min-width: 74px; }
.check .text { color: var(--ink2); min-width: 0; overflow-wrap: anywhere; }
.check .chip { margin-left: auto; }
.repo { padding: 10px 12px; border-radius: 10px; background: var(--bg2); margin-bottom: 7px; }
.repo .row { justify-content: space-between; }
.repo details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.repo ul { margin: 6px 0 0; padding-left: 0; list-style: none; font: 12px/1.55 var(--mono); max-height: 180px; overflow: auto; }

/* ---------- reports ---------- */
.filters { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filters button { flex: none; border: 1px solid var(--line); background: var(--card); padding: 5px 13px; border-radius: 99px; cursor: pointer; font-size: 13.5px; color: var(--ink2); }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.reader { display: grid; gap: 12px; }
.reader-head { display: flex; align-items: center; gap: 8px; }
.reader-head h2 { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame { width: 100%; height: calc(100dvh - 210px); min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.md { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; overflow-wrap: anywhere; line-height: 1.7; }
.md h1 { font-size: 21px; margin: 4px 0 12px; } .md h2 { font-size: 17.5px; margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 15.5px; margin: 18px 0 6px; } .md h4, .md h5, .md h6 { font-size: 14.5px; margin: 14px 0 4px; }
.md p { margin: 8px 0; } .md ul, .md ol { padding-left: 22px; margin: 6px 0; } .md li { margin: 3px 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--bg2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg2); padding: 11px 13px; border-radius: 10px; overflow: auto; } .md pre code { background: none; padding: 0; }
.md blockquote { margin: 10px 0; padding: 2px 14px; border-left: 3px solid var(--accent); color: var(--ink2); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.md-table { overflow-x: auto; margin: 10px 0; }
.md table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.md th { background: var(--bg2); font-weight: 600; }
.md .md-link { border-bottom: 1px dashed var(--muted); }
.md .md-box.done { color: var(--ok); }

/* ---------- ask ---------- */
.ask-box { display: grid; gap: 10px; }
.ask-box textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.ask-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.ask-row .code-input { padding: 9px 12px; font-size: 16px; }
.hint { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.hint .ic { width: 16px; height: 16px; margin-top: 2px; }
.suggest { display: flex; gap: 7px; flex-wrap: wrap; }
.suggest button { text-align: left; border: 1px dashed var(--line); background: transparent; border-radius: 99px; padding: 4px 11px; font-size: 13px; color: var(--ink2); cursor: pointer; }
.suggest button:hover { border-color: var(--accent); color: var(--accent); }
.answer { margin-top: 12px; }
.steps { font: 12px/1.6 var(--mono); color: var(--muted); margin: 8px 0; max-height: 140px; overflow: auto; }
.qa { padding: 0; overflow: hidden; }
.qa summary { list-style: none; cursor: pointer; padding: 13px 16px; display: grid; gap: 2px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary .q { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qa .md { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }

/* ---------- audit ---------- */
.audit-li { display: grid; grid-template-columns: 92px 1fr; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.audit-li:first-child { border-top: 0; }
.audit-li .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; grid-column: 2; }
.audit-li .what { grid-column: 2; overflow-wrap: anywhere; }
.audit-li .chip { grid-row: span 2; align-self: start; justify-self: start; margin-top: 2px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 11px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- v2: task sheet, kill switch, needs marks, ask options, settings ---------- */
.row.mt { margin-top: 12px; }
button.li { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; color: inherit; font: inherit; cursor: pointer; }
button.li:first-child { border-top: 0; }
button.li:hover .title { color: var(--accent); }
.btn.danger { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); color: var(--bad); }
.sheet-result .kv { padding: 10px 12px; border-radius: 10px; background: var(--bg2); }
.warn-text { color: var(--warn); }

/* 等你拍板: waiting days + quick marks */
.ask-item .q .wait { margin-left: auto; flex: none; font-size: 12px; font-weight: 550; color: var(--muted); }
.ask-item .q .wait.old { color: var(--bad); }
.ask-actions { display: flex; gap: 6px; margin-top: 7px; }
.ask-actions .btn.small { min-height: 28px; padding: 0 9px; font-size: 12.5px; }
.ask-actions .ic { width: 15px; height: 15px; }
.ask-item.gone { opacity: .35; transition: opacity .2s; pointer-events: none; }
.ask-item.muted-item .q { color: var(--muted); font-weight: 500; }
.hidden-needs { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.hidden-needs summary { cursor: pointer; }

/* 问 Claude: data source chips + model toggle */
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.toggles-label { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.tog { border: 1px solid var(--line); background: var(--card); color: var(--ink2); border-radius: 99px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.tog.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg2); }
.seg button { border: 0; background: transparent; padding: 5px 14px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* settings */
.switch-row { cursor: pointer; }
.switch { position: relative; flex: none; width: 42px; height: 25px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(17px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.callout { padding: 11px 13px; border-radius: 11px; background: var(--warn-soft); color: var(--ink2); font-size: 13.5px; }
.callout b { color: var(--warn); }
.callout ol { margin: 6px 0 0; padding-left: 20px; }
.li .sub.err { color: var(--bad); }

/* ---------- v3: 后台任务队列 ---------- */
.tq-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.tq-head .worker { font-size: 12.5px; color: var(--muted); }
.tq-form { display: grid; gap: 12px; }
.tq-form textarea { min-height: 170px; resize: vertical; line-height: 1.6; }
.tq-form select.input { appearance: auto; }
.tq-form .count { font-size: 12px; color: var(--muted); font-weight: 400; }
.tq-form .count.over { color: var(--bad); }
.tq-modes { display: grid; gap: 8px; }
.tq-mode { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); cursor: pointer; text-align: left; color: inherit; font: inherit; }
.tq-mode input { margin: 4px 0 0; grid-row: span 2; accent-color: var(--accent); }
.tq-mode b { font-weight: 600; font-size: 14px; }
.tq-mode span { font-size: 12.5px; color: var(--muted); }
.tq-mode.on { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.tq-mode.disabled { opacity: .5; cursor: not-allowed; }
.tq-instr { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; background: var(--bg2); border-radius: 10px; padding: 11px 13px; max-height: 320px; overflow: auto; }
.tq-timeline { display: grid; gap: 4px; font-size: 13px; }
.tq-timeline div { display: flex; gap: 8px; align-items: center; }
.tq-timeline .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.tq-log { max-height: 46vh; }
.tq-diff { margin: 0; padding: 11px 13px; border-radius: 10px; background: var(--bg2); font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-x: auto; overflow-wrap: anywhere; max-height: 360px; }
