/* mituan design system —— 深海蓝 · 青色科技主题；跟随系统 / 暗 / 亮。与 mituan 控制台同一套变量。 */
:root {
  color-scheme: dark;
  --bg: #070b14; --card: rgba(148,178,255,.045); --card-solid: #0e1524; --line: rgba(148,178,255,.12);
  --text: #e6edf7; --muted: #93a2bd; --faint: #64748b;
  --brand1: #2563eb; --brand2: #0ea5e9; --brand3: #22d3ee; --accent-rgb: 14,165,233; --accent-text: #7dd3fc;
  --grad: linear-gradient(120deg, var(--brand1), var(--brand2) 60%, var(--brand3));
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --idle: #64748b;
  --track: rgba(148,163,184,.16); --soft: rgba(148,163,184,.07); --gridline: rgba(148,178,255,.035);
  --radius: 16px; --shadow: 0 10px 40px rgba(0,0,0,.4);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb; --card: #ffffff; --card-solid: #ffffff; --line: rgba(15,40,80,.1);
  --text: #0f1b2d; --muted: #52627a; --faint: #8a97ab; --accent-text: #0369a1;
  --track: rgba(15,40,80,.08); --soft: rgba(15,40,80,.035); --gridline: rgba(15,40,80,.035); --shadow: 0 8px 28px rgba(15,40,80,.07);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f7fb; --card: #ffffff; --card-solid: #ffffff; --line: rgba(15,40,80,.1);
    --text: #0f1b2d; --muted: #52627a; --faint: #8a97ab; --accent-text: #0369a1;
    --track: rgba(15,40,80,.08); --soft: rgba(15,40,80,.035); --gridline: rgba(15,40,80,.035); --shadow: 0 8px 28px rgba(15,40,80,.07);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 14px/1.6 system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--text); background-color: var(--bg); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
  background-image:
    radial-gradient(900px 480px at 8% -12%, rgba(37,99,235,.16), transparent 60%),
    radial-gradient(760px 460px at 100% 0%, rgba(34,211,238,.09), transparent 60%),
    linear-gradient(var(--gridline) 1px, transparent 1px), linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
  background-attachment: fixed;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--soft); border: 1px solid var(--line); }

/* 品牌 */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: inherit; }
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 6px 16px rgba(var(--accent-rgb),.35)); }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -.5px; background: var(--grad);
            -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; white-space: nowrap; }
footer { text-align: center; color: var(--faint); font-size: 12.5px; padding: 28px 0 32px; }
footer b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
footer a { color: var(--muted); }

/* 布局 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
        box-shadow: var(--shadow); backdrop-filter: blur(14px); }
h2 { font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--grad); flex: none; }
h3 { margin: 0; font-size: 16px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer, .grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }

/* 控件 */
button { appearance: none; border: 1px solid var(--line); background: var(--card-solid); color: var(--text);
       border-radius: 10px; padding: 7px 13px; font: inherit; font-size: 13.5px; cursor: pointer; display: inline-flex;
       align-items: center; gap: 6px; transition: transform .12s, border-color .12s, background .12s; white-space: nowrap; }
button:hover { border-color: rgba(var(--accent-rgb),.6); transform: translateY(-1px); }
button.primary { background: var(--grad); border: 0; color: #fff; font-weight: 600; box-shadow: 0 6px 18px rgba(37,99,235,.3); }
button.danger { color: var(--bad); }
button.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
input, textarea, select { font: inherit; font-size: 13.5px; color: var(--text); background: var(--soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 11px; outline: none; width: 100%; }
input:focus, textarea:focus { border-color: rgba(var(--accent-rgb),.6); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.15); }
input[type=checkbox] { width: auto; accent-color: var(--brand1); }
details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }

/* 状态 */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 10px; border-radius: 99px;
        border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { color: var(--ok); background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); }
.pill.warn { color: var(--warn); background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }
.pill.bad { color: var(--bad); background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.25); }
.pill.idle { color: var(--idle); }
.pill.run { color: var(--accent-text); background: rgba(var(--accent-rgb),.1); border-color: rgba(var(--accent-rgb),.3); }
.pill.run::before { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.stage { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 9px; border-radius: 99px; white-space: nowrap; border: 1px solid; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 6px 0; border-top: 1px dashed var(--line); }
.kv:first-of-type { border-top: 0; }
.kv > span:first-child { color: var(--muted); white-space: nowrap; }
.kv > span:last-child { text-align: right; overflow-wrap: anywhere; }
.stat { padding: 14px 16px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.stat b { display: block; font-size: 22px; letter-spacing: -.3px; margin-top: 2px; }
.stat small { color: var(--muted); font-size: 12.5px; }

/* 主题切换 */
.theme { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-solid); }
.theme button { border: 0; background: none; color: var(--muted); width: 30px; height: 28px; padding: 0;
                display: grid; place-items: center; border-radius: 7px; }
.theme button:hover { color: var(--text); transform: none; }
.theme button svg { width: 16px; height: 16px; }
.theme button.on { background: rgba(var(--accent-rgb),.14); color: var(--accent-text); }

/* 稿件卡片（弹窗） */
.item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 12px 14px; border-radius: 12px; }
.item.unseen { border-color: rgba(var(--accent-rgb),.7); box-shadow: 0 0 0 1px rgba(var(--accent-rgb),.5) inset, var(--shadow); }
.item .head { display: flex; gap: 8px; align-items: center; }
.item .venue { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .id { color: var(--muted); white-space: nowrap; font-size: 12.5px; }
.item .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.item .meta { color: var(--muted); font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0;
         background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px;
         box-shadow: var(--shadow); transition: all .25s; z-index: 60; font-size: 14px; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
