:root {
  --brand: #165dff;
  --brand-dark: #0e42d2;
  --brand-soft: #e8efff;
  --accent: #ff7d00;
  --accent-soft: #fff3e6;
  --success: #00b42a;
  --success-soft: #e8ffea;
  --danger: #f53f3f;
  --danger-soft: #ffece8;
  --warning: #ff9a2e;
  --text: #1d2129;
  --text-2: #4e5969;
  --muted: #86909c;
  --line: #e5e8ef;
  --bg: #f2f4f8;
  --card: #ffffff;
  --sidebar: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 30px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.18);
  --sidebar-w: 236px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-family: "SF Mono", Consolas, "Roboto Mono", monospace; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

/* ------------------------------------------------------------ 登录 */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--card);
}
.login-visual {
  position: relative;
  overflow: hidden;
  padding: 56px;
  color: #fff;
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(145deg, #165dff 0%, #0b3bb8 55%, #072a86 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 560px; height: 560px;
  right: -260px; bottom: -300px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 157, 0, 0.32), transparent 62%);
  filter: blur(18px);
}
.login-brand { display: flex; align-items: center; gap: 14px; font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.login-visual h1 { font-size: 40px; line-height: 1.25; margin: 0 0 16px; letter-spacing: 1px; }
.login-visual p { color: rgba(255, 255, 255, 0.78); max-width: 430px; font-size: 15px; line-height: 1.8; margin: 0; }
.login-points { display: grid; gap: 12px; margin-top: 34px; position: relative; z-index: 1; }
.login-point { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255,255,255,.92); }
.login-point span.dot { width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 28px; margin: 0 0 8px; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; }
.demo-accounts { margin-top: 26px; border-top: 1px dashed var(--line); padding-top: 20px; }
.demo-accounts .label { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.demo-chip {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; border: 1px solid var(--line); background: #fafbfc;
  border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; cursor: pointer;
  transition: .15s;
}
.demo-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.demo-chip b { font-weight: 600; font-size: 13px; }
.demo-chip span { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------ 布局 */
/* 细滚动条：页面内容多时才出现，侧边栏完全隐藏滚动条 */
html { scrollbar-width: thin; scrollbar-color: #c9d2e0 transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #c9d2e0; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 8px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(140deg, var(--brand), #3b82ff);
  display: grid; place-items: center; color: #fff; flex: 0 0 auto;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .26);
  overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-text b { display: block; font-size: 16px; letter-spacing: .5px; }
.brand-text span { display: block; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.side-nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-height: 0; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.side-nav::-webkit-scrollbar { width: 0; height: 0; }
.nav-group { font-size: 10.5px; color: #a9b0bd; padding: 10px 12px 3px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 9px; color: var(--text-2);
  cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
  font-size: 13.5px; transition: .15s;
}
.nav-item svg { flex: 0 0 auto; opacity: .78; }
.nav-item:hover { background: #f4f6fa; color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 0 6px; border-radius: 20px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 10px 12px; border-radius: 12px; background: #f7f9fc; font-size: 12px; color: var(--muted); flex: 0 0 auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px; padding: 0 28px; display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar-title h1 { font-size: 18px; margin: 0; font-weight: 650; }
.topbar-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px;
  border-radius: 40px; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #165dff, #6aa1ff);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.user-chip b { font-size: 13px; display: block; line-height: 1.2; }
.user-chip span { font-size: 11px; color: var(--muted); }
.view { padding: 24px 28px 90px; max-width: 1360px; width: 100%; margin: 0 auto; }

/* ------------------------------------------------------------ 通用组件 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(229,232,239,.7); }
.card-pad { padding: 20px; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.section-title { font-size: 15px; font-weight: 650; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-link { font-size: 13px; color: var(--brand); cursor: pointer; background: none; border: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-weight: 550; font-size: 14px;
  cursor: pointer; transition: .15s; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { border-color: #c9d2e3; background: #f9fafc; color: var(--text); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.soft:hover { background: #dbe7ff; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #e56f00; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: #ffdad4; }
.btn.success { background: var(--success-soft); color: var(--success); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: #f5f7fb; color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, .select, .textarea {
  height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
  background: #fff; outline: none; width: 100%; transition: .15s; font-size: 14px;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 76px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,93,255,.12); }
.input::placeholder { color: #b6bdc9; }
.input.sm, .select.sm { height: 34px; font-size: 13px; border-radius: 8px; padding: 0 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.search-box { position: relative; flex: 1; min-width: 180px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 36px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 550; background: #f2f4f8; color: var(--text-2);
  white-space: nowrap;
}
.badge.blue { background: var(--brand-soft); color: var(--brand); }
.badge.orange { background: var(--accent-soft); color: #c25e00; }
.badge.green { background: var(--success-soft); color: #00801d; }
.badge.red { background: var(--danger-soft); color: #cf2727; }
.badge.gray { background: #f2f4f8; color: var(--muted); }
.badge.purple { background: #f5e8ff; color: #8f2bd6; }

.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty .emoji { font-size: 34px; display: block; margin-bottom: 10px; opacity: .7; }

/* ------------------------------------------------------------ 工作台 */
.hero {
  border-radius: 20px; padding: 24px 26px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #165dff 0%, #0d47d6 60%, #0a37ae 100%);
  box-shadow: 0 18px 40px rgba(22, 93, 255, .25);
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 340px; height: 340px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 62%);
}
.hero h2 { margin: 0; font-size: 15px; font-weight: 500; color: rgba(255,255,255,.82); }
.hero .big { font-size: 40px; font-weight: 700; letter-spacing: .5px; line-height: 1.2; margin: 6px 0 4px; }
.hero .big small { font-size: 16px; font-weight: 500; opacity: .8; margin-right: 4px; }
.hero .sub { font-size: 12.5px; color: rgba(255,255,255,.72); }
.hero-actions { display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-actions .btn { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.26); backdrop-filter: blur(6px); color: #fff; }
.hero-actions .btn:hover { background: rgba(255,255,255,.26); }
.hero-actions .btn.primary { background: #fff; color: var(--brand); }
.hero-actions .btn.primary:hover { background: #f2f6ff; }

.cards-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
#subsidy-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { #subsidy-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { #subsidy-summary { grid-template-columns: 1fr; } }

.quote-paper { background:#fff; color:#111; padding:34px 42px; font-family:"SimSun","Songti SC",serif; font-size:13px; line-height:1.7; }
.quote-paper h1 { text-align:center; font-size:26px; letter-spacing:8px; margin:0 0 18px; font-weight:700; }
.quote-meta { display:flex; justify-content:space-between; border-bottom:1px solid #333; padding-bottom:6px; }
.quote-paper p { margin:12px 0; }
.quote-parties { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:10px 0; }
.quote-lead { font-weight:600; }
.quote-table { width:100%; border-collapse:collapse; margin:8px 0; }
.quote-table th, .quote-table td { border:1px solid #444; padding:6px 7px; font-size:12.5px; vertical-align:middle; }
.quote-table th { background:#f2f2f2; text-align:center; }
.quote-table .num { text-align:right; }
.quote-notes { border-top:1px solid #ddd; padding-top:8px; margin-top:10px; font-size:12px; }
.quote-sign { display:flex; justify-content:space-between; margin-top:34px; font-size:13px; }
.quote-sign-right { text-align:right; line-height:1.9; }
@media print {
  body * { visibility:hidden; }
  #print-root, #print-root * { visibility:visible; }
  #print-root { position:absolute; left:0; top:0; width:100%; }
  .quote-paper { padding:0; font-size:12px; }
}
.stat-card { padding: 17px 18px; }
.stat-card .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 7px; letter-spacing: -.3px; }
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-card .delta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); cursor: pointer; transition: .15s; text-align: left;
}
.quick:hover { border-color: #bcd0ff; box-shadow: var(--shadow); transform: translateY(-1px); }
.quick .qi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.quick b { display: block; font-size: 14px; }
.quick span { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------ 列表/表格 */
.list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  transition: .15s; cursor: pointer;
}
.row-card:hover { border-color: #c5d6ff; box-shadow: var(--shadow); }
.row-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; background: #f3f6fb; color: var(--text-2); }
.row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-sub { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-sub .delivery-addr { max-width: min(100%, 520px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.order-action-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; background: #fff8f7; border: 1px solid #ffe1dc; border-radius: var(--radius); }
.order-action-bar .action-bar-title { font-weight: 650; font-size: 13.5px; margin-bottom: 2px; }
.order-action-bar .btn { flex: 0 0 auto; }
.advantage-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.advantage-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.advantage-item b { font-size: 13px; color: var(--text); }
.advantage-item span { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
@media (max-width: 980px) { .advantage-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.row-meta { text-align: right; flex: 0 0 auto; }
.row-meta .amount { font-weight: 700; font-size: 15px; }
.row-meta .time { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.table th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 550;
  padding: 11px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.table td { padding: 12px 14px; border-bottom: 1px solid #f0f2f6; font-size: 13.5px; vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: #fafcff; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
#subsidy-recon table.table th { font-size: 12px; }
#subsidy-recon table.table td { font-size: 13px; line-height: 1.5; }
#subsidy-recon table.table .mono { font-family: inherit; font-size: inherit; font-variant-numeric: tabular-nums; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .select { width: auto; min-width: 130px; }
.segmented { display: inline-flex; background: #eef1f6; padding: 3px; border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.segmented button {
  border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px;
  color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.segmented button.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(20,30,50,.1); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  border: 0; background: none; padding: 10px 14px; font-size: 14px; color: var(--text-2);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ------------------------------------------------------------ 表单页 */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.summary-panel { position: sticky; top: 88px; }
.summary-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; color: var(--text-2); }
.summary-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 14px; }
.summary-total .val { font-size: 26px; font-weight: 700; color: var(--danger); font-variant-numeric: tabular-nums; }
.summary-total .val.profit { color: var(--success); font-size: 22px; }

.line-table { width: 100%; border-collapse: collapse; }
.line-table th { font-size: 11.5px; color: var(--muted); font-weight: 550; text-align: left; padding: 6px 8px; white-space: nowrap; }
.line-table td { padding: 6px 8px; vertical-align: middle; }
.line-table .input { height: 34px; font-size: 13px; padding: 0 8px; border-radius: 8px; }
.line-table .qty-input { width: 62px; text-align: center; }
.line-table .price-input { width: 92px; text-align: right; }
.line-name { font-weight: 600; font-size: 13.5px; }
.line-sub { font-size: 11px; color: var(--muted); }
.line-del { color: var(--muted); background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 6px; }
.line-del:hover { color: var(--danger); background: var(--danger-soft); }
.line-rows { display: flex; flex-direction: column; gap: 10px; }
.line-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.line-card .line-top { display: flex; gap: 10px; align-items: flex-start; }
.line-card .line-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.line-card .line-grid .field > label { font-size: 10.5px; color: var(--muted); }
.line-card .line-grid .input { height: 32px; font-size: 12.5px; }
.line-total { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

.cart-empty { padding: 34px 16px; text-align: center; color: var(--muted); border: 1px dashed #d7dce6; border-radius: 12px; }

/* ------------------------------------------------------------ 扫码 */
.scan-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.scan-box {
  border-radius: var(--radius); padding: 26px; color: #fff; min-height: 250px;
  background: linear-gradient(150deg, #101a33, #1d3a72 60%, #165dff 140%);
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.scan-box h3 { margin: 0 0 6px; font-size: 18px; }
.scan-box p { margin: 0; color: rgba(255,255,255,.7); font-size: 13px; }
.scan-big-btn {
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: var(--brand); display: grid; place-items: center;
  box-shadow: 0 0 0 12px rgba(255,255,255,.12); transition: .2s; margin: 16px 0;
}
.scan-big-btn:hover { transform: scale(1.04); }
.manual-scan { display: flex; gap: 8px; margin-top: 12px; }

.scan-screen {
  position: fixed; inset: 0; z-index: 200; background: #0b0f18;
  display: flex; flex-direction: column; color: #fff;
}
.scan-video-wrap { position: relative; flex: 1; overflow: hidden; display: grid; place-items: center; }
.scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.scan-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.25); }
.scan-frame { width: min(74vw, 380px); height: min(40vw, 200px); border-radius: 18px; position: relative; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.scan-frame::before, .scan-frame::after {
  content: ""; position: absolute; width: 34px; height: 34px; border: 3px solid #fff; border-radius: 8px;
}
.scan-frame::before { left: -2px; top: -2px; border-right: 0; border-bottom: 0; }
.scan-frame::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
.scan-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: linear-gradient(90deg, transparent, #4d8dff, transparent); animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 0%,100% { top: 18%; opacity: .3; } 50% { top: 82%; opacity: 1; } }
.scan-toolbar { padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); background: #0b0f18; display: flex; flex-direction: column; gap: 10px; }
.scan-toolbar .row { gap: 8px; }
.scan-hint { text-align: center; font-size: 12.5px; color: rgba(255,255,255,.6); }
.scan-close { position: absolute; top: 16px; right: 16px; z-index: 2; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.scan-manual { display: flex; gap: 8px; }
.scan-manual .input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.scan-manual .input::placeholder { color: rgba(255,255,255,.45); }

/* ------------------------------------------------------------ 弹窗 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 420px; }
.modal-head { padding: 18px 22px 12px; display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 8px 22px 18px; overflow-y: auto; }
.modal-foot { padding: 14px 22px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { border: 0; background: #f2f4f8; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--text-2); }

/* ------------------------------------------------------------ 提示 */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1d2129; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: toastIn .2s ease; display: flex; align-items: center; gap: 8px; max-width: 90vw;
}
.toast.success { background: #0b7a22; }
.toast.error { background: #c62f2f; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }

.loading-screen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 400; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #d9e2f7; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ 导入 */
.dropzone {
  border: 2px dashed #c9d4e8; border-radius: 16px; padding: 34px 20px; text-align: center;
  background: #fafcff; cursor: pointer; transition: .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .dz-icon { width: 52px; height: 52px; border-radius: 16px; background: #fff; display: grid; place-items: center; margin: 0 auto 12px; color: var(--brand); box-shadow: var(--shadow); }
.dropzone b { display: block; font-size: 15px; }
.dropzone span { font-size: 12.5px; color: var(--muted); }
.import-steps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; font-size: 12px; color: var(--muted); }
.import-steps .step { display: flex; align-items: center; gap: 6px; }
.import-steps .n { width: 20px; height: 20px; border-radius: 50%; background: #e8edf7; color: var(--text-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.import-steps .step.active .n { background: var(--brand); color: #fff; }
.import-steps .step.active { color: var(--text); }
.preview-table { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.preview-table table { border-collapse: collapse; font-size: 11.5px; white-space: nowrap; }
.preview-table th, .preview-table td { border-bottom: 1px solid #eef1f6; border-right: 1px solid #f2f4f8; padding: 6px 9px; text-align: left; }
.preview-table th { background: #fafbfc; position: sticky; top: 0; color: var(--text-2); }
.map-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.map-chip { font-size: 11.5px; padding: 4px 8px; border-radius: 7px; background: #f2f6ff; color: var(--brand); }
.map-chip.missing { background: var(--danger-soft); color: var(--danger); }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.result-num { background: #f7f9fc; border-radius: 10px; padding: 10px; text-align: center; }
.result-num b { display: block; font-size: 20px; }
.result-num span { font-size: 11px; color: var(--muted); }
.err-list { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.err-row { display: flex; gap: 10px; padding: 7px 10px; border-bottom: 1px solid #f2f4f8; font-size: 12px; }
.err-row .no { color: var(--danger); flex: 0 0 54px; }
.notice { background: #fff8e8; border: 1px solid #ffe2b0; color: #8a5b00; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; }
.notice.blue { background: #eef4ff; border-color: #cfe0ff; color: #1c4bb8; }

.notify-btn { position: relative; }
.notify-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 20px; background: var(--danger); color: #fff;
  font-size: 10.5px; line-height: 18px; text-align: center; font-weight: 600;
  border: 2px solid #fff; box-sizing: content-box;
}
.notify-item { display: flex; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #f2f4f8; cursor: pointer; }
.notify-item:hover { background: #fafbfc; }
.notify-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-top: 7px; flex: 0 0 auto; }
.notify-item.read .dot { background: transparent; }
.notify-item .nt { font-size: 13px; font-weight: 600; }
.notify-item .nb { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.notify-item .nm { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ------------------------------------------------------------ 出库核验 */
.photo-actions { display: flex; gap: 10px; margin: 14px 0; }
.photo-preview {
  border-radius: 14px; background: #eef1f6; overflow: hidden;
  min-height: 120px; display: grid; place-items: center; margin-bottom: 8px; padding: 6px;
}
.photo-preview img { max-width: 100%; max-height: 300px; object-fit: contain; display: block; border-radius: 8px; }
.photo-preview .cart-empty { border: 0; color: var(--muted); }
.ocr-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.ocr-meta .field > label { font-size: 11.5px; }
.ocr-items { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ocr-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fafbfc;
}
.ocr-item input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; }
.ocr-item .ocr-name { font-weight: 600; font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ocr-fields { display: flex; gap: 8px; flex: 0 0 auto; }
.ocr-fields label { font-size: 10.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.ocr-fields .input { width: 76px; height: 32px; text-align: right; }
.ocr-raw { margin-top: 12px; font-size: 12px; color: var(--muted); }
.ocr-raw summary { cursor: pointer; color: var(--brand); }
.ocr-raw pre {
  max-height: 220px; overflow: auto; background: #f7f9fc; border-radius: 10px;
  padding: 12px; white-space: pre-wrap; word-break: break-all; font-size: 11.5px; line-height: 1.7;
}
@media (max-width: 640px) {
  .ocr-meta { grid-template-columns: 1fr; }
  .ocr-item { align-items: flex-start; flex-wrap: wrap; }
  .ocr-fields { width: 100%; padding-left: 28px; }
  .ocr-fields label { flex: 1; }
  .ocr-fields .input { width: 100%; }
}

/* ------------------------------------------------------------ 标签/小票 */
.label-preview { display: flex; justify-content: center; padding: 8px; background: #f7f9fc; border-radius: 12px; }
.barcode-label { background: #fff; padding: 10px 12px 8px; text-align: center; width: 260px; border: 1px solid #eee; }
.barcode-label .bl-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barcode-label .bl-model { font-size: 10px; color: #666; }
.barcode-label .bl-price { font-size: 14px; font-weight: 700; margin: 2px 0; }
.barcode-label svg { width: 100%; height: auto; display: block; }

.receipt { font-size: 13px; }
.receipt h3 { text-align: center; margin: 0 0 4px; }
.receipt .r-sub { text-align: center; color: var(--muted); font-size: 11px; margin-bottom: 14px; }
.receipt .r-row { display: flex; justify-content: space-between; padding: 4px 0; }
.receipt .r-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #eee; }
.receipt .r-total { border-top: 2px solid #333; margin-top: 8px; padding-top: 8px; font-weight: 700; font-size: 15px; }

/* ------------------------------------------------------------ 图表 */
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 185px; padding-top: 20px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bar-col .bar-value { font-size: 9px; line-height: 1.2; color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bar-col .bar { width: 100%; max-width: 38px; max-height: calc(100% - 24px); background: linear-gradient(180deg, #4d8dff, #165dff); border-radius: 6px 6px 3px 3px; min-height: 3px; transition: .3s; }
.bar-col .bar.muted { background: #dbe4f5; }
.bar-col .d { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }

.progress { height: 6px; border-radius: 6px; background: #eef1f6; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }

/* ------------------------------------------------------------ 移动端 */
.bottom-nav { display: none; }
.fab-scan { display: none; }

@media (max-width: 1100px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
  .scan-hero { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .sidebar { display: none; }
  .topbar { height: 58px; padding: 0 14px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title p { display: none; }
  .user-chip .user-txt { display: none; }
  .user-chip { padding: 4px; border: 0; background: transparent; }
  .view { padding: 14px 14px 96px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255,255,255,.96); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav button {
    flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center;
    gap: 2px; font-size: 10.5px; color: var(--muted); padding: 5px 0; cursor: pointer;
  }
  .bottom-nav button.active { color: var(--brand); font-weight: 600; }
  .bottom-nav button.scan-tab { position: relative; }
  .bottom-nav .scan-circle {
    width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff;
    display: grid; place-items: center; margin-top: -18px; box-shadow: 0 8px 18px rgba(22,93,255,.35);
    border: 3px solid #fff;
  }
  .hero { padding: 20px; flex-direction: column; align-items: flex-start; }
  .hero .big { font-size: 32px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-card .value { font-size: 21px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quick { padding: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 94vh; }
  .modal.wide, .modal.narrow { max-width: none; }
  .modal-body { padding-bottom: 12px; }
  .row-card { padding: 12px; }
  .row-icon { width: 38px; height: 38px; }
  .row-meta .amount { font-size: 14px; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .line-card .line-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-bars { height: 150px; gap: 3px; }
  .bar-col .bar-value { font-size: 8px; }
  .bar-col .d { font-size: 9px; }
  .filters .search-box { flex: 1 0 100%; }
  .filters .select { flex: 1; min-width: 0; }
}

@media (max-width: 420px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .stat-card .value { font-size: 19px; }
  .quick { padding: 12px 10px; gap: 9px; }
  .quick .qi { width: 34px; height: 34px; border-radius: 10px; }
  .quick b { font-size: 13px; }
  .quick > span:last-child > span { display: none; }
  .hero .big { font-size: 28px; }
}

@media print {
  @page { size: A4; margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; height: auto !important; overflow: visible !important; background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; position: static !important; left: auto !important; top: auto !important;
    width: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; page-break-after: avoid !important; }
  #print-root .quote-paper { display: block !important; width: auto !important; min-height: 0 !important;
    margin: 0 !important; padding: 20px 24px !important; box-shadow: none !important;
    page-break-inside: avoid !important; page-break-after: avoid !important; }
  #print-root .quote-paper:last-child { page-break-after: auto !important; }
  .sidebar, .topbar, .bottom-nav, .no-print, .modal-head, .modal-foot { display: none !important; }
  .modal-backdrop { position: static; background: #fff; padding: 0; }
  .modal { box-shadow: none; max-height: none; max-width: none; }
  .modal-body { overflow: visible; padding: 0; }
  .print-area { display: block !important; }
  .view { padding: 0; }
}
