/* 号讯宽带合伙人 · 管理端样式 v13
   设计语言：蓝色主色 + 宣纸白底 + 大圆角卡片 + 轻阴影，移动优先、桌面自适应 */
:root {
  --primary: #1267F1;
  --primary-2: #0b4fc4;
  --primary-grad: linear-gradient(135deg, #2f8bff 0%, #1267F1 55%, #0b4fc4 100%);
  --primary-soft: #eef4ff;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1b2430;
  --text2: #6b7688;
  --muted: #93a0b4;
  --danger: #e5484d;
  --green: #0a8f4a;
  --orange: #d97706;
  --border: #eaeef5;
  --border-2: #dfe6f1;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px rgba(16,24,40,.055);
  --shadow-hover: 0 2px 6px rgba(16,24,40,.06), 0 12px 28px rgba(16,24,40,.09);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55;
  display: flex; justify-content: center;
  -webkit-font-smoothing: antialiased;
}
#app {
  width: 100%; max-width: 480px; min-height: 100vh;
  background: var(--bg); position: relative;
  display: flex; flex-direction: column;
}
@media (min-width: 900px) {
  body { background: #eef2f8; }
  #app { max-width: 560px; box-shadow: 0 0 60px rgba(16,24,40,.08); }
}

/* ---------- 顶部栏 ---------- */
.header {
  background: var(--primary-grad); color: #fff;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 16px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 50;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 6px 20px rgba(18,103,241,.18);
}
.header .back {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 10px;
  background: rgba(255,255,255,.16); border: 0; color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.header .back:active { background: rgba(255,255,255,.28); }
.header .title { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.header .sub { font-size: 11.5px; opacity: .82; margin-top: 3px; }
.header .right { margin-left: auto; display: flex; gap: 12px; font-size: 12px; align-items: center; }
.header .right a { color: #fff; text-decoration: none; background: rgba(255,255,255,.16); padding: 5px 10px; border-radius: 9px; font-size: 12px; }
.badge { background: #ff4d4f; color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; margin-left: 2px; }

/* ---------- 页面容器 ---------- */
.page { flex: 1; padding: 14px 14px 88px; }
.page.no-pad { padding: 0 0 88px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow);
  border: 1px solid rgba(234,238,245,.9);
}
.card h3 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.card .desc { color: var(--text2); font-size: 12.5px; line-height: 1.65; }
.card.tight { padding: 12px 14px; }

/* 分组标题 */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 4px 9px; font-size: 13px; font-weight: 700; color: var(--text);
}
.section-title small { font-weight: 400; color: var(--muted); font-size: 11.5px; }

/* ---------- 指标卡 ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 14px 14px 13px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  border: 1px solid rgba(234,238,245,.9);
}
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary-soft); }
.stat .label { color: var(--text2); font-size: 12px; }
.stat .value { font-size: 23px; font-weight: 800; margin-top: 6px; font-family: ui-rounded, math, sans-serif; letter-spacing: -.4px; }
.stat .value.money { color: var(--danger); }
.stat .value.blue { color: var(--primary); }
.stat .hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

.stat-card { display: flex; text-align: center; padding: 16px 6px; }
.stat-card .stat { flex: 1; box-shadow: none; border: 0; padding: 0; background: transparent; }
.stat-card .stat::before { display: none; }
.stat-card .stat b { display: block; font-size: 20px; color: var(--primary); line-height: 1.3; font-family: ui-rounded, math; }
.stat-card .stat span { font-size: 11.5px; color: var(--text2); }

/* ---------- 分段控制 / 页签 ---------- */
.seg { display: flex; background: #eef2f8; border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 0; border-radius: 9px; font-size: 13px; color: #5b6779; cursor: pointer; transition: .18s; }
.seg button.on { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 1px 4px rgba(16,24,40,.09); }
.seg.small button { padding: 5px 0; font-size: 12px; }

.tabs { display: flex; gap: 18px; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.tabs button { border: 0; background: none; padding: 12px 2px; font-size: 14px; color: #5b6779; position: relative; cursor: pointer; }
.tabs button.on { color: var(--primary); font-weight: 700; }
.tabs button.on::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: 24px; height: 3px; border-radius: 2px; background: var(--primary); }

/* 状态筛选 chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: 0 0 auto; border: 1px solid var(--border-2); background: #fff; color: var(--text2);
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
}
.chips button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border-2); border-radius: 10px;
  padding: 11px 12px; font-size: 14px; outline: none; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: #b3bdcc; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,103,241,.12); }
.field.row { display: flex; gap: 8px; }
.field.row > * { flex: 1; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; border: 0; border-radius: 11px; padding: 12px 0;
  font-size: 15px; font-weight: 600; background: var(--primary-grad); color: #fff;
  cursor: pointer; box-shadow: 0 6px 16px rgba(18,103,241,.22); transition: .18s;
}
.btn:active { transform: translateY(1px); opacity: .92; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); box-shadow: none; }
.btn.gray { background: #f2f5fa; color: var(--text2); box-shadow: none; border: 1px solid var(--border-2); }
.btn.danger { background: linear-gradient(135deg,#ff6b6b,#e5484d); box-shadow: 0 6px 16px rgba(229,72,77,.2); }
.btn.mini { width: auto; padding: 7px 15px; font-size: 12.5px; border-radius: 9px; box-shadow: none; }
.btn-row { display: flex; gap: 10px; }
.link { color: var(--primary); text-decoration: none; font-size: 12.5px; }
.link.muted { color: var(--text2); }

/* ---------- 商品卡片 ---------- */
.item-card {
  background: var(--card); border-radius: var(--radius); padding: 13px;
  margin-bottom: 11px; box-shadow: var(--shadow); border: 1px solid rgba(234,238,245,.9);
  transition: box-shadow .2s;
}
.item-top { display: flex; gap: 11px; }
.item-img { width: 76px; height: 76px; border-radius: 11px; object-fit: cover; background: #f5f8fd; flex: 0 0 auto; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: 14.5px; font-weight: 650; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { color: var(--muted); font-size: 11.5px; margin-top: 5px; display: flex; gap: 7px; flex-wrap: wrap; }
.item-meta span { background: #f5f8fd; padding: 1px 7px; border-radius: 6px; }
.item-tags { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 10.5px; padding: 1.5px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.tag.cyan { background: #e6f8f6; color: #0a8f8a; }
.tag.orange { background: #fff4e5; color: var(--orange); }
.tag.gray { background: #f2f5fa; color: var(--text2); }
.commission { color: var(--danger); font-size: 18px; font-weight: 800; font-family: ui-rounded, math; letter-spacing: -.3px; }
.commission-label { color: var(--muted); font-size: 11px; }
.item-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--border-2); }
.item-actions a {
  color: var(--primary); font-size: 12px; text-decoration: none;
  background: var(--primary-soft); padding: 5px 11px; border-radius: 8px;
}
.item-actions a.red { color: var(--danger); background: #fdeced; }
.item-actions a.gray { color: var(--text2); background: #f2f5fa; }

/* ---------- 列表行 ---------- */
.row-item {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  margin-bottom: 11px; box-shadow: var(--shadow); border: 1px solid rgba(234,238,245,.9);
}
.row-item .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-item .head b { font-size: 13.5px; font-weight: 650; }
.status-pill { font-size: 11px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.pill-blue { background: var(--primary-soft); color: var(--primary); }
.pill-green { background: #e9f8ef; color: var(--green); }
.pill-orange { background: #fff4e5; color: var(--orange); }
.pill-red { background: #fdeced; color: var(--danger); }
.pill-gray { background: #f2f5fa; color: var(--text2); }
.row-item .meta { color: var(--text2); font-size: 12.5px; margin-top: 7px; line-height: 1.7; }
.row-item .meta .muted { color: var(--muted); }
.row-item .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-2); }
.row-item .foot .links { display: flex; gap: 14px; }
.row-item .foot a { color: var(--primary); font-size: 12.5px; text-decoration: none; }
.row-item .foot a.red { color: var(--danger); }

/* 数据行（键值对齐） */
.data-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--border-2); font-size: 13px; }
.data-row:last-child { border-bottom: 0; }
.data-row .k { color: var(--text2); }
.data-row .v { font-weight: 600; }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; margin-top: 4px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--border-2); border-radius: 2px; }
.timeline .tl { position: relative; padding: 5px 0; font-size: 12.5px; color: var(--text2); }
.timeline .tl::before { content: ""; position: absolute; left: -18px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.timeline .tl:first-child::before { background: var(--primary); }
.timeline .tl time { display: block; font-size: 11px; color: var(--muted); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(12px);
  display: flex; border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 60;
}
@media (min-width: 900px) { .tabbar { max-width: 560px; } }
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 7px; text-decoration: none;
  color: #929dae; font-size: 10.5px; position: relative; transition: color .15s;
}
.tabbar a .ic { font-size: 20px; display: block; margin-bottom: 1px; filter: grayscale(.25); }
.tabbar a.on { color: var(--primary); font-weight: 600; }
.tabbar a.on .ic { filter: none; }
.tabbar .dot { position: absolute; top: 3px; right: 24%; background: #ff4d4f; color: #fff; font-size: 9px; border-radius: 8px; padding: 0 4px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 420px;
  max-height: 84vh; overflow-y: auto; padding: 20px;
  box-shadow: 0 24px 60px rgba(15,23,42,.28);
}
.modal h3 { margin-bottom: 14px; font-size: 16.5px; }
.modal .close { float: right; border: 0; background: #f2f5fa; border-radius: 9px; width: 28px; height: 28px; font-size: 15px; color: var(--text2); cursor: pointer; }

/* ---------- 键值表 ---------- */
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 9px 12px; font-size: 13px; line-height: 1.6; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-all; }

/* toast */
#toast {
  position: fixed; top: 46%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(17,24,39,.86); color: #fff; padding: 11px 20px; border-radius: 11px;
  font-size: 13px; z-index: 200; display: none; max-width: 78%; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* ---------- 登录页 ---------- */
.login-wrap { padding: 0 22px; display: flex; flex-direction: column; min-height: 100vh; justify-content: center; }
.login-brand { padding: 0 0 26px; text-align: center; }
.login-brand h1 { font-size: 25px; letter-spacing: .5px; }
.login-brand .slogan { color: var(--primary); font-size: 12.5px; margin-top: 7px; }
.login-card { background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow-hover); }
.login-foot { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 18px; }

/* ---------- 汇总条 ---------- */
.summary-bar {
  background: var(--primary-grad); border-radius: var(--radius); color: #fff;
  padding: 18px; margin-bottom: 12px; position: relative; overflow: hidden;
  box-shadow: 0 10px 26px rgba(18,103,241,.22);
}
.summary-bar::after { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.1); }
.summary-bar .big { font-size: 28px; font-weight: 800; font-family: ui-rounded, math; letter-spacing: -.5px; }
.summary-bar .sub-row { display: flex; gap: 18px; margin-top: 10px; font-size: 11.5px; opacity: .94; flex-wrap: wrap; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 46px 0; font-size: 13px; }
.empty .ic { font-size: 38px; margin-bottom: 10px; opacity: .8; }

/* ---------- 趋势图 ---------- */
.trend { display: flex; align-items: flex-end; gap: 7px; height: 108px; padding-top: 6px; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.trend .bar { width: 62%; background: linear-gradient(180deg,#bcd7ff,#dbe9ff); border-radius: 5px 5px 2px 2px; min-height: 3px; transition: height .3s; }
.trend .bar.hot { background: linear-gradient(180deg,#2f8bff,#1267F1); }
.trend .lbl { font-size: 10px; color: var(--muted); }

/* ---------- 筛选栏 ---------- */
.filter-bar { background: var(--card); border-radius: var(--radius); padding: 12px; margin-bottom: 11px; box-shadow: var(--shadow); border: 1px solid rgba(234,238,245,.9); }
.filter-bar .frow { display: flex; gap: 8px; margin-bottom: 8px; }
.filter-bar .frow:last-child { margin-bottom: 0; }
.filter-bar select, .filter-bar input {
  flex: 1; min-width: 0; border: 1px solid var(--border-2); border-radius: 9px;
  padding: 9px 10px; font-size: 12.5px; background: #fff; color: var(--text); outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--primary); }

/* ---------- 供货 / 比价 ---------- */
.offer { display: flex; gap: 9px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--border-2); }
.offer .o-main { flex: 1; min-width: 0; }
.offer .o-name { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer .o-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.offer .o-right { text-align: right; flex-shrink: 0; }
.offer .o-comm { font-size: 14px; font-weight: 800; color: var(--primary); font-family: ui-rounded, math; }
.offer.best { background: #f2fbf5; border-radius: 10px; padding: 10px 10px; border-top: 0; margin-top: 6px; }
.offer.best .o-name { color: #0a6b3a; }

/* ---------- 菜单组（我的页） ---------- */
.menu-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(234,238,245,.9); overflow: hidden; margin-bottom: 12px; }
.menu-group .g-title { font-size: 11.5px; color: var(--muted); padding: 12px 16px 4px; letter-spacing: .5px; }
.menu-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--text); border-top: 1px solid var(--border); }
.menu-row:first-of-type { border-top: 0; }
.menu-row:active { background: #f7f9fd; }
.menu-row .mi { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 15px; flex: 0 0 auto; }
.menu-row .mt { flex: 1; min-width: 0; }
.menu-row .mt b { display: block; font-size: 13.5px; font-weight: 600; }
.menu-row .mt span { font-size: 11.5px; color: var(--muted); }
.menu-row .arrow { color: #c3ccda; font-size: 15px; }
.menu-row .badge-n { background: #ff4d4f; color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; }

/* ---------- 快捷入口宫格 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick { text-align: center; padding: 10px 2px; border-radius: 12px; text-decoration: none; color: var(--text); }
.quick:active { background: #f5f8fd; }
.quick .qi { width: 40px; height: 40px; margin: 0 auto 6px; border-radius: 12px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.quick span { font-size: 11.5px; color: var(--text2); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px 4px; border-bottom: 1px dashed var(--border); }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 密钥展示 ---------- */
.secret-box { background: #0f172a; color: #d5e3f5; border-radius: 10px; padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; line-height: 1.7; }
.secret-box .k { color: #7f9cc4; }
.secret-box .v { color: #cfe1ff; }
.code-inline { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f2f5fa; border-radius: 6px; padding: 1px 6px; font-size: 12px; color: #334155; }
/* 大号邀请码展示 */
.code-big {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; font-weight: 700;
  letter-spacing: 4px; text-align: center; color: var(--primary);
  background: linear-gradient(135deg,#eef4ff,#f7faff); border: 1px dashed #c7d8ff;
  border-radius: 12px; padding: 14px 8px; margin: 12px 0 4px;
}

/* 空数据占位 */
.skeleton { background: linear-gradient(90deg,#f2f5fa,#e9eef7,#f2f5fa); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
