/* =========================================================
   WiFi 设备分销商城 · 全站样式
   简约高对比 · 手机/电脑自适应 · 图标为内联 SVG（无 emoji）
   ========================================================= */

:root {
  --ink: #0f1720;
  --ink-2: #26303c;
  --muted: #6b7280;
  --line: #e6e8ec;
  --line-2: #eef0f3;
  --bg: #f5f6f8;
  --card: #ffffff;
  --brand: #1f5eff;
  --brand-ink: #1246d6;
  --brand-soft: #eef3ff;
  --ok: #16a34a;
  --ok-soft: #eefaf1;
  --warn: #d97706;
  --warn-soft: #fff7ec;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 32, .04), 0 8px 24px rgba(15, 23, 32, .05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 32, .06);
  --topbar-h: 58px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }

.ic { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ok-text { color: var(--ok); }
.dot { color: var(--line); margin: 0 6px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 20px; padding-bottom: 32px; }
.narrow { max-width: 620px; }

/* ---------------- 顶部栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 14px; height: var(--topbar-h); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--ink); color: #fff;
}
.brand-mark.lg { width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 12px; }
.brand-name { font-size: 16px; }
.topnav { margin-left: auto; display: flex; gap: 4px; }
.topnav a {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 9px;
  color: var(--muted); font-size: 14px; font-weight: 550;
}
.topnav a:hover { background: var(--line-2); color: var(--ink); }
.topnav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { font-size: 14px; color: var(--muted); }
.iconbtn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { background: var(--line-2); color: var(--ink); }

/* ---------------- 后台/分销骨架 ---------------- */
.shell { display: flex; align-items: flex-start; max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; gap: 20px; }
.sidebar { flex: none; width: 208px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.sidenav { display: flex; flex-direction: column; gap: 3px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 550;
}
.sidenav a:hover { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.sidenav a.on { background: var(--ink); color: #fff; }
.content { flex: 1; min-width: 0; }

.tabbar { display: none; }

/* ---------------- 卡片 / 区块 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > .card { margin-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: flex-end; }

.empty {
  display: grid; place-items: center; gap: 10px; padding: 48px 20px; text-align: center;
  color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty p { color: var(--muted); }
.hint { margin-top: 14px; color: var(--muted); font-size: 13px; }
.tips { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 2; }
.tips b { color: var(--ink); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; line-height: 1.4; white-space: nowrap; transition: .15s;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--line-2); color: var(--ink); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3c7c7; }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.tiny { padding: 5px 9px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.disabled, .btn:disabled { opacity: .5; pointer-events: none; }

/* ---------------- 提示条 ---------------- */
.flash-wrap { padding-top: 14px; }
.flash {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 10px; border: 1px solid var(--line); background: #fff;
}
.flash.ok { background: var(--ok-soft); border-color: #cbeed6; color: #14663a; }
.flash.warn { background: var(--warn-soft); border-color: #f6e0c0; color: #8a5200; }
.flash.danger { background: var(--danger-soft); border-color: #f4cccc; color: #a01b1b; }
.flash.brand { background: var(--brand-soft); border-color: #d3e0ff; color: var(--brand-ink); }

/* ---------------- 首页 ---------------- */
.hero {
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
  border: 1px solid var(--line); border-radius: 18px; padding: 34px 28px; text-align: center;
  box-shadow: var(--shadow-sm); margin-bottom: 8px;
}
.hero h1 { font-size: 26px; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 14px; }
.hero-enter {
  position: relative; display: flex; gap: 8px; max-width: 420px; margin: 20px auto 0;
}
.hero-enter-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.hero-enter input {
  flex: 1; padding: 11px 14px 11px 40px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; font-family: inherit; background: #fff;
}
.hero-enter input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 94, 255, .12); }

/* ---------------- 商品网格 ---------------- */
.grid { display: grid; gap: 14px; }
.grid-products { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .18s;
}
.pcard:hover { border-color: #d4d9e0; box-shadow: var(--shadow); transform: translateY(-2px); }
.pcard-img { position: relative; display: block; aspect-ratio: 1 / 1; background: #f2f4f7; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.pcard-ph { display: grid; place-items: center; width: 100%; height: 100%; color: #c3c9d2; }
.badge-over {
  position: absolute; top: 10px; left: 10px; background: rgba(15, 23, 32, .78); color: #fff;
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
}
.pcard-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard-title { font-size: 14px; line-height: 1.45; min-height: 40px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { color: var(--danger); font-weight: 700; font-size: 17px; }
.price i { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.stock { font-size: 12px; color: var(--muted); }

/* ---------------- 店铺头 ---------------- */
.shop-head {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.shop-avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--ink); color: #fff; }
.shop-meta { flex: 1; min-width: 0; }
.shop-meta h1 { font-size: 18px; }
.shop-meta p { display: flex; align-items: center; gap: 5px; font-size: 13px; word-break: break-all; }

/* ---------------- 商品详情 ---------------- */
.crumb { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.detail-gallery { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.detail-main { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; background: #f2f4f7; }
.detail-main.ph { display: grid; place-items: center; color: #c3c9d2; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.thumb.on { border-color: var(--brand); }
.detail-info h1 { font-size: 21px; line-height: 1.4; }
.detail-price { color: var(--danger); font-size: 28px; font-weight: 750; margin: 10px 0; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  background: var(--line-2); color: var(--ink-2); font-size: 12.5px;
}
.detail-desc { margin-top: 20px; }
.rich { color: var(--ink-2); font-size: 14.5px; line-height: 1.9; word-break: break-word; }

/* ---------------- 表单 ---------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }
input[type=text], input[type=password], input[type=tel], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 94, 255, .12); }
input:disabled { background: var(--line-2); color: var(--muted); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.inline-form { flex-direction: row; gap: 10px; }
.inline-form input { flex: 1; }
.reject-form { display: flex; gap: 8px; align-items: center; }
.reject-form input { width: 160px; padding: 7px 10px; font-size: 13px; }

/* 数量步进器 */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; }
.stepper button { width: 42px; height: 42px; border: 0; background: #fff; font-size: 18px; color: var(--ink); cursor: pointer; }
.stepper button:hover { background: var(--line-2); }
.stepper input { width: 70px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; padding: 10px 0; }
.stepper input:focus { box-shadow: none; }

/* 支付方式 */
.paytypes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.paytype { cursor: pointer; }
.paytype input { position: absolute; opacity: 0; pointer-events: none; }
.paytype span {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--ink-2); transition: .15s;
}
.paytype input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

.paybar { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.paybar-total { display: flex; flex-direction: column; }
.paybar-total b { color: var(--danger); font-size: 22px; }
.paybar .btn { flex: 1; padding: 13px; }

/* ---------------- 订单卡 ---------------- */
.ocard { padding: 16px 18px; }
.ocard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ocard-title { font-size: 15px; }
.ocard-title i { font-style: normal; color: var(--muted); font-weight: 500; font-size: 13px; }
.kv { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.kv.center { text-align: center; }
.kv > div { display: flex; gap: 10px; font-size: 13.5px; }
.kv > div > span { flex: none; width: 76px; color: var(--muted); }
.kv > div > b { color: var(--ink-2); font-weight: 550; word-break: break-all; display: flex; align-items: center; gap: 8px; }
.kv.center > div { justify-content: center; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--line-2); color: var(--ink-2);
}
.badge.ok { background: var(--ok-soft); color: #14663a; }
.badge.warn { background: var(--warn-soft); color: #8a5200; }
.badge.danger { background: var(--danger-soft); color: #a01b1b; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge.muted { background: var(--line-2); color: var(--muted); }

.refund-apply { margin-top: 12px; }
.refund-apply > summary { list-style: none; cursor: pointer; width: fit-content; }
.refund-apply > summary::-webkit-details-marker { display: none; }
.refund-apply .form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }

/* 列表行 */
.row-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 0; }
.row-thumb {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px;
  background: #f2f4f7; color: #c3c9d2; overflow: hidden; flex: none;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-main { flex: 1; min-width: 0; }
.row-main h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.row-acts { display: flex; align-items: center; gap: 8px; flex: none; }

.price-row { display: flex; align-items: center; gap: 14px; padding: 13px 15px; margin-bottom: 0; }
.price-input { display: flex; align-items: center; gap: 4px; flex: none; }
.price-input > span { color: var(--muted); }
.price-input input { width: 118px; text-align: right; }
.savebar { position: sticky; bottom: 12px; margin-top: 14px; }

/* 统计 */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.stat b { font-size: 20px; }

/* 标签页 */
.toolbar { margin-bottom: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }

/* ---------------- 认证页 ---------------- */
.auth-wrap { min-height: calc(100vh - 58px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow);
}
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand h1 { font-size: 20px; margin-bottom: 4px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-foot a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }

/* ---------------- 结果页 ---------------- */
.result-card { text-align: center; padding: 36px 26px; }
.result-ic { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 16px; }
.result-ic.ok { background: var(--ok-soft); color: var(--ok); }
.result-ic.warn { background: var(--warn-soft); color: var(--warn); }
.result-ic.danger { background: var(--danger-soft); color: var(--danger); }
.result-card h1 { font-size: 20px; margin-bottom: 6px; }
.result-card .row-actions { justify-content: center; margin-top: 20px; }

/* ---------------- 弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 32, .45); }
.modal-box {
  position: relative; background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 360px;
  text-align: center; box-shadow: 0 20px 60px rgba(15, 23, 32, .25);
}
.modal-box h3 { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; margin-bottom: 16px; }
.qr-img { width: 220px; height: 220px; margin: 0 auto 12px; border-radius: 12px; border: 1px solid var(--line); }
.qr-name { font-weight: 600; margin-bottom: 12px; }
.qr-link { display: flex; gap: 8px; margin-bottom: 14px; }
.qr-link input { font-size: 13px; }
.qr-link .btn { flex: none; }

/* ---------------- 页脚 ---------------- */
.site-foot {
  text-align: center; color: var(--muted); font-size: 13px; padding: 26px 16px 34px;
}

/* ---------------- 上传行 ---------------- */
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-row input[type=file] { width: auto; flex: 1; min-width: 200px; padding: 8px; font-size: 13px; }

/* ---------------- 余额卡 ---------------- */
.balance-card { background: var(--ink); border-color: var(--ink); color: #fff; }
.balance-card .muted, .balance-card .small { color: rgba(255, 255, 255, .65); }
.balance { font-size: 34px; font-weight: 750; margin: 4px 0 18px; letter-spacing: -.02em; }
.balance-card input, .balance-card select { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff; }
.balance-card input:focus, .balance-card select:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.balance-card .field > label { color: rgba(255, 255, 255, .8); }
.balance-card .btn { background: #fff; color: var(--ink); border-color: #fff; }
.balance-card .btn:hover { background: #eef0f3; color: var(--ink); }

/* ---------------- 响应式 ---------------- */
.only-mobile { display: none; }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 720px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: grid !important; }

  .shell { display: block; padding: 14px 14px 96px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 70;
    background: #fff; border-right: 1px solid var(--line); padding: 18px 14px;
    transform: translateX(-102%); transition: transform .24s ease; overflow-y: auto;
    box-shadow: 0 0 40px rgba(15, 23, 32, .12);
  }
  body.drawer-open .sidebar { transform: translateX(0); }
  body.drawer-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(15, 23, 32, .4); z-index: 65;
  }
  .sidenav a { padding: 12px 14px; font-size: 15px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 10px;
    color: var(--muted); font-size: 11.5px;
  }
  .tabbar a.on { color: var(--brand); }

  .hero { padding: 26px 18px; }
  .hero h1 { font-size: 22px; }
  .grid-products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .field-row { flex-direction: column; gap: 14px; }
  .row-card { flex-wrap: wrap; }
  .row-acts { width: 100%; justify-content: flex-end; }
  .price-row { flex-wrap: wrap; }
  .price-input { width: 100%; }
  .price-input input { flex: 1; width: auto; }
  .reject-form { width: 100%; }
  .reject-form input { flex: 1; width: auto; }
  .shop-head { flex-wrap: wrap; }
  .paytypes { grid-template-columns: 1fr 1fr; }
  .qr-img { width: 190px; height: 190px; }
  .wrap { padding: 0 14px; }
}

@media (max-width: 380px) {
  .grid-products { grid-template-columns: 1fr; }
  .paytypes { grid-template-columns: 1fr; }
}
