:root {
  --bg: #f3f1f6;
  --sidebar: #1a1a2e;
  --sidebar-2: #23233d;
  --panel: #ffffff;
  --line: #e6e1ec;
  --text: #1a1a2e;
  --muted: #6b6576;
  --accent: #5B21B6;
  --accent-soft: #f3e8ff;
  --danger: #dc2626;
  --ok: #059669;
  --warn: #d97706;
  --shadow: 0 10px 28px rgba(26, 26, 46, .06);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.login-card .brand { font-size: 18px; }
.login-card .sub { margin: 6px 0 18px; }
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
}
.sub {
  color: var(--muted);
  margin: 8px 0 24px;
  font-size: 13px;
  line-height: 1.6;
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea, .search {
  width: 100%;
  background: #fff;
  border: 1px solid #d9e1ec;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, .12);
}
.btn {
  border: 0;
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
  background: #1a1a2e;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  transition: background .2s, color .2s, border-color .2s, transform .12s, box-shadow .2s;
}
.btn:hover { background: var(--accent); }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; padding: 12px; display: inline-block; text-align: center; }
.btn.ghost {
  background: #fff;
  border: 1px solid #ddd7e6;
  color: var(--text);
}
.btn.ghost:hover {
  background: #f7f4fb;
  color: var(--accent);
  border-color: #d4c7ea;
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm {
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1.2;
}
.ops {
  white-space: nowrap;
}
th.ops, td.ops {
  width: 12%;
  background: #fff;
  overflow: visible;
  white-space: nowrap;
}
td.ops .btn {
  display: inline-block;
  vertical-align: middle;
}
td.ops .btn + .btn { margin-left: 2px; }
.ops-btns {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  flex-wrap: nowrap;
  vertical-align: middle;
}
.btn.warn { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.btn.warn:hover { background: #ffedd5; color: #9a3412; }
.err {
  display: none;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}

.app {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: var(--bg);
}
.sidebar {
  background:
    radial-gradient(180px 140px at 20% 0%, rgba(108, 63, 245, .28), transparent 70%),
    linear-gradient(180deg, #23233d 0%, var(--sidebar) 42%, #141428 100%);
  color: #e2e8f0;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}
.nav-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar .brand {
  margin: 2px 4px 12px;
  color: #fff;
  font-size: 13px;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  letter-spacing: .02em;
}
.sidebar .brand svg {
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 7px;
  background: rgba(255,255,255,.12);
}
.nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #b7b3c7;
  margin-bottom: 5px;
  font-size: 12px;
  text-align: left;
  box-sizing: border-box;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.nav-ico {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex: 0 0 auto;
}
.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(180deg, #9b7aff, #7c5cff);
  color: #fff;
  box-shadow: 0 8px 18px rgba(124, 92, 255, .22);
}
.nav-group {
  width: 100%;
  margin-bottom: 5px;
}
.nav-group > .nav-item { margin-bottom: 0; }
.nav-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  flex: 1;
}
.nav-caret {
  width: 10px;
  height: 10px;
  fill: currentColor;
  transition: transform .16s ease;
}
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-sub {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 0 16px;
}
.nav-group.open .nav-sub { display: flex; }
.nav-sub-item {
  font-size: 11px;
  padding: 6px 8px;
  background: rgba(255,255,255,.05);
}
.nav-group.active > .nav-toggle {
  color: #fff;
  background: rgba(155, 122, 255, .22);
}
.main {
  padding: 16px 18px 28px;
  overflow: auto;
  min-height: 0;
  height: 100%;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(900px 280px at 100% 0%, rgba(113, 64, 246, .08), transparent 55%),
    radial-gradient(700px 240px at 0% 100%, rgba(255, 155, 107, .06), transparent 50%),
    var(--bg);
}
.main > section { min-height: 100%; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}
.topbar .brand { font-size: 20px; }
.topbar .sub { margin: 4px 0 0; }
.fund-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}
.fund-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.fund-card:first-child {
  background: linear-gradient(135deg, #1a1a2e, #2a2150);
  border-color: transparent;
  color: #fff;
}
.fund-card:first-child .l,
.fund-card:first-child .s { color: rgba(255,255,255,.7); }
.fund-card:first-child .n { color: #fff; }
.fund-card .l {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.fund-card .n {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.fund-card .s {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.fund-card.stall { background: linear-gradient(180deg, #f7f3ff, #efe8ff); border-color: #ddd6fe; }
.fund-card.stall .n { color: #5B21B6; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.dash-grid > .card {
  overflow: hidden;
}
.card .n { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.card .l { color: var(--muted); margin-top: 6px; font-size: 13px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.tab {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.tab:hover { color: var(--text); border-color: #d4c7ea; }
.tab.active { color: #fff; border-color: transparent; background: #1a1a2e; box-shadow: 0 6px 14px rgba(26, 26, 46, .16); }
.tab.st-ordered.active { background: #475569; }
.tab.st-shipped.active { background: #2563eb; }
.tab.st-arrived.active { background: #7c3aed; }
.tab.st-settled.active { background: #059669; }
.tab.st-exception.active { background: #dc2626; }

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 12px;
  line-height: 1.7;
}
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.search { min-width: 180px; width: auto; padding: 8px 11px; font-size: 12px; border-radius: 12px; }

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td {
  text-align: left;
  padding: 2px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  white-space: nowrap;
  height: 32px;
  max-height: 32px;
  line-height: 14px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
th {
  color: #6b6576;
  font-weight: 600;
  background: #faf8fc;
  height: 30px;
  max-height: 30px;
  padding: 2px 4px;
}
tr:hover td { background: #f7f4fb; }
.order-table { width: 100%; table-layout: fixed; }
.order-table th.price, .order-table td.price { width: 5%; }
.order-table th.quote-col, .order-table td.quote-col,
.order-table th.profit-col, .order-table td.profit-col { width: 6%; }
.order-table th.model, .order-table td.model { width: 8%; }
.order-table th.forward, .order-table td.forward { width: 8%; }
.order-table th.owner, .order-table td.owner { width: 6%; }
.order-table th.oname, .order-table td.oname { width: 7%; }
.order-table th.phone, .order-table td.phone { width: 8%; }
.order-table th.addr, .order-table td.addr { width: 13%; }
.order-table th.track-no, .order-table td.track-no { width: 12%; }
.order-table th.logi, .order-table td.logi { width: 13%; }
.order-table th.ship, .order-table td.ship,
.order-table th.cur-status, .order-table td.cur-status { width: 7%; }
.order-table th.ops, .order-table td.ops { width: 12%; }
.order-table[data-view="ordered"] th.addr,
.order-table[data-view="ordered"] td.addr { width: auto; }
.order-table[data-view="ordered"] th.track-no,
.order-table[data-view="ordered"] td.track-no { width: 14%; }
.order-table[data-view="ordered"] th.model,
.order-table[data-view="ordered"] td.model { width: 10%; }
.order-table[data-view="settled"] th.addr,
.order-table[data-view="settled"] td.addr { width: auto; }
.order-table[data-view="settled"] th.track-no,
.order-table[data-view="settled"] td.track-no { width: 12%; }
.order-table[data-view="all"] th.addr,
.order-table[data-view="all"] td.addr { width: 16%; }
.order-table[data-view="all"] th.track-no,
.order-table[data-view="all"] td.track-no { width: 13%; }
td.addr, td.logi {
  white-space: normal;
  overflow: hidden;
  padding: 1px 3px;
}
.addr-clip {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  max-height: 28px;
  line-height: 14px;
  font-size: 10px;
  word-break: break-all;
}
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge.yes { background: #ecfdf5; color: #047857; }
.badge.no { background: #f1f5f9; color: #64748b; }
.badge.warn { background: #fff7ed; color: #c2410c; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-size: 13px;
  color: var(--text);
}
.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.logistics-cfg { margin-bottom: 12px; padding: 14px 16px; }
.logistics-cfg-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.logistics-cfg-cookie { flex: 1.6; min-width: 280px; margin: 0; }
.logistics-cfg .field { margin: 0; min-width: 120px; }
.logistics-cfg-cookie label span {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 500;
}
.logistics-cfg .btn { height: 42px; padding: 0 16px; white-space: nowrap; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-ui {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d9e1ec;
  position: relative;
  flex: 0 0 auto;
  transition: background .15s;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
  transition: transform .15s;
}
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.badge.ex { background: #fef2f2; color: #b91c1c; }
.badge.st-ordered { background: #f1f5f9; color: #475569; }
.badge.st-shipped { background: #eff6ff; color: #1d4ed8; }
.badge.st-arrived { background: #f5f3ff; color: #6d28d9; }
.badge.st-settled { background: #ecfdf5; color: #047857; }
.order-table td.quote-col { color: #047857; font-weight: 600; }
.order-table td.profit-col { color: #b45309; font-weight: 600; }
.badge.st-exception { background: #fef2f2; color: #b91c1c; }

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(26, 26, 46, .46);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  overflow: auto;
}
.modal {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px 16px;
  box-shadow: 0 24px 60px rgba(26, 26, 46, .18);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  position: sticky;
  top: -14px;
  z-index: 2;
  background: #fff;
  padding: 14px 0 8px;
  margin-top: -14px;
}
.modal-head .brand { margin: 0; font-size: 15px; }
.modal .grid2 { gap: 8px; margin-top: 8px !important; }
.modal .field { margin-bottom: 8px; }
.modal .field input, .modal .field select, .modal .field textarea {
  padding: 7px 9px;
  font-size: 13px;
  border-radius: 8px;
}
.modal .btn { padding: 6px 10px; font-size: 12px; }
.check-row { display: flex; gap: 12px; align-items: center; min-height: 32px; }
.cron-switch { margin-left: auto; min-height: 32px; font-size: 12px; color: var(--muted); }
.notice-text {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
}
.modal-actions { display: flex; gap: 8px; align-items: center; }
.confirm-modal { width: min(420px, 100%); }
.confirm-modal .notice-text { margin: 8px 0 0; font-size: 14px; line-height: 1.7; }
#confirm-modal { z-index: 90; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.status-preview {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.dash-table { min-width: 0 !important; table-layout: auto !important; }
.dash-table th, .dash-table td {
  height: auto;
  max-height: none;
  white-space: nowrap;
  width: auto !important;
}
.dash-table th:nth-child(1), .dash-table td:nth-child(1),
.dash-table th:nth-child(2), .dash-table td:nth-child(2),
.dash-table th:nth-child(3), .dash-table td:nth-child(3) { width: auto; }
.date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  margin-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.date-strip::-webkit-scrollbar { display: none; }
.date-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  transition: background .15s, color .15s, border-color .15s;
}
.date-chip:hover { color: var(--text); border-color: #d4c7ea; }
.date-chip.active { background: #1a1a2e; color: #fff; border-color: transparent; }
.maotai-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hn-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  max-width: min(720px, calc(100vw - 24px));
}
.hn-toast.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.hn-toast.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.hn-toast.detail {
  border-radius: 12px;
  text-align: left;
  font-weight: 500;
  padding: 12px 14px;
}
.hn-toast-main { font-weight: 700; margin-bottom: 8px; }
.hn-toast-raw {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11px;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(15,23,42,.04);
  border-radius: 8px;
  padding: 8px;
}
#hn-proxy-mask { z-index: 99999 !important; }
.hn-proxy-modal { max-width: 420px; }
.hn-proxy-body {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  word-break: break-all;
}
.hn-proxy-body.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.hn-proxy-body.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.mp-home {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 12px;
}
.mp-panel { padding: 16px; }
.mp-qr-box {
  display: flex;
  gap: 14px;
  align-items: center;
}
.mp-qr {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.mp-banners {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.mp-banner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.mp-banner img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: #f8fafc;
}
.mp-banner .ops {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 8px;
}
.mp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.mp-color-row, .mp-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mp-color-row input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
}
.mp-upload-row input { flex: 1; }
.cx-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 24px);
  overflow: hidden;
  gap: 8px;
}
.cx-page .tabs { margin: 0; flex: 0 0 auto; }
.cx-page .fund-grid { margin: 0; flex: 0 0 auto; }
#school-tabs { margin-bottom: 2px; }
.school-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 8px;
  overflow: hidden;
}
.school-pane.hidden { display: none !important; }
#cx-console-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
#cx-console-pane.hidden { display: none !important; }
.cx-jobs-pane {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.cx-jobs-pane .table-wrap { max-height: 100%; }
.cx-pct {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.cx-pct-bar {
  flex: 1;
  height: 6px;
  background: #e8edf4;
  border-radius: 999px;
  overflow: hidden;
}
.cx-pct-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.cx-pct-n { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cx-done-box { margin-top: 8px; }
.cx-done-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.cx-done-toggle span {
  color: var(--text);
}
.cx-done-box .toolbar { margin: 6px 0; }
.cx-page .fund-card { padding: 8px 10px; }
.cx-page .fund-card .n { font-size: 16px; margin-top: 2px; }
.cx-page .fund-card .s { margin-top: 2px; }
.cx-split {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.cx-split > div {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cx-panel { padding: 10px; }
.cx-page .cx-panel .sub { margin: 0 0 8px; font-size: 12px; }
.cx-page .field { margin-bottom: 8px; }
.cx-page .field label { margin-bottom: 4px; }
.cx-page .field input,
.cx-page .field select {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
}
.cx-page .toolbar { margin: 0; gap: 4px; }
.cx-page .toolbar .btn { padding: 6px 10px; font-size: 12px; }
.cx-remember {
  height: auto;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
}
.cx-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin: 0 0 8px;
}
.cx-opts .switch {
  height: auto;
  font-size: 12px;
  font-weight: 500;
}
.cx-course-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.cx-course-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.cx-course {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
}
.cx-course.active {
  background: var(--accent-soft);
  border-color: #d8b4fe;
  color: #5B21B6;
  font-weight: 600;
}
.cx-split > div:last-child > .cx-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.cx-log {
  height: 240px;
  min-height: 240px;
  max-height: 240px;
  overflow: auto;
  background: #111827;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  flex: 0 0 240px;
  contain: strict;
  overflow-anchor: none;
}
.hidden { display: none !important; }

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 52px 1fr;
    height: 100dvh;
    overflow: hidden;
  }
  .main { padding: 10px 10px 24px; max-width: 100%; overflow: auto; min-height: 0; }
  .topbar { margin-bottom: 12px; }
  .topbar .brand { font-size: 17px; }
  .fund-grid { grid-template-columns: 1fr; }
  .sidebar {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    align-items: center;
    scrollbar-width: none;
    max-width: 100%;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    background: #1a1a2e;
  }
  .nav-foot {
    display: flex;
    flex-direction: row;
    gap: 6px;
    margin-top: 0;
    padding-top: 0;
    flex: 0 0 auto;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .brand {
    margin: 0 8px 0 0;
    white-space: nowrap;
    font-size: 14px;
    flex: 0 0 auto;
    line-height: 32px;
    flex-direction: row;
    gap: 6px;
  }
  .sidebar .brand svg { width: 22px; height: 22px; padding: 3px; }
  .nav-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    flex: 0 0 auto;
    gap: 6px;
    margin-bottom: 0;
  }
  .nav-sub {
    flex-direction: row;
    padding: 0;
    gap: 6px;
  }
  .nav-item {
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 4px;
    margin-bottom: 0;
    padding: 0 12px;
    white-space: nowrap;
    font-size: 13px;
    line-height: 32px;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    box-sizing: border-box;
  }
  .nav-ico { width: 14px; height: 14px; }
  .cards, .dash-grid, .maotai-split, .mp-home, .cx-split { grid-template-columns: 1fr; }
  .cx-page, .school-pane { height: auto; overflow: visible; }
  .cx-opts { grid-template-columns: 1fr; }
  .cx-log { height: 200px; min-height: 200px; max-height: 200px; flex-basis: 200px; }
  .grid2 { grid-template-columns: 1fr; }
  .search { min-width: 0; width: 100%; font-size: 16px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  table { max-width: none; }
  #status-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #status-tabs::-webkit-scrollbar { display: none; }
  #status-tabs .tab { flex: 0 0 auto; }
  .order-table {
    width: 100%;
    min-width: 960px;
  }
  .order-table th.price, .order-table td.price { width: 52px; min-width: 52px; }
  .order-table th.quote-col, .order-table td.quote-col,
  .order-table th.profit-col, .order-table td.profit-col { width: 64px; min-width: 64px; }
  .order-table th.model, .order-table td.model { width: 80px; min-width: 80px; }
  .order-table th.forward, .order-table td.forward { width: 88px; min-width: 88px; }
  .order-table th.owner, .order-table td.owner { width: 68px; min-width: 68px; }
  .order-table th.oname, .order-table td.oname { width: 72px; min-width: 72px; }
  .order-table th.phone, .order-table td.phone { width: 92px; min-width: 92px; }
  .order-table th.addr, .order-table td.addr { width: 140px; min-width: 140px; }
  .order-table th.track-no, .order-table td.track-no { width: 120px; min-width: 120px; }
  .order-table th.logi, .order-table td.logi { width: 140px; min-width: 140px; }
  .order-table th.ship, .order-table td.ship,
  .order-table th.cur-status, .order-table td.cur-status { width: 72px; min-width: 72px; }
  #school-tabs, #cx-tabs, #mp-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #school-tabs::-webkit-scrollbar,
  #cx-tabs::-webkit-scrollbar,
  #mp-tabs::-webkit-scrollbar { display: none; }
  #school-tabs .tab, #cx-tabs .tab, #mp-tabs .tab { flex: 0 0 auto; }
  th.ops, td.ops { width: 148px; min-width: 148px; overflow: visible; }
  .btn.sm { padding: 4px 7px; font-size: 12px; }
  .modal {
    width: 100%;
    border-radius: 14px 14px 0 0;
    max-width: 100%;
    max-height: calc(100dvh - 56px);
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .modal-mask {
    align-items: flex-end;
    padding: 0;
    padding-top: 56px;
  }
  .modal-head { top: -14px; }
}
