/* ================= 基础 ================= */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e6e9ee;
  --line-2: #eff2f5;
  --text: #12181f;
  --muted: #6b7684;
  --muted-2: #98a2b0;
  --primary: #0f766e;
  --primary-600: #0c635c;
  --primary-50: #e8f5f2;
  --amber: #b45309;
  --amber-50: #fef3e2;
  --red: #be123c;
  --red-50: #fdeef1;
  --green: #15803d;
  --green-50: #eaf7ee;
  --blue: #1d4ed8;
  --blue-50: #eef2ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 24, 31, .04), 0 8px 24px rgba(18, 24, 31, .05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
a { color: var(--primary); }
.hidden { display: none !important; }

/* ================= 登录 ================= */
.login { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.login-brand {
  position: relative;
  background: radial-gradient(1200px 600px at 20% 10%, #118a7e 0%, #0b5c55 45%, #073f3a 100%);
  color: #eaf6f4;
  padding: 64px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.login-brand::after {
  content: ""; position: absolute; inset: -30% -20% auto auto; width: 520px; height: 520px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 0 0 60px rgba(255,255,255,.04), 0 0 0 140px rgba(255,255,255,.03);
}
.brand-mark {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  font-size: 30px; font-weight: 700; letter-spacing: 2px;
}
.brand-logo { display: flex; align-items: center; min-height: 64px; }
.login-logo {
  display: block; height: 64px; width: auto; max-width: 260px; object-fit: contain;
  background: #fff; border-radius: 12px; padding: 7px 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.side-brand-logo { flex: none; display: flex; align-items: center; }
.side-logo {
  display: block; width: auto; height: auto; max-width: 96px; max-height: 40px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px;
}
.brand-mark.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; background: var(--primary-50); color: var(--primary); border: 1px solid #cfe9e4; }
.brand-copy h1 { font-size: 44px; margin: 40px 0 8px; letter-spacing: 6px; font-weight: 700; }
.brand-copy .en { letter-spacing: 3px; font-size: 11px; color: rgba(234,246,244,.62); margin: 0 0 28px; }
.brand-copy .desc { font-size: 16px; line-height: 2; color: rgba(234,246,244,.82); }
.brand-foot { font-size: 12px; letter-spacing: 2px; color: rgba(234,246,244,.45); }

.login-panel { display: grid; place-items: center; padding: 48px; }
.login-form { width: min(380px, 100%); }
.login-form h2 { font-size: 26px; margin: 0 0 8px; }
.login-form .sub { color: var(--muted); margin: 0 0 28px; line-height: 1.7; }
.login-form label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.login-form input {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 14px; margin-bottom: 16px; background: #fff; transition: .15s;
}
.login-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.login-error { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 10px; }
.demo { width: min(380px, 100%); margin-top: 32px; border-top: 1px dashed var(--line); padding-top: 20px; }
.demo-title { font-size: 12px; color: var(--muted-2); margin-bottom: 12px; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--muted); transition: .15s;
}
.chip-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

/* ================= 布局 ================= */
.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.sidebar {
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px 18px; border-bottom: 1px solid var(--line-2); }
.side-brand b { display: block; font-size: 14px; }
.side-brand small { color: var(--muted-2); font-size: 10px; letter-spacing: 1.5px; }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: var(--muted); cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%;
  font-size: 13.5px; transition: .15s;
}
.nav-item svg { width: 17px; height: 17px; opacity: .7; flex: none; }
.nav-item:hover { background: #f6f8fa; color: var(--text); }
.nav-item.on { background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.nav-item.on svg { opacity: 1; }
.nav-item .tag { margin-left: auto; font-size: 10px; background: var(--red-50); color: var(--red); border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.side-foot { padding: 14px 18px; border-top: 1px solid var(--line-2); font-size: 11px; color: var(--muted-2); display: flex; align-items: center; gap: 8px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-50); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.page-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.page-title h1 { font-size: 19px; margin: 0; font-weight: 600; }
.page-title span { font-size: 12px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.userchip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-50); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.uc-text { max-width: 230px; min-width: 0; }
.uc-text b { display: block; font-size: 13px; line-height: 1.3; }
.uc-text small { display: block; max-width: 230px; font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view { padding: 22px 24px 40px; }

/* ================= 通用组件 ================= */
.btn {
  height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; transition: .15s; white-space: nowrap; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: #d2d8e0; background: #fafbfc; }
a.btn { text-decoration: none; color: inherit; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--primary-600); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f2f4f7; color: var(--text); }
.btn.danger { color: var(--red); border-color: #f6d4dc; background: var(--red-50); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-h .hint { font-size: 12px; color: var(--muted-2); }
.grid { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; color: var(--muted-2); }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  border: 0; background: transparent; padding: 10px 14px; cursor: pointer;
  color: var(--muted); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.search {
  height: 34px; min-width: 220px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: #fff;
}
.search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.select { height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: #fff; }
.spacer { flex: 1; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  text-align: left; padding: 11px 14px; background: #fafbfc; color: var(--muted);
  font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }
tbody tr { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 44px; text-align: center; color: var(--muted-2); font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 4px 0; color: var(--muted); font-size: 12px; }

.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; }
.chip.gray { background: #f1f3f6; color: var(--muted); }
.chip.amber { background: var(--amber-50); color: var(--amber); }
.chip.green { background: var(--green-50); color: var(--green); }
.chip.red { background: var(--red-50); color: var(--red); }
.chip.blue { background: var(--blue-50); color: var(--blue); }
.chip.teal { background: var(--primary-50); color: var(--primary-600); }
.chip-line { border: 1px solid var(--line); background: #fff; color: var(--muted); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dash-period { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dash-period .seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.dash-period .seg button { padding: 5px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.dash-period .seg button.active { background: #e6f4f1; color: #0f766e; font-weight: 600; }
.kpi { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi .k { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.kpi .v { font-size: 26px; font-weight: 650; margin-top: 8px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi .f { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }
.kpi .badge-up { color: var(--green); }
.kpi .badge-down { color: var(--red); }
.kpi .badge-flat { color: var(--muted-2); }
.kpi .badge-warn { color: var(--amber); }

.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-top: 16px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row .bar-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.bar-row .bar-track { height: 7px; background: #f1f3f6; border-radius: 999px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #14a396, #0f766e); }

.todo-list { display: flex; flex-direction: column; }
.todo { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.todo:hover { background: #fbfcfd; }
.todo:last-child { border-bottom: 0; }
.todo .t-type { font-size: 11px; color: var(--muted); background: #f4f6f8; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.todo .t-main { min-width: 0; }
.todo .t-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo .t-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.todo .t-amount { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }

/* 图表 */
.chart { width: 100%; height: 210px; display: block; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); padding: 0 20px 14px; }

/* ================= 表格外的统计 ================= */
.sum-bar { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding: 10px 2px; }
.sum-bar b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ================= 表单 / 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 32, .38); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; z-index: 60; overflow: auto;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 14px; width: min(720px, 100%); box-shadow: 0 24px 70px rgba(16,24,32,.22);
  animation: up .18s ease; margin-bottom: 40px;
}
.modal.wide { width: min(920px, 100%); }
.modal.narrow { width: min(460px, 100%); }
@keyframes up { from { transform: translateY(10px); opacity: .9 } to { transform: none; opacity: 1 } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-h h3 { margin: 0; font-size: 16px; }
.modal-h .x { border: 0; background: transparent; font-size: 20px; color: var(--muted-2); cursor: pointer; line-height: 1; }
.modal-b { padding: 20px 22px; max-height: 66vh; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line-2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.company-logo-row {
  display: flex; align-items: center; gap: 22px; padding-bottom: 20px; margin-bottom: 20px;
  border-bottom: 1px dashed var(--line);
}
.logo-preview {
  width: 132px; height: 88px; flex: none; border: 1px dashed var(--line); border-radius: 12px;
  background: #fafbfb; display: grid; place-items: center; position: relative; overflow: hidden;
}
.logo-preview img { max-width: 118px; max-height: 74px; object-fit: contain; background: #fff; }
.logo-preview .thumb-del { position: absolute; top: 5px; right: 5px; }
.logo-empty { text-align: center; color: var(--muted-2); }
.logo-empty span {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin: 0 auto 6px;
  background: var(--primary-50); color: var(--primary); font-size: 18px; font-weight: 700;
}
.logo-empty small { font-size: 11px; }
.logo-upload-copy { flex: 1; min-width: 0; }
.logo-upload-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.logo-upload-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--muted); }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; background: #fff; width: 100%;
}
.field textarea { height: auto; min-height: 78px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.field .help { font-size: 11px; color: var(--muted-2); }

.items-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.items-table table { font-size: 12.5px; }
.items-table thead th { padding: 8px 10px; }
.items-table tbody td { padding: 6px 10px; cursor: default; }
.items-table input, .items-table select { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; width: 100%; background: #fff; }
.items-table .del { border: 0; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 15px; }
.items-foot { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: #fafbfc; font-size: 12.5px; }
.items-foot b { font-size: 15px; }
.add-line { border: 1px dashed #cfd6de; background: #fff; color: var(--muted); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 12px; }
.add-line:hover { border-color: var(--primary); color: var(--primary); }

.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; margin-bottom: 18px; }
.dv label { display: block; font-size: 11.5px; color: var(--muted-2); margin-bottom: 3px; }
.dv div { font-size: 13.5px; word-break: break-all; }
.section-title { font-size: 12.5px; color: var(--muted); margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* ================= 库存总览 ================= */
.stock-cell { display: flex; align-items: center; gap: 6px; }
.stock-num { font-variant-numeric: tabular-nums; }
.stock-num.low { color: var(--red); font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted-2); flex-wrap: wrap; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* ================= Toast ================= */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translate(-50%, -16px);
  background: #1b2530; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 90; max-width: 80vw;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #8f1730; }

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .company-logo-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .logo-preview { width: 100%; height: 120px; }
  .logo-preview img { max-width: 200px; max-height: 100px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; align-items: center; }
  .side-brand, .side-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav-item { white-space: nowrap; }
  .topbar { padding: 0 14px; }
  .page-title h1 { font-size: 16px; }
  .view { padding: 16px 14px 32px; }
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 36px; min-height: 320px; }
  .brand-copy h1 { font-size: 30px; margin-top: 24px; }
  .login-panel { padding: 32px 24px; }
  .top-actions #currencyToggle { display: none; }
}

/* 产品研发进度条 / 星级 */
.prog { width: 64px; height: 6px; border-radius: 3px; background: rgba(15, 92, 88, .12); display: inline-block; vertical-align: middle; overflow: hidden; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, #128a82, #35b3a6); border-radius: 3px; }

/* 上传与图片 */
.upload-box { border: 1px dashed #cdd6e0; border-radius: 8px; padding: 10px 12px; background: #fbfcfd; }
.upload-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.thumb, .thumb-wrap { position: relative; width: 54px; height: 54px; display: inline-block; }
.thumb img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid #e6ebf1; background: #fff; }
.thumb-wrap .thumb-del { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; border: none; background: #be123c; color: #fff; font-size: 12px; line-height: 18px; cursor: pointer; padding: 0; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; background: #fff; border: 1px solid #e6ebf1; border-radius: 6px; width: 100%; }
.file-row a { color: #0f766e; text-decoration: none; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.detail-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-thumbs a img { width: 82px; height: 82px; object-fit: cover; border-radius: 6px; border: 1px solid #e6ebf1; }
.cell-thumb { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; border: 1px solid #e6ebf1; vertical-align: middle; margin-right: 8px; }
.listing-thumb { display: inline-block; width: 38px; height: 38px; object-fit: cover; border-radius: 5px; border: 1px solid #e6ebf1; background: #fff; vertical-align: middle; }
.listing-thumb-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: #94a3b8; background: #f1f5f9; }
.listing-thumb-btn { display: inline-flex; padding: 0; border: 0; background: transparent; cursor: zoom-in; border-radius: 5px; }
.listing-thumb-btn:hover .listing-thumb { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15,118,110,.14); }
.image-lightbox { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(15,23,42,.78); }
.image-lightbox-panel { position: relative; width: min(800px, 92vw); height: min(800px, 92vh); padding: 0; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.35); }
.image-lightbox-panel img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.image-lightbox-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: rgba(15,23,42,.72); color: #fff; font-size: 20px; line-height: 32px; cursor: pointer; }
.stars { letter-spacing: 1px; color: #d99a1a; font-size: 13px; }
.stars .muted { color: #c8cdd2; }

/* 采购比价 */
.cmp-tip { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: var(--primary-50); color: var(--primary-700); font-size: 12.5px; line-height: 1.7; }
.cmp-wrap { box-shadow: none; }
.cmp-table thead th { vertical-align: top; padding: 10px 10px 9px; white-space: normal; }
.cmp-table tbody td, .cmp-table tfoot td { padding: 8px 10px; cursor: default; }
.cmp-table tfoot td { background: #fbfcfd; border-top: 1px solid var(--line); }
.cmp-table .cmp-item { min-width: 190px; }
.cmp-table .cmp-item b { font-size: 12.5px; }
.cmp-table .cmp-item .muted { margin-top: 3px; font-size: 11.5px; }
.cmp-col { min-width: 168px; }
.cmp-sup { width: 100%; height: 32px; margin-bottom: 4px; }
.cmp-cur { font-size: 10.5px; color: var(--muted-2); font-weight: 500; }
.cmp-pick { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.cmp-pick input { width: auto; height: auto; }
.cmp-best-tag { display: none; margin-top: 6px; padding: 1px 6px; border-radius: 4px; background: var(--green-50); color: var(--green); font-size: 10.5px; font-weight: 600; }
.cmp-price, .cmp-lead, .cmp-terms { width: 100%; min-width: 86px; height: 32px; }
.cmp-total { font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-delta { margin-top: 2px; font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.cmp-delta.good { color: var(--green); }
.cmp-delta.warn { color: var(--red); }
.cmp-col.best { background: #f0fbf5; }
.cmp-summary { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #f6f8fa; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.cmp-summary b { color: var(--text); }

/* ---------- 系统联动中心 ---------- */
.link-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.link-score { width: 116px; height: 116px; flex: 0 0 116px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid var(--line); background: #fff; }
.link-score b { font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.link-score span { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.link-score.green { border-color: #b7e7cf; background: #f3fcf7; } .link-score.green b { color: var(--green); }
.link-score.amber { border-color: #f3dfb2; background: #fffbf2; } .link-score.amber b { color: var(--amber); }
.link-score.red { border-color: #f3c9c9; background: #fff7f7; } .link-score.red b { color: var(--red); }
.link-hero-main { flex: 1 1 380px; min-width: 280px; }
.link-title { font-size: 17px; font-weight: 650; margin-bottom: 4px; }
.link-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.link-stats b { font-variant-numeric: tabular-nums; }
.link-stats .red { color: var(--red); } .link-stats .amber { color: var(--amber); } .link-stats .green { color: var(--green); }
.link-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.link-card { min-width: 0; }
.link-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.link-card-head b { font-size: 13.5px; }
.link-items { max-height: 300px; overflow: auto; }
.link-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px dashed #eef1f4; }
.link-item:last-child { border-bottom: 0; }
.link-ok { padding: 18px 0 10px; color: var(--green); font-size: 13px; }
.link-auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; padding-top: 10px; }
.link-auto { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: #f7f9fb; }
.link-auto b { font-size: 12.5px; } .link-auto span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.link-suggest-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #eef1f4; }
.link-suggest-row:last-child { border-bottom: 0; }
@media (max-width: 900px) { .link-grid { grid-template-columns: 1fr; } .link-score { width: 92px; height: 92px; flex-basis: 92px; } .link-score b { font-size: 27px; } }

/* ---------- 登录页双端提示 ---------- */
.login-device { width: min(380px, 100%); margin-top: 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.device-title { font-size: 12.5px; font-weight: 650; color: var(--text); }
.device-desc { margin-top: 4px; font-size: 11.5px; line-height: 1.65; color: var(--muted); }
.login-url { margin-top: 8px; padding: 7px 9px; border-radius: 7px; background: #fff; border: 1px dashed #cfd8e0; font-size: 11.5px; color: var(--primary-600); word-break: break-all; }

/* ---------- 手机端适配（≤640px） ---------- */
@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .login { min-height: 100vh; }
  .login-brand { min-height: 0; padding: 18px 16px; flex-direction: row; align-items: center; gap: 12px; }
  .login-brand::after { width: 260px; height: 260px; inset: -180px -80px auto auto; }
  .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 20px; flex: none; }
  .brand-logo { align-items: center; min-height: 42px; }
  .login-logo { height: 42px; max-width: 150px; padding: 4px 6px; border-radius: 9px; }
  .brand-copy h1 { font-size: 20px; margin: 0; letter-spacing: 3px; }
  .brand-copy .en { margin: 2px 0 0; font-size: 8.5px; letter-spacing: 1.5px; }
  .brand-copy .desc, .brand-foot { display: none; }
  .login-panel { display: block; padding: 22px 16px 34px; }
  .login-form { width: 100%; }
  .login-form h2 { font-size: 22px; }
  .login-form .sub { margin-bottom: 18px; font-size: 12px; }
  .login-form input { height: 46px; margin-bottom: 13px; font-size: 15px; }
  .login-form .btn.block { height: 46px; font-size: 15px; }
  .demo { width: 100%; margin-top: 22px; padding-top: 16px; }
  .login-device { width: 100%; }

  .sidebar { box-shadow: 0 1px 0 var(--line); }
  .nav { padding: 6px 8px; gap: 4px; }
  .nav-item { padding: 8px 10px; font-size: 12.5px; width: auto; }
  .nav-item svg { width: 15px; height: 15px; }
  .nav-item .tag { display: none; }
  .topbar { height: auto; min-height: 54px; padding: 7px 10px; gap: 6px; }
  .page-title { flex: 1; min-width: 0; }
  .page-title h1 { font-size: 15.5px; }
  .page-title span { display: none; }
  .top-actions { gap: 2px; }
  .top-actions #pwdBtn { display: none; }
  .userchip { padding: 2px; }
  .uc-text { display: none; }
  .avatar { width: 30px; height: 30px; }
  #logoutBtn { height: 30px; padding: 0 8px; font-size: 12px; }
  .view { padding: 12px 10px 28px; }
  .card-pad { padding: 14px 13px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 12px; gap: 0; -webkit-overflow-scrolling: touch; }
  .tab-btn { padding: 9px 10px; font-size: 12.5px; white-space: nowrap; }
  .toolbar { gap: 7px; }
  .toolbar .search { flex: 1 1 100%; min-width: 0; height: 38px; }
  .toolbar .btn, .toolbar .select { height: 36px; }
  .btn { min-height: 34px; }
  .detail-grid { grid-template-columns: 1fr; }
  .modal-mask { padding: 0; align-items: stretch; }
  .modal, .modal.wide, .modal.narrow { width: 100%; min-height: 100vh; border-radius: 0; margin: 0; }
  .modal-b { max-height: none; padding: 16px 14px; }
  .modal-h, .modal-f { padding: 13px 14px; }
  .modal-f .btn { flex: 1; }
  .link-score { width: 78px; height: 78px; flex-basis: 78px; }
  .link-score b { font-size: 24px; }
  .link-actions { width: 100%; }
  .link-actions .btn { flex: 1; }
  .link-stats { gap: 10px 14px; }
  .link-suggest-row { align-items: flex-start; flex-direction: column; }
}

/* ================= 财务统计报表 ================= */
.stats-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
}
.stats-modes { display: inline-flex; background: #f2f5f6; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.stats-mode {
  border: 0; background: transparent; color: var(--muted); height: 31px; padding: 0 14px;
  border-radius: 7px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.stats-mode:hover { color: var(--ink); }
.stats-mode.on { background: #fff; color: #0b7064; font-weight: 700; box-shadow: 0 1px 4px rgba(20, 50, 45, .1); }
.stats-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stats-range input[type="date"], .stats-range select {
  height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: #fff;
  color: var(--ink); font-family: inherit; font-size: 12.5px;
}
.stats-range .btn { height: 34px; min-height: 34px; }
.stats-sub { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; margin: 4px 2px 14px; color: var(--ink); }
.stats-bars { padding: 10px 16px 16px; border-top: 1px dashed var(--line); margin-top: 4px; }
.stats-bar-row { display: grid; grid-template-columns: 118px 1fr 100px; align-items: center; gap: 10px; margin-top: 7px; font-size: 11.5px; }
.stats-bar-row > span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-bar-row > b { text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; font-size: 12px; }
.stats-track { height: 8px; background: #eef3f4; border-radius: 999px; overflow: hidden; }
.stats-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3fc3b2, #0b7064); min-width: 2px; }
.stats-toolbar .btn.ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
@media (max-width: 640px) {
  .stats-toolbar { align-items: stretch; }
  .stats-modes { width: 100%; }
  .stats-mode { flex: 1; padding: 0 6px; }
  .stats-range { width: 100%; }
  .stats-range input[type="date"] { flex: 1; min-width: 0; }
  .stats-range .btn { flex: 1; }
  .stats-bar-row { grid-template-columns: 76px 1fr 82px; gap: 7px; }
  .stats-sub { flex-direction: column; gap: 2px; }
}
