/* Restock Console —— 商务风格后台 */
:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e4e8f0;
  --border-strong: #d3d9e4;
  --text: #0f172a;
  --text-2: #475467;
  --text-3: #8892a6;
  --brand: #2457e6;
  --brand-hover: #1c47c7;
  --brand-soft: #edf2ff;
  --brand-line: #cfdcff;
  --navy: #0b1730;
  --navy-2: #12223f;
  --ok: #0c8f62;
  --ok-soft: #e8f7f0;
  --ok-line: #bfe6d4;
  --warn: #b26b05;
  --warn-soft: #fdf6e7;
  --warn-line: #f2dcac;
  --bad: #d23b3b;
  --bad-soft: #fdf0f0;
  --bad-line: #f3c9c9;
  --violet: #6941c6;
  --violet-soft: #f3efff;
  --radius: 12px;
  --radius-sm: 8px;
  --ring: 0 0 0 3px rgba(36, 87, 230, .18);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, .25);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { letter-spacing: -.01em; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
td.mono { white-space: nowrap; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.ta-r { text-align: right; }
.nowrap { white-space: nowrap; }

svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ---------- 启动 ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 品牌 ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #5a85ff 0%, #2457e6 55%, #1a3fb0 100%);
  box-shadow: 0 6px 14px -4px rgba(36, 87, 230, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark svg.i { width: 16px; height: 16px; }
.brand-name b { font-weight: 700; margin-left: 3px; }
.brand-light { color: #fff; }
.brand-light .brand-name b { color: #86a6ff; }
.brand-dark { color: var(--text); }
.brand-dark .brand-name b { color: var(--brand); }

/* ---------- 登录 ---------- */
.login { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 40px 56px; color: #dbe3f3;
  background:
    radial-gradient(900px 520px at -8% -12%, rgba(52, 98, 220, .55) 0%, transparent 60%),
    radial-gradient(760px 480px at 108% 112%, rgba(18, 120, 170, .45) 0%, transparent 58%),
    var(--navy);
}
.login-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 88%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 88%);
}
.login-hero > * { position: relative; }
.hero-copy { margin: auto 0; max-width: 540px; padding: 40px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 5px 12px 5px 10px; border-radius: 999px;
  font-size: 12.5px; letter-spacing: .06em; color: #a9bfff; background: rgba(90, 133, 255, .12); border: 1px solid rgba(90, 133, 255, .28);
}
.eyebrow svg.i { width: 15px; height: 15px; }
.hero-copy h1 { margin: 0 0 18px; font-size: 42px; line-height: 1.18; font-weight: 750; color: #fff; }
.lead { margin: 0 0 34px; max-width: 470px; font-size: 15.5px; line-height: 1.7; color: #aebbd6; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.hero-points li { display: flex; gap: 14px; align-items: flex-start; }
.tick { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; color: #93b2ff; background: rgba(90, 133, 255, .14); border: 1px solid rgba(90, 133, 255, .26); }
.tick svg.i { width: 17px; height: 17px; }
.hero-points b { display: block; font-size: 14.5px; font-weight: 600; color: #fff; }
.hero-points span { font-size: 13px; color: #8fa0c0; }
.hero-stats { display: flex; gap: 0; margin-top: 38px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 12px; background: rgba(255, 255, 255, .035); }
.hero-stats div { flex: 1; padding: 14px 18px; border-left: 1px solid rgba(255, 255, 255, .08); }
.hero-stats div:first-child { border-left: 0; }
.hero-stats b { display: block; font-size: 20px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 12.5px; color: #8697b8; }
.hero-foot { font-size: 12.5px; color: #64759a; }

.login-side { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.login-card > .muted { margin: 0 0 28px; }
.login-card .brand { margin-bottom: 36px; }
.fine { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 0; font-size: 12.5px; color: var(--text-3); }
.fine svg.i { width: 14px; height: 14px; }
.form-error { display: flex; gap: 8px; align-items: flex-start; margin: -4px 0 16px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; color: #9b2424; background: var(--bad-soft); border: 1px solid var(--bad-line); }
.mobile-only { display: none; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--text-3); font-weight: 400; font-style: normal; margin-left: 6px; }
.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #bfc7d5; }
.input:focus { border-color: var(--brand); box-shadow: var(--ring); }
.input::placeholder { color: #a3acbd; }
.input:disabled { background: var(--surface-2); color: var(--text-3); }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238892a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.input-sm { height: 34px; padding: 0 10px; font-size: 13.5px; }
select.input-sm { padding-right: 28px; background-position: right 8px center; }
.input-icon { position: relative; }
.input-icon svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.input-icon .input { height: 42px; padding-left: 38px; font-size: 14.5px; }
.affix { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; height: 34px; transition: border-color .15s, box-shadow .15s; }
.affix:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.affix > span { padding: 0 0 0 10px; color: var(--text-3); font-size: 13px; }
.affix input { border: 0; outline: none; background: transparent; height: 100%; width: 100%; min-width: 0; padding: 0 10px 0 6px; font-size: 13.5px; }
.w-qty { width: 68px; }
.w-price { width: 100px; }
.w-num { width: 120px; }
.w-code { width: 200px; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--brand); cursor: pointer; flex: none; }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #cdd4e0; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .25); transition: transform .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch.sm .track { width: 34px; height: 19px; }
.switch.sm .track::after { width: 13px; height: 13px; }
.switch.sm input:checked + .track::after { transform: translateX(15px); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.btn:hover { background: var(--surface-2); border-color: #c3cad8; color: var(--text); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg.i { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(36, 87, 230, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-danger { color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { color: #b42a2a; background: var(--bad-soft); border-color: #eaaaaa; }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: #b93030; border-color: #b93030; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 44px; font-size: 15px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; padding: 0; }
.btn-group { display: flex; gap: 8px; }
.btn .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.linkbtn:hover { color: var(--brand-hover); text-decoration: underline; }
.linkbtn.danger { color: var(--bad); }

/* ---------- 布局 ---------- */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px 14px; color: #c3cde0; background: var(--navy); }
.side > .brand { padding: 4px 10px 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 14px 0 6px; padding: 0 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: #566789; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: #a7b3ca; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active { background: rgba(90, 133, 255, .16); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #6b93ff; }
.nav a.active svg.i { color: #9cb7ff; }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-style: normal; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; color: #fff; background: var(--brand); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 6px 2px 10px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #3a5591, #233a68); border: 1px solid rgba(255, 255, 255, .12); }
.side-user b { display: block; font-size: 13.5px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user span { font-size: 12px; color: #6f81a5; }
.icon-btn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #8d9bb6; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 32px; min-height: 68px; background: rgba(255, 255, 255, .9); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.5) blur(10px); backdrop-filter: saturate(1.5) blur(10px);
}
.top h1 { margin: 0; font-size: 19px; font-weight: 700; }
.top p { margin: 2px 0 0; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.updated { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.view { width: 100%; max-width: 1320px; padding: 24px 32px 56px; }
.stack { display: grid; gap: 20px; }
.grid { display: grid; gap: 20px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }

/* ---------- 卡片 ---------- */
.card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); }
.card-h .tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-h .tools .input { width: auto; }
.card-b { padding: 20px; }
.card-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }

.kpi { padding: 18px 20px 17px; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi-ic svg.i { width: 19px; height: 19px; }
.kpi-ic.blue { color: var(--brand); background: var(--brand-soft); }
.kpi-ic.green { color: var(--ok); background: var(--ok-soft); }
.kpi-ic.gray { color: var(--text-3); background: var(--surface-2); }
.kpi-ic.amber { color: var(--warn); background: var(--warn-soft); }
.kpi-ic.violet { color: var(--violet); background: var(--violet-soft); }
.kpi-ic.red { color: var(--bad); background: var(--bad-soft); }
.kpi-value { margin-top: 4px; font-size: 27px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi-value small { margin-left: 4px; font-size: 14px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.kpi-sub { margin-top: 6px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); min-height: 19px; }
.kpi-sub .ok { color: var(--ok); font-weight: 600; }
.kpi-sub .bad { color: var(--bad); font-weight: 600; }

/* ---------- 徽标 ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.badge.bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.badge.info { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-line); }
.badge.muted { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.badge.violet { color: var(--violet); background: var(--violet-soft); border-color: #ddd2fb; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1px solid; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.pill.ok .dot { animation: pulse 2s ease-out infinite; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.pill.info { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-line); }
.pill.muted { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12, 143, 98, .45); } 70% { box-shadow: 0 0 0 7px rgba(12, 143, 98, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 143, 98, 0); } }

/* ---------- 提示条 ---------- */
.alerts { display: grid; gap: 10px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 10px; border: 1px solid; font-size: 13.5px; }
.alert > svg.i { width: 18px; height: 18px; align-self: flex-start; margin-top: 1px; }
.alert .at { flex: 1; min-width: 0; }
.alert .at b { font-weight: 700; margin-right: 6px; }
.alert .at span { opacity: .9; word-break: break-word; }
.alert .btn { flex: none; }
.alert.warn { color: #7a4a05; background: var(--warn-soft); border-color: var(--warn-line); }
.alert.bad { color: #8d1f1f; background: var(--bad-soft); border-color: var(--bad-line); }
.alert.info { color: #1d3c95; background: var(--brand-soft); border-color: var(--brand-line); }
.alert.ok { color: #0b5e41; background: var(--ok-soft); border-color: var(--ok-line); }

/* ---------- 目标列表 / 动态 ---------- */
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.tlist li:last-child { border-bottom: 0; }
.prio { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line); font-variant-numeric: tabular-nums; }
.tname { flex: 1; min-width: 0; }
.tname b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname span { font-size: 12.5px; color: var(--text-3); }
.tprice { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tprice span { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); }
.tlist .badge { min-width: 64px; justify-content: center; }

.feed { list-style: none; margin: 0; padding: 8px 0; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 9px 20px; font-size: 13px; align-items: start; }
.fdot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #c2cad8; box-shadow: 0 0 0 3px #eef1f6; }
.fdot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.fdot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.fdot.warn { background: #e19a1d; box-shadow: 0 0 0 3px var(--warn-soft); }
.fdot.info { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ft { color: var(--text-2); word-break: break-word; }
.ft b { color: var(--text); font-weight: 650; margin-right: 6px; }
.feed time { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 16px 20px 20px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.pcard.on { background: #f3fbf7; border-color: var(--ok-line); }
.pcard.tgt { border-color: var(--brand-line); background: #f7f9ff; }
.pcard.tgt.on { background: #f3fbf7; border-color: var(--ok-line); }
.pc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pc-top b { font-weight: 600; font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { font-size: 12px; color: var(--text-3); }
.pc-bot { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.pc-price { font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums; }
.pc-price span { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.tag-target { font-size: 11.5px; font-weight: 700; color: var(--brand); }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { position: sticky; top: 0; padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfd; }
.table .sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.table .strong { font-weight: 600; }
.table.edit td, .table.edit th { padding: 10px 8px; }
.table.edit td:first-child, .table.edit th:first-child { padding-left: 18px; }
.table.edit td:last-child, .table.edit th:last-child { padding-right: 14px; }
.table td.price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.price.dim { color: var(--text-3); }
.row-arch td { color: var(--text-3); }

.prio-ctl { display: flex; align-items: center; gap: 6px; }
.updown { display: flex; flex-direction: column; }
.updown button { width: 22px; height: 15px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: 4px; }
.updown button:hover:not(:disabled) { color: var(--brand); background: var(--brand-soft); }
.updown button:disabled { opacity: .3; cursor: default; }
.updown svg.i { width: 14px; height: 14px; stroke-width: 2.2; }
.sel-product { min-width: 210px; }
.sel-period { min-width: 136px; }
.sel-os { min-width: 118px; }
.table.edit td:nth-child(2) { width: 40%; }

/* ---------- 设置行 ---------- */
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.setrow:last-child { border-bottom: 0; }
.sl { min-width: 0; }
.sl b { display: block; font-size: 14px; font-weight: 600; }
.sl span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.terms { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.terms ol { margin: 10px 0 0; padding: 12px 16px 12px 34px; font-size: 13px; line-height: 1.75; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.inline-warn { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--warn); font-weight: 600; }
.inline-warn svg.i { width: 15px; height: 15px; }
.statline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 14px; margin: 0 0 18px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; }
details.help { margin-top: 14px; font-size: 13px; color: var(--text-2); }
details.help summary { cursor: pointer; color: var(--brand); font-weight: 600; list-style: none; }
details.help summary::-webkit-details-marker { display: none; }
details.help ol { margin: 10px 0 0; padding-left: 20px; line-height: 1.8; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.result { margin-top: 14px; }
pre.out { margin: 14px 0 0; max-height: 420px; overflow: auto; padding: 14px 16px; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: #cdd7e6; background: #0b1220; }

.addrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.addrow .muted { font-size: 12.5px; }

.savebar {
  position: sticky; bottom: 18px; z-index: 6; margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 20px; border-radius: 12px; color: #fff; background: var(--navy); box-shadow: var(--shadow-lg); animation: rise .2s ease-out;
}
.savebar span { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.savebar .btn-ghost { color: #c3cde0; }
.savebar .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 日志 ---------- */
.logbox {
  height: min(64vh, 680px); overflow: auto; margin: 0; padding: 16px 18px; border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; color: #c7d1e2; background: #0b1220;
}
.logbox .lt { color: #5d7194; margin-right: 10px; }
.l-ok { color: #4ade80; }
.l-bad { color: #f87171; }
.l-warn { color: #fbbf24; }
.l-info { color: #82a7ff; }
.l-dim { color: #75849e; }
.ctl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 500; }

/* ---------- 空状态 / 骨架 ---------- */
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty .eic { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 12px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); }
.empty b { display: block; margin-bottom: 4px; font-size: 14.5px; color: var(--text); }
.skel { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, #eceff5 0%, #f6f7fa 50%, #eceff5 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 提示 / 弹窗 ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 400px; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; color: #fff; background: #101d36; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; }
.toast svg.i { margin-top: 1px; }
.toast.ok svg.i { color: #4ade80; }
.toast.bad svg.i { color: #f87171; }
.toast.info svg.i { color: #82a7ff; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(9, 17, 34, .48); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal-card { width: 100%; max-width: 430px; padding: 24px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal-ic { width: 44px; height: 44px; margin-bottom: 14px; display: grid; place-items: center; border-radius: 12px; color: var(--brand); background: var(--brand-soft); }
.modal-ic.danger { color: var(--bad); background: var(--bad-soft); }
.modal-ic svg.i { width: 22px; height: 22px; }
.modal-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.modal-card p { margin: 0 0 22px; font-size: 14px; line-height: 1.65; color: var(--text-2); white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .mobile-only { display: flex; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side > .brand { padding: 0 6px 0 2px; }
  .side > .brand .brand-name, .nav-label, .side-user { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav a { padding: 8px 10px; white-space: nowrap; font-size: 13.5px; }
  .nav a.active::before { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .top { position: static; flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .top-actions { justify-content: flex-start; }
  .view { padding: 16px 16px 48px; }
  .setrow { flex-direction: column; align-items: flex-start; gap: 12px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .nav a span { display: none; }
  .hero-copy h1 { font-size: 32px; }
}
