/* ============================================================================
   商城页样式（mall.wjd8.cn）
   ----------------------------------------------------------------------------
   配色直接沿用客户端 app/renderer/index.html 的变量（同一个产品，同一个样子）。
   两条自我约束，和 CSP 配套：
     1. 不引外部字体 / 图标库 / CSS 框架 —— 全部用系统字体和内联 SVG、CSS 形状；
     2. 不用行内 style 属性（CSP 的 style-src 只有 'self'，没有 'unsafe-inline'）。
   ============================================================================ */

:root {
  --bg: #16161a;
  --bg2: #1e1e24;
  --bg3: #24242c;
  --line: #2c2c34;
  --fg: #e8e8ee;
  --dim: #9a9aa8;
  --accent: #fe2c55;
  --ok: #2ecc71;
  --blue: #4c8dff;
  --warn: #ffb020;
  --radius: 12px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.3; margin: 0 0 12px; }
h1 { font-size: 34px; letter-spacing: -0.5px; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
em { font-style: normal; color: var(--accent); }
small { color: var(--dim); font-weight: 400; font-size: 13px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- 顶栏 */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(22, 22, 26, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.top .wrap { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--fg); font-weight: 600; }
.brand:hover { text-decoration: none; }
.logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.nav { display: flex; gap: 16px; margin-left: auto; }
.nav a { color: var(--dim); }
.nav a:hover { color: var(--fg); text-decoration: none; }
.topact { display: flex; gap: 8px; align-items: center; }
.who { color: var(--dim); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg3); color: var(--fg);
  font: inherit; font-size: 14px; white-space: nowrap;
}
.btn:hover { background: #30303a; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #e0244b; }
.btn.ghost { background: transparent; }
.btn.big { height: 44px; padding: 0 22px; font-size: 15px; }
.btn.danger { background: #b3213b; border-color: #b3213b; color: #fff; }

/* ---------------------------------------------------------------- 通用块 */
.section { padding: 54px 0; }
.section.alt { background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lead { color: var(--dim); margin: 0 0 22px; max-width: 62ch; }
.note { color: var(--dim); font-size: 13px; margin-top: 18px; max-width: 70ch; }
.hint { color: var(--dim); font-size: 13px; margin: 10px 0 0; }
.err { color: #ff7a90; font-size: 13px; margin: 10px 0 0; }

.card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.section:not(.alt) .card { background: var(--bg2); }
.card h3 { margin-top: 0; }
.card.empty { text-align: center; padding: 34px 20px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- 首屏 */
.hero { padding: 64px 0 50px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 40px; margin-bottom: 16px; }
.sub { color: var(--dim); font-size: 16px; max-width: 60ch; margin: 0 0 26px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.facts li { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.facts b { display: block; margin-bottom: 4px; }
.facts span { color: var(--dim); font-size: 13px; }

/* ---------------------------------------------------------------- 套餐 */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.plan {
  position: relative; background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column;
}
.plan.best { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(254, 44, 85, 0.28); }
.badge {
  position: absolute; top: -11px; right: 18px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.price { display: flex; align-items: baseline; gap: 4px; margin: 6px 0 16px; }
.price .cur { font-size: 18px; color: var(--dim); }
.price b { font-size: 38px; font-weight: 700; letter-spacing: -1px; }
.price .per { color: var(--dim); font-size: 13px; }
.spec { list-style: none; margin: 0 0 14px; padding: 0; color: var(--dim); font-size: 14px; }
.spec li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.spec b { color: var(--fg); }
.feat { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feat li {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; color: var(--dim);
}
.plan .buy { margin-top: auto; width: 100%; }

/* ---------------------------------------------------------------- 账号 */
.auth { max-width: 420px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg3); padding: 4px; border-radius: 9px; }
.tab {
  flex: 1; height: 32px; border: 0; border-radius: 7px; background: transparent;
  color: var(--dim); font: inherit; cursor: pointer;
}
.tab.on { background: var(--bg); color: var(--fg); font-weight: 600; }
.pane { display: none; flex-direction: column; gap: 12px; }
.pane.on { display: flex; }
.pane label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--dim); }
.pane input {
  height: 38px; padding: 0 11px; border-radius: 8px; background: #121216;
  border: 1px solid var(--line); color: var(--fg); font: inherit;
}
.pane input:focus { outline: none; border-color: var(--blue); }
.pane .btn { margin-top: 4px; }

.rows { margin-bottom: 16px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--dim); font-size: 14px; }
.row .v { text-align: right; word-break: break-all; }
.actions { display: flex; gap: 8px; }
.steps { margin: 0; padding-left: 20px; color: var(--dim); font-size: 14px; }
.steps li { padding: 3px 0; }
.steps strong { color: var(--fg); }

/* ---------------------------------------------------------------- 设备表 */
.dev { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.dev th, .dev td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.dev th { color: var(--dim); font-weight: 500; font-size: 13px; }
.dev tr:last-child td { border-bottom: 0; }
.dev .cur * { color: var(--fg); }
.dev .tagcur {
  margin-left: 6px; font-size: 12px; color: var(--ok);
  border: 1px solid rgba(46, 204, 113, 0.4); border-radius: 999px; padding: 1px 7px;
}
.dev .btn { height: 30px; padding: 0 12px; font-size: 13px; }

/* ---------------------------------------------------------------- FAQ */
details {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 10px;
}
details summary { cursor: pointer; font-weight: 600; }
details summary::marker { color: var(--accent); }
details p { color: var(--dim); margin: 10px 0 0; }

/* ---------------------------------------------------------------- 页脚 */
.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--dim); font-size: 13px; }
.foot p { margin: 0 0 6px; }
.fine { max-width: 72ch; }

/* ---------------------------------------------------------------- 弹窗 */
.dlg {
  width: min(440px, 92vw); padding: 0; border: 1px solid #34343e; border-radius: 14px;
  background: #1c1c22; color: var(--fg); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.dlghead { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dlghead h3 { margin: 0; }
.dlghead .x {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line);
  background: transparent; color: var(--dim); font-size: 17px; line-height: 1; cursor: pointer;
}
.dlghead .x:hover { background: var(--bg3); color: var(--fg); }
.dlgbody { padding: 18px; }
.dlgbody p { margin: 0 0 12px; color: var(--dim); font-size: 14px; }
.dlgbody .btn { width: 100%; }
.dlgbody .amount { font-size: 30px; font-weight: 700; color: var(--fg); }
.qr {
  width: 218px; height: 218px; margin: 6px auto 14px; display: block;
  background: #fff; border-radius: 10px; padding: 10px; object-fit: contain;
}
.order-no { font-family: ui-monospace, Consolas, monospace; color: var(--dim); font-size: 12px; word-break: break-all; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.pill.wait { background: rgba(255, 176, 32, 0.14); color: var(--warn); }
.pill.ok { background: rgba(46, 204, 113, 0.14); color: var(--ok); }
.pill.bad { background: rgba(254, 44, 85, 0.14); color: var(--accent); }

/* ---------------------------------------------------------------- 提示 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--bg3); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 18px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  max-width: 90vw; z-index: 60;
}
.toast.ok { border-color: rgba(46, 204, 113, 0.5); }
.toast.err { border-color: rgba(254, 44, 85, 0.5); }

/* ---------------------------------------------------------------- 窄屏 */
@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .nav { display: none; }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; }
  .brandtext { display: none; }
  .topact { margin-left: auto; }
  .dev th:nth-child(3), .dev td:nth-child(3) { display: none; }
}
