:root {
  --brand-600: #2F9E44;  /* 品牌主色（装饰/填充） */
  --brand-700: #247F37;  /* 承载白字的深一档：主按钮、文字链接、选中态（AA 5.04:1） */
  --brand-800: #1C6A30;
  --brand-500: #5FBF74;
  --brand-100: #E9F6EC;
  --bg: #F5F8F6;
  --surface: #FFFFFF;
  --border: #E3EAE6;
  --ink: #1C2A24;
  --ink-2: #5C6B64;
  --ink-3: #9AA5A0;
  --success-bg: #E7F6EE;
  --success-tx: #15803D;
  --info-bg: #EAF1FD;
  --info-tx: #1D5BC4;
  --warn-bg: #FDF1E3;
  --warn-tx: #B54708;
  --error-bg: #FDECEA;
  --error-tx: #B42318;
  --neutral-bg: #F2F4F7;
  --neutral-tx: #475467;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.error { color: var(--error-tx); font-size: 13px; min-height: 18px; }

.login { min-height: 100vh; display: grid; place-items: center; }
.login-card {
  width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: 0 8px 32px rgba(16,24,40,.08);
}
.login-card h1 { font-size: 20px; margin: 20px 0 8px; }
.login-card input {
  width: 100%; height: 48px; margin: 20px 0 12px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 20px; letter-spacing: 8px; text-align: center;
}
.login-card input:focus { outline: 2px solid var(--brand-600); border-color: transparent; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--brand-700); }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-600); }
.brand-logo { width: 34px; height: 34px; object-fit: contain; }

.btn {
  height: 44px; border-radius: 8px; border: 0; background: var(--brand-700); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; padding: 0 18px;
}
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--brand-700); border: 1px solid var(--brand-700); }
.btn-sm { height: 32px; font-size: 13px; padding: 0 12px; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 24px 16px; display: flex; flex-direction: column; gap: 20px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { padding: 10px 12px; border-radius: 8px; color: var(--ink-2); cursor: pointer; font-size: 14px; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--brand-100); color: var(--brand-700); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.link { background: none; border: 0; color: var(--ink-2); cursor: pointer; text-align: left; padding: 0; font-size: 13px; }
.link:hover { color: var(--error-tx); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.page-title { font-size: 18px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.select { height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: #fff; }
.sub-banner { background: var(--warn-bg); color: var(--warn-tx); padding: 6px 12px; border-radius: 999px; font-size: 12px; }
.view { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.metric { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric-label { color: var(--ink-2); font-size: 13px; margin-bottom: 6px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
thead th { height: 44px; background: var(--bg); text-align: left; font-size: 13px; color: var(--ink-2); font-weight: 500; padding: 0 12px; border-bottom: 1px solid var(--border); }
tbody td { height: 48px; padding: 0 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
tbody tr:hover { background: #FAFCFB; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.pill-success { background: var(--success-bg); color: var(--success-tx); }
.pill-info { background: var(--info-bg); color: var(--info-tx); }
.pill-warn { background: var(--warn-bg); color: var(--warn-tx); }
.pill-error { background: var(--error-bg); color: var(--error-tx); }
.pill-neutral { background: var(--neutral-bg); color: var(--neutral-tx); }

.state { padding: 48px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.skeleton-row { height: 48px; background: linear-gradient(90deg, #EEF2F0 25%, #F7FAF8 37%, #EEF2F0 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--ink-2); }
.field input, .field select { height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; }
.row-actions { display: flex; gap: 8px; }

/* ── 侧栏分组与状态（对齐 v4 对比稿 p65） ─────────────── */
.store-select { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: #fff; font-size: 13px; margin-bottom: 4px; }
.nav-group { margin-bottom: 10px; }
.nav-label { font-size: 11px; color: var(--ink-3); padding: 6px 12px 2px; letter-spacing: .04em; }
.nav-badge { float: right; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--error); color: #fff; font-size: 11px; text-align: center; }
.sidebar-foot { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ── 顶栏 ────────────────────────────────────────────── */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.crumbs .sep { color: var(--ink-3); }
.search { width: 260px; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; background: var(--bg); font-size: 13px; }
.bell { position: relative; width: 36px; height: 36px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.bell::before { content: '\1F514'; font-size: 15px; }
.bell-dot { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; border-radius: 8px; background: var(--error); color: #fff; font-size: 10px; text-align: center; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.who-meta { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }

/* ── 概览布局 ────────────────────────────────────────── */
.page-head { display: flex; align-items: center; justify-content: space-between; }
.page-head h1 { margin: 0; font-size: 22px; }
.range-tabs { display: flex; align-items: center; gap: 6px; }
.range { height: 32px; line-height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13px; color: var(--ink-2); background: #fff; border: 1px solid var(--border); }
.range.active { background: var(--brand-100); color: var(--brand-700); border-color: var(--brand-100); font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.icon-success { background: var(--success-bg); color: var(--success-tx); }
.icon-info { background: var(--info-bg); color: var(--info-tx); }
.icon-warn { background: var(--warn-bg); color: var(--warn-tx); }
.icon-error { background: var(--error-bg); color: var(--error-tx); }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi-value { font-size: 30px; font-weight: 700; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12px; }
.kpi-note.success { color: var(--success-tx); }
.kpi-note.warn { color: var(--warn-tx); }
.kpi-note.info { color: var(--info-tx); }
.kpi-note.neutral { color: var(--ink-3); }

.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
.main-col, .rail { display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 15px; }

.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar-track { flex: 1; display: flex; align-items: flex-end; }
.bar-total { width: 100%; background: var(--brand-100); border-radius: 6px 6px 0 0; min-height: 4px; display: flex; align-items: flex-end; }
.bar-total.today { background: var(--brand-600); }
.bar-done { width: 100%; background: var(--brand-600); opacity: .85; border-radius: 6px 6px 0 0; }
.bar-label { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 8px; }

.todo-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--ink); text-decoration: none; }
.todo-row:last-child { border-bottom: 0; }
.todo-label { flex: 1; font-size: 13px; }
.todo-count { font-size: 15px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-warn { background: var(--warn); }
.dot-error { background: var(--error); }
.dot-info { background: var(--info); }
.dot-success { background: var(--success); }
.dot-neutral { background: var(--neutral); }

.timeline-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.timeline-row:last-child { border-bottom: 0; }
.timeline-text { flex: 1; font-size: 13px; }

.sub-line { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.storage-label { display: flex; justify-content: space-between; margin-bottom: 6px; }
.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand-600); border-radius: 999px; }
.progress-fill.warn { background: var(--warn); }
.link { color: var(--brand-700); font-size: 13px; text-decoration: none; }
.state.small { padding: 20px; }

/* ── 登录页（对齐 v4 对比稿 p66） ─────────────────────── */
.login-split { display: grid; grid-template-columns: 1fr 520px; min-height: 100vh; }
.brand-panel { background: #EDF6F1; padding: 72px 56px; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-logo-lg { width: 56px; height: 56px; }
.brand-name { font-size: 26px; font-weight: 700; color: var(--brand-700); }
.slogan { font-size: 22px; line-height: 1.5; margin: 8px 0 0; font-weight: 600; color: #1C2A24; }
.usp { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.usp li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: 14px; }
.usp li::before { content: '✓'; position: absolute; left: 0; color: var(--brand-700); font-weight: 700; }
.trial-note { align-self: flex-start; background: #fff; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--warn-tx); }
.auth-panel { display: flex; align-items: center; justify-content: center; background: #fff; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; }
.auth-tabs { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 26px; }
.auth-tab { flex: 1; padding: 10px 8px; text-align: center; font-size: 13px; color: var(--ink-2); text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.auth-tab.active { background: var(--bg); color: var(--brand-700); font-weight: 600; }
.auth-tab .small { font-size: 10px; }
.auth-card h1 { font-size: 20px; margin: 0 0 8px; }
.auth-card input { height: 48px; margin: 18px 0 12px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 20px; letter-spacing: 6px; text-align: center; }
.btn-block { width: 100%; }
.btn-wechat { background: #07C160; color: #fff; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--ink-3); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.center { text-align: center; }

/* ── 全局搜索 ─────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-panel { position: absolute; top: 42px; left: 0; width: 340px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.10); padding: 6px; z-index: 30; max-height: 420px; overflow: auto; }
.search-group-title { font-size: 11px; color: var(--ink-3); padding: 8px 10px 4px; }
.search-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.search-item:hover { background: var(--bg); }
.search-empty { padding: 18px 12px; color: var(--ink-3); font-size: 13px; text-align: center; }

/* ── 扫码登录 ─────────────────────────────────────────── */
.qr-login { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0 8px; }
.qr-image { width: 180px; height: 180px; border: 1px solid var(--border); border-radius: 12px; background: #fff; object-fit: contain; }

/* KPI 图标 SVG 居中 */
.kpi-icon svg { display: block; }
.brand { font-size: 15px; }

.field.hidden { display: none; }

/* 侧栏图标（v5 OPS/W 系统一） */
.nav-item { position: relative; padding-left: 38px; display: flex; align-items: center; }
.nav-item::before { content: ''; position: absolute; left: 14px; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; opacity: .85; }
.nav-item.active::before { opacity: 1; }
