/* ---------- 启动 ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
}

.boot-logo {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(160deg, #7a6cff, #5b5bd6);
  color: #fff;
  box-shadow: 0 12px 28px rgba(91, 91, 214, 0.25);
}

.boot-logo svg {
  width: 28px;
  height: 28px;
}

.boot-text {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.6px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 22px 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 186px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(155deg, #7d70ff 0%, #5b5bd6 78%);
  color: #fff;
  box-shadow: 0 7px 16px rgba(91, 91, 214, 0.24);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #232837;
}

.brand-text small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.6px;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  margin: 0 16px;
  background: var(--line);
}

.topbar-tagline {
  color: #8c93a5;
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
}

.account-trigger {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(160deg, #efefff, #e4e4ff);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  transition: box-shadow 0.16s, transform 0.16s;
}

.account-trigger:hover {
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.12);
}

.account-menu {
  position: fixed;
  top: 57px;
  right: 18px;
  z-index: 95;
  width: 252px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-pop);
  animation: popIn 0.16s ease;
}

.account-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #7f74ff, #5b5bd6);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.account-head .name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #262c3b;
}

.account-head .handle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.account-meta {
  margin: 12px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7f8fc;
  color: #8e95a7;
  font-size: 11.5px;
  line-height: 1.8;
}

.account-meta .mode-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6f7688;
}

.account-sep {
  height: 1px;
  margin: 6px 0;
  background: var(--line-2);
}

.account-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #5b6273;
  font-size: 13px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.account-item:hover {
  background: #f5f6fb;
  color: var(--danger);
}

.account-item svg {
  width: 15px;
  height: 15px;
}

/* ---------- 布局 / 侧栏 ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  padding-top: var(--topbar-h);
  transition: grid-template-columns 0.2s ease;
}

.sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 14px 12px 16px;
  border-right: 1px solid var(--line);
  background: #fbfbfd;
  transition: transform 0.2s ease;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: #525a6e;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  color: #7d8497;
  transition: color 0.15s;
}

.nav-item em {
  margin-left: auto;
  color: #a6abbb;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 500;
}

.nav-item:hover {
  background: #f2f3f9;
}

.nav-item.active {
  background: #eef0ff;
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active svg,
.nav-item.active em {
  color: var(--primary);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding: 14px 10px 4px;
  color: #a1a7b7;
  font-size: 11.5px;
}

.channel-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f2f3f9;
  color: #777e92;
  font-size: 11px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.dot.sim {
  background: #f59e0b;
}

.main {
  grid-column: 2;
  min-width: 0;
  padding: 26px 32px 64px;
}

#view {
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
}

.shell.collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.shell.collapsed .sidebar {
  transform: translateX(-102%);
}

.sidebar-mask {
  display: none;
}

/* ---------- 页面基础 ---------- */
.page-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2px 0 20px;
}

.page-title {
  margin: 0;
  color: #202633;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.page-sub {
  color: var(--muted);
  font-size: 13px;
}

.page-sub b {
  color: #4a5162;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 24px 0 12px;
  color: #293040;
  font-size: 15px;
  font-weight: 600;
}

.section-head::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, #7f73ff, #5b5bd6);
}

.section-head .section-extra {
  margin-left: auto;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
}

.section-head .section-extra:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.page-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 90px 20px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-height: 108px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6d7486;
  font-size: 13px;
}

.stat-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f2f3f7;
  color: #8d93a3;
}

.stat-ico svg {
  width: 16px;
  height: 16px;
}

.stat-value {
  margin-top: 8px;
  color: #232a39;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-card.processing .stat-ico {
  background: var(--info-soft);
  color: var(--info);
}

.stat-card.success .stat-ico {
  background: var(--success-soft);
  color: var(--success);
}

.stat-card.failed .stat-ico {
  background: var(--danger-soft);
  color: var(--danger);
}

.stat-card.rate .stat-ico {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-card .stat-value.processing {
  color: #2563eb;
}

.stat-card .stat-value.success {
  color: #16a34a;
}

.stat-card .stat-value.failed {
  color: #dc2626;
}

/* ---------- 工作台 ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.quick-card:hover {
  border-color: #d9d8ff;
  box-shadow: 0 10px 24px rgba(91, 91, 214, 0.08);
  transform: translateY(-1px);
}

.quick-ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}

.quick-ico svg {
  width: 20px;
  height: 20px;
}

.quick-title {
  display: block;
  color: #2a3140;
  font-size: 14px;
  font-weight: 600;
}

.quick-desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.recent-table {
  min-width: 820px;
}

.order-main {
  color: #2c3343;
  font-size: 12.8px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1px;
}

.order-sub {
  margin-top: 4px;
  color: #9aa1b2;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.cell-amount {
  color: #39404f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-time {
  color: #9aa1b2;
  font-size: 12.5px;
  white-space: nowrap;
}

.status-cell {
  white-space: nowrap;
}

.recent-table th:nth-child(1) {
  width: 42%;
}

/* ---------- 工具栏 / 订单页 ---------- */
.orders-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}

.orders-toolbar .spacer {
  flex: 1;
  min-width: 4px;
}

.search {
  position: relative;
  display: inline-flex;
}

.search > svg {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 15px;
  height: 15px;
  color: #9aa0b2;
  transform: translateY(-50%);
  pointer-events: none;
}

.search .input {
  width: 208px;
  padding-left: 32px;
}

.date-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.date-nav {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #9aa0b2;
}

.date-nav:hover {
  background: #f2f3f9;
  color: #5b6273;
}

.date-nav svg {
  width: 14px;
  height: 14px;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #4d5568;
  font-size: 13px;
  transition: border-color 0.16s;
}

.date-pill:hover {
  border-color: #d0d4e2;
}

.date-pill svg {
  width: 15px;
  height: 15px;
  color: #8b92a4;
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 85;
  min-width: 258px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-pop);
  animation: popIn 0.14s ease;
}

.date-presets {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.date-preset {
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #5b6273;
  font-size: 12.5px;
  text-align: left;
}

.date-preset:hover {
  background: #f5f6fb;
}

.date-preset.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.date-custom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 10px 4px 4px;
  border-top: 1px solid var(--line-2);
}

.date-custom .input {
  height: 30px;
  flex: 1;
  min-width: 0;
  padding: 0 7px;
  font-size: 12px;
}

.date-custom span {
  color: #a0a6b6;
  font-size: 11.5px;
}

.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e3e2fd;
  border-radius: 999px;
  background: #f7f6ff;
  color: #6a66dd;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.16s, border-color 0.16s;
}

.auto-refresh .dot {
  width: 6px;
  height: 6px;
  background: #a8a5c9;
}

.auto-refresh.on {
  border-color: #dcdafd;
  background: #f0efff;
  color: #5b58d6;
}

.auto-refresh.on .dot {
  background: #6d64f4;
  box-shadow: 0 0 0 3px rgba(109, 100, 244, 0.14);
  animation: pulse 2.4s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.export-wrap {
  position: relative;
  display: inline-flex;
}

.export-wrap > .btn .chev {
  width: 13px;
  height: 13px;
  margin-left: -1px;
  color: #9aa0b2;
}

.menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 85;
  width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-pop);
  animation: popIn 0.14s ease;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #5b6273;
  font-size: 12.5px;
  text-align: left;
}

.menu-item:hover {
  background: #f5f6fb;
  color: var(--text);
}

.menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.menu-item svg {
  width: 14px;
  height: 14px;
  color: #8b92a4;
}

.menu-item .count {
  margin-left: auto;
  color: #9aa1b2;
  font-size: 11.5px;
}

.menu-hint {
  padding: 7px 9px 4px;
  color: #a0a6b6;
  font-size: 11px;
}

.orders-table {
  min-width: 1020px;
}

.orders-table th .th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.th-sort svg {
  width: 12px;
  height: 12px;
  color: #b6bac8;
}

.th-sort:hover {
  color: #4d5568;
}

.th-sort.active {
  color: var(--primary);
}

.th-sort.active svg {
  color: var(--primary);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.row-actions .link {
  font-size: 12.5px;
}

.fail-hint {
  display: inline-block;
  max-width: 132px;
  overflow: hidden;
  color: #cf3a3a;
  font-size: 12px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 12.5px;
}

.table-foot .foot-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pager-btn {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #727a8d;
  font-size: 12px;
}

.pager-btn:hover:not(:disabled) {
  border-color: #cdd2e3;
  color: var(--text);
}

.pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pager-btn svg {
  width: 13px;
  height: 13px;
}

.pager-info {
  min-width: 46px;
  margin: 0 3px;
  color: #6b7280;
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.foot-select {
  position: relative;
  display: inline-flex;
}

.foot-select select {
  appearance: none;
  height: 28px;
  padding: 0 24px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.foot-select svg {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 12px;
  height: 12px;
  color: #9aa0b2;
  transform: translateY(-50%);
  pointer-events: none;
}

/* ---------- 数据统计 ---------- */
.stats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}

.segmented {
  display: inline-flex;
  gap: 6px;
}

.seg-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #5c6376;
  font-size: 12.5px;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.seg-btn:hover {
  border-color: #d3d7e5;
}

.seg-btn.active {
  border-color: #dcdcff;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 4px;
}

.summary-card {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.summary-label {
  color: #868da0;
  font-size: 12.5px;
}

.summary-value {
  margin-top: 6px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
}

.summary-value.purple {
  color: #5b5bd6;
}

.summary-value.green {
  color: #16a34a;
}

.summary-value.red {
  color: #dc2626;
}

.summary-value.dark {
  color: #232a39;
}

.stats-table {
  min-width: 620px;
}

.stats-table td {
  padding: 12px 16px;
}

.num-success {
  color: #15803d;
  font-variant-numeric: tabular-nums;
}

.num-failed {
  color: #cf3a3a;
  font-variant-numeric: tabular-nums;
}

.num-rate {
  color: #2c3343;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chart-card {
  padding: 16px 20px 12px;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.chart-title {
  color: #454d60;
  font-size: 12.5px;
  font-weight: 500;
}

.legend {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #8b92a4;
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend i.purple {
  background: #6d6af0;
}

.legend i.green {
  background: #2fbd74;
}

.chart-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.chart-svg {
  display: block;
  width: 100%;
  min-width: 580px;
  height: auto;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a3a9ba;
  font-size: 12.5px;
  pointer-events: none;
}

.chart-tip {
  position: absolute;
  z-index: 6;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(31, 36, 48, 0.94);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.65;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -112%);
  transition: opacity 0.12s ease;
  box-shadow: 0 8px 22px rgba(15, 20, 35, 0.18);
}

.chart-tip.show {
  opacity: 1;
}

.chart-tip b {
  font-weight: 600;
}

.chart-tip .t-date {
  color: #c7cbe0;
  margin-bottom: 2px;
}

/* ---------- 上传页 ---------- */
.upload-card {
  padding: 18px 20px 16px;
}

.upload-card + .upload-card {
  margin-top: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: #293040;
  font-size: 14.5px;
  font-weight: 600;
}

.card-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #7f73ff, #5b5bd6);
}

.card-title .card-ico {
  display: none;
}

.count-chip {
  margin-left: 1px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f9;
  color: #8b92a4;
  font-size: 11.5px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 24px 20px;
  border: 1.5px dashed #d9dcea;
  border-radius: 12px;
  background: #fbfcff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #b8b8f3;
  background: #f8f8ff;
}

.dropzone.busy {
  pointer-events: none;
  opacity: 0.75;
}

.dropzone-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #efefff;
  color: var(--primary);
}

.dropzone-ico svg {
  width: 22px;
  height: 22px;
}

.dropzone-title {
  color: #5c6376;
  font-size: 13.5px;
}

.dropzone-hint {
  color: #9aa1b2;
  font-size: 12px;
}

.file-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-link:hover {
  color: var(--primary-strong);
}

.file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcff;
  color: #6b7280;
  font-size: 11.5px;
}

.file-chip svg {
  width: 13px;
  height: 13px;
  color: #8e95a7;
}

.file-chip .chip-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip .chip-count {
  color: #9aa1b2;
}

.upload-textarea {
  display: block;
  width: 100%;
  min-height: 252px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fcfcff;
  color: #4d5568;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  outline: none;
  resize: vertical;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.upload-textarea::placeholder {
  color: #a7acbc;
}

.upload-textarea:focus {
  border-color: #bcbcf4;
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.07);
}

.upload-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: #9aa1b2;
  font-size: 12px;
}

.upload-foot .foot-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.batch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.batch-row .input {
  width: 320px;
  max-width: 100%;
}

.char-count {
  color: #a4aaba;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.submit-row .btn-primary {
  min-width: 112px;
  height: 36px;
}

.submit-note {
  color: #9aa1b2;
  font-size: 12px;
}

.result-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #d8f0e2;
  border-radius: 12px;
  background: #f5fcf8;
}

.result-banner.warn {
  border-color: #f3e2bd;
  background: #fffbf2;
}

.result-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #e4f6ec;
  color: #16a34a;
}

.result-banner.warn .result-ico {
  background: #fdf0d5;
  color: #d97706;
}

.result-ico svg {
  width: 17px;
  height: 17px;
}

.result-title {
  color: #166534;
  font-size: 13.5px;
  font-weight: 600;
}

.result-banner.warn .result-title {
  color: #92590a;
}

.result-desc {
  margin-top: 3px;
  color: #5f7a6b;
  font-size: 12.5px;
  line-height: 1.7;
}

.result-banner.warn .result-desc {
  color: #8b7047;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ---------- 弹窗 / 提示 ---------- */
.modal-root:empty {
  display: none;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 26, 46, 0.42);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
}

.modal-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: min(86vh, 820px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(19, 24, 47, 0.25);
  animation: popIn 0.18s ease;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line-2);
}

.modal-head h3 {
  margin: 0;
  color: #232a39;
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  overflow: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-2);
  background: #fcfcff;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
}

.detail-item {
  min-width: 0;
}

.detail-item label {
  display: block;
  margin-bottom: 4px;
  color: #9aa1b2;
  font-size: 11.5px;
}

.detail-item .value {
  color: #333a4a;
  font-size: 13px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.detail-block {
  margin-top: 18px;
}

.detail-block > label {
  display: block;
  margin-bottom: 6px;
  color: #9aa1b2;
  font-size: 11.5px;
}

.detail-block pre {
  max-height: 190px;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #f7f8fc;
  color: #525a6e;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

.toast-root {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 540px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 25, 50, 0.12);
  color: #3c4354;
  font-size: 13px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.toast.error svg {
  color: var(--danger);
}

.toast.warn svg {
  color: var(--warn);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.985);
  }
}

/* ---------- 对账 / 管理后台 ---------- */
.stats-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-card.accounts .stat-ico,
.stat-card.upload .stat-ico {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-card.upload .stat-ico {
  background: var(--info-soft);
  color: var(--info);
}

.stat-value.accounts {
  color: #5b5bd6;
}

.admin-toolbar {
  margin: 18px 0 12px;
}

.admin-toolbar .search .input {
  width: 240px;
}

.admin-table {
  min-width: 1020px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(160deg, #f0efff, #e3e2ff);
  color: #5b5bd6;
  font-size: 12px;
  font-weight: 700;
}

.user-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #2c3343;
  font-size: 13px;
  font-weight: 500;
}

.user-handle {
  margin-top: 2px;
  color: #9aa1b2;
  font-size: 11.5px;
}

.self-tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f0ff;
  color: #6c63dd;
  font-size: 10px;
  font-weight: 500;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f3f4f8;
  color: #6b7280;
  font-size: 11px;
  white-space: nowrap;
}

.role-badge.admin {
  background: #eef0ff;
  color: #5b5bd6;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e9f7ee;
  color: #15803d;
  font-size: 11px;
  white-space: nowrap;
}

.state-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.state-badge.off {
  background: #fdeeee;
  color: #cf3a3a;
}

.modal-panel.modal-narrow {
  width: min(520px, 100%);
}

.modal-panel.modal-wide {
  width: min(760px, 100%);
}

.modal-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f7f8fc;
  color: #7a8194;
  font-size: 12.5px;
  line-height: 1.7;
}

.modal-note b {
  color: #4d5568;
  font-weight: 600;
}

.modal-field {
  display: block;
  margin-bottom: 14px;
}

.modal-field > span {
  display: block;
  margin-bottom: 6px;
  color: #6d7486;
  font-size: 12.5px;
}

.modal-field .input {
  height: 38px;
}

.modal-error {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fdeeee;
  color: #c23a3a;
  font-size: 12.5px;
  line-height: 1.6;
}

.batch-textarea {
  display: block;
  width: 100%;
  min-height: 170px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fcfcff;
  color: #4d5568;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  outline: none;
  resize: vertical;
}

.batch-textarea:focus {
  border-color: #b7b8f4;
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.08);
}

.credentials-table {
  min-width: 0;
}

.credentials-table th,
.credentials-table td {
  padding: 9px 12px;
}

.credentials-table .mono {
  color: #2c3343;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.credentials-table + .modal-error {
  margin-top: 12px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .stat-grid,
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .topbar-tagline {
    display: none;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .topbar {
    padding: 0 14px;
  }

  .brand {
    width: auto;
  }

  .topbar-divider {
    display: none;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    top: var(--topbar-h);
    width: 232px;
    transform: translateX(-102%);
    box-shadow: 16px 0 40px rgba(20, 25, 50, 0.08);
    z-index: 70;
  }

  .shell.sidebar-open .sidebar {
    transform: none;
  }

  .shell.main-collapsed .sidebar,
  .shell.collapsed .sidebar {
    transform: translateX(-102%);
  }

  .main {
    grid-column: 1;
    padding: 20px 16px 48px;
  }

  .sidebar-mask {
    position: fixed;
    inset: var(--topbar-h) 0 0;
    z-index: 65;
    display: block;
    background: rgba(24, 30, 50, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .shell.sidebar-open .sidebar-mask {
    opacity: 1;
    pointer-events: auto;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .search .input {
    width: 100%;
  }

  .orders-toolbar .spacer {
    display: none;
  }

  .orders-toolbar {
    gap: 7px;
  }
}

@media (max-width: 620px) {
  .page-title {
    font-size: 21px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 0;
    padding: 13px 15px;
  }

  .stat-value {
    font-size: 25px;
  }

  .batch-row .input {
    width: 100%;
  }

  .batch-row {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .char-count {
    align-self: flex-end;
  }

  .result-banner {
    flex-wrap: wrap;
  }

  .result-actions {
    width: 100%;
    margin-left: 44px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .table-foot {
    justify-content: center;
  }

  .article-actions {
    width: 100%;
  }
}
