/* ============================================================
   VPS 补货监控 · Web 后台样式
   ============================================================ */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --sidebar: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --line: #e7e9ee;
  --line-strong: #d6dae2;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #eef2ff;
  --accent-text: #ffffff;
  --ok: #059669;   --ok-soft: #ecfdf5;
  --bad: #dc2626;  --bad-soft: #fef2f2;
  --warn: #d97706; --warn-soft: #fffbeb;
  --info: #0284c7; --info-soft: #f0f9ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --r: 14px;
  --r-sm: 9px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #12151c;
    --surface-2: #171b23;
    --sidebar: #0e1117;
    --text: #e8ebf1;
    --text-2: #a3acbb;
    --muted: #6b7484;
    --line: #232834;
    --line-strong: #2f3644;
    --accent: #818cf8;
    --accent-2: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, .12);
    --accent-text: #0b0d12;
    --ok: #34d399;   --ok-soft: rgba(52, 211, 153, .12);
    --bad: #f87171;  --bad-soft: rgba(248, 113, 113, .12);
    --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
    --info: #38bdf8; --info-soft: rgba(56, 189, 248, .12);
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.xs { font-size: 12px; }
.sm { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.form-error, .error { color: var(--bad); }
.form-error { min-height: 1.4em; margin: 8px 0 0; font-size: 13px; }
.warn-text { color: var(--warn); }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------------- 布局 ---------------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; }
.brand b { display: block; font-size: 15px; letter-spacing: .2px; }
.brand span { display: block; font-size: 11px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 6px 16px rgba(79, 70, 229, .25);
  position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 10px; top: 8px; width: 11px; height: 7px;
  border: solid #fff; border-width: 0 0 3px 3px; transform: rotate(-45deg); border-radius: 1px; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 13px; margin-bottom: 18px; }
.brand-mark.lg::after { left: 15px; top: 13px; width: 16px; height: 9px; border-width: 0 0 4px 4px; }
#tabs { display: flex; flex-direction: column; gap: 2px; }
#tabs a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
#tabs a:hover { background: var(--surface-2); color: var(--text); }
#tabs a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.bot-state { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.35; }
.bot-state b { display: block; font-size: 13px; }
.bot-state span { color: var(--text-2); }

.content { padding: 28px 36px 64px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -.2px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- 卡片 ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; margin: 0; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.stat .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); }
.stat .ico.ok { background: var(--ok-soft); color: var(--ok); }
.stat .ico.warn { background: var(--warn-soft); color: var(--warn); }
.stat .ico.info { background: var(--info-soft); color: var(--info); }
.stat .ico svg.i { width: 19px; height: 19px; }
.stat .label { color: var(--text-2); font-size: 12.5px; }
.stat .value { font-size: 26px; font-weight: 650; line-height: 1.2; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 15px; color: var(--muted); font-weight: 500; }
.stat .sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------------- 表单与按钮 ---------------- */
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
label.field { display: block; margin-bottom: 14px; }
label.field > span:first-child { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form > .grow { flex: 1 1 280px; }
.inline-form > .w { flex: 0 1 200px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-weight: 550; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); border-radius: 999px;
  padding: 2px 11px; font: inherit; font-size: 12px; cursor: pointer; transition: all .15s; }
.chip:hover, .chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hint { display: block; margin-top: 6px; color: var(--text-2); font-size: 12px; min-height: 1.4em; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------------- 徽章与状态 ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 550; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.live { background: var(--ok); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .45); } 70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.live-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2);
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }

.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 64px; }
.meter > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: .3px;
  background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; transition: background .12s; }
tr.click:hover td { background: var(--surface-2); }
tr.gone td { opacity: .5; }
table.wide { min-width: 720px; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar input[type=search] { max-width: 280px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 5px 11px; border-radius: 7px; font: inherit;
  font-size: 12.5px; font-weight: 550; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

/* ---------------- 时间线 ---------------- */
.timeline { list-style: none; margin: 0; padding: 4px 0; }
.timeline li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 10px 20px; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tl-dot { margin-top: 7px; }
.timeline .tl-main { min-width: 0; }
.timeline .tl-title { font-weight: 550; overflow-wrap: anywhere; }
.timeline .tl-sub { font-size: 12px; color: var(--text-2); }
.timeline time { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------------- 图表 ---------------- */
.chart { padding: 14px 20px 8px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar.sold { fill: var(--bad); opacity: .55; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart text { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.chart .legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------------- 推送对象编辑 ---------------- */
.target { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 14px; overflow: hidden; background: var(--surface); }
.target-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.target-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 13px; }
.target-body { padding: 14px 16px; }
.pick-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-bottom: 14px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; }
.pick:hover { border-color: var(--line-strong); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick.disabled { opacity: .55; cursor: not-allowed; }
.pick .pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.toggle-line { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 550; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 12px; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--warn-soft); color: var(--text); border: 1px solid transparent; margin-bottom: 18px; }
.callout.info { background: var(--accent-soft); }
.callout svg.i { color: var(--warn); margin-top: 2px; }
.callout.info svg.i { color: var(--accent); }
.callout b { display: block; margin-bottom: 2px; }

.newtoken { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--ok-soft); }
.newtoken p { margin: 0 0 8px; }
.newtoken code { display: block; flex: 1; font-size: 14px; padding: 8px 10px; word-break: break-all; user-select: all; background: var(--surface); }

.empty { padding: 36px 20px; text-align: center; color: var(--text-2); }
.empty svg.i { width: 30px; height: 30px; color: var(--muted); margin-bottom: 6px; }
.empty b { display: block; color: var(--text); margin-bottom: 2px; }

.mt { margin-top: 14px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.grow { flex: 1; min-width: 0; }
.chart .legend .lg-ok { background: var(--accent); }
.chart .legend .lg-bad { background: var(--bad); opacity: .55; }

/* 版本更新 */
.update-badge { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.update-badge:hover { text-decoration: none; filter: brightness(1.05); }
.ver-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ver { font-size: 20px; font-weight: 650; letter-spacing: -.3px; }
.changelog { list-style: none; margin: 10px 0 0; padding: 0; max-height: 240px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r-sm); }
.changelog li { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.changelog li:last-child { border-bottom: 0; }
.changelog code { flex: none; }
.changelog span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.changelog time { color: var(--muted); font-size: 12px; white-space: nowrap; }
pre.log { max-height: 220px; overflow: auto; margin: 10px 0 0; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); font: 12px/1.5 var(--mono); white-space: pre-wrap; }
.progress { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--accent-soft); margin-top: 12px; }
.progress .spin { width: 18px; height: 18px; border: 2px solid var(--accent); border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; flex: none; }

/* 侧边抽屉 */
.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .4); backdrop-filter: blur(2px); animation: fade .15s; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(920px, 100%); background: var(--bg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px;
  border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-head h3 { margin: 0; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px 28px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 22px; align-items: start; }
.editor .preview-col { position: sticky; top: 0; }
.field .auto { display: block; font-size: 12px; color: var(--text-2); margin-top: 5px; }
.field .auto b { color: var(--text); font-weight: 550; }

/* Telegram 消息预览 */
.tg { background: #e6ebee url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='3' cy='3' r='1.2' fill='%23cfd8dc'/%3E%3C/svg%3E");
  border-radius: var(--r); padding: 18px 16px; border: 1px solid var(--line); }
.tg-bubble { background: #ffffff; color: #0f1419; border-radius: 14px 14px 14px 4px; padding: 10px 12px 8px;
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.tg-bubble a { color: #2481cc; }
.tg-bubble s a, .tg-bubble s { color: #6b7a86; }
.tg-meta { text-align: right; font-size: 11px; color: #8a9aa6; margin-top: 2px; }
@media (prefers-color-scheme: dark) {
  .tg { background-color: #0e1621; background-image: none; }
  .tg-bubble { background: #182533; color: #e9eef3; }
  .tg-bubble a { color: #6ab3f3; }
  .tg-bubble s a, .tg-bubble s { color: #7f91a4; }
}
.preview-tabs { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips .badge { font-weight: 500; }

/* 骨架屏 */
.skel-title { width: 180px; height: 26px; }
.skel-line { height: 14px; margin: 12px 0; }
.skel-line:nth-child(2n) { width: 70%; }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%);
  background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------- 登录 ---------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, var(--accent-soft), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 36px 32px 28px; }
.login-card h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; }
.login-card > .muted { margin: 4px 0 24px; }

/* ---------------- 提示与弹窗 ---------------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60;
  max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: slidein .2s ease-out; }
.toast.ok svg.i { color: var(--ok); }
.toast.bad svg.i { color: var(--bad); }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .2s; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); animation: fade .15s; }
.modal-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); padding: 22px 22px 18px; animation: pop .18s ease-out; }
.modal-card h3 { margin: 0 0 6px; font-size: 16px; }
.modal-card p { margin: 0 0 20px; color: var(--text-2); white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn.primary.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor .preview-col { position: static; order: -1; }
  .drawer-body { padding: 16px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 8px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .brand span { display: none; }
  #tabs { order: 3; flex-direction: row; width: 100%; overflow-x: auto; gap: 4px; }
  #tabs a { padding: 7px 10px; white-space: nowrap; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .bot-state { padding: 6px 10px; }
  .bot-state .bs-text span { display: none; }
  #logout { width: auto; }
  #logout .lbl { display: none; }
  .content { padding: 18px 16px 56px; }
  .page-head h1 { font-size: 19px; }
  .stats { gap: 10px; }
  .stat { padding: 13px 14px; gap: 10px; }
  .stat .ico { width: 32px; height: 32px; }
  .stat .value { font-size: 21px; }
  th, td { padding: 10px 12px; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .timeline li { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
