/* ================================================================
   代理账号仓储系统 · 共享样式
   ================================================================ */

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #6b7a90;
  --muted-2: #93a1b5;
  --line: #e6eaf2;
  --line-strong: #d5dce9;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eef4ff;
  --green: #059669;
  --green-soft: #e9f9f1;
  --amber: #b45309;
  --amber-soft: #fef4e6;
  --red: #dc2626;
  --red-soft: #fdeeee;
  --purple: #7c3aed;
  --purple-soft: #f3edff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 30px 70px -24px rgba(15, 23, 42, 0.35);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.hidden {
  display: none !important;
}

/* 启动占位：仅在浏览器记住登录状态时显示，避免首屏空白 */
.boot-view {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(79, 125, 245, 0.28), transparent 60%),
    linear-gradient(160deg, #0a1222 0%, #101b32 55%, #0a1222 100%);
  color: #cbd5e1;
}

html.boot-pending .boot-view {
  display: flex;
}

html.auth-hint #login-view {
  display: none !important;
}

.boot-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 18px 40px -18px rgba(37, 99, 235, 0.9);
}

.boot-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.22);
  border-top-color: #60a5fa;
  animation: boot-spin 0.8s linear infinite;
}

.boot-text {
  font-size: 13px;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.num {
  font-variant-numeric: tabular-nums;
}

.spacer {
  flex: 1;
}

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

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  border-color: #c2cbdb;
  background: #fbfcfe;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), #4f7df5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.7);
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #3f6ef0);
}

.btn.success {
  background: var(--green);
  border-color: transparent;
  color: #fff;
}

.btn.danger {
  background: var(--red);
  border-color: transparent;
  color: #fff;
}

.btn.danger-ghost {
  color: var(--red);
  border-color: #f1c9c9;
  background: #fff;
}

.btn.danger-ghost:hover {
  background: var(--red-soft);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--muted);
}

.btn.ghost:hover {
  background: #f1f4fa;
  color: var(--ink);
}

.btn.sm {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn.block {
  width: 100%;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  transition: all 0.15s;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #f8fafc;
}

/* ------------------------------ 表单 ------------------------------ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.field .hint {
  font-size: 12px;
  color: var(--muted-2);
}

.input,
.select,
.textarea {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.55;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #8fb0f8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.input::placeholder,
.textarea::placeholder {
  color: #a8b4c6;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: 0;
}

.search-box {
  position: relative;
  min-width: 220px;
}

.search-box .input {
  padding-left: 33px;
}

.search-box::before {
  content: "⌕";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 16px;
  pointer-events: none;
}

/* ------------------------------ 标签 / 徽章 ------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  background: #f1f4f9;
  color: var(--muted);
}

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

.badge.plain::before {
  display: none;
}

.badge.green {
  background: var(--green-soft);
  color: var(--green);
}

.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.red {
  background: var(--red-soft);
  color: var(--red);
}

.badge.blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge.purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: #f1f4f9;
  color: var(--muted);
}

.tag.stock-tag {
  background: var(--green-soft);
  color: var(--green);
}

/* ------------------------------ 卡片 ------------------------------ */

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

.card-pad {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  font-size: 15px;
}

.card-head .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--muted);
}

.empty .icon {
  font-size: 34px;
  opacity: 0.4;
  display: block;
  margin-bottom: 10px;
}

.empty strong {
  display: block;
  color: var(--ink-2);
  font-size: 14.5px;
  margin-bottom: 4px;
}

/* ------------------------------ 表格 ------------------------------ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 680px;
}

table.data th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 11px 16px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f3f9;
  vertical-align: middle;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr:hover {
  background: #fbfcff;
}

table.data td.actions {
  text-align: right;
  white-space: nowrap;
}

table.data td.actions .btn {
  margin-left: 4px;
}

.cell-main {
  font-weight: 600;
  color: var(--ink);
}

.cell-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.amount-pos {
  color: var(--green);
  font-weight: 650;
}

.amount-neg {
  color: var(--red);
  font-weight: 650;
}

/* ------------------------------ 弹窗 ------------------------------ */

#modal-root {
  position: relative;
  z-index: 60;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 18px 40px;
  overflow-y: auto;
  animation: fade 0.15s ease;
}

.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  margin: auto 0;
}

.modal.wide {
  max-width: 720px;
}

.modal.xwide {
  max-width: 880px;
}

.modal.xxwide {
  max-width: 1240px;
}

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

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 0;
}

.modal-head h3 {
  font-size: 17px;
  flex: 1;
}

.modal-head .sub {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
}

.modal-body {
  padding: 18px 22px 22px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 0 0 16px 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------ Toast ------------------------------ */

#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  background: #111c2f;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
  max-width: 360px;
  pointer-events: auto;
}

.toast.success {
  background: #065f46;
}

.toast.error {
  background: #991b1b;
}

.toast.leave {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ================================================================
   登录页
   ================================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(79, 125, 245, 0.35), transparent 60%),
    radial-gradient(800px 460px at 92% 108%, rgba(124, 58, 237, 0.28), transparent 60%),
    linear-gradient(160deg, #0a1222 0%, #101b32 55%, #0a1222 100%);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.985);
  border-radius: 20px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.65);
  padding: 34px 32px 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.8);
  flex: none;
}

.auth-brand .name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-brand .desc {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-title {
  font-size: 21px;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted-2);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-foot-center {
  justify-content: center;
  align-items: center;
}

.auth-switch {
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.auth-switch:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.form-error {
  display: none;
  background: var(--red-soft);
  color: #b91c1c;
  border: 1px solid #f6cccc;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
}

.form-error.show {
  display: block;
}

/* ================================================================
   代理前台
   ================================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.topbar .brand .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 16px;
}

.topbar .brand small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.tabs button:hover {
  background: #f2f5fb;
  color: var(--ink);
}

.tabs button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0e1a30, #1d2f52);
  color: #fff;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 20px -12px rgba(15, 23, 42, 0.8);
}

.balance-chip strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.balance-chip .lbl {
  color: #9fb0cc;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  color: #3730a3;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 22px 70px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head h2 {
  font-size: 20px;
}

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

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  border-color: #b9c5da;
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
}

.stock-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
  position: relative;
  overflow: hidden;
}

.stock-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  opacity: 0;
  transition: opacity 0.15s;
}

.stock-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #d8e1f0;
}

.stock-card:hover::after {
  opacity: 1;
}

.stock-card .top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.stock-card .title {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.45;
  word-break: break-word;
}

.stock-card .tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stock-card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.price {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.price small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 1px;
}

.platform-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  flex: none;
  text-transform: uppercase;
}

.platform-dot.c1 {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.platform-dot.c2 {
  background: linear-gradient(135deg, #10b981, #0ea5e9);
}

.platform-dot.c3 {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.platform-dot.c4 {
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
}

/* 我的账号 */

.my-account {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.my-account:last-child {
  border-bottom: 0;
}

.cred-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 12.5px;
  word-break: break-all;
}

.cred-row .cred-label {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: none;
  width: 34px;
}

.cred-row .cred-value {
  flex: 1;
  min-width: 0;
}

.cred-row .icon-btn {
  width: 24px;
  height: 24px;
  font-size: 12px;
  flex: none;
}

.reveal-credentials {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

/* 充值 */

.recharge-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.recharge-note {
  background: var(--primary-soft);
  border: 1px solid #d8e5ff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.7;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-amounts .chip {
  border-radius: 8px;
  padding: 7px 0;
  text-align: center;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.dot.amber {
  background: #f59e0b;
}

.dot.red {
  background: var(--red);
}

/* ================================================================
   管理后台
   ================================================================ */

.admin-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  width: 232px;
  flex: none;
  background:
    radial-gradient(420px 300px at 0% 0%, rgba(59, 130, 246, 0.18), transparent 65%),
    linear-gradient(180deg, #0b1220, #0d1628 60%, #0a1220);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 20px;
}

.side-brand .name {
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
}

.side-brand .desc {
  font-size: 10.5px;
  color: #7c8db0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.side-nav .label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5d6f92;
  padding: 14px 10px 6px;
}

.side-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: #a9b8d4;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.side-nav button .ico {
  width: 18px;
  text-align: center;
  font-size: 15px;
  opacity: 0.85;
}

.side-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.side-nav button.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(99, 102, 241, 0.9));
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(59, 130, 246, 0.9);
}

.side-nav .count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 11px;
  padding: 0 7px;
  line-height: 18px;
  font-weight: 700;
}

.side-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  color: #fff;
  font-size: 13px;
}

.side-user .avatar {
  background: rgba(255, 255, 255, 0.12);
  color: #dbeafe;
}

.side-user small {
  display: block;
  color: #7c8db0;
  font-size: 11px;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}

.admin-head h1 {
  font-size: 19px;
}

.admin-head .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.admin-body {
  padding: 24px 28px 60px;
  max-width: 1440px;
  width: 100%;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card .k {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card .v {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-card .v small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-left: 3px;
}

.stat-card .v.green {
  color: var(--green);
}

.stat-card .v.blue {
  color: var(--primary);
}

.stat-card .v.purple {
  color: var(--purple);
}

.stat-card .v.amber {
  color: var(--amber);
}

.stat-card .foot {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 18px;
  align-items: start;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 180px;
  padding: 16px 4px 0;
}

.chart .col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.chart .bar-track {
  width: 100%;
  max-width: 40px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  position: relative;
}

.chart .bar {
  width: 100%;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #4f7df5, #2563eb);
  position: relative;
  transition: height 0.3s ease;
}

.chart .bar.zero {
  background: #e8edf7;
}

.chart .bar .tip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 600;
}

.chart .day {
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

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

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
}

.cat-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.cat-line:last-child {
  border-bottom: 0;
}

.cat-line .name {
  flex: 1;
  font-weight: 600;
}

.cat-line .bar-mini {
  width: 70px;
  height: 6px;
  border-radius: 99px;
  background: #eef2f9;
  overflow: hidden;
}

.cat-line .bar-mini i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  border-radius: 99px;
}

.views {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pager-note {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
}

/* ------------------------------ 卡种 / 卡券库存 ------------------------------ */

.input.compact,
.select.compact {
  height: 34px;
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}

.select.compact {
  padding-right: 26px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.link-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
}

.link-btn:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.link-btn.danger {
  color: var(--red);
}

.type-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  word-break: break-word;
}

.type-name:hover {
  color: var(--primary);
}

.stock-number {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.stock-number.zero {
  color: var(--red);
}

.inventory-table td {
  vertical-align: middle;
}

.inventory-table .checkbox-col,
.cards-table .checkbox-col {
  width: 36px;
  padding-right: 4px;
  text-align: center;
}

table.data th.checkbox-col {
  padding-right: 4px;
}

table.data input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

table.data tr.selected td {
  background: #f5f9ff;
}

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

.table-foot strong {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

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

.pager-count {
  color: var(--muted);
  margin-right: 3px;
  white-space: nowrap;
}

.pg {
  appearance: none;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pg:hover:not(:disabled) {
  border-color: #b9c5da;
  background: #f8fafc;
}

.pg.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.pg-dots {
  color: var(--muted-2);
  padding: 0 1px;
  font-size: 12px;
}

.select.pager-size {
  width: auto;
  height: 28px;
  padding: 2px 24px 2px 7px;
  font-size: 12px;
  border-radius: 6px;
}

.modal-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}

.info-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.info-item .k {
  color: var(--muted-2);
  font-size: 11.5px;
}

.info-item strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.info-item strong.zero {
  color: var(--red);
}

.mc-toolbar,
.mc-subbar,
.mc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mc-toolbar {
  margin-top: 12px;
}

.mc-subbar {
  margin-top: 12px;
}

.mc-actions {
  margin-top: 10px;
  padding: 9px 10px;
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.mc-actions .btn {
  white-space: nowrap;
}

.btn.xs {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11.5px;
}

.mc-scroll {
  max-height: 44vh;
  overflow: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mc-scroll table.data {
  min-width: 1060px;
}

.mc-scroll table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--line);
}

.truncate {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.card-secret {
  letter-spacing: 0.03em;
}

.seg {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seg button {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg button:hover {
  border-color: #b9c5da;
}

.seg button.active {
  background: var(--primary-soft);
  border-color: #b9d0ff;
  color: var(--primary);
}

.readonly-box {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 650;
  color: var(--primary);
}

.code-area {
  font-family: var(--mono);
  font-size: 12.5px;
}

.row-menu {
  position: fixed;
  z-index: 220;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.12s ease;
}

.row-menu button {
  appearance: none;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.row-menu button:hover {
  background: #f3f6fc;
}

.row-menu button.danger {
  color: var(--red);
}

.form-ok {
  background: var(--green-soft);
  color: #047857;
  border: 1px solid #c3ecd9;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
}

.result-list {
  margin-top: 6px;
  max-height: 130px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
}

.pick-card {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.pick-card:last-child {
  border-bottom: 0;
}

.pick-card .cred-row {
  background: #fff;
}

.toolbar-card {
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

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

.detail-section h4 {
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.detail-list .line {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #f2f5fa;
  font-size: 12.5px;
}

.detail-list .line:last-child {
  border-bottom: 0;
}

.detail-list .line .time {
  color: var(--muted-2);
  width: 88px;
  flex: none;
  font-size: 11.5px;
}

.detail-list .line .grow {
  flex: 1;
  min-width: 0;
}

.mask {
  letter-spacing: 0.12em;
  color: var(--muted-2);
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}

.kv .item {
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
}

.kv .item .k {
  font-size: 11.5px;
  color: var(--muted-2);
}

.kv .item .v {
  font-weight: 650;
  font-size: 14px;
  margin-top: 2px;
  word-break: break-all;
}

/* ================================================================
   响应式
   ================================================================ */

@media (max-width: 1080px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .modal-backdrop {
    padding: 18px 10px 24px;
  }

  .modal-body {
    max-height: calc(100vh - 170px);
  }

  .toolbar-card .input.compact,
  .toolbar-card .select.compact {
    flex: 1 1 130px;
    width: auto !important;
  }

  .mc-actions {
    gap: 6px;
  }

  .table-foot {
    align-items: flex-start;
  }

  .topbar-inner {
    height: auto;
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar .brand {
    flex: 1;
  }

  .tabs {
    order: 3;
    width: 100%;
    padding-bottom: 4px;
  }

  .balance-chip {
    padding: 6px 10px;
  }

  .container {
    padding: 18px 16px 60px;
  }

  .recharge-layout {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 12px 14px;
  }

  .side-brand {
    padding-bottom: 12px;
  }

  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 4px;
  }

  .side-nav .label {
    display: none;
  }

  .side-nav button {
    white-space: nowrap;
    width: auto;
    padding: 8px 12px;
  }

  .side-foot {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .side-user {
    flex: 1;
    padding: 0;
    font-size: 12.5px;
  }

  .side-foot .row {
    flex: none;
  }

  .admin-head,
  .admin-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-head {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .my-account {
    grid-template-columns: 1fr;
  }

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

/* ================================================================
   提卡 / 提取链接
   ================================================================ */

.req {
  color: var(--red);
  font-weight: 600;
}

.pick-options {
  margin-top: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pick-option-hint {
  margin: 3px 0 0 26px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.pick-warn {
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid #f3dfbc;
  background: var(--amber-soft);
  color: #92400e;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.65;
}

.pick-success-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.pick-success-head h4 {
  font-size: 15px;
  margin-bottom: 3px;
}

.pick-success-dot {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 18px;
  font-weight: 700;
}

.pick-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pick-link-box .input {
  flex: 1;
  min-width: 0;
  height: 38px;
  font-size: 12.5px;
}

.pick-creds {
  margin-top: 14px;
}

.pick-creds summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 12.5px;
  user-select: none;
}

.pick-creds[open] summary {
  margin-bottom: 4px;
}

/* ------------------------------ 买家提取页 ------------------------------ */

.pick-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #eef3f9 0%, #f5f7fa 240px, #f2f4f7 100%);
}

.pick-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 28px 16px 64px;
}

.pick-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.pick-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0.01em;
}

.pick-brand .logo-mark {
  width: 28px;
  height: 28px;
  font-size: 13px;
  border-radius: 8px;
}

.pick-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pick-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.pick-panel-head h1 {
  font-size: 20px;
  margin-bottom: 5px;
  word-break: break-word;
}

.pick-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 22px;
}

.pick-item {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.pick-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pick-item-text {
  margin: 0;
  padding-right: 34px;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-2);
}

.pick-item-copy {
  position: absolute;
  top: 40px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.pick-actions {
  padding: 4px 22px 18px;
}

.pick-primary {
  width: 100%;
  height: 48px;
  font-size: 15px;
  border-radius: 11px;
}

.pick-note {
  padding: 0 22px 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.pick-fulltext {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-2);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  max-height: 55vh;
  overflow: auto;
}

.pick-wallet {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
}

.pick-wallet h3 {
  font-size: 13.5px;
  margin-bottom: 4px;
}

.pick-wallet-list {
  display: flex;
  flex-direction: column;
}

.pick-wallet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}

.pick-wallet-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pick-wallet-row .info {
  flex: 1;
  min-width: 0;
}

.pick-wallet-row .name {
  font-weight: 600;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick-wallet-row .meta {
  color: var(--muted-2);
  font-size: 11.5px;
}

.pick-error {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 54px 26px;
  text-align: center;
}

.pick-error .icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.pick-error h1 {
  font-size: 20px;
  margin-bottom: 8px;
}

.pick-error p {
  color: var(--muted);
  margin-top: 6px;
}

@media (max-width: 560px) {
  .pick-shell {
    padding: 16px 12px 44px;
  }

  .pick-panel-head {
    padding: 18px 16px 14px;
  }

  .pick-panel-head h1 {
    font-size: 18px;
  }

  .pick-card-list {
    padding: 12px 16px;
  }

  .pick-actions {
    padding: 2px 16px 16px;
  }

  .pick-note {
    padding: 0 16px 18px;
  }

  .pick-link-box {
    flex-direction: column;
    align-items: stretch;
  }

  .pick-link-box .btn {
    width: 100%;
  }
}

/* ------------------------------ 折扣 / 批量提取 ------------------------------ */

.price .price-original {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
  text-decoration: line-through;
}

.tag.discount-tag {
  background: var(--amber-soft, #fff4e0);
  color: var(--amber, #b45309);
}

.batch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 86px 104px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.batch-info {
  min-width: 0;
}

.batch-price,
.batch-line {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.batch-price {
  color: var(--muted);
  font-size: 12.5px;
}

.batch-line {
  font-weight: 650;
  font-size: 13px;
}

.batch-qty {
  width: 100%;
  text-align: center;
}

.batch-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--primary-soft);
}

.batch-summary strong {
  color: var(--primary);
}

.batch-hint {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12.5px;
}

.batch-hint.error {
  color: var(--red);
}

@media (max-width: 720px) {
  .batch-row {
    grid-template-columns: 1fr 70px;
    grid-template-areas:
      "info price"
      "qty line";
    gap: 6px 10px;
  }

  .batch-info { grid-area: info; }
  .batch-price { grid-area: price; }
  .batch-qty { grid-area: qty; width: 90px; text-align: left; }
  .batch-line { grid-area: line; }
}

/* ------------------------------ 积分中心 ------------------------------ */

.points-chip {
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
}

.points-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 22px;
}

.points-big {
  margin-top: 4px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.points-rate {
  max-width: 620px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.points-grid {
  padding: 16px;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
}

.point-card .price {
  font-size: 17px;
}

.point-card .price small {
  font-size: 17px;
}

@media (max-width: 720px) {
  .points-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .points-big {
    font-size: 28px;
  }
}

.invite-card {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.invite-card h3 {
  font-size: 15px;
}

.invite-card .sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.invite-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.invite-code {
  display: inline-block;
  padding: 8px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  overflow-wrap: anywhere;
}

/* 代理管理：按总代理分组的下拉树 */
.users-tree .user-cell {
  min-width: 220px;
}

.users-tree th,
.users-tree td {
  padding: 10px 9px;
}

.users-tree .time-cell {
  white-space: nowrap;
}

.users-tree .perf-cell {
  white-space: nowrap;
}

.users-tree .user-cell .cell-sub {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-tree td.actions .btn {
  margin-left: 3px;
  padding: 4px 7px;
  font-size: 11.5px;
}

.users-tree .tree-toggle {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}

.users-tree .tree-toggle:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.users-tree .tree-toggle-empty {
  visibility: hidden;
}

.users-tree .user-depth .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}

/* ================================================================
   代理前台 · 手机端适配
   ================================================================ */

.team-table {
  min-width: 860px;
}

.links-table {
  min-width: 900px;
}

.point-log-table {
  min-width: 720px;
}

@media (max-width: 720px) {
  body.portal {
    overflow-x: hidden;
  }

  .portal .topbar-inner {
    height: auto;
    padding: 8px 12px 6px;
    gap: 8px 10px;
  }

  .portal .topbar .brand {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    gap: 8px;
  }

  .portal .topbar .brand small {
    display: none;
  }

  .portal .topbar .brand .logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 14px;
  }

  .portal .balance-chip {
    padding: 5px 9px;
    gap: 5px;
    border-radius: 8px;
    font-size: 11.5px;
  }

  .portal .balance-chip strong {
    font-size: 14px;
  }

  .portal .user-chip {
    order: 2;
    width: 100%;
    gap: 8px;
    font-size: 12.5px;
  }

  .portal .user-chip .btn {
    margin-left: auto;
    min-height: 32px;
  }

  .portal .tabs {
    order: 3;
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 1px 12px 4px;
    gap: 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .portal .tabs button {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 12.5px;
    border-radius: 8px;
    scroll-snap-align: start;
  }

  .portal .container {
    padding: 14px 14px calc(56px + env(safe-area-inset-bottom));
  }

  .portal .page-head {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }

  .portal .page-head h2 {
    font-size: 19px;
  }

  .portal .page-head .sub {
    font-size: 12.5px;
    line-height: 1.55;
  }

  .portal #tab-catalog .page-head .row-wrap {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 8px;
  }

  .portal #tab-catalog .page-head .row-wrap .search-box {
    min-width: 0;
    width: 100%;
  }

  .portal #tab-catalog .page-head .row-wrap .search-box .input,
  .portal #tab-catalog .page-head .row-wrap .select,
  .portal #tab-catalog .page-head .row-wrap .btn {
    width: 100%;
  }

  .portal .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-right: -14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .portal .chips::-webkit-scrollbar {
    display: none;
  }

  .portal .chips .chip {
    flex: 0 0 auto;
  }

  .portal .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .portal .stock-card {
    padding: 15px;
  }

  .portal .card-head {
    padding: 14px 16px;
  }

  .portal .card-pad {
    padding: 16px;
  }

  .portal .points-grid {
    padding: 12px;
  }

  .portal .points-overview {
    padding: 16px;
    gap: 12px;
  }

  .portal .team-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    align-items: start;
  }

  .portal .team-overview .points-big {
    font-size: 24px;
  }

  .portal .team-overview .points-rate {
    grid-column: 1 / -1;
    margin-top: 2px;
  }

  .portal .my-account {
    padding: 16px;
    gap: 14px;
  }

  .portal .input,
  .portal .select,
  .portal .textarea {
    font-size: 16px;
  }

  .portal .btn.sm {
    min-height: 34px;
  }

  .portal .btn.xs {
    min-height: 32px;
  }

  /* 手机端列表：表格转为卡片，避免横向滚动 */
  .portal .mobile-cards {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }

  .portal .mobile-cards thead {
    display: none;
  }

  .portal .mobile-cards tbody,
  .portal .mobile-cards tr {
    display: block;
    width: 100%;
  }

  .portal .mobile-cards tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .portal .mobile-cards tr:last-child {
    border-bottom: 0;
  }

  .portal .mobile-cards tr:hover {
    background: transparent;
  }

  .portal .mobile-cards td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    width: auto;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }

  .portal .mobile-cards td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
  }

  .portal .mobile-cards td[data-label=""]::before,
  .portal .mobile-cards td.mobile-title::before,
  .portal .mobile-cards td.mobile-actions::before {
    display: none;
  }

  .portal .mobile-cards td.mobile-title {
    display: block;
    padding: 0 0 8px;
    text-align: left;
  }

  .portal .mobile-cards td.mobile-title .cell-main {
    font-size: 15px;
  }

  .portal .mobile-cards td.mobile-title .cell-sub {
    margin-top: 2px;
    white-space: normal;
    line-height: 1.5;
  }

  .portal .mobile-cards td.mobile-actions {
    justify-content: flex-end;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px dashed var(--line);
  }

  .portal .mobile-cards td.cell-sub {
    max-width: none !important;
    white-space: normal;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .portal .mobile-cards .cell-stack {
    min-width: 0;
    text-align: right;
  }

  .portal .mobile-cards .cell-stack .cell-sub {
    margin-top: 2px;
    white-space: normal;
    line-height: 1.5;
  }

  .portal .mobile-cards td[data-label="链接"] {
    display: none;
  }

  .portal .team-table .mobile-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .portal .links-table .mobile-actions {
    gap: 8px;
  }

  .portal .links-table .mobile-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .portal .modal-backdrop {
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .portal .modal {
    border-radius: 14px;
    margin: auto 0;
  }

  .portal .modal-head {
    padding: 16px 16px 0;
  }

  .portal .modal-body {
    padding: 16px;
    max-height: calc(100vh - 150px);
  }

  .portal .modal-foot {
    padding: 12px 16px;
    gap: 8px;
  }

  .portal .modal-foot .btn {
    flex: 1;
    justify-content: center;
  }

  .portal .auth-page {
    padding: 18px 12px;
  }

  .portal .auth-card {
    border-radius: 16px;
  }
}

@media (max-width: 350px) {
  .portal .topbar .brand > div {
    display: none;
  }

  .portal .topbar-inner {
    gap: 8px;
  }
}

@media (max-width: 720px) {
  .auth-page::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
