:root {
  --ink: #102a2a;
  --green: #0f766e;
  --teal: #20c6ae;
  --lime: #dfff73;
  --line: #dfe9e5;
  --muted: #74837c;
  --bg: #f4f7f5;
  --red: #dc2626;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 85% 0, #dcf4ed 0, transparent 32%), var(--bg); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
button, input { font: inherit; }
.topbar { height: 74px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: linear-gradient(110deg, #071d1c, #103e39 60%, #0f766e); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 42px; height: 42px; display: block; flex: 0 0 auto; border-radius: 13px; object-fit: cover; background: transparent; box-shadow: 0 5px 14px rgba(0,0,0,.2); }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; margin-top: 3px; color: #9fd8cd; font-size: 9px; letter-spacing: .16em; }
.freshness { color: #b8d8d1; font-size: 11px; }
.module-nav { display: flex; gap: 5px; padding: 4px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: rgba(255,255,255,.06); }
.module-nav a { padding: 7px 14px; border-radius: 8px; color: #a7cbc4; text-decoration: none; font-size: 11px; font-weight: 700; }
.module-nav a.active { color: #062621; background: var(--lime); }
.platform-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 14px; margin-top: 14px; }
.chart-panel .chart { height: 360px; }
.trend-panel { margin-top: 14px; }
.trend-panel .chart { height: 360px; }
.platform-table { width: 100%; font-size: 11px; }
.platform-table th, .platform-table td { padding: 10px 12px; }
.platform-table th { color: #61756c; background: #f7faf9; }
.platform-status { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.platform-status.ok { color: #047857; background: #e8f8f1; }
.platform-status.missing { color: #9a5b0a; background: #fff5df; }
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } .platform-kpis { grid-template-columns: 1fr; } }
.shell { width: min(1480px, calc(100% - 40px)); margin: 26px auto 42px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: 38px; letter-spacing: -.05em; }
.page-head > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.range-panel { display: grid; gap: 8px; justify-items: end; }
.range-buttons { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.range { border: 0; border-radius: 8px; padding: 8px 14px; color: #6d7e76; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.range.active { color: #fff; background: var(--ink); }
.custom-range { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.custom-range input { min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.custom-range button { min-height: 34px; padding: 5px 12px; border: 0; border-radius: 8px; color: #fff; background: var(--green); cursor: pointer; }
.hidden { display: none !important; }
.warning { margin-top: 18px; padding: 13px 16px; border: 1px solid #f0d09b; border-radius: 12px; color: #9a5b0a; background: #fff8e9; font-size: 11px; line-height: 1.7; }
.date-caption { margin: 16px 0 10px; color: var(--muted); font-size: 11px; }
.empty-data { margin-bottom: 12px; padding: 30px; border: 1px dashed #cbd9d4; border-radius: 14px; color: var(--muted); background: #fbfdfc; text-align: center; font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.kpi { min-height: 130px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.95); box-shadow: 0 12px 30px rgba(10,70,60,.05); display: flex; flex-direction: column; justify-content: space-between; }
.kpi.primary { color: #fff; border-color: transparent; background: linear-gradient(145deg, #0f766e, #0b4d49); }
.kpi span, .kpi small { color: var(--muted); font-size: 10px; }
.kpi.primary span, .kpi.primary small { color: #b9ebe0; }
.kpi strong { font-size: clamp(25px, 2.5vw, 37px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi.pending strong { color: #9a5b0a; font-size: 22px; }
.negative { color: var(--red) !important; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(350px, .75fr); gap: 14px; margin-top: 14px; }
.panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.panel-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.panel-head strong { display: block; font-size: 13px; }
.panel-head small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.chart { height: 300px; }
.empty { min-height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { padding: 10px 12px; border-radius: 10px; background: #f7faf9; }
.facts dt { color: var(--muted); font-size: 9px; }
.facts dd { margin: 4px 0 0; font-size: 12px; font-weight: 700; }
.missing-list { margin-top: 12px; display: grid; gap: 7px; }
.missing-item { padding: 9px 11px; border: 1px dashed #e5c482; border-radius: 9px; color: #8c5a08; background: #fffaf0; font-size: 10px; }
.definitions { margin-top: 14px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfc; }
.definitions h2 { margin: 0 0 8px; font-size: 13px; }
.definitions ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 10px; line-height: 1.9; }
.loading { opacity: .55; }
@media (max-width: 1080px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lower-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .topbar { padding: 0 18px; } .shell { width: calc(100% - 24px); } .page-head { align-items: flex-start; flex-direction: column; } .range-panel { justify-items: start; width: 100%; } .kpi-grid { grid-template-columns: 1fr; } }

.store-dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.store-dashboard-head h1 { margin-top: 8px; }
.store-dashboard-head > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.back-link { display: inline-block; margin-bottom: 13px; color: var(--green); text-decoration: none; font-size: 11px; }
.store-cockpit-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.store-cockpit-kpis .kpi { min-height: 112px; }
.store-cockpit-kpis .kpi strong { font-size: clamp(22px, 2vw, 30px); }
@media (max-width: 1000px) { .store-dashboard-head { align-items: flex-start; flex-direction: column; } .store-cockpit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .store-cockpit-kpis { grid-template-columns: 1fr; } }

/* 店铺入口与表格可读性 */
.table-scroll { width: 100%; overflow-x: auto; }
.cell-main { min-width: 180px; font-weight: 700; }
.muted { color: var(--muted); font-size: 10px; line-height: 1.7; }
.text-link { color: var(--green); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.missing-item .text-link { color: #7a4d00; }

/* 单页店铺驾驶舱 */
.cockpit-shell { margin-top: 20px; }
.cockpit-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.store-heading .back-link { margin-bottom: 7px; }
.store-heading h1 { font-size: 34px; }
.store-heading #store-meta { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.cockpit-controls { display: flex; align-items: flex-end; gap: 16px; }
.store-switcher { display: grid; gap: 6px; }
.control-label { color: var(--muted); font-size: 9px; font-weight: 700; }
.store-switch-row { display: flex; align-items: center; gap: 5px; }
.store-switch-row select { width: 300px; min-height: 38px; padding: 7px 34px 7px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 11px; outline: none; }
.store-switch-row select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.store-switch-row button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--green); background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.store-switch-row button:disabled { color: #b8c5c0; background: #f7faf9; cursor: not-allowed; }
.cockpit-caption { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 13px 0 9px; color: var(--muted); font-size: 10px; }
.caption-tip { color: #98a69f; }
.cockpit-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cockpit-kpi { min-height: 96px; padding: 14px 16px; border-radius: 14px; }
.cockpit-kpi strong { font-size: clamp(21px, 2vw, 29px); }
.cockpit-kpi small { font-size: 9px; }
.comparison-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; overflow: hidden; }
.comparison-strip > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 9px 16px; border-right: 1px solid var(--line); }
.comparison-strip > div:last-child { border-right: 0; }
.comparison-strip span { color: var(--muted); font-size: 9px; }
.comparison-strip strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.cockpit-main-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, .75fr); gap: 14px; margin-top: 14px; }
.cockpit-main-grid .chart { height: 292px; }
.cockpit-details { margin-top: 14px; padding: 0; overflow: hidden; }
.detail-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); background: #f8fbfa; }
.detail-tab { padding: 8px 13px 10px; border: 0; border-bottom: 2px solid transparent; color: #6d7e76; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.detail-tab.active { color: var(--green); border-bottom-color: var(--green); }
.detail-view { padding: 0; }
.compact-table { max-height: 332px; overflow: auto; }
.compact-table th { position: sticky; top: 0; z-index: 1; }
.compact-table td { white-space: nowrap; }
.compact-table td.cell-main { min-width: 420px; max-width: 680px; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.compact-missing { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px; }
.compact-missing + .muted { display: block; margin: 12px 14px 14px; }
.cockpit-definitions { margin-top: 12px; padding: 0; }
.cockpit-definitions summary { padding: 13px 16px; color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; }
.cockpit-definitions ul { margin: 0; padding: 0 34px 15px; }
@media (max-width: 1280px) {
  .cockpit-toolbar { align-items: flex-start; flex-direction: column; }
  .cockpit-controls { width: 100%; justify-content: space-between; }
  .cockpit-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cockpit-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .cockpit-controls { align-items: stretch; flex-direction: column; }
  .store-switch-row select { width: 100%; }
  .cockpit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-strip > div:nth-child(2) { border-right: 0; }
  .comparison-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .compact-missing { grid-template-columns: 1fr 1fr; }
}

/* 店铺看板首页筛选 */
.analysis-controls { display: flex; align-items: flex-end; gap: 14px; }
.store-filter-panel { display: grid; gap: 6px; }
.store-filter-panel select { width: 310px; min-height: 42px; padding: 8px 34px 8px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 11px; outline: none; }
.store-filter-panel select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
@media (max-width: 900px) {
  .analysis-controls { align-items: stretch; flex-direction: column; }
  .store-filter-panel select { width: 100%; }
}

/* M4 商品管理 */
.product-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-quality-strip { margin-top: 12px; }
.product-category-grid { align-items: stretch; }
.product-category-grid .chart { height: 390px; }
.product-category-table { max-height: 390px; overflow: auto; }
.product-category-table th { position: sticky; top: 0; z-index: 1; }
.product-top-panel { margin-top: 14px; }
.product-top-table td { white-space: nowrap; }
.product-top-table .product-name-cell { max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.category-name { display: inline-block; padding: 3px 8px; border-radius: 999px; color: #52645c; background: #f1f5f3; font-size: 9px; font-weight: 700; white-space: nowrap; }
.category-name.major { color: #076b5f; background: #e5f7f1; }
.definitions code { padding: 1px 5px; border-radius: 5px; color: #31544a; background: #eef5f2; font-size: 9px; }
@media (max-width: 1080px) { .product-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .product-kpis { grid-template-columns: 1fr; } }

/* 全模块导航与通用模块 */
.module-nav { max-width: min(980px, 68vw); overflow-x: auto; scrollbar-width: thin; flex-shrink: 1; }
.module-nav a { white-space: nowrap; }
.module-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.order-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.module-panel { margin-top: 14px; }
.module-table { max-height: 560px; overflow: auto; }
.module-table th { position: sticky; top: 0; z-index: 1; }
.module-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.status-pill { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-pill.ok { color: #047857; background: #e8f8f1; }
.status-pill.warn { color: #9a5b0a; background: #fff5df; }
.status-pill.danger { color: #b91c1c; background: #feecec; }
.period-switch { display: flex; gap: 4px; margin-top: 12px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #fff; width: max-content; }
.period-switch button { padding: 7px 14px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.period-switch button.active { color: #fff; background: var(--ink); }
.report-actions { display: flex; align-items: center; gap: 8px; }
.report-actions input, .inline-form input, .policy-form input, .policy-form select, .policy-form textarea, .settings-form input { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 11px; outline: none; }
.primary-button, .inline-form button, .policy-form button, .settings-form button { min-height: 36px; padding: 7px 14px; border: 0; border-radius: 9px; color: #fff; background: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; }
.inline-form { display: grid; grid-template-columns: 130px 1fr 170px 1fr auto; gap: 8px; margin-bottom: 12px; }
.policy-form { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 130px 1fr 150px 150px auto; gap: 8px; align-items: start; }
.form-grid textarea { grid-column: 1 / -2; }
.form-grid button { grid-column: -2 / -1; align-self: end; }
.settings-form { display: grid; gap: 12px; max-width: 420px; }
.settings-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.settings-form label input[type="number"], .settings-form label input[type="time"] { width: 100%; }
.check-row { display: flex !important; align-items: center; grid-template-columns: auto 1fr; }
.check-row input { min-height: auto !important; }
.table-action { padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.policy-content { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.permission-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; }
.permission-grid label { display: flex; align-items: center; gap: 5px; color: #52645c; font-size: 9px; white-space: nowrap; }
.permission-table td { vertical-align: top; }
.role-desc { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 400; }
.source-status { display: grid; gap: 8px; }
.source-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 11px; border-radius: 9px; background: #f7faf9; font-size: 10px; }
.source-row strong { font-size: 9px; }
.ok-text { color: #047857; }
.warn-text { color: #9a5b0a; }
.warning.info { border-color: #a7d9cc; color: #0b675b; background: #effaf7; }
@media (max-width: 1280px) { .module-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .order-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .form-grid { grid-template-columns: 1fr 1fr; } .form-grid textarea { grid-column: 1 / -1; } .form-grid button { grid-column: 1 / -1; } }
@media (max-width: 900px) { .module-split { grid-template-columns: 1fr; } .inline-form { grid-template-columns: 1fr 1fr; } .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .module-nav { max-width: 55vw; } }
@media (max-width: 650px) { .module-kpis, .order-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .inline-form { grid-template-columns: 1fr; } }

/* AdminLTE 风格固定侧边栏：M1-M12 */
:root { --sidebar-width: 252px; }
body { padding-left: var(--sidebar-width); }
.topbar {
  position: fixed; inset: 0 auto 0 0; z-index: 100;
  width: var(--sidebar-width); height: 100vh; padding: 0;
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  color: #d9ece7;
  background: linear-gradient(180deg, #061b1a 0%, #0b2d2a 58%, #0b3d37 100%);
  box-shadow: 10px 0 30px rgba(4, 35, 31, .12);
}
.topbar .brand { min-height: 76px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.08); flex: 0 0 auto; }
.topbar .brand-icon { width: 40px; height: 40px; border-radius: 12px; }
.topbar .brand strong { font-size: 16px; color: #fff; }
.topbar .brand small { color: #87bcb1; }
.topbar .module-nav {
  flex: 1 1 auto; max-width: none; width: 100%; padding: 12px;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  overflow-y: auto; overflow-x: hidden;
  border: 0; border-radius: 0; background: transparent;
}
.topbar .module-nav::-webkit-scrollbar { width: 4px; }
.topbar .module-nav::-webkit-scrollbar-thumb { border-radius: 4px; background: rgba(255,255,255,.18); }
.nav-section-title { padding: 13px 11px 5px; color: #759d93; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.module-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 5px 9px;
  border-radius: 9px; color: #a8c8c1; text-decoration: none; font-size: 11px; font-weight: 600;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.module-nav a:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.module-nav a.active { color: #092c28; background: var(--lime); box-shadow: 0 7px 18px rgba(0,0,0,.1); }
.nav-index { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: #8dbeb4; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.module-nav a.active .nav-index { color: #0b4139; border-color: rgba(7,70,60,.15); background: rgba(255,255,255,.42); }
.nav-label { white-space: nowrap; }
.topbar .freshness { flex: 0 0 auto; margin: 8px 12px 14px; padding: 10px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; color: #8fb8ae; background: rgba(255,255,255,.045); font-size: 9px; line-height: 1.55; }
.shell { width: auto; max-width: none; margin: 24px 28px 42px 28px; }
.sidebar-mobile-toggle { display: none; }
@media (max-width: 900px) {
  body { padding-left: 0; }
  .sidebar-mobile-toggle { display: block; position: fixed; z-index: 130; top: 12px; left: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,.08); }
  .topbar { width: 272px; transform: translateX(-105%); transition: transform .22s ease; }
  body.sidebar-open .topbar { transform: translateX(0); }
  .shell { margin: 66px 12px 30px; }
}

.settings-form label small { color: #8b9991; font-size: 9px; line-height: 1.4; }

.business-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; color: #076b5f; background: #e5f7f1; font-size: 9px; font-weight: 700; white-space: nowrap; }

.module-kpis .kpi strong, .order-kpis .kpi strong { font-size: clamp(18px, 1.8vw, 27px); white-space: nowrap; }

/* 订单列表与明细抽屉 */
.order-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #f8fbfa; }
.order-filter-bar select, .order-filter-bar input { min-height: 35px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 10px; outline: none; }
.order-filter-bar input { flex: 1 1 240px; min-width: 180px; }
.secondary-button { min-height: 35px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--green); background: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
.secondary-button:disabled { color: #aebbb6; cursor: not-allowed; background: #f5f8f7; }
.order-main-table { max-height: 610px; overflow: auto; }
.order-main-table table { min-width: 2200px; }
.order-main-table th { position: sticky; top: 0; z-index: 2; white-space: nowrap; }
.order-main-table td { white-space: nowrap; font-size: 9px; }
.order-main-table .shop-cell { min-width: 160px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.status-pill.muted-status { color: #6b7280; background: #f0f2f1; }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 12px; color: var(--muted); font-size: 9px; }
.pagination-bar > div { display: flex; align-items: center; gap: 8px; }
#page-indicator { min-width: 46px; text-align: center; color: var(--ink); font-weight: 700; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(4, 23, 20, .36); backdrop-filter: blur(2px); }
.order-drawer { position: fixed; z-index: 210; top: 0; right: 0; bottom: 0; width: min(1120px, 82vw); display: flex; flex-direction: column; background: #f6f9f7; box-shadow: -20px 0 50px rgba(4,35,31,.16); }
.order-drawer-head { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 24px 16px; color: #fff; background: linear-gradient(120deg,#072725,#0f766e); }
.order-drawer-head h2 { margin: 0; font-size: 22px; }
.order-drawer-head .eyebrow { color: #a9e4d9; }
.drawer-close { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; color: #fff; background: rgba(255,255,255,.08); font-size: 24px; line-height: 1; cursor: pointer; }
.order-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 22px 32px; }
.drawer-section { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.drawer-section h3 { margin: 0 0 12px; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.detail-grid > div { padding: 9px 11px; border-radius: 9px; background: #f7faf9; }
.detail-grid dt { color: var(--muted); font-size: 9px; }
.detail-grid dd { margin: 4px 0 0; font-size: 11px; font-weight: 700; word-break: break-all; }
.drawer-section .product-name-cell { min-width: 360px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.account-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.drawer-raw summary { color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; }
.drawer-raw[open] summary { margin-bottom: 12px; }
.raw-field-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.raw-field-table th, .raw-field-table td { padding: 7px 8px; border-bottom: 1px solid #edf2f0; text-align: left; vertical-align: top; }
.raw-field-table th { color: var(--muted); background: #f7faf9; }
.raw-field-table code { color: #0f766e; font-family: Consolas, monospace; }
.raw-value { max-width: 720px; word-break: break-all; color: #3f554c; }
.item-raw-block { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.item-raw-block summary { color: #52645c; font-size: 10px; font-weight: 700; cursor: pointer; }
.loading-text { padding: 20px; color: var(--muted); text-align: center; }
body.drawer-open { overflow: hidden; }
@media (max-width: 900px) {
  .order-drawer { width: 100vw; }
  .detail-grid { grid-template-columns: 1fr; }
}

.order-kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.shipping-kpi strong { color: var(--green); }
.shipping-kpi small { line-height: 1.55; }
.order-main-table table { min-width: 2480px; }
.order-main-table .product-short-cell { min-width: 120px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: #0f5f56; }
.order-main-table .address-cell { min-width: 220px; max-width: 300px; white-space: normal; line-height: 1.55; }
.estimate-cell { border-bottom: 1px dotted #8ba69e; cursor: help; }
@media (max-width: 1280px) { .order-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .order-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 库存查询与子模块导航 */
.submodule-tabs { display: flex; gap: 5px; margin-top: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #fff; width: max-content; }
.submodule-tabs a { padding: 7px 15px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 10px; font-weight: 700; }
.submodule-tabs a.active { color: #fff; background: var(--ink); }
.inventory-search-panel { margin-top: 14px; }
.inventory-search-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inventory-search-bar input { flex: 1 1 360px; min-width: 240px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; outline: none; }
.inventory-search-bar select { min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 10px; }
.source-readiness { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.source-ready-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 10px; }
.source-ready-card strong { font-size: 9px; }
.source-ready-card.ready { border-color: #b0ddd0; background: #f2fbf8; }
.source-ready-card.ready strong { color: #047857; }
.source-ready-card.pending { border-color: #ecd29e; background: #fffaf0; }
.source-ready-card.pending strong { color: #9a5b0a; }
.inventory-query-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.inventory-query-table { max-height: 620px; overflow: auto; }
.inventory-query-table table { min-width: 2050px; }
.inventory-query-table th { position: sticky; top: 0; z-index: 1; }
.inventory-query-table td { white-space: nowrap; font-size: 9px; }
.source-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.source-badge.elertr { color: #075f54; background: #e1f7f0; }
.source-badge.jst { color: #52645c; background: #f0f4f2; }
.source-badge.haier { color: #1d4f91; background: #edf4ff; }
.source-badge.warehouse { color: #7c3d0b; background: #fff3dc; }
.inventory-check { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.inventory-check input { flex: 0 0 auto; width: 14px; min-width: 14px; height: 14px; min-height: 0; padding: 0; accent-color: var(--green); }
.inventory-snapshot-meta { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 9px; line-height: 1.6; }
.inventory-snapshot-meta:empty { display: none; }
.inventory-import-button { border-color: #efcd8c; color: #8a4f06; background: #fffaf0; }
.inventory-import-status { margin-top: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #f8fbfa; font-size: 9px; line-height: 1.55; word-break: break-all; }
.inventory-import-status.success { border-color: #b0ddd0; color: #047857; background: #f2fbf8; }
.inventory-import-status.error { border-color: #efb4ad; color: #a32d21; background: #fff4f2; }
@media (max-width: 1200px) { .inventory-query-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .source-readiness { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .inventory-query-kpis { grid-template-columns: 1fr 1fr; } }

.sidebar-user { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 12px 0; padding: 10px 11px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-user strong { display: block; color: #fff; font-size: 10px; }
.sidebar-user small { display: block; margin-top: 3px; color: #8fb8ae; font-size: 8px; }
.sidebar-user a { color: #dfff73; text-decoration: none; font-size: 9px; white-space: nowrap; }

.account-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.account-form input, .account-form select { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 10px; }
.account-form input { flex: 1 1 150px; }
.account-form select { flex: 0 1 170px; }
.account-form button { min-height: 36px; padding: 7px 14px; border: 0; border-radius: 9px; color: #fff; background: var(--green); font-size: 10px; font-weight: 700; cursor: pointer; }
.department-form input:last-of-type { flex: 2 1 240px; }
.small-select { min-height: 28px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 9px; }
.action-cell { display: flex; flex-wrap: wrap; gap: 4px; }
