/* 天枢 IDC · 自研轻量样式表（不依赖任何 CDN）
   v3 变更（文字对比度按「舒适可读」重配，不再只是刚好过 AA 线）：
   1) 文字三级层次加深：弱化 5.32 → 6.50、次要 7.24 → 8.90（页面底色上实测）
   2) 语义色加深：success 5.32→6.90 / warning 5.38→6.80 / danger 5.15→6.22
   3) 🔴 修掉禁用态按钮的可读性 bug：原先用 opacity .5，
      主按钮实际只剩 2.29:1（白字叠半透明蓝底），几乎看不清；
      改为显式灰底深字，实测 5.8:1
   4) 后台侧栏分组标题 5.26 → 6.68
   5) 补齐手机与平板断点，表格横向滚动 + 首列吸附，触控目标加大
   6) 移动端导航抽屉与侧栏抽屉的配套样式 */

:root {
    /* ---- 主色 ---- */
    --c-primary: #185fa5;
    --c-primary-dark: #0c447c;
    --c-primary-light: #e6f1fb;
    --c-teal: #0f6e56;
    --c-teal-light: #e1f5ee;

    /* ---- 语义色：文字色在各自浅底上均 ≥ 6.2:1 ---- */
    --c-success: #0b5f49;
    --c-success-bg: #e7f7f0;
    --c-warning: #7a4a0a;
    --c-warning-bg: #fdf3e3;
    --c-danger: #a52a25;
    --c-danger-bg: #fdecec;

    /* ---- 文字层级：正文 / 次要 / 弱化 ----
       白底 / 页面底实测：正文 15.8 / 14.7，次要 9.6 / 8.9，弱化 7.0 / 6.5
       弱化文字也留足余量，12px 的小字（.hint / .tiny）看着不发灰 */
    --c-text: #1f2329;
    --c-text-mid: #3d4653;
    --c-text-dim: #515a67;

    --c-border: #e2e6ec;
    --c-border-strong: #cfd7e2;
    --c-bg: #f5f7fa;
    --c-white: #fff;
    --c-muted-bg: #eef1f5;
    --c-hover-bg: #fafcfe;
    --c-th-bg: #fafbfc;

    /* 禁用态：显式配色，不用 opacity（半透明会让文字对比度崩到 2:1 左右） */
    --c-disabled-bg: #eef1f5;
    --c-disabled-border: #dbe1e8;
    --c-disabled-text: #515a67;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 6px 20px rgba(16, 28, 45, .08);
    --nav-h: 62px;
    --card-pad: 20px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    overflow-wrap: break-word;
    -webkit-tap-highlight-color: rgba(24, 95, 165, .12);
}

img, svg, video { max-width: 100%; height: auto; }

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

/* 键盘可达性：只在键盘聚焦时显示焦点框，鼠标点击不显示 */
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(24, 95, 165, .16);
}

/* ---------- 布局 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.row > * { min-width: 0; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.flex { display: flex; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.between > *, .center > * { min-width: 0; }
.center { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap20 { gap: 20px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt40 { margin-top: 40px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.ml8 { margin-left: 8px; } .ml16 { margin-left: 16px; } .mr8 { margin-right: 8px; }
.tc { text-align: center; } .tr { text-align: right; }
.muted { color: var(--c-text-dim); }
.dim { color: var(--c-text-mid); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- 导航 ---------- */
.nav {
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    position: sticky; top: 0; z-index: 50;
    padding-top: env(safe-area-inset-top);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 12px; }
.logo { font-size: 18px; font-weight: 700; color: var(--c-primary); letter-spacing: .5px; white-space: nowrap; }
.logo span { color: var(--c-teal); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--c-text-mid); font-size: 14px; }
.nav-links a:hover, .nav-links a.on { color: var(--c-primary); }
.nav-toggle {
    display: none;
    align-items: center; justify-content: center;
    width: 42px; height: 38px;
    font-size: 18px; line-height: 1;
    background: var(--c-white); color: var(--c-text);
    border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    cursor: pointer;
}
.nav-toggle:active { background: var(--c-muted-bg); }

/* 抽屉遮罩（前台导航 / 后台侧栏共用）
   注意 z-index 必须低于 .nav(50) 与 .side(100)，否则会盖住抽屉面板，
   导致面板变灰、菜单项点不动 */
.drawer-mask {
    position: fixed; inset: 0;
    background: rgba(15, 25, 40, .45);
    opacity: 0; visibility: hidden;
    transition: opacity .2s, visibility .2s;
    z-index: 40;
}
.drawer-mask.open { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--card-pad);
}
.card-tight { padding: 14px 16px; }
.card-h { font-size: 15px; font-weight: 600; margin: 0 0 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-h .more { font-size: 13px; font-weight: 400; color: var(--c-text-dim); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    /* 次要按钮是白底，落在浅色渐变上会「隐形」：
       白底 #fff 对 hero 渐变只有 1.05~1.11:1，原来的边框 #e2e6ec 也只有 1.16:1。
       所以边框统一加深一档、再加一点浅阴影，保证在任何浅色背景上都能看出这是个按钮。 */
    border: 1px solid var(--c-border-strong);
    background: var(--c-white);
    color: var(--c-text);
    box-shadow: 0 1px 2px rgba(16, 28, 45, .06);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    font-family: inherit;
    transition: .15s;
    text-align: center;
}
.btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn:active { background: var(--c-primary-light); box-shadow: none; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }
.btn-primary:active { background: var(--c-primary-dark); }
.btn-teal { background: var(--c-teal); border-color: var(--c-teal); color: #fff; }
.btn-teal:hover { background: #0b5a46; border-color: #0b5a46; color: #fff; }
.btn-danger { background: #fff; border-color: var(--c-danger); color: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-lg { padding: 11px 26px; font-size: 15px; }
.btn-block { display: block; width: 100%; }

/* 禁用态：用显式配色而不是 opacity。
   opacity:.5 会把「白字 + 蓝底」一起透到页面底色上，实测只剩 2.29:1，
   用户根本看不清按钮上写的是什么。灰色实底 + 深灰字实测 5.8:1。 */
.btn:disabled, .btn.disabled {
    background: var(--c-disabled-bg);
    border-color: var(--c-disabled-border);
    color: var(--c-disabled-text);
    opacity: 1;
    cursor: not-allowed;
    box-shadow: none;
}
/* 权重需要压过 .btn.btn-primary 那组兜底规则 */
.btn.btn-primary:disabled, .btn.btn-primary.disabled,
.btn.btn-teal:disabled, .btn.btn-teal.disabled,
.btn.btn-danger:disabled, .btn.btn-danger.disabled {
    background: var(--c-disabled-bg);
    border-color: var(--c-disabled-border);
    color: var(--c-disabled-text);
}

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--c-text-mid); }
.form-item .hint { font-size: 12px; color: var(--c-text-dim); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=tel], input[type=search], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--c-text);
    min-height: 38px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-primary); }
input:disabled, select:disabled, textarea:disabled { background: var(--c-muted-bg); color: var(--c-text-dim); cursor: not-allowed; }
textarea { min-height: 100px; resize: vertical; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline > * { flex: 1; min-width: 120px; }
.form-inline > .btn { flex: 0 0 auto; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--c-border); }
th { font-weight: 600; color: var(--c-text-mid); font-size: 13px; background: var(--c-th-bg); white-space: nowrap; }
.tbl-empty { padding: 48px 0; text-align: center; color: var(--c-text-dim); }
@media (hover: hover) {
    tbody tr:hover { background: var(--c-hover-bg); }
}
/* 宽表格容器：窄屏横向滚动，避免撑破卡片 */
.tbl-wrap { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }

/* ---------- 徽标 ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 1.7; white-space: nowrap; font-weight: 500; }
.badge-success { background: var(--c-success-bg); color: var(--c-success); }
.badge-info { background: var(--c-primary-light); color: var(--c-primary); }
.badge-warning { background: var(--c-warning-bg); color: var(--c-warning); }
.badge-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-muted { background: var(--c-muted-bg); color: var(--c-text-dim); }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-info { background: var(--c-primary-light); color: var(--c-primary-dark); }
.alert-success { background: var(--c-success-bg); color: var(--c-success); }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning); }
.alert-danger { background: var(--c-danger-bg); color: var(--c-danger); }

/* ---------- 统计块 ---------- */
.stat { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px 20px; }
.stat .k { font-size: 13px; color: var(--c-text-dim); }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; color: var(--c-primary-dark); overflow-wrap: anywhere; }
.stat .v.teal { color: var(--c-teal); }
.stat .v.warn { color: var(--c-warning); }

/* ---------- 产品卡 ---------- */
.prod { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; transition: .18s; }
.prod-name { font-size: 16px; font-weight: 600; min-width: 0; }
.prod-sub { font-size: 13px; color: var(--c-text-dim); margin-top: 4px; min-height: 40px; }
.prod-price { font-size: 26px; font-weight: 700; color: var(--c-primary); }
.prod-price small { font-size: 13px; font-weight: 400; color: var(--c-text-dim); }
.spec-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.spec-list span { font-size: 12px; background: #f2f5f9; color: var(--c-text-mid); padding: 3px 9px; border-radius: 4px; }
@media (hover: hover) {
    .prod:hover { border-color: var(--c-primary); box-shadow: 0 4px 16px rgba(24, 95, 165, .08); }
}

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pager a, .pager span {
    padding: 6px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    font-size: 13px; background: #fff; color: var(--c-text-mid);
}
.pager .on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pager a.on { color: #fff; }

/* ---------- 页脚 ---------- */
.foot { border-top: 1px solid var(--c-border); background: #fff; margin-top: 56px; padding: 28px 0; color: var(--c-text-dim); font-size: 13px; }
.foot a { color: var(--c-text-mid); }
.foot-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }

/* ---------- 首页 Hero ---------- */
.hero { background: linear-gradient(150deg, #eef4fb 0%, #f7fafd 55%, #eaf6f1 100%); border-bottom: 1px solid var(--c-border); padding: 56px 0; }
.hero h1 { font-size: clamp(23px, 4.4vw, 32px); margin: 0 0 14px; line-height: 1.35; }
.hero .lead { font-size: clamp(14px, 2.3vw, 15px); margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* hero 的渐变是所有浅色底里最浅的，次要按钮的边界要再加强一档才看得出来 */
.hero .btn { border-color: #bcc7d6; }
.hero .btn-primary { border-color: var(--c-primary); }

/* 公告行：不再用 float，窄屏也不会错位 */
.notice-row { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--c-border); }
.notice-row:last-child { border-bottom: none; }
.notice-row .n-text { flex: 1; min-width: 0; }

/* ---------- 后台 ---------- */
.admin-body { display: flex; min-height: 100vh; }
.side { width: 210px; background: #1f2733; color: #c8d0da; flex: 0 0 210px; }
.side-logo { padding: 18px 20px; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid #2c3644; }
.side-logo small { display: block; font-size: 11px; font-weight: 400; color: #a3aeba; margin-top: 2px; letter-spacing: 1px; }
.side nav { padding: 10px 0; }
.side nav a { display: block; padding: 10px 20px; color: #c8d0da; font-size: 14px; border-left: 3px solid transparent; }
.side nav a:hover { background: #262f3c; color: #fff; }
.side nav a.on { background: #262f3c; color: #fff; border-left-color: #4c9ae0; }
.side nav .grp { padding: 14px 20px 6px; font-size: 12px; color: #a3aeba; letter-spacing: .5px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 56px; background: #fff; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 24px; }
.topbar .who { font-size: 13px; color: var(--c-text-mid); }
.content { padding: 24px; flex: 1; min-width: 0; }
.page-title { font-size: 18px; font-weight: 600; margin: 0 0 20px; }
.only-mobile { display: none; }

/* ---------- 登录页 ---------- */
.auth {
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(140deg, #eef4fb 0%, #f6f9fc 60%, #eef7f3 100%);
    padding: 20px;
}
.auth-box { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 34px 30px; box-shadow: 0 8px 32px rgba(24, 95, 165, .07); }
.auth-box h1 { font-size: 20px; margin: 0 0 6px; }
.auth-box .sub { color: var(--c-text-dim); font-size: 13px; margin-bottom: 24px; }

/* ---------- 用户中心侧栏 ---------- */
.user-nav { flex: 0 1 190px; min-width: 0; }
.user-nav .u-name { font-weight: 600; margin-bottom: 2px; overflow-wrap: anywhere; }
.user-nav .u-links { display: grid; gap: 2px; }
.user-nav .u-links a { padding: 6px 0; color: var(--c-text-mid); }
.user-nav .u-links a.on { color: var(--c-primary); font-weight: 600; }

/* ---------- 订单周期 / 支付方式选项 ---------- */
.cycle-item, .pay-m { display: flex; align-items: center; gap: 8px; border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.cycle-item input[type=radio], .pay-m input[type=radio] { width: auto; margin: 0; flex: 0 0 auto; }
.cycle-item > .grow, .pay-m > .grow { min-width: 0; }
.cycle-item:active, .pay-m:active { background: #f7fafd; }
.pay-m { padding: 13px 14px; gap: 10px; }

/* ---------- 详情行 ---------- */
.kv { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--c-border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 130px; color: var(--c-text-dim); flex: 0 0 130px; }
.kv .v { flex: 1; min-width: 0; word-break: break-all; }

/* ---------- 工具类 ---------- */
.divider { height: 1px; background: var(--c-border); margin: 16px 0; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: #f4f6f8; padding: 2px 6px; border-radius: 4px; word-break: normal; overflow-wrap: break-word; }
.progress { height: 6px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--c-primary); }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 按钮配色兜底 ----------
   说明：.nav-links a / .card-h .more 这类「后代选择器」权重会高于 .btn-primary 本身，
   会把按钮文字压成灰色（蓝底灰字，几乎看不清）。这里用双类选择器把配色钉死，
   必须放在样式表靠后位置，靠顺序+权重一起兜住。 */
.btn.btn-primary, .btn.btn-primary:hover, .btn.btn-primary:active { color: #fff; }
.btn.btn-teal, .btn.btn-teal:hover, .btn.btn-teal:active { color: #fff; }
.btn.btn-danger { color: var(--c-danger); }
.btn.btn-danger:hover, .btn.btn-danger:active { color: #fff; }

/* 减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ==================== 顶部公告条 / 在线客服悬浮球 ==================== */

/* ---- 公告条：可关闭，关闭状态记在 localStorage ---- */
.notice-bar {
    background: linear-gradient(90deg, var(--c-primary-light), var(--c-teal-light));
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text); font-size: 13.5px;
}
.notice-bar > .wrap { display: flex; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.notice-bar .nb-ico { flex: 0 0 auto; font-size: 14px; }
.notice-bar .nb-txt { flex: 1; min-width: 0; }
.notice-bar .nb-txt a { color: var(--c-primary-dark); text-decoration: underline; font-weight: 600; }
.notice-bar .nb-x {
    flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
    color: var(--c-text-dim); font-size: 17px; line-height: 1;
    padding: 4px 7px; border-radius: var(--radius-sm);
}
.notice-bar .nb-x:hover { background: rgba(16, 28, 45, .08); color: var(--c-text); }
.notice-bar[hidden] { display: none; }

/* ---- 右下角客服悬浮球 ---- */
.cs-fab {
    position: fixed; right: 20px; bottom: 24px; z-index: 60;
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.cs-fab-btn {
    width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--c-primary); color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11.5px; line-height: 1.15; font-weight: 600; letter-spacing: .5px;
    box-shadow: 0 8px 22px rgba(24, 95, 165, .35);
}
.cs-fab-btn:hover { background: var(--c-primary-dark); }
.cs-fab-btn .cs-fab-ico { font-size: 17px; line-height: 1; margin-bottom: 2px; }

.cs-panel {
    width: 270px; background: var(--c-white);
    border: 1px solid var(--c-border); border-radius: 12px;
    box-shadow: var(--shadow); overflow: hidden;
}
.cs-panel[hidden] { display: none; }
.cs-panel-h {
    padding: 12px 14px; background: var(--c-primary-light);
    color: var(--c-primary-dark); font-weight: 600; font-size: 13.5px;
}
.cs-panel-b { padding: 8px; }
.cs-row {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; border-radius: 8px; border: 0; background: transparent;
    color: var(--c-text); text-decoration: none; font-size: 13.5px; text-align: left; cursor: pointer;
    font-family: inherit;
}
.cs-row:hover { background: var(--c-hover-bg); }
.cs-row .cs-ico {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
    background: var(--c-muted-bg); display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.cs-row .cs-txt { flex: 1; min-width: 0; }
.cs-row .cs-sub { display: block; color: var(--c-text-dim); font-size: 12px; margin-top: 1px; word-break: break-all; }
.cs-panel-f { padding: 9px 14px; border-top: 1px solid var(--c-border); color: var(--c-text-dim); font-size: 12px; }

@media (max-width: 560px) {
    .cs-fab { right: 14px; bottom: 16px; }
    .cs-fab-btn { width: 46px; height: 46px; font-size: 10.5px; }
    .cs-fab-btn .cs-fab-ico { font-size: 15px; }
    .cs-panel { width: min(270px, calc(100vw - 28px)); }
    .notice-bar { font-size: 12.5px; }
}

/* ==================== 响应式断点 ==================== */

/* ---- 平板 / 窄桌面 ---- */
@media (max-width: 1080px) {
    .wrap, .wrap-sm { padding: 0 16px; }
    .side { width: 190px; flex-basis: 190px; }
}

/* ---- 平板竖屏及以下：抽屉化、表格滚动、触控加大 ---- */
@media (max-width: 820px) {
    .card { --card-pad: 16px; }

    /* 前台导航改为展开面板 */
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: absolute; left: 0; right: 0; top: 100%;
        display: none; flex-direction: column; align-items: stretch; gap: 0;
        background: var(--c-white); border-bottom: 1px solid var(--c-border);
        padding: 4px 0 12px; box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 13px 20px; font-size: 15px; border-bottom: 1px solid #f1f4f8; }
    .nav-links a:last-child { border-bottom: none; }
    .nav-links a.btn { margin: 12px 20px 4px; }
    .nav-links a.btn-primary { border-bottom-color: var(--c-primary); }

    /* 后台侧栏改为抽屉 */
    .side {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
        width: 232px; flex-basis: 232px;
        transform: translateX(-100%); transition: transform .22s ease;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .side.open { transform: none; }
    .only-mobile { display: inline-flex; }
    .topbar { min-height: 54px; padding: 8px 14px; flex-wrap: wrap; row-gap: 6px; }
    .content { padding: 14px; }
    .page-title { font-size: 17px; margin-bottom: 14px; }

    /* 表格：横向滚动 + 首列吸附（首列分隔线即为「可横向滑动」的视觉提示） */
    .tbl-wrap { margin: 0 calc(var(--card-pad) * -1); padding: 0 var(--card-pad); }
    table { font-size: 13px; }
    th, td { padding: 9px 10px; }
    /* 手机端按内容排布，避免标识（订单号 / IP / 服务号）被挤成逐字竖排；
       过长的说明文字仍会在 260px 内自动折行 */
    .tbl-wrap table { width: max-content; min-width: 100%; }
    .tbl-wrap td { max-width: 260px; }
    .tbl-wrap th { max-width: 190px; }
    .tbl-wrap th:first-child, .tbl-wrap td:first-child { position: sticky; left: 0; background: var(--c-white); border-right: 1px solid var(--c-border); }
    .tbl-wrap th:first-child { background: var(--c-th-bg); }
    .tbl-wrap tr:hover td:first-child { background: var(--c-hover-bg); }

    /* 表单：输入框 16px 防 iOS 聚焦自动放大；筛选项换行铺满 */
    input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
    input[type=tel], input[type=search], select, textarea { font-size: 16px; min-height: 42px; }
    .form-inline > * { flex: 1 1 100%; }
    .form-inline > .btn { flex: 0 0 auto; }
    .form-inline > select { max-width: none !important; }
    textarea { min-height: 110px; }

    /* 按钮：触控目标加大 */
    .btn { padding: 10px 16px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
    .btn-block { display: flex; width: 100%; }
    .btn-sm { padding: 6px 12px; min-height: 34px; }
    .btn-lg { min-height: 46px; padding: 12px 22px; }
    td .btn + .btn, .nowrap .btn + .btn { margin-left: 4px; }

    /* 用户中心侧栏改为横滑标签条 */
    .user-nav { flex: 1 1 100%; }
    .user-nav .card-tight { padding: 12px 14px; }
    .user-nav .u-divider { display: none; }
    .user-nav .u-links {
        display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .user-nav .u-links a {
        flex: 0 0 auto; padding: 7px 13px; font-size: 13px;
        border: 1px solid var(--c-border); border-radius: 20px; background: #fff; white-space: nowrap;
    }
    .user-nav .u-links a.on { border-color: var(--c-primary); background: var(--c-primary-light); }

    /* 栅格与卡片密度 */
    .grid { gap: 14px; }
    .grid-4 { gap: 12px; }
    .stat { padding: 14px 16px; }
    .stat .v { font-size: 21px; }
    .prod { padding: 16px; }
    .prod-price { font-size: 23px; }
    .hero { padding: 40px 0; }
    .foot { margin-top: 36px; padding: 22px 0; }
    .foot-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .foot-inner .tr { text-align: left; }
    .pager a, .pager span { padding: 5px 10px; }
    .kv .k { flex-basis: 108px; width: 108px; }
}

/* ---- 手机 ---- */
@media (max-width: 560px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { padding: 12px 13px; }
    .stat .k { font-size: 12.5px; }
    .stat .v { font-size: 19px; }
    .card-h { font-size: 14.5px; }
    .prod-sub { min-height: 0; }
    .hero { padding: 30px 0 28px; }
    .auth { padding: 14px; }
    .auth-box { padding: 26px 22px; border-radius: 12px; }
    .auth-box h1 { font-size: 19px; }

    /* 键值行改为上下排布，长内容不再被挤压 */
    .kv { flex-direction: column; gap: 2px; padding: 9px 0; }
    .kv .k { flex-basis: auto; width: auto; font-size: 12.5px; }
    .kv .v { font-size: 14px; }

    .topbar .who { font-size: 12px; }
    .topbar .who .who-extra { display: none; }
    .content { padding: 12px; }
    .card { --card-pad: 14px; }
    .btn { padding: 10px 14px; }
    .btn-sm { font-size: 12.5px; }
}

/* ---- 小屏手机（iPhone SE 一代等 320px 宽）---- */
@media (max-width: 380px) {
    :root { --nav-h: 56px; }
    .wrap, .wrap-sm { padding: 0 12px; }
    .logo { font-size: 16px; }
    .hero h1 { font-size: 21px; }
    .prod-price { font-size: 21px; }
    .btn { padding: 9px 12px; font-size: 13px; }
    .btn-lg { padding: 11px 16px; font-size: 14px; }
}

/* ==================== 后台：左右分区独立滚动 + 侧栏分类折叠 ====================
   左边栏和右边内容区各自滚动，互不带动 —— 翻长表格时菜单不会跟着跑掉。
   侧栏菜单按分类折叠：点分类标题展开/收起，当前页所在的分类自动展开。 */
.admin-body { height: 100vh; overflow: hidden; }
.side {
    height: 100vh; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin; scrollbar-color: #3a4655 transparent;
}
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: #3a4655; border-radius: 3px; }
.side::-webkit-scrollbar-track { background: transparent; }
.main { height: 100vh; overflow: hidden; }
.content { overflow-y: auto; }

.menu-group > .grp {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; border: 0; background: transparent; cursor: pointer;
    padding: 13px 20px 8px; font-size: 12px; color: #a3aeba;
    letter-spacing: .5px; font-family: inherit; text-align: left;
    transition: color .18s ease, background-color .18s ease;
}
.menu-group > .grp:hover { color: #fff; background: #232b37; }
.menu-group > .grp:active { background: #2b3442; }
.menu-group > .grp .arw {
    width: 0; height: 0; flex: 0 0 auto; margin-left: 8px;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; transition: transform .18s ease;
}
.menu-group.open > .grp .arw { transform: rotate(180deg); }
/* 展开/收起走高度 + 透明度过渡，不再用 display 硬切
   （原来 `display:none → block` 是「啪」一下整块弹出来，看着生硬） */
.menu-group .grp-items {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .3s cubic-bezier(.4, 0, .2, 1), opacity .22s ease;
}
.menu-group.open .grp-items { max-height: 460px; opacity: 1; }
.menu-group .grp-items a { transform: translateY(-6px); transition: transform .28s cubic-bezier(.4, 0, .2, 1); }
.menu-group.open .grp-items a { transform: translateY(0); }

/* ==================== 后台列表：多选 + 批量操作 ==================== */

/* 复选框那一列：窄、居中、不参与横向滚动 */
.ck-cell { width: 38px; text-align: center; }
.ck-cell input[type=checkbox] {
    width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0;
    vertical-align: middle; cursor: pointer; accent-color: var(--c-primary);
}
/* 勾选的那一行整行淡蓝：一眼看出哪些会被操作到 */
tbody tr:has(.ck-row:checked) { background: var(--c-primary-light); }

/* 批量操作条：勾选后才出现（JS 控制 hidden） */
.bulk-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    padding: 10px 14px; margin: 0 0 12px;
    background: var(--c-primary-light); border: 1px solid #d6e4f5; border-radius: 8px;
}
.bulk-bar[hidden] { display: none; }
.bulk-n { font-size: 13px; color: var(--c-text-mid); margin-right: 4px; }
.bulk-n b { color: var(--c-primary-dark); font-size: 15px; margin: 0 2px; }
.bulk-bar .btn { flex: 0 0 auto; }

/* 初帧禁用菜单折叠过渡
   侧栏的脚本要等侧栏 HTML 解析完才能跑；不加这条，加载瞬间若本地记录的状态
   与服务端渲染的不一致，就会看到菜单"自己弹一下"（用户反馈的"点击会重新收缩"） */
.side.menu-init .menu-group .grp-items,
.side.menu-init .menu-group > .grp .arw,
.side.menu-init .menu-group .grp-items a { transition: none !important; }

/* 手机端侧栏是抽屉，恢复整页滚动更顺手 */
@media (max-width: 820px) {
    .admin-body { height: auto; overflow: visible; }
    .main { height: auto; overflow: visible; }
    .content { overflow: visible; }
    .side { height: 100vh; }
}

/* ==================== 下拉框：去掉系统原生样式，统一描边 + 自绘箭头 ==================== */
select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    cursor: pointer;
    padding-right: 34px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23515a67' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
select:hover { border-color: var(--c-border-strong); }
select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(24, 95, 165, .16); }
select:disabled { background-image: none; padding-right: 12px; }
select::-ms-expand { display: none; }

/* ==================== 自定义弹窗（uiAlert / uiConfirm / uiPrompt） ==================== */
.ui-mask {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(19, 27, 38, .45);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    animation: uiFade .16s ease-out;
}
.ui-dlg {
    width: 100%; max-width: 420px; max-height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    background: var(--c-white); border-radius: var(--radius);
    box-shadow: 0 18px 48px rgba(16, 28, 45, .22);
    animation: uiPop .18s cubic-bezier(.2, .9, .3, 1.15);
}
.ui-dlg-wide { max-width: 560px; }
.ui-dlg-hd { padding: 18px 20px 0; font-size: 15px; font-weight: 600; color: var(--c-text); }
.ui-dlg-bd { padding: 12px 20px 4px; overflow-y: auto; }
.ui-dlg-msg { font-size: 14px; line-height: 1.7; color: var(--c-text-mid); white-space: pre-wrap; word-break: break-word; }
.ui-dlg-input { margin-top: 12px; }
.ui-dlg-ft { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 18px; }
.ui-dlg-ft .btn { min-width: 92px; }

@media (max-width: 560px) {
    .ui-dlg-ft { flex-direction: column-reverse; }
    .ui-dlg-ft .btn { width: 100%; }
}

@keyframes uiFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes uiPop {
    from { opacity: 0; transform: translateY(8px) scale(.98) }
    to   { opacity: 1; transform: none }
}

/* 提示条：固定居中（原来靠行内样式，这里收敛进样式表，并加淡入） */
#appToast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 2100; margin: 0; text-align: center;
    min-width: 200px; max-width: calc(100vw - 32px);
    box-shadow: 0 8px 28px rgba(16, 28, 45, .16);
    animation: uiPop .18s ease-out;
}

/* ==================== 官网首页 ==================== */

/* Hero 改成「左文案 + 右价格卡」两栏：
   原来只有一句标语，右半边整片空着，视觉上重心全压在左边。 */
.hero-inner { display: flex; align-items: center; gap: 40px; }
.hero-copy { flex: 1 1 auto; min-width: 0; max-width: 620px; }

.hero-eyebrow {
    display: inline-block; margin-bottom: 14px;
    padding: 3px 11px; border-radius: 999px;
    background: var(--c-primary-light); color: var(--c-primary-dark);
    font-size: 12px; letter-spacing: .3px;
}
.hero h1 em { font-style: normal; color: var(--c-primary); }

/* 信任点：对勾图标 + 文字，比一排小灰字更容易扫 */
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; }
.hero-trust span { font-size: 13px; color: var(--c-text-mid); }
.hero-trust i { color: var(--c-teal); font-size: 12px; margin-right: 6px; }

.hero-card {
    flex: 0 0 300px; max-width: 300px;
    background: var(--c-white); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 22px;
    box-shadow: var(--shadow);
}
.hc-k { font-size: 13px; color: var(--c-text-dim); }
.hc-v { font-size: 30px; font-weight: 700; color: var(--c-primary); margin: 6px 0 2px; }
.hc-v small { font-size: 13px; font-weight: 400; color: var(--c-text-dim); }
.hc-n { font-size: 14px; font-weight: 600; }
.hc-tip { font-size: 12px; color: var(--c-text-dim); margin-top: 12px; line-height: 1.65; }

/* 首页优势卡片 */
.feat {
    background: var(--c-white); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 18px;
}
/* .feat-i 只管字号与颜色；图标形状由 .ico 画，1em 正好跟着这里的字号走 */
.feat-i { font-size: 22px; line-height: 1; color: var(--c-primary); }
.feat-t { font-weight: 600; margin: 10px 0 6px; }
.feat-d { font-size: 13px; color: var(--c-text-dim); line-height: 1.65; }

.sec-h { font-size: 19px; margin: 0; }
/* .prod 是纵向 flex：价格行用 margin-top:auto 顶到底部，
   同一行卡片的高矮就不会因为卖点文字行数不同而参差 */
.prod-foot { margin-top: auto; }
.prod-note { font-size: 12px; color: var(--c-teal); margin-top: 8px; }

/* 常见问题：用原生 details，不引 JS；summary 去掉系统三角，自绘 +/− */
.faq { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--c-border); }
.faq details:last-child { border-bottom: none; }
.faq summary {
    cursor: pointer; padding: 14px 18px; font-size: 14px; font-weight: 600;
    list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
/* 展开指示用图标库的 chevron，展开时转 180°（模板里写 <i class="bi bi-chevron-down">） */
.faq summary i { color: var(--c-text-dim); transition: transform .2s ease; }
.faq details[open] summary { color: var(--c-primary); }
.faq details[open] summary i { transform: rotate(180deg); }
.faq-a { padding: 0 18px 16px; font-size: 13px; color: var(--c-text-mid); line-height: 1.75; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 820px) {
    .hero-inner { flex-direction: column; align-items: stretch; gap: 26px; }
    .hero-card { flex: none; max-width: none; }
}

/* ==================== 商品选择页（左树 + 右细节） ==================== */

.pick { display: flex; align-items: flex-start; gap: 22px; }

/* 左栏：大栏目（类型）套小栏目（机房/分组） */
.pick-side {
    flex: 0 0 236px; max-width: 236px;
    background: var(--c-white); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 10px;
}
.pick-all, .pick-sub {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 8px; font-size: 14px;
}
.pick-all b, .pick-sub b, .pick-grp b { font-weight: 400; font-size: 12px; color: var(--c-text-dim); }
.pick-all:hover, .pick-sub:hover { background: var(--c-primary-light); }
.pick-all.on, .pick-sub.on { background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600; }
.pick-all.on b, .pick-sub.on b { color: var(--c-primary-dark); }

/* 大栏目标题：只是分组标签（不可点），靠上边框把层级分开 */
.pick-grp {
    display: flex; justify-content: space-between; align-items: center;
    margin: 6px 0 2px; padding: 8px 10px 2px;
    font-size: 12px; letter-spacing: .4px; color: var(--c-text-dim);
    border-top: 1px solid var(--c-border);
}
.pick-grp:first-child { border-top: none; margin-top: 0; padding-top: 2px; }
/* 小栏目缩进一格，层级一眼可见 */
.pick-sub.is-sub { padding-left: 22px; }

/* 右栏 */
.pick-main { flex: 1 1 auto; min-width: 0; }
.pick-head { margin-bottom: 12px; }
.pick-title { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border: 1px solid var(--c-border); border-radius: 999px;
    font-size: 12px; color: var(--c-text-mid); background: var(--c-white);
}
.chip em { font-style: normal; font-size: 11px; color: var(--c-text-dim); }
.chip:hover { border-color: var(--c-primary); color: var(--c-primary-dark); }
.chip.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.chip.on em { color: rgba(255, 255, 255, .82); }

/* 选购页右栏「上半部」：标题 + 排序 + 机房筛选，理成一块
   （原来标题孤零零、几十个小标签直接铺开、「其他」还排在中间，看着乱） */
.pick-head-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.pick-title { font-size: 17px; font-weight: 600; margin: 0; display: flex; align-items: baseline; gap: 8px; }
.pick-count { font-size: 12px; font-weight: 400; color: var(--c-text-dim); }
.pick-sort { display: flex; align-items: center; gap: 6px; }
.pick-sort-i {
    padding: 4px 11px; border: 1px solid var(--c-border); border-radius: 999px;
    font-size: 12px; color: var(--c-text-mid); background: var(--c-white); white-space: nowrap;
}
.pick-sort-i:hover { border-color: var(--c-primary); color: var(--c-primary-dark); }
.pick-sort-i.on { background: var(--c-primary-light); border-color: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600; }

.pick-filter {
    background: var(--c-white); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.pick-filter-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.pick-filter-l { font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--c-text-dim); }
.pick-filter-on { font-size: 12px; color: var(--c-primary-dark); background: var(--c-primary-light); border-radius: 999px; padding: 2px 10px; }
.pick-filter-tip { font-size: 12px; color: var(--c-text-dim); margin-left: auto; }

.pick-more { margin-top: 9px; }
.pick-more > summary { list-style: none; cursor: pointer; display: inline-block; font-size: 12px; color: var(--c-primary-dark); }
.pick-more > summary::-webkit-details-marker { display: none; }
.pick-more > summary::after { content: ' ▾'; font-size: 10px; }
.pick-more[open] > summary::after { content: ' ▴'; }

/* 商品行：名称 + 配置直接摊开，右边价格与按钮 */
.pick-list { display: flex; flex-direction: column; gap: 10px; }
.pick-row {
    display: flex; align-items: center; gap: 18px;
    background: var(--c-white); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 14px 16px;
}
.pick-row:hover { border-color: var(--c-primary); }
.pick-info { flex: 1 1 auto; min-width: 0; }
.pick-name { font-weight: 600; font-size: 15px; }
.pick-line { font-size: 12px; color: var(--c-text-dim); margin-top: 3px; }
.pick-buy { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pick-price { font-size: 18px; font-weight: 700; color: var(--c-primary); white-space: nowrap; }
.pick-price small { font-size: 12px; font-weight: 400; color: var(--c-text-dim); }

/* 详情页的配置明细：<ul> 版（裸 <li> 在浏览器里没有项目符号、缩进也是乱的） */
.spec-list-block { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.spec-list-block li { position: relative; padding-left: 12px; font-size: 13px; color: var(--c-text-mid); }
.spec-list-block li::before { content: '·'; position: absolute; left: 0; color: var(--c-primary); }

/* 首页品类卡上的配置行：两行封顶，不让长文案把卡片撑歪 */
.cat-spec {
    margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--c-text-dim);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 820px) {
    .pick { flex-direction: column; }
    .pick-side { flex: none; width: 100%; max-width: none; }
    .pick-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .pick-buy { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ==================== 统一工具类（2026-10-13 全站优化） ====================
   背景：审计发现模板里到处是「各写一遍」的内联样式 ——
   `style="margin-left:auto"` 6 处、`card-h + font-size:14px` 9 处、
   `style="padding:9px 0;border-bottom:1px dashed …"` 8 处、
   textarea 的 min-height 9 处、双栏 `flex:1 1 NNNpx` **26 处**（还写错了两处 min-width ✗）。
   这里把它们收成公共类 ✓ —— 以后改一处、全站跟着变 ✓。 */
.ml-auto { margin-left: auto; }

/* 卡片里小一号的说明性标题（原来是 card-h 再叠内联字号） */
.card-note { font-size: 14px; }

/* 虚线分隔的行（订单动态、消息列表、流水清单到处在用 ✓） */
.list-row { padding: 9px 0; border-bottom: 1px dashed var(--c-border); }
.list-row:last-child { border-bottom: 0; }

/* textarea 两档高度（原来每个页面各写一个 min-height ✓） */
.ta-sm { min-height: 90px; }
.ta-md { min-height: 160px; }

/* 双栏骨架：主栏 + 侧栏
   ⚠️ 关键在 `min-width: 0` ✓ —— 内联写 `min-width: 300px` 的那两处，
      在 320px 宽的机型上会横向溢出 ✓（整页能被手指拖着左右晃 ✗）。
      窄屏（≤820px）一律变单列 ✓（与客户区侧栏的断点一致 ✓）。 */
.split { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.split-main { flex: 1 1 560px; min-width: 0; }
.split-side { flex: 0 1 380px; min-width: 0; }
/* 二级栏（页内还有一层并排：如「我的服务 | 快捷入口」✓）
   ⚠️ 别拿 .split-main 顶替 ✗ —— 基准 560 会把这种窄栏提前挤到下一行 ✓
   （迁移时就踩到过：300px 的栏被归一成 560 ✓ 页面直接变了形 ✗） */
.split-sub { flex: 1 1 300px; min-width: 0; }
/* 小格子：配置项一类的等宽块（原本 240px 基准 ✓） */
.split-cell { flex: 1 1 240px; min-width: 0; }
@media (max-width: 820px) {
    .split { gap: 14px; }
    .split-main, .split-side, .split-sub, .split-cell { flex: 1 1 100%; }
}

/* 正负金额 / 强调文字（原来是 6 处内联 color ✓） */
.text-success { color: #12a37a; }
.text-danger { color: #d0453f; }

/* 必填星号 */
.req { color: #d0453f; font-style: normal; margin-left: 2px; }

/* 块级空状态（表格内仍用 .tbl-empty ✓） */
.empty { padding: 26px 10px; text-align: center; color: var(--c-text-dim); font-size: 13px; }

/* ==================== 多选型选项（如「可用支付方式」） ====================
   原生 checkbox 只有 13px 左右，点起来费劲（手机上尤其容易点空），
   而且勾没勾中只有那个小方块的变化，不好确认。这里做成整块可点的 chip。
   注意：`.form-item label` 是「后代选择器」，权重比单个类高，
   所以下面必须写成 `.form-item .chk-item` 才能盖过它的 display/margin/color。 */
.chk-row { display: flex; flex-wrap: wrap; gap: 10px; }
.form-item .chk-item {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0; padding: 9px 14px;
    cursor: pointer; user-select: none;
    border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    background: var(--c-white);
    font-size: 14px; color: var(--c-text);
    transition: border-color .16s ease, background-color .16s ease;
}
.form-item .chk-item:hover { border-color: var(--c-border-strong); }
.form-item .chk-item input[type=checkbox] {
    width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0;
    flex: 0 0 auto; cursor: pointer; accent-color: var(--c-primary);
}
.form-item .chk-item:has(input:checked) {
    border-color: var(--c-primary); background: var(--c-primary-light);
    color: var(--c-primary-dark); font-weight: 600;
}

/* ==================== 图标 ====================
   统一用 **Bootstrap Icons v1.13.2（MIT）**，自托管在 `/static/icons/`，
   由两个 layout 的 `<link>` 引入，**不走 CDN** —— 这个站至今没有任何运行时外部依赖，
   CDN 一旦被墙或抽风，全站图标会一起消失（而图标没了页面就散了）。

   为什么不用 emoji：同一个 emoji 在 iOS / 安卓 / Windows 是三种字形，大小与基线不可控，
   彩色实心块也和本站的细线风格冲突。

   用法：<i class="bi bi-check-lg" aria-hidden="true"></i>
   图标是字体字形：颜色跟随文字（currentColor）、大小跟随 font-size，
   所以放进按钮 / hover / 深色底都会自动变色，不必额外写样式。
   查名字：https://icons.getbootstrap.com/（本地这份有 2078 个图标）。 */

/* ==================== 官网首页：流程 / 品类 ==================== */
/* 6 张卡的区块用 3 列：`.grid-4` 在 1180px 宽下会排成 5 列，6 张卡就成了 5+1，很别扭 */
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.step { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px; }
.step-n {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--c-primary-light); color: var(--c-primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.step-t { font-weight: 600; margin: 10px 0 6px; }
.step-d { font-size: 13px; color: var(--c-text-dim); line-height: 1.65; }

.cats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cat {
    display: block; padding: 14px 16px;
    background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius);
    color: var(--c-text);
    transition: border-color .16s ease, box-shadow .16s ease;
}
.cat:hover { border-color: var(--c-primary); color: var(--c-text); box-shadow: 0 4px 16px rgba(24, 95, 165, .08); }
.cat-n { font-size: 14px; font-weight: 600; }
.cat-p { font-size: 19px; font-weight: 700; color: var(--c-primary); margin-top: 6px; }
.cat-p small { font-size: 12px; font-weight: 400; color: var(--c-text-dim); }
.cat-c { font-size: 12px; color: var(--c-text-dim); margin-top: 2px; }

/* ==================== 商品页排版与视觉修正 ====================
   这一轮针对「页面难看」的具体问题，逐条修：
   ① 上游描述里的内联红字/字号 → .prod-desc 统一接管排版
   ② 规格详情「机房 / 所在地」占满一整行、右边空一片 → 紧凑卡片网格
   ③ 价格与购买按钮在页面最下面，首屏看不到 → 顶部价格条
   ④ 首页 4 张场景卡在 1000~1150px 宽度下排成 3+1（右边空一半）→ 2×2 / 4×1
   ⑤ 右下角客服球压在内容上（卡片文字、产品行按钮）→ 默认半透明
   ------------------------------------------------------------- */

/* ① 商品描述：结构保留，排版听我们的（上游那套颜色/字号一律不生效） */
.prod-desc { font-size: 14px; line-height: 1.9; color: var(--c-text-mid); }
.prod-desc p { margin: 0 0 8px; }
.prod-desc h1, .prod-desc h2, .prod-desc h3,
.prod-desc h4, .prod-desc h5, .prod-desc h6 {
    font-size: 14px; font-weight: 600; color: var(--c-text);
    margin: 14px 0 6px; line-height: 1.6;
}
.prod-desc h1:first-child, .prod-desc h2:first-child, .prod-desc h3:first-child,
.prod-desc h4:first-child, .prod-desc h5:first-child, .prod-desc h6:first-child { margin-top: 0; }
.prod-desc ul, .prod-desc ol { margin: 6px 0 8px; padding-left: 20px; }
.prod-desc li { margin: 3px 0; }
.prod-desc table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.prod-desc td, .prod-desc th { border: 1px solid var(--c-border); padding: 6px 10px; text-align: left; }
.prod-desc strong, .prod-desc b { color: var(--c-text); }
.prod-desc font, .prod-desc span { color: inherit; font-size: inherit; }
.prod-desc img { max-width: 100%; height: auto; }

/* ② 规格详情：紧凑卡片网格，把宽度填满（原来 .kv 的固定 130px 标签列在宽容器里显得很空） */
.spec-grid { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.spec-cell { background: #f8fafc; border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; }
.spec-cell-t { font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--c-text-dim); margin-bottom: 6px; }
.spec-cell-r { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed var(--c-border); }
.spec-cell-r:last-child { border-bottom: none; }
.spec-cell-r span { color: var(--c-text-dim); }
.spec-cell-r b { font-weight: 600; color: var(--c-text); }

/* ③ 顶部价格条：首屏就能看到价格和购买入口（原来要滚到最后） */
.buy-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: var(--c-primary-light); border: 1px solid #d6e4f5;
    border-radius: 10px; padding: 10px 14px; margin: 0 0 16px;
}
.buy-bar-p { font-size: 22px; font-weight: 700; color: var(--c-primary); line-height: 1.2; }
.buy-bar-p small { font-size: 12px; font-weight: 400; color: var(--c-text-dim); }
.buy-bar .btn { flex: 0 0 auto; }

/* ④ 4 张卡：中屏 2×2、宽屏一行 4 张（auto-fill 会排出「3+1」右边空一片） */
.grid-4x { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1080px) { .grid-4x { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .grid-4x { grid-template-columns: 1fr; } }

/* ⑤ 客服球默认半透明：它固定在右下角，会压住卡片文字和产品行的按钮 */
.cs-fab { opacity: .62; transition: opacity .2s ease; }
.cs-fab:hover, .cs-fab:focus-within { opacity: 1; }

/* ==================== 年度活动专区入口条 ====================
   放在首页首屏下缘（Hero 之后第一块）：活动要有活动该有的样子，
   所以这里用暖色（区别于全站的蓝），一眼能从页面里跳出来。 */
.promo-strip {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: 0 0 26px; padding: 14px 18px;
    background: linear-gradient(90deg, #fff7ea, #fffdf9);
    border: 1px solid #f2d7a8; border-radius: var(--radius);
    color: var(--c-text);
    transition: border-color .16s ease, box-shadow .18s ease;
}
.promo-strip:hover { border-color: #e6c07c; box-shadow: 0 6px 18px rgba(200, 140, 30, .12); }
.promo-badge {
    flex: 0 0 auto; font-size: 12px; font-weight: 700; letter-spacing: .5px;
    color: #fff; background: #e08a20; border-radius: 999px; padding: 3px 10px;
}
.promo-text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.7; }
.promo-text b { color: #b3690a; }
.promo-go { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: #b3690a; }

/* ==================== 手感与动效 ====================
   原则：能用 CSS 做的就不引库，能用 0KB 换来的手感就别花 100KB。
   这里所有动效都被文件上方的 prefers-reduced-motion 规则统一压制
   （那条规则把 animation/transition 时长压到 .01ms），不用逐条再写一遍。 */

/* ---- AJAX 指示器：屏幕**正中央**的「处理中」卡片 ----
   演进过程（都是用户反馈驱动 ✓）：
   ① 顶部 2px 蓝条 → 被嫌像一根线 ✗（顺带发现它与后台顶栏 .topbar 撞名，把后台头部压隐形 ✗）
   ② 右下角深灰小胶囊 → 被嫌「不明显，很容易忽视」✗
   ③ 右下角蓝底大胶囊 → 明显了，但位置偏 ✗
   ④ **正中央卡片 + 动画**（本次 ✓ 用户指定 ✓）

   两个刻意的取舍：
   · 不加遮罩、`pointer-events: none` ✓ —— 它只是进度提示，不该挡住页面操作 ✗；
   · 仍然保持「快请求不显示 / 显示了至少留 0.5 秒」的节奏（见 app.js ✓），
     否则每次点都弹一张卡，比不提示还吵 ✗。 */
.ajax-toast {
    position: fixed; left: 50%; top: 50%; z-index: 999;
    transform: translate(-50%, -50%) scale(.9);
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    min-width: 172px; padding: 24px 30px 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .97);
    color: var(--c-text); font-size: 14.5px; font-weight: 600; letter-spacing: .3px;
    box-shadow: 0 20px 50px rgba(16, 28, 45, .2), 0 0 0 1px rgba(16, 28, 45, .05);
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .24s cubic-bezier(.2, .85, .3, 1.3);
}
.ajax-toast.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* 双环：外环顺时针、内环逆时针 —— 比单环看着"更在忙" ✓ */
.ajax-toast .rings { position: relative; width: 40px; height: 40px; }
.ajax-toast .rings i { position: absolute; border-radius: 50%; }
.ajax-toast .rings .r1 {
    inset: 0;
    border: 3px solid rgba(24, 95, 165, .18); border-top-color: var(--c-primary);
    animation: ajaxSpin .8s linear infinite;
}
.ajax-toast .rings .r2 {
    inset: 10px;
    border: 2px solid transparent; border-bottom-color: var(--c-primary-dark);
    animation: ajaxSpinRev 1.4s linear infinite;
}
@keyframes ajaxSpin { to { transform: rotate(360deg); } }
@keyframes ajaxSpinRev { to { transform: rotate(-360deg); } }

/* 文字后的三点跳动 */
.ajax-toast .txt { display: flex; align-items: center; gap: 2px; }
.ajax-toast .txt i {
    width: 3.5px; height: 3.5px; margin-left: 2px;
    border-radius: 50%; background: var(--c-primary); opacity: .25;
    animation: ajaxDot 1.1s ease-in-out infinite;
}
.ajax-toast .txt i:nth-child(2) { animation-delay: .17s; }
.ajax-toast .txt i:nth-child(3) { animation-delay: .34s; }
@keyframes ajaxDot {
    0%, 60%, 100% { opacity: .25; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}
/* 减少动效偏好下全部停下：全局那条规则只把时长压成 .01ms（会变成乱闪 ✗），
   所以必须显式 animation: none（带 !important 才压得过它 ✓） */
@media (prefers-reduced-motion: reduce) {
    .ajax-toast .rings .r1, .ajax-toast .rings .r2, .ajax-toast .txt i { animation: none !important; }
    .ajax-toast .rings .r1 { border-color: rgba(24, 95, 165, .22); border-top-color: var(--c-primary); }
    .ajax-toast .txt i { opacity: .55; }
}
@media (max-width: 560px) {
    .ajax-toast { min-width: 150px; padding: 20px 24px 18px; font-size: 14px; gap: 12px; }
    .ajax-toast .rings { width: 34px; height: 34px; }
    .ajax-toast .rings .r2 { inset: 9px; }
}

/* ---- 键盘焦点：鼠标点的不要描边，Tab 走的必须看得见 ---- */
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.nav-links a:focus-visible, .pick-sub:focus-visible, .pick-all:focus-visible, .chip:focus-visible { outline-offset: 3px; }

/* ---- 按钮：按下有反馈，请求中会转圈 ---- */
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .08s ease, box-shadow .15s ease; }
.btn:active { transform: translateY(1px); }
.btn.loading { position: relative; pointer-events: none; }
.btn.loading::after {
    content: ''; position: absolute; right: 10px; top: 50%;
    width: 12px; height: 12px; margin-top: -7px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: btnSpin .6s linear infinite;
}
.btn-block.loading, .btn-lg.loading { padding-right: 34px; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ---- sticky 导航：滚动之后分一层，不然和内容"糊"在一起 ---- */
.nav { transition: box-shadow .2s ease; }
.nav.scrolled { box-shadow: 0 1px 0 rgba(16, 28, 45, .03), 0 6px 18px rgba(16, 28, 45, .07); }

/* ---- 首页 hero：渐变缓慢流动（纯 CSS，0KB）---- */
.hero {
    background-size: 200% 200%;
    animation: heroDrift 26s ease-in-out infinite alternate;
}
@keyframes heroDrift {
    from { background-position: 0% 40%; }
    to   { background-position: 100% 60%; }
}

/* ---- 卡片：hover 轻微上浮 ---- */
.cat, .pick-row { transition: border-color .16s ease, box-shadow .18s ease, transform .18s ease; }
.cat:hover, .pick-row:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(24, 95, 165, .09); }

/* 商品行整行可点：把按钮的伪元素铺满整行。
   手机上尤其重要 —— 不用瞄准右下角那个小按钮，点哪儿都进详情。 */
.pick-row { position: relative; }
.pick-row .pick-buy .btn::after { content: ''; position: absolute; inset: 0; }

/* ---- 分页：补上 hover 反馈（原来只有"当前页"有样式）---- */
.pager a:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* 客服球固定在右下角，会压住产品列表最后一行的"查看/选购"。
   右栏留出它的高度，滚到底时最后一个按钮不会被盖住。
   （中途滚动时的瞬时重叠没法根治，但整行可点已经兜住了 —— 点行的任何位置都能进详情。） */
.pick-main { padding-bottom: 92px; }

/* ---- 滚动入场（类名由 JS 挂：脚本没跑或跑挂了，元素就是普通可见状态）---- */
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.in {
    opacity: 1; transform: none;
    transition: opacity .5s ease, transform .5s cubic-bezier(.16, .84, .28, 1);
}

/* ---- 移动端：产品选择页左树改成横向滑动条 ----
   竖着排 11 个栏目的话，手机上要划好几屏才看到商品；横滑一行、手指一甩就换栏目。 */
@media (max-width: 820px) {
    .pick-side {
        display: flex; align-items: center; gap: 8px;
        width: 100%; max-width: none; flex: none;
        padding: 0 0 6px; border: 0; background: transparent;
        overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .pick-side::-webkit-scrollbar { display: none; }
    .pick-side > * { flex: 0 0 auto; }
    .pick-all, .pick-sub {
        padding: 6px 13px; border: 1px solid var(--c-border);
        border-radius: 999px; background: var(--c-white);
        font-size: 13px; white-space: nowrap;
    }
    .pick-sub.is-sub { padding-left: 13px; }
    /* 大栏目标签只当分隔符用，别做成"假装能点的胶囊" */
    .pick-grp {
        border-top: 0; margin: 0; padding: 0 4px;
        white-space: nowrap; background: transparent;
    }
}


