/* =====================================================================
   通用分销商城 · 设计系统 V2（现代商业亮色）
   藏青蓝 + 白底 + 金橙点缀 · 移动优先，同时兼顾桌面后台
   说明：保留 V1 全部 class 名（低风险覆盖全站），仅升级视觉语言
   ===================================================================== */
:root {
  /* 色板：藏青蓝系 */
  --navy-950: #081b33;
  --navy-900: #0b2545;
  --navy-800: #123a5f;
  --navy-700: #1a4d7a;
  --brand: #0e4d92;          /* 主行动蓝（变量名保留，值升级） */
  --brand-strong: #0a3d75;
  --brand-soft: #e8f0fa;
  /* 金橙点缀（价格 / 收益 / 里程碑高亮） */
  --gold: #c8881f;
  --gold-strong: #a97110;
  --gold-soft: #fbf0dc;
  /* 中性 */
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #16233b;
  --sub: #5c6b7f;
  --line: #e2e8f0;
  /* 语义色 */
  --ok: #15803d;
  --ok-soft: #e5f5ec;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #c0392b;
  --danger-soft: #fce8e6;
  /* 形状与阴影 */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06), 0 1px 3px rgba(11, 37, 69, .08);
  --shadow-md: 0 4px 18px rgba(11, 37, 69, .08), 0 2px 6px rgba(11, 37, 69, .05);
  --shadow-lg: 0 14px 34px rgba(11, 37, 69, .14);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
        "Microsoft YaHei", "Segoe UI", sans-serif;
  padding-bottom: 84px;
}
a { color: var(--brand); text-decoration: none; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--navy-900);
  box-shadow: 0 1px 8px rgba(11, 37, 69, .04);
}
.topbar .spacer { flex: 1; }
.topbar .merchant { font-size: 12px; color: var(--sub); font-weight: 500; }
.topbar strong, .topbar > strong { letter-spacing: .01em; }

/* ---------------- 布局 ---------------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 14px 28px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 10px; font-size: 15px; color: var(--navy-900); }
.muted { color: var(--sub); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.hint { color: var(--sub); font-size: 12px; }

/* ---------------- 金额 / 价格 ---------------- */
.price { color: var(--gold-strong); font-weight: 700; font-size: 17px; }
.price small { font-weight: 500; font-size: 12px; color: var(--sub); }
.money-hero {
  font-size: 30px; font-weight: 800; color: var(--gold-strong);
  letter-spacing: -.02em; line-height: 1.2;
}
.money-hero small { font-size: 14px; font-weight: 600; color: var(--sub); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 11px 20px;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  text-align: center; text-decoration: none;
  box-shadow: 0 2px 6px rgba(14, 77, 146, .28);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 4px 12px rgba(14, 77, 146, .32); }
.btn:active { transform: translateY(1px); }
.btn.block { display: flex; width: 100%; }
.btn.ghost {
  background: #fff; color: var(--navy-800);
  border: 1px solid var(--line); font-weight: 600;
  box-shadow: none;
}
.btn.ghost:hover { border-color: #c3cede; background: #f7f9fc; filter: none; }
.btn.small { padding: 7px 13px; font-size: 13px; }
.btn.gold {
  background: linear-gradient(180deg, #d99a33, var(--gold-strong));
  box-shadow: 0 2px 6px rgba(169, 113, 16, .30);
}
.btn[disabled] { background: #c7ced9; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:hover { filter: none; }

/* ---------------- 表单 ---------------- */
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 12px; font-size: 15px; background: #fff; color: var(--text);
  font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 77, 146, .12);
}
textarea { min-height: 90px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; font-weight: 500; }
.fld label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; font-weight: 500; }

/* ---------------- 商品卡 ---------------- */
.pdt {
  display: flex; gap: 13px; padding: 13px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 11px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.pdt:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pdt .thumb {
  width: 88px; height: 88px; border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--brand-soft), #f6fafd);
  border: 1px solid #e4ebf3;
  flex: 0 0 88px; display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-size: 12px; font-weight: 500; overflow: hidden;
}
.pdt .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdt .name { font-weight: 650; color: var(--navy-900); }
.pdt .subtitle { color: var(--sub); font-size: 13px; margin: 4px 0 8px; }

/* ---------------- 标签 / 徽章 ---------------- */
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); margin-left: 6px; font-weight: 600;
}
.tag.gold { background: var(--gold-soft); color: var(--gold-strong); }
.tag.gray { background: #eef1f5; color: var(--sub); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: #eef1f5; color: var(--sub); font-weight: 600; white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.gold { background: var(--gold-soft); color: var(--gold-strong); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------------- 底部操作栏 ---------------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  max-width: 720px; margin: 0 auto;
  box-shadow: 0 -4px 18px rgba(11, 37, 69, .06);
}
.bar .btn { flex: 1; min-width: 92px; }

/* ---------------- 提示条 ---------------- */
.notice {
  background: var(--gold-soft); border: 1px solid #ecd9ae; color: #7a5410;
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13px;
  margin-bottom: 14px; line-height: 1.6;
}

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; color: var(--sub); padding: 48px 0; font-size: 14px; }

/* ---------------- 键值行 ---------------- */
.kv { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.kv span:first-child { color: var(--sub); }
.kv b { color: var(--navy-900); }

/* ---------------- Tabs（胶囊） ---------------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 15px; font-size: 14px; font-weight: 500; cursor: pointer;
  white-space: nowrap; color: var(--navy-800);
  transition: all .15s ease;
}
.tabs button:hover { border-color: #c3cede; }
.tabs button.active {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  border-color: var(--brand); color: #fff; font-weight: 600;
  box-shadow: 0 2px 6px rgba(14, 77, 146, .26);
}

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--sub); font-weight: 600; background: #f7f9fc; font-size: 12px; }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f8fafd; }

/* ---------------- 后台 / 控制台 Shell（桌面侧边栏） ---------------- */
.shell { display: flex; min-height: 100vh; padding-bottom: 0; }
.shell .side {
  width: 218px; flex: 0 0 218px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #cdd9e8; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.side .brand-line {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px 16px;
  font-weight: 800; color: #fff; font-size: 15px; letter-spacing: .02em;
}
.side .brand-line .dot {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 26px;
  background: linear-gradient(160deg, #d99a33, var(--gold-strong));
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px;
  box-shadow: 0 3px 8px rgba(201, 136, 31, .35);
}
.side .tabs { flex-direction: column; gap: 2px; margin: 0; overflow: visible; }
.side .tabs button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 0; background: transparent; color: #b9c6d8; border-radius: 9px;
  padding: 10px 12px; font-size: 13.5px; font-weight: 500; white-space: normal;
  transition: all .15s ease;
}
.side .tabs button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side .tabs button.active {
  background: rgba(255, 255, 255, .12); color: #fff; font-weight: 650;
  box-shadow: inset 2px 0 0 var(--gold);
}
.side .side-foot { margin-top: auto; padding: 10px 12px 0; font-size: 12px; color: #7e8fao; color: #8192a8; border-top: 1px solid rgba(255,255,255,.08); }
.shell .main { flex: 1; min-width: 0; padding: 20px 22px 34px; }
.shell .main .wrap { max-width: 1180px; padding: 0; }
.shell-topbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.shell-topbar .spacer { flex: 1; }
.shell-topbar h1 { font-size: 19px; margin: 0; color: var(--navy-900); font-weight: 750; }
.shell-topbar .sub { font-size: 12.5px; color: var(--sub); }

/* ---------------- 指标卡 ---------------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.metric .lab { font-size: 12px; color: var(--sub); font-weight: 500; }
.metric b { display: block; font-size: 22px; margin-top: 6px; color: var(--navy-900); font-weight: 800; letter-spacing: -.01em; }
.metric .gold { color: var(--gold-strong); }
.metric::after {
  content: ""; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px;
  border-radius: 50%; background: radial-gradient(circle, rgba(14,77,146,.06), transparent 70%);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }

/* ---------------- 首页 Hero ---------------- */
.hero {
  border-radius: 18px; padding: 22px 20px; margin-bottom: 16px;
  background:
    radial-gradient(120% 160% at 85% -20%, rgba(217, 154, 51, .32) 0%, transparent 45%),
    linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero .h-name { font-size: 20px; font-weight: 800; letter-spacing: .01em; }
.hero .h-sub { margin-top: 5px; font-size: 13px; color: #b9c9de; }
.hero .h-stats { display: flex; gap: 26px; margin-top: 16px; }
.hero .h-stat .v { font-size: 19px; font-weight: 800; color: var(--gold-soft); }
.hero .h-stat .v b { color: #ffd489; }
.hero .h-stat .l { font-size: 12px; color: #93a7c4; margin-top: 2px; }

/* ---------------- 登录卡强化 ---------------- */
.login-hero { text-align: center; padding: 18px 16px 6px; }
.login-hero .ico {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px;
  background: linear-gradient(160deg, var(--brand), var(--brand-strong));
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 6px 16px rgba(14, 77, 146, .30);
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(6px);
  background: rgba(8, 27, 51, .92); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; z-index: 99; opacity: 0; transition: opacity .22s ease, transform .22s ease;
  pointer-events: none; box-shadow: var(--shadow-lg); max-width: 82vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 其他 ---------------- */
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.linkbox { background: #f7f9fc; border: 1px dashed #ccd6e2; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--navy-800); }
.steps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.step {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sub);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.step .n {
  width: 19px; height: 19px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.step.done .n { background: var(--ok-soft); color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--danger); }
.verlist { display: flex; flex-direction: column; gap: 8px; }
.v { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; background: #fff; }
.ava { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.mt { margin-top: 6px; }
.mt8 { margin-top: 8px; }
.w { width: 100%; }

/* ---------------- 移动端适配 ---------------- */
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .shell .side { width: 100%; flex: none; height: auto; position: static; padding: 12px 10px 8px; }
  .shell .side .brand-line { padding: 4px 6px 10px; }
  .shell .side .tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; }
  .shell .side .tabs button { width: auto; white-space: nowrap; padding: 8px 12px; }
  .shell .side .side-foot { display: none; }
  .shell .main { padding: 14px 12px 26px; }
  .metrics { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}
