:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #14213d;
  --muted: #667085;
  --border: #e4e7ec;
  --brand: #12b76a;
  --brand-strong: #067647;
  --brand-soft: #ecfdf3;
  --danger: #d92d20;
  --warning: #dc6803;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .10);
  --font: "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
}

a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }

.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }
.danger { color: var(--danger); }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #032b1a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
}

.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--brand-strong); background: var(--brand-soft); }

.top-right { display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); font-size: 13px; }

.container { max-width: 1500px; margin: 0 auto; padding: 24px; }

/* flash */
.flash-wrap { display: grid; gap: 8px; margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.flash.error { border-color: #fecdca; background: #fef3f2; color: #b42318; }
.flash.message, .flash.success { border-color: #abefc6; background: #ecfdf3; color: #067647; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #ffffff; }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.ghost { background: transparent; }
.btn.danger-ghost { border-color: #fda29b; color: var(--danger); background: #fff; }
.btn.danger-ghost:hover { background: #fef3f2; }
.btn.small { min-height: 30px; padding: 5px 10px; font-size: 13px; }
.btn.tiny { min-height: 26px; padding: 3px 8px; font-size: 12px; }
.btn.block { width: 100%; }
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* page head */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.page-head p { margin: 6px 0 0; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions form { margin: 0; }

/* stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
}
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { font-size: 22px; font-weight: 600; }

/* panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.form-panel { padding-bottom: 14px; }

/* form fields */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span { color: var(--muted); font-size: 12px; }
.field input, .field select {
  width: 100%;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.field.compact { margin-bottom: 0; min-width: 140px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-actions { display: flex; gap: 8px; padding-bottom: 1px; }

.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-edit { display: flex; align-items: center; gap: 6px; margin: 0; }
.inline-edit input {
  height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  min-width: 150px;
}
.check-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.shop-picker {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 12px;
  background: var(--surface-2);
  display: grid;
  gap: 6px;
}

/* tables */
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--surface-2); }
.data-table tr.selected td { background: var(--brand-soft); }
.data-table td { font-size: 13px; }

/* tags */
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
}
.tag.success { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.tag.warning { color: #b54708; background: #fffaeb; border-color: #fedf89; }
.tag.danger { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.tag.muted { color: var(--muted); }

/* shop management */
.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.detail-panel {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.detail-shop { padding: 4px 0 12px; border-bottom: 1px solid var(--border); }
.detail-name { font-size: 18px; font-weight: 600; }
.detail-list {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 10px;
  margin: 14px 0;
}
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; font-weight: 500; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.detail-actions .btn { width: 100%; }
.detail-actions .btn:first-child:last-child { grid-column: span 2; }

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 16, 29, .55);
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(620px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(16, 24, 40, .24);
  padding: 20px;
}
.modal-card.wide { width: min(900px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* sync */
.sync-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.job-progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.progress-head { display: flex; justify-content: space-between; font-weight: 500; }
.progress-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--brand); transition: width .3s ease; }

/* login */
.login-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.login-logo { width: 104px; height: 104px; object-fit: contain; border-radius: 18px; }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card p { margin: 0 0 18px; }
.login-card .btn { margin-top: 6px; }
.login-card .hint { margin-top: 14px; }
.login-card .link { display: inline-block; margin-top: 12px; font-size: 13px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* dashboard */
.dashboard-body {
  --bg: #070d18;
  --surface: #101a2b;
  --surface-2: #152238;
  --text: #e6edf7;
  --muted: #8fa3bf;
  --border: #1e2d45;
  --brand: #32f08c;
  --brand-strong: #0fdc78;
  --brand-soft: #062a1b;
  --danger: #f87454;
  --warning: #f5b544;
  --shadow: none;
  background: #070d18;
}
.dashboard-body .topbar { background: #0b1424; border-bottom-color: #1e2d45; }
.dashboard-body .brand { color: #e6edf7; }
.dashboard-body .nav a { color: #8fa3bf; }
.dashboard-body .nav a:hover { background: #152238; }
.dashboard-body .nav a.active { color: #32f08c; background: #062a1b; }
.dashboard-body .btn { background: #101a2b; border-color: #1e2d45; color: #e6edf7; }
.dashboard-body .btn:hover { background: #152238; }
.dashboard-body .btn.primary { background: #32f08c; border-color: #32f08c; color: #032b1a; }
.dashboard-body .btn.ghost { background: transparent; }
.dashboard-body .flash { background: #101a2b; border-color: #1e2d45; }
.dashboard-body .flash.error { background: #2a1216; border-color: #5b2028; color: #fda29b; }
.dashboard-body .flash.success { background: #062a1b; border-color: #0f5132; color: #6ce9a6; }

.dash-wrap { max-width: 1600px; margin: 0 auto; padding: 22px 24px 34px; }
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dash-head h1 { font-size: 26px; color: #f1f5fb; letter-spacing: 1px; }
.dash-meta {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.dash-caliber {
  padding: 8px 18px;
  border: 1px dashed #2a4560;
  border-radius: 999px;
  color: #8fa3bf;
  font-size: 13px;
  letter-spacing: .3px;
}
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(50, 240, 140, 0.35);
  background: rgba(50, 240, 140, 0.08);
  color: #8fe3b8;
  font-size: 13px;
  box-shadow: 0 0 16px rgba(50, 240, 140, 0.10);
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #32f08c;
  box-shadow: 0 0 8px rgba(50, 240, 140, 0.8);
}
.sync-pill.stale {
  border-color: #1e2d45;
  background: rgba(143, 163, 191, 0.06);
  color: #8fa3bf;
  box-shadow: none;
}
.sync-pill.stale .sync-dot { background: #6f839f; box-shadow: none; }
.live-clock {
  font-size: 22px;
  font-weight: 600;
  color: #f1f5fb;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}
.dashboard-body .btn-settings {
  min-height: 38px;
  padding: 0 20px;
  border-radius: 10px;
  background: rgba(56, 132, 255, 0.14);
  border: 1px solid rgba(56, 132, 255, 0.45);
  color: #a8c8ff;
}
.dashboard-body .btn-settings:hover {
  background: rgba(56, 132, 255, 0.24);
  border-color: rgba(56, 132, 255, 0.65);
  color: #cfe1ff;
}

.period-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.period-tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid #1e2d45;
  background: #101a2b;
  color: #8fa3bf;
  font-size: 13px;
  transition: color .15s, background .15s, border-color .15s;
}
.period-tab:hover { color: #e6edf7; background: #152238; text-decoration: none; }
.period-tab.active {
  color: #062a1b;
  background: #32f08c;
  border-color: #32f08c;
  font-weight: 600;
}
.period-range { margin-left: auto; color: #6f839f; font-size: 12px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.kpi-card {
  background: #101a2b;
  border: 1px solid #1e2d45;
  border-radius: 12px;
  padding: 16px 18px;
}
.kpi-label { color: #8fa3bf; font-size: 12px; }
.kpi-value { color: #f1f5fb; font-size: 30px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-note { color: #6f839f; font-size: 12px; }
.kpi-value.danger { color: #f87454; }
.kpi-value.ok { color: #32f08c; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.dash-grid .panel {
  background: #101a2b;
  border-color: #1e2d45;
  box-shadow: none;
  margin: 0;
  min-height: 240px;
}
.dash-grid .chart-panel { grid-column: span 2; }
.dash-grid .panel-head h2 { color: #e6edf7; }
.dash-grid .panel-head .muted { color: #8fa3bf; }
.trend-tabs { display: flex; align-items: center; gap: 4px; }
.trend-tab {
  cursor: pointer;
  font-size: 12px;
  color: #8fa3bf;
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: inherit;
  line-height: 1.5;
  transition: color .15s, background .15s, border-color .15s;
}
.trend-tab:hover { color: #c9d6e8; }
.trend-tab.active {
  color: #bfefff;
  background: rgba(34, 211, 238, 0.13);
  border-color: rgba(34, 211, 238, 0.35);
}
.chart { width: 100%; height: 300px; }
.fallback-table { display: none; max-height: 260px; overflow: auto; }
.fallback-table table { width: 100%; border-collapse: collapse; }
.fallback-table th, .fallback-table td { padding: 7px 8px; border-bottom: 1px solid #1e2d45; font-size: 12px; color: #c9d6e8; text-align: left; }
.fallback-table th { color: #8fa3bf; }
.bar-list { display: grid; gap: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.bar-label { color: #c9d6e8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; background: #152238; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: #32f08c; border-radius: 999px; }
.bar-fill.accent { background: #80c1ff; }
.bar-fill.blue { background: #64b4ff; }
.bar-value { color: #e6edf7; text-align: right; font-variant-numeric: tabular-nums; }
.empty-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #2f4a2c;
  background: #0d2418;
  color: #9fe8bf;
}

.config-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(360px, 100%);
  padding: 20px;
  background: #101a2b;
  border-left: 1px solid #1e2d45;
  overflow: auto;
  box-shadow: -20px 0 40px rgba(0, 0, 0, .35);
}
.config-drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer-head h2 { color: #e6edf7; }
.config-drawer .muted { color: #8fa3bf; }
.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #1e2d45;
  color: #e6edf7;
}
.config-row .check { color: #e6edf7; }

.config-group-title {
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1e2d45;
  color: #8fa3bf;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.order-actions { display: flex; gap: 4px; flex-shrink: 0; }
.order-actions .icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #243450;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
}
.order-actions .icon-btn:hover { border-color: var(--brand); color: var(--brand); }

.shop-table-panel { margin-top: 14px; background: #101a2b; border-color: #1e2d45; }
.shop-table-panel .data-table th { color: #8fa3bf; }
.shop-table-panel .data-table td { color: #dbe6f5; }
.shop-table-panel .data-table tbody tr:hover td { background: #142136; }

.kpi-value.warn { color: #f2b544; }
.sort-input {
  width: 58px;
  height: 30px;
  padding: 4px 8px;
  border: 1px solid #1e2d45;
  border-radius: 6px;
  background: #152238;
  color: #e6edf7;
  font: inherit;
}
.config-drawer .btn.primary { margin-top: 16px; }

/* responsive */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-layout { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
}
@media (max-width: 980px) {
  .nav { gap: 0; overflow-x: auto; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .chart-panel { grid-column: span 1; }
  .sync-grid { grid-template-columns: 1fr; }
  .dash-head { flex-direction: column; align-items: flex-start; }
  .dash-meta { gap: 16px; }
  .page-head { flex-direction: column; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .brand span:last-child { display: none; }
  .container, .dash-wrap { padding: 14px; }
  .stat-grid, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 80px minmax(0, 1fr) 90px; }
}

.pager-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.pager-info { color: var(--muted); font-size: 13px; }
.pager-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.page-btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-strong); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-btn.disabled { color: var(--muted); opacity: .55; cursor: default; }
.page-ellipsis { color: var(--muted); padding: 0 2px; }
.pager-jump { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.pager-jump select,
.pager-jump input {
  height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.pager-jump input { width: 68px; }

.subjects-panel .inline-edit input[type="text"] {
  width: 310px;
  min-width: 310px;
}
.subjects-panel .field.compact input[type="text"] { width: 300px; }
.subjects-panel .data-table th:nth-child(3),
.subjects-panel .data-table td:nth-child(3),
.subjects-panel .data-table th:nth-child(4),
.subjects-panel .data-table td:nth-child(4),
.subjects-panel .data-table th:nth-child(5),
.subjects-panel .data-table td:nth-child(5) { width: 96px; white-space: nowrap; }

/* 系统设置下拉菜单 */
.nav-menu { position: relative; }
.nav-menu-title {
  display: block;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
}
.nav-menu:hover .nav-menu-title { background: var(--surface-2); }
.nav-menu-title.active { color: var(--brand-strong); background: var(--brand-soft); }
.nav-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 158px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 30;
}
.nav-menu:hover .nav-submenu { display: block; }
.nav-submenu a {
  display: block;
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.nav-submenu a:hover { background: var(--surface-2); text-decoration: none; }
.dashboard-body .nav-menu-title { color: #8fa3bf; }
.dashboard-body .nav-menu:hover .nav-menu-title { background: #152238; }
.dashboard-body .nav-menu-title.active { color: #32f08c; background: #062a1b; }
.dashboard-body .nav-submenu { background: #101a2b; border-color: #1e2d45; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.dashboard-body .nav-submenu a { color: #e6edf7; }
.dashboard-body .nav-submenu a:hover { background: #152238; }

/* ==================== 数据大屏二 ==================== */
.screen2-body {
  --s2-bg: #040c1c;
  --s2-panel: rgba(8, 26, 58, 0.78);
  --s2-panel-2: rgba(11, 34, 74, 0.66);
  --s2-line: rgba(64, 158, 255, 0.24);
  --s2-line-soft: rgba(64, 158, 255, 0.12);
  --s2-text: #e8f2ff;
  --s2-muted: #8ea9cf;
  --s2-cyan: #35d0ff;
  --s2-green: #32f0a0;
  --s2-gold: #ffc857;
  --s2-pink: #ff7aa2;
  --s2-red: #ff6b6b;
  margin: 0;
  height: 100vh;
  overflow: hidden;
  color: var(--s2-text);
  font-family: "Bahnschrift", "DIN Alternate", "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(1200px 620px at 50% -12%, rgba(46, 111, 255, 0.30), transparent 62%),
    radial-gradient(900px 520px at -8% 100%, rgba(0, 190, 255, 0.12), transparent 60%),
    radial-gradient(800px 480px at 108% 92%, rgba(120, 80, 255, 0.12), transparent 62%),
    linear-gradient(180deg, #061226 0%, #041023 55%, #030a17 100%);
}
.screen2-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(86, 160, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 160, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 82%);
  z-index: 0;
}
.screen2-body .topbar { display: none; }
.screen2-body .flash-wrap { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 90; }
.screen2-body .flash { background: #0d2b4d; border: 1px solid #2b6f9e; color: #bfe8ff; }
.s2-wrap {
  position: relative;
  z-index: 1;
  height: 100vh;
  padding: 10px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
}

/* header */
.s2-head {
  flex: none;
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 0 8px;
}
.s2-head-side { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.s2-head-left { align-items: flex-start; }
.s2-head-right { align-items: flex-end; flex-direction: row; justify-content: flex-end; gap: 8px; }
.s2-live { display: flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .5px; color: var(--s2-cyan); }
.s2-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--s2-green);
  box-shadow: 0 0 0 0 rgba(50, 240, 160, .7);
  animation: s2Pulse 1.8s infinite;
}
@keyframes s2Pulse {
  0% { box-shadow: 0 0 0 0 rgba(50, 240, 160, .7); }
  70% { box-shadow: 0 0 0 8px rgba(50, 240, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(50, 240, 160, 0); }
}
.s2-updated { font-size: 11px; color: var(--s2-muted); }
.s2-title { text-align: center; line-height: 1.1; }
.s2-title h1 {
  margin: 0;
  font-size: clamp(22px, 1.85vw, 36px);
  letter-spacing: .12em;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 10%, #9bd9ff 52%, #3da9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 14px rgba(43, 138, 255, .38));
  white-space: nowrap;
}
.s2-title span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: .42em;
  color: #5f8ec2;
  text-transform: uppercase;
}
.s2-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(64, 158, 255, .42);
  background: rgba(24, 74, 140, .38);
  color: #bfe1ff;
  font-size: 12px;
  letter-spacing: .5px;
  cursor: pointer;
  transition: .18s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.s2-btn:hover { background: rgba(46, 132, 240, .5); color: #fff; text-decoration: none; border-color: rgba(96, 190, 255, .7); }
.s2-btn.ghost { background: transparent; border-color: rgba(64, 158, 255, .22); color: var(--s2-muted); }
.s2-clock {
  min-width: 90px;
  font-size: 16px;
  letter-spacing: .06em;
  color: #d7efff;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* period bar */
.s2-periods {
  flex: none;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px;
  border-top: 1px solid rgba(64, 158, 255, .1);
  border-bottom: 1px solid rgba(64, 158, 255, .1);
  background: linear-gradient(90deg, rgba(12, 36, 76, .2), rgba(20, 60, 120, .34), rgba(12, 36, 76, .2));
}
.s2-period-tabs { display: flex; align-items: center; gap: 4px; }
.s2-period {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: #8ea9cf;
  text-decoration: none;
  letter-spacing: .06em;
  transition: .18s;
}
.s2-period:hover { color: #d9f0ff; text-decoration: none; background: rgba(48, 126, 230, .2); }
.s2-period.active {
  color: #041221;
  background: linear-gradient(180deg, #6fe3ff, #2ab6ee);
  box-shadow: 0 0 16px rgba(53, 208, 255, .45);
  font-weight: 700;
}
.s2-range { display: flex; align-items: center; gap: 8px; color: #a9c6e8; font-size: 12px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.s2-range i { color: #4b7fb6; font-style: normal; }
.s2-range em { color: var(--s2-cyan); font-style: normal; padding-left: 4px; border-left: 1px solid rgba(53, 208, 255, .25); }
.s2-data-note { padding: 1px 8px; border-radius: 9px; background: rgba(255, 200, 87, .1); border: 1px solid rgba(255, 200, 87, .25); color: var(--s2-gold); font-size: 10px; font-weight: 400; }

/* grid */
.s2-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 23.5%) minmax(0, 1fr) minmax(320px, 24.5%);
  gap: 11px;
}
.s2-col { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.s2-panel {
  position: relative;
  min-height: 0;
  min-width: 0;
  padding: 10px 12px 11px;
  border: 1px solid var(--s2-line);
  border-radius: 9px;
  background:
    linear-gradient(158deg, rgba(20, 54, 108, .62), rgba(6, 22, 48, .76) 62%),
    var(--s2-panel);
  box-shadow:
    inset 0 1px 0 rgba(126, 196, 255, .12),
    0 14px 34px rgba(0, 4, 14, .34);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.s2-panel::before,
.s2-panel::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: var(--s2-cyan);
  border-style: solid;
  opacity: .55;
  pointer-events: none;
}
.s2-panel::before { left: 6px; top: 6px; border-width: 1px 0 0 1px; }
.s2-panel::after { right: 6px; bottom: 6px; border-width: 0 1px 1px 0; }
.s2-panel-head {
  flex: none;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.s2-panel-head h2 {
  position: relative;
  margin: 0;
  padding-left: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #eaf6ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.s2-panel-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--s2-cyan);
  box-shadow: 0 0 8px var(--s2-cyan);
}
.s2-panel-head h2::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 24px;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(53, 208, 255, .9), transparent);
}
.s2-head-note { font-size: 10px; color: #6d90b8; white-space: nowrap; letter-spacing: .08em; }
.s2-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.s2-chip {
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid rgba(64, 158, 255, .2);
  background: rgba(18, 46, 88, .35);
  color: #8ea9cf;
  font-size: 11px;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: .16s;
}
.s2-chip:hover { color: #dff4ff; border-color: rgba(53, 208, 255, .45); text-decoration: none; }
.s2-chip.active {
  color: #03101f;
  font-weight: 700;
  border-color: rgba(53, 208, 255, .9);
  background: linear-gradient(180deg, #7ee9ff, #2fb9ef);
  box-shadow: 0 0 12px rgba(53, 208, 255, .38);
}
.s2-chip.small { padding: 2px 7px; font-size: 10.5px; }
.s2-chip.ghost { background: transparent; }
.s2-dir {
  margin-left: 2px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(64, 158, 255, .3);
  border-radius: 4px;
  color: var(--s2-cyan);
  font-size: 11px;
  text-decoration: none;
}
.s2-dir:hover { background: rgba(53, 208, 255, .16); text-decoration: none; }
.s2-sortbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -1px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(64, 158, 255, .14);
}
.s2-sort-label { font-size: 10px; color: #5f83ad; letter-spacing: .1em; }
.s2-count { margin-left: auto; font-size: 10px; color: #5f83ad; white-space: nowrap; }
.s2-empty { padding: 36px 0; text-align: center; color: #5f83ad; font-size: 12px; }

/* scroll */
.s2-scroll { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.s2-scroll-track { will-change: transform; }
.s2-scroll-half { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }

/* rank list */
.s2-rank-head,
.s2-port-head,
.s2-product-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  padding: 0 8px 5px;
  font-size: 10px;
  letter-spacing: .08em;
  color: #5f83ad;
}
.s2-rank-head span:last-child { text-align: right; }
.s2-rank-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 94px;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid rgba(64, 158, 255, .1);
  background: linear-gradient(90deg, rgba(21, 52, 100, .46), rgba(12, 32, 66, .28));
}
.s2-no {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(30, 66, 116, .7);
  color: #7fa6d0;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.s2-no.top1 { background: linear-gradient(135deg, #ffe08a, #e49a1d); color: #3a2100; box-shadow: 0 0 10px rgba(255, 200, 87, .45); }
.s2-no.top2 { background: linear-gradient(135deg, #e8f4ff, #8fa9c2); color: #1c2c3c; }
.s2-no.top3 { background: linear-gradient(135deg, #ffc08c, #c47032); color: #33180a; }
.s2-rank-main { min-width: 0; }
.s2-rank-name { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; line-height: 1.35; color: #e2efff; }
.s2-rank-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s2-platform {
  flex: none;
  padding: 0 4px;
  height: 15px;
  line-height: 14px;
  border: 1px solid rgba(53, 208, 255, .35);
  border-radius: 3px;
  font-size: 9px;
  font-style: normal;
  color: #7fe0ff;
  background: rgba(53, 208, 255, .08);
}
.s2-platform.douyin { color: #ff9ab7; border-color: rgba(255, 122, 162, .4); background: rgba(255, 122, 162, .08); }
.s2-platform.jd { color: #ff8c7a; border-color: rgba(255, 120, 90, .4); background: rgba(255, 120, 90, .08); }
.s2-platform.pdd { color: #ff9f9f; border-color: rgba(230, 80, 80, .4); background: rgba(230, 80, 80, .08); }
.s2-platform.taobao, .s2-platform.tmall { color: #ffb570; border-color: rgba(255, 150, 60, .4); background: rgba(255, 150, 60, .08); }
.s2-platform.wechat, .s2-platform.video { color: #7df0a8; border-color: rgba(50, 240, 160, .4); background: rgba(50, 240, 160, .08); }
.s2-platform.xiaohongshu { color: #ff8b8b; border-color: rgba(255, 90, 90, .4); background: rgba(255, 90, 90, .08); }
.s2-rank-sub { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 2px; font-size: 10px; color: #7292b6; line-height: 1.3; }
.s2-rank-amt { text-align: right; min-width: 0; }
.s2-rank-amt b { display: block; font-size: 13px; font-weight: 700; color: #eaf7ff; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.s2-rank-amt span { display: block; margin-top: 1px; font-size: 9.5px; color: #6789ae; }

/* shop data */
.s2-data-panel { flex: 0 0 39%; }
.s2-mini-stats { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 8px; }
.s2-mini {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(64, 158, 255, .13);
  background: rgba(13, 36, 74, .5);
}
.s2-mini span { display: block; font-size: 10px; color: #6d90b8; letter-spacing: .04em; }
.s2-mini b { display: block; margin-top: 2px; font-size: 16px; color: #dff3ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s2-mini em { display: block; margin-top: 1px; font-size: 9px; font-style: normal; color: #587da3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s2-donut-tabs { flex: none; display: flex; gap: 4px; margin-bottom: 3px; }
.s2-donut-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 45% minmax(0, 1fr); gap: 4px; align-items: stretch; }
.s2-donut { min-height: 0; height: 100%; }
.s2-legend { min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; overflow: hidden; }
.s2-legend-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 5px; align-items: center; font-size: 10.5px; color: #9cb6d6; }
.s2-legend-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); }
.s2-legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s2-legend-val { color: #dcefff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s2-legend-val em { margin-left: 3px; font-style: normal; font-size: 9px; color: #6789ae; }
.s2-donut-empty { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 11px; color: #5f83ad; }

/* center */
.s2-hero { flex: 0 0 148px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 12px 18px; }
.s2-hero::before, .s2-hero::after { opacity: .9; }
.s2-hero-main { min-width: 0; }
.s2-hero-label { display: block; font-size: 11px; color: #83a7ce; letter-spacing: .22em; }
.s2-hero-value {
  margin-top: 2px;
  font-size: clamp(42px, 4.15vw, 74px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 6%, #a8e8ff 46%, #38b6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 24px rgba(37, 145, 255, .32));
  white-space: nowrap;
}
.s2-hero-value small { margin-left: 6px; font-size: 14px; letter-spacing: .1em; color: #7da6cf; -webkit-text-fill-color: #7da6cf; }
.s2-hero-exact { margin-top: 4px; font-size: 12px; color: #6f93ba; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.s2-hero-side {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 14px;
  padding-left: 18px;
  border-left: 1px solid rgba(64, 158, 255, .18);
}
.s2-hero-side div { display: flex; flex-direction: column; gap: 3px; }
.s2-hero-side span { font-size: 10px; color: #6d90b8; letter-spacing: .06em; white-space: nowrap; }
.s2-hero-side b { font-size: 17px; color: #dff3ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s2-hero-badge {
  min-width: 96px;
  padding: 7px 12px;
  border-radius: 7px;
  text-align: center;
  border: 1px solid rgba(64, 158, 255, .25);
  background: rgba(13, 38, 76, .55);
}
.s2-hero-badge span { display: block; font-size: 9.5px; color: #6d90b8; letter-spacing: .06em; }
.s2-hero-badge b { display: block; margin-top: 3px; font-size: 18px; font-variant-numeric: tabular-nums; color: #a9c6e8; }
.s2-hero-badge.up b { color: var(--s2-green); text-shadow: 0 0 14px rgba(50, 240, 160, .35); }
.s2-hero-badge.down b { color: var(--s2-red); text-shadow: 0 0 14px rgba(255, 107, 107, .3); }

.s2-mid { flex: 0 0 232px; min-height: 0; display: grid; grid-template-columns: minmax(240px, 36%) minmax(0, 1fr); gap: 11px; }
.s2-gauge-panel { padding-bottom: 6px; }
.s2-gauge { flex: 1; min-height: 0; margin-top: -6px; }
.s2-gauge-meta { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; padding-top: 2px; border-top: 1px solid rgba(64, 158, 255, .1); }
.s2-gauge-meta div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 2px 0; }
.s2-gauge-meta span { font-size: 10px; color: #6d90b8; white-space: nowrap; }
.s2-gauge-meta b { font-size: 11.5px; color: #dff3ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s2-gauge-meta b.up { color: var(--s2-green); }
.s2-gauge-meta b.down { color: var(--s2-red); }
.s2-kpi-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; }
.s2-kpi-grid.dense { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s2-kpi {
  position: relative;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid rgba(64, 158, 255, .13);
  background: linear-gradient(150deg, rgba(20, 54, 104, .5), rgba(8, 25, 52, .45));
  overflow: hidden;
}
.s2-kpi::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: rgba(53, 208, 255, .55); }
.s2-kpi > span { display: block; font-size: 10px; color: #6d90b8; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s2-kpi > b { display: block; margin-top: 2px; font-size: clamp(17px, 1.42vw, 25px); line-height: 1.15; color: #e9f7ff; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s2-kpi > em { display: block; margin-top: 2px; font-size: 9px; font-style: normal; color: #587da3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s2-kpi.ok::before { background: var(--s2-green); }
.s2-kpi.ok > b { color: var(--s2-green); text-shadow: 0 0 16px rgba(50, 240, 160, .25); }
.s2-kpi.warn::before { background: var(--s2-gold); }
.s2-kpi.warn > b { color: var(--s2-gold); }
.s2-kpi.danger::before { background: var(--s2-red); }
.s2-kpi.danger > b { color: #ff9d9d; }

.s2-trend-panel { flex: 1; min-height: 0; }
.s2-trend-tools { display: flex; align-items: center; gap: 5px; }
.s2-chart { flex: 1; min-height: 0; width: 100%; }
.s2-trend-note { flex: none; text-align: right; font-size: 9.5px; color: #587da3; letter-spacing: .05em; }

/* right */
.s2-port-panel { flex: 1.08; }
.s2-product-panel { flex: 1; }
.s2-ops-panel { flex: 0 0 26%; }
.s2-port-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid rgba(64, 158, 255, .1);
  background: linear-gradient(90deg, rgba(20, 51, 99, .42), rgba(11, 30, 62, .26));
}
.s2-port-main { min-width: 0; }
.s2-port-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.s2-port-name { font-size: 12px; color: #e2efff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s2-port-share { font-size: 10px; color: var(--c); font-variant-numeric: tabular-nums; }
.s2-port-bar { height: 3px; margin: 4px 0 3px; border-radius: 2px; background: rgba(64, 158, 255, .12); overflow: hidden; }
.s2-port-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--c), rgba(255, 255, 255, .85)); box-shadow: 0 0 8px var(--c); min-width: 2px; }
.s2-port-sub { font-size: 9.5px; color: #6789ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s2-port-amt { text-align: right; min-width: 0; }
.s2-port-amt b { display: block; font-size: 12.5px; color: #eaf7ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s2-port-amt span { display: block; margin-top: 1px; font-size: 9.5px; color: #6789ae; white-space: nowrap; }
.s2-product-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(64, 158, 255, .09);
  background: rgba(14, 38, 76, .34);
}
.s2-product-main { min-width: 0; }
.s2-product-name { font-size: 11.5px; color: #dcecff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s2-product-sub { margin-top: 2px; font-size: 9.5px; color: #6789ae; }
.s2-product-amt { text-align: right; font-size: 12px; color: #eaf7ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s2-ops { flex: 1; min-height: 0; margin: 0; padding: 0 2px; list-style: none; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 2px 14px; overflow: hidden; }
.s2-ops li { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 4px 0; border-bottom: 1px dashed rgba(64, 158, 255, .1); }
.s2-ops span { font-size: 10px; color: #6d90b8; white-space: nowrap; }
.s2-ops b { font-size: 11.5px; color: #dff3ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s2-ops b.warn { color: var(--s2-gold); }

/* config drawer on screen 2 */
.s2-config { width: min(390px, 100%); background: linear-gradient(180deg, #0b1a30, #081326); border-left: 1px solid rgba(64, 158, 255, .22); box-shadow: -18px 0 44px rgba(0, 2, 10, .5); overflow-y: auto; }
.s2-config .config-head { position: sticky; top: -20px; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: -6px -4px 8px; padding: 10px 4px; background: rgba(9, 22, 41, .96); border-bottom: 1px solid rgba(64, 158, 255, .14); }
.s2-config .config-head h3 { margin: 0; font-size: 16px; color: #eaf6ff; letter-spacing: .06em; }
.s2-config .icon-btn { color: #7fa6d0; }
.s2-config .config-section { margin-top: 14px; }
.s2-config .config-section h4 { margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px solid rgba(64, 158, 255, .14); font-size: 12px; font-weight: 600; color: #9fc2e6; letter-spacing: .08em; }
.s2-config .config-hint { margin: 0 0 4px; font-size: 10.5px; color: #5f83ad; line-height: 1.5; }
.s2-config .config-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid rgba(64, 158, 255, .09); color: #cfe4fa; font-size: 12px; }
.s2-config .config-row label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.s2-config .config-row input[type=checkbox] { accent-color: #35d0ff; }
.s2-config .drag { color: #4b6f96; font-size: 12px; }
.s2-config .mini-btn { width: 22px; height: 22px; border: 1px solid rgba(64, 158, 255, .25); border-radius: 4px; background: rgba(20, 50, 95, .5); color: #8fb4da; cursor: pointer; font-size: 11px; line-height: 1; }
.s2-config .mini-btn:hover { background: rgba(53, 208, 255, .2); color: #e6f8ff; }
.s2-config .sort-input { width: 48px; height: 26px; border: 1px solid rgba(64, 158, 255, .22); border-radius: 5px; background: #0d2340; color: #d9edff; font-size: 12px; padding: 2px 6px; }
.s2-config .field { display: grid; gap: 4px; margin-bottom: 8px; min-width: 0; }
.s2-config .field > span { font-size: 10.5px; color: #6d90b8; }
.s2-config .field input, .s2-config .field select { height: 32px; padding: 4px 8px; border: 1px solid rgba(64, 158, 255, .22); border-radius: 5px; background: #0d2340; color: #d9edff; font-size: 12px; }
.s2-config .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.s2-config .config-actions { display: flex; gap: 8px; margin: 16px 0 8px; }
.s2-config .config-actions .btn { flex: 1; }
.s2-config .btn { background: #102842; border-color: rgba(64, 158, 255, .25); color: #cfe4fa; }
.s2-config .btn.primary { background: linear-gradient(180deg, #5be0ff, #239fd6); border-color: transparent; color: #032030; font-weight: 700; }

/* responsive */
@media (max-width: 1500px) {
  .s2-grid { grid-template-columns: 310px minmax(0, 1fr) 330px; }
  .s2-hero-side { gap: 9px; padding-left: 12px; }
  .s2-hero-side b { font-size: 15px; }
  .s2-kpi-grid.dense { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s2-period { padding: 4px 8px; }
}
@media (max-width: 1180px) {
  .screen2-body { height: auto; overflow: auto; }
  .s2-wrap { height: auto; min-height: 100vh; overflow: visible; }
  .s2-grid { grid-template-columns: 1fr; }
  .s2-col { min-height: auto; }
  .s2-panel { min-height: 360px; }
  .s2-hero { min-height: 160px; }
  .s2-mid { min-height: 250px; }
  .s2-head { height: auto; padding: 6px 8px; grid-template-columns: 1fr; }
  .s2-head-right { justify-content: center; flex-wrap: wrap; }
  .s2-title h1 { white-space: normal; }
  .s2-periods { height: auto; flex-wrap: wrap; padding: 6px 8px; }
  .s2-period { padding: 4px 7px; }
  .s2-scroll { max-height: 360px; }
}
