/* Futu 超市 · 代理后台 */

:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --line: #e4e8e6;
  --line-strong: #cfd6d2;
  --ink: #101815;
  --ink-2: #4a5651;
  --ink-3: #87938d;
  --brand: #0f9d76;
  --brand-ink: #0a7a5b;
  --brand-soft: #e4f5ef;
  --side: #0d1512;
  --side-2: #16211c;
  --side-ink: #b9c6bf;
  --amber: #a86a0a;
  --amber-soft: #fcf1d9;
  --red: #c2362f;
  --red-soft: #fdebe9;
  --blue: #2463c9;
  --blue-soft: #e7effc;
  --gray-soft: #eef1ef;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(13, 21, 18, 0.05);
  --shadow-pop: 0 12px 40px rgba(13, 21, 18, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
/* 带 hidden 属性的元素一律不显示：不然 .note、.btn 这些自己写了 display 的会把它盖掉 */
[hidden] { display: none !important; }
.boot { display: grid; place-items: center; height: 100dvh; color: var(--ink-3); }

/* ---------- 登录 ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, #d9f0e7 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 110%, #e3ece8 0%, transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px 26px;
  box-shadow: 0 20px 60px rgba(13, 21, 18, 0.08);
}
.login-card h1 { font-size: 21px; letter-spacing: 0.01em; margin-top: 16px; }
.login-card .sub { color: var(--ink-3); margin: 2px 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; height: 42px; margin-top: 6px; font-size: 15px; }
.login-card .foot { margin-top: 16px; font-size: 12.5px; color: var(--ink-3); text-align: center; line-height: 1.7; }
.login-card .foot a.disabled { color: var(--ink-3); pointer-events: none; text-decoration: none; }
.login-card .howto { margin: 0 0 18px; font-size: 13.5px; }
.login-card a.btn { display: grid; place-items: center; text-decoration: none; }
.code-input { font-family: var(--mono); font-size: 24px; letter-spacing: 0.42em; text-align: center; height: 50px; padding-left: 0.42em; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
}

/* ---------- 外壳 ---------- */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.side {
  background: var(--side);
  color: var(--side-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh;
  padding: 16px 12px max(12px, env(safe-area-inset-bottom));
  /* 三段：上面店名、中间菜单、底下账号栏。菜单多了、窗口矮了，只有中间那段自己滚，
     底下的账号栏（退出登录在那里）永远完整露着，不会被菜单挤出屏幕 */
  overflow: hidden;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff; flex: none; }
.side .nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -6px; padding: 0 6px 10px;
  scrollbar-width: thin; scrollbar-color: #2a3a33 transparent;
}
.side .nav::-webkit-scrollbar { width: 6px; }
.side .nav::-webkit-scrollbar-thumb { background: #2a3a33; border-radius: 3px; }
.side .brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
.side .brand b { font-size: 15px; font-weight: 650; }
.side .brand small { display: block; font-size: 11.5px; color: #7f8f87; font-weight: 400; margin-top: -1px; }
.nav-group { font-size: 11.5px; color: #6f7f77; padding: 14px 10px 6px; letter-spacing: 0.06em; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 2px;
  border-radius: 8px; color: var(--side-ink);
}
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.active { background: #1c2b25; color: #fff; }
.nav a.active svg { color: #4fd3aa; }
.nav a .count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: #b7791f; color: #fff; font-size: 11.5px; text-align: center; line-height: 18px;
}
svg { width: 18px; height: 18px; flex: none; }
.nav svg, .btn svg { width: 17px; height: 17px; }
.topbar svg { width: 22px; height: 22px; }
.step .n svg { width: 14px; height: 14px; }
.side .who {
  flex: none; padding: 12px 10px 4px; border-top: 1px solid #1e2a25;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 -12px 14px -12px rgba(0, 0, 0, 0.55);  /* 菜单还能往下滚的时候，这里看得出上面压着东西 */
}
/* 菜单底下固定的一排小链接（使用指南、免责声明）：不跟着菜单滚，一直在 */
.side .foot-links {
  flex: none; display: flex; gap: 4px; padding: 8px 0; border-top: 1px solid #1e2a25;
  box-shadow: 0 -12px 14px -12px rgba(0, 0, 0, 0.55);
}
.side .foot-links a {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 4px; border-radius: 8px; color: var(--side-ink); font-size: 12.5px; white-space: nowrap;
}
.side .foot-links a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.side .foot-links a.active { background: #1c2b25; color: #fff; }
.side .foot-links a.active svg { color: #4fd3aa; }
.side .foot-links svg { width: 15px; height: 15px; }
.side .foot-links + .who { box-shadow: none; }
/* 窗口不够高就把菜单排紧一点，目标是常见的笔记本屏幕上一屏放得下、不用滚。越矮排得越紧 */
@media (max-height: 900px) {
  .side { padding-top: 12px; }
  .side .brand { padding-bottom: 8px; }
  .nav-group { padding: 9px 10px 4px; }
  .nav a { padding: 6px 10px; margin-bottom: 1px; }
  .side .foot-links { padding: 6px 0; }
  .side .who { padding-top: 9px; }
}
@media (max-height: 780px) {
  .nav-group { padding: 7px 10px 3px; }
  .nav a { padding: 5px 10px; line-height: 1.4; }
  .side .foot-links a { padding: 5px 4px; }
}
@media (max-height: 690px) {
  .side { padding-top: 10px; }
  .side .brand { padding-bottom: 5px; }
  .nav-group { padding: 5px 10px 2px; font-size: 11px; }
  .nav a { padding: 4px 10px; font-size: 13.5px; line-height: 1.35; margin-bottom: 0; }
  .side .foot-links { padding: 4px 0; }
  .side .who { padding-top: 7px; }
}
@media (max-height: 620px) {
  .nav-group { padding: 4px 10px 1px; }
  .nav a { padding: 3px 10px; }
}
.side .who .name { color: #e7eeea; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .who .role { font-size: 11.5px; color: #7f8f87; }
.side .who button {
  margin-left: auto; background: none; border: 0; color: #8fa097; cursor: pointer;
  padding: 6px; border-radius: 6px; display: grid;
}
.side .who button:hover { background: var(--side-2); color: #fff; }

.main { min-width: 0; }
.topbar {
  display: none; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--side); color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.topbar button { background: none; border: 0; color: #fff; padding: 6px; display: grid; cursor: pointer; }
.topbar b { font-weight: 600; }
.page { padding: 26px 30px 60px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 650; letter-spacing: 0.01em; }
.page-head p { color: var(--ink-3); margin-top: 2px; font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.scrim { display: none; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 15px; font-weight: 620; }
.card-head .sub { color: var(--ink-3); font-size: 13px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- 指标块 ---------- */
.stat { padding: 16px 18px; }
.stat .label { color: var(--ink-2); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; margin-top: 4px; line-height: 1.2; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.stat .foot { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.mini-stats > div { padding: 12px 18px; border-right: 1px solid var(--line); }
.mini-stats > div:last-child { border-right: 0; }
.mini-stats .label { color: var(--ink-3); font-size: 12.5px; }
.mini-stats .value { font-weight: 620; font-size: 15px; }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-weight: 520; cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); border-color: #b9c2bd; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.danger { color: var(--red); border-color: #e7c1be; }
.btn.danger:hover { background: var(--red-soft); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.link { border: 0; background: none; color: var(--brand-ink); padding: 0 4px; height: auto; }
.btn.link.danger { color: var(--red); }
.btn[disabled] { opacity: 0.55; cursor: default; pointer-events: none; }

.field { display: block; }
.field > span, .field > label { display: block; font-size: 13px; font-weight: 520; color: var(--ink-2); margin-bottom: 5px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; min-height: 92px; line-height: 1.55; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 157, 118, 0.14); }
.input::placeholder { color: #a5aea9; }
.input.sm { height: 32px; padding: 0 9px; font-size: 13px; }
.input.num { text-align: right; }
.form { display: grid; gap: 15px; }
.form.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.with-suffix { position: relative; }
.with-suffix .input { padding-right: 34px; }
.with-suffix i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); font-size: 13px; pointer-events: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 36px; height: 21px; border-radius: 12px; background: #c9d0cc; transition: background 0.15s; flex: none; position: relative; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.toolbar .input { width: auto; min-width: 120px; height: 34px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar .spacer { flex: 1; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 12px 11px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 520; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--brand-ink); border-bottom-color: var(--brand); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-weight: 520; font-size: 12.5px; color: var(--ink-3);
  padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcfb; }
.table th.right, .table td.right { text-align: right; }
.table td .sub { color: var(--ink-3); font-size: 12.5px; }
.table .title { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .act { white-space: nowrap; text-align: right; }
.table .act .btn + .btn { margin-left: 4px; }
.table tr.clickable { cursor: pointer; }
.table tr.dim td { color: var(--ink-3); }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-weight: 560; margin-bottom: 4px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.pager .spacer { flex: 1; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 520; white-space: nowrap; background: var(--gray-soft); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge.plain::before { display: none; }
.badge.green { background: var(--brand-soft); color: var(--brand-ink); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- 提示条 ---------- */
.note { display: flex; gap: 10px; padding: 11px 14px; border-radius: 9px; background: var(--blue-soft); color: #1d4a94; font-size: 13.5px; margin-bottom: 16px; align-items: flex-start; }
.note.warn { background: var(--amber-soft); color: #7a4d05; }
.note.bad { background: var(--red-soft); color: #8f2823; }
/* 回调验证没通过：要一眼看到，并且说清楚卡在哪 */
.note.cb-stuck { border: 1.5px solid var(--red); font-size: 14px; line-height: 1.7; }
.note.ok { background: var(--brand-soft); color: #0a6048; }
.note svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.note a { color: inherit; text-decoration: underline; }
.note .btn { margin-left: auto; flex: none; }
/* 管理员概览页顶上的「需要留意」：同一类事合成一行，一个框装下 */
.note.attention ul { margin: 6px 0 0; padding-left: 18px; }
.note.attention li { margin: 3px 0; line-height: 1.65; }
.note.attention li a { white-space: nowrap; }
.note.attention .btn { align-self: flex-start; }
.attention-more { font-size: 12.5px; margin: -6px 0 14px; }
.attention-more .btn.link { font-size: 12.5px; }

/* ---------- 开店步骤 ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step { padding: 16px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.step:last-child { border-right: 0; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 650; background: var(--gray-soft); color: var(--ink-2); margin-bottom: 4px; }
.step.done .n { background: var(--brand); color: #fff; }
.step b { font-weight: 600; }
.step p { color: var(--ink-3); font-size: 12.5px; flex: 1; }
.step a { font-size: 13px; margin-top: 6px; font-weight: 520; }
.step.done a { color: var(--ink-3); }

/* ---------- 图表 ---------- */
.viz { position: relative; padding: 14px 18px 6px; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz .grid-line { stroke: var(--line); stroke-width: 1; }
.viz .axis-text { fill: var(--ink-3); font-size: 11px; }
.viz .val-text { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.viz .bar { fill: var(--brand); transition: fill 0.1s; }
.viz .slot:hover .bar, .viz .slot:focus .bar { fill: var(--brand-ink); }
.viz .slot { outline: none; cursor: default; }
.viz .slot .hit { fill: transparent; }
.viz .slot:hover .hit, .viz .slot:focus-visible .hit { fill: rgba(16, 24, 21, 0.04); }
.viz-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 8px 10px;
  font-size: 12.5px; line-height: 1.5; white-space: nowrap;
  transform: translate(-50%, -100%); box-shadow: var(--shadow-pop);
}
.viz-tip b { display: block; font-weight: 600; }
.viz-tip span { color: #b9c6bf; }
.rows { padding: 6px 18px 14px; }
.rows .row { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; }
.rows .row .meter { height: 6px; border-radius: 3px; background: var(--gray-soft); overflow: hidden; }
.rows .row .meter i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.rows .row .v { font-weight: 600; white-space: nowrap; }
.rows .row .v small { color: var(--ink-3); font-weight: 400; margin-left: 6px; }

/* ---------- 键值 ---------- */
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 9px 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-all; }
.codebox { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.copy { border: 0; background: none; color: var(--brand-ink); cursor: pointer; font-size: 12.5px; padding: 0 4px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c2c9c5; margin-right: 6px; }
.dot.on { background: var(--brand); box-shadow: 0 0 0 3px rgba(15, 157, 118, 0.18); }
.dot.err { background: var(--red); }

/* ---------- 机器人预览 ---------- */
.botcard { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.botcard .avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 19px; flex: none; }
.botcard .meta b { font-size: 15.5px; display: block; }
.botcard .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; flex: none; }
.price-grid { display: grid; gap: 8px; margin-top: 2px; }
.price-grid label { display: grid; grid-template-columns: 68px 130px auto minmax(0, 1fr); gap: 10px; align-items: center; }
.price-grid em { font-style: normal; color: var(--ink-2); font-size: 13px; }
.price-grid small { color: var(--ink-3); font-size: 12.5px; }
.price-grid.tiers label { grid-template-columns: 62px 150px 170px auto minmax(0, 1fr); }
.price-grid.tiers label.head b { font-weight: 550; font-size: 12.5px; color: var(--ink-2); }
.btn.ghost { border-color: transparent; background: none; color: var(--brand-ink); padding-left: 6px; padding-right: 6px; }
.btn.ghost:hover { background: var(--brand-soft); }
.quote-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 12px; background: var(--surface-2); }
.quote-box .label { color: var(--ink-3); font-size: 12.5px; }
.quote-box .big { font-size: 20px; margin: 4px 0 10px; letter-spacing: -0.01em; }
.quote-box .hint { color: var(--ink-3); font-size: 12px; margin-top: 8px; }
.table.compact th, .table.compact td { padding: 7px 10px; font-size: 13px; }
.form.cols .toggle-row.full, .form.cols .full { grid-column: 1 / -1; }
.toggle-row { display: flex; gap: 12px; align-items: flex-start; padding: 2px 0; }
.toggle-row .switch { margin-top: 2px; }
.toggle-row b { font-weight: 600; display: block; }
.toggle-row p { margin: 1px 0 0; color: var(--ink-3); font-size: 12.5px; }
.howto { counter-reset: step; display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.howto li { counter-increment: step; display: flex; gap: 10px; color: var(--ink-2); }
.howto li::before { content: counter(step); width: 21px; height: 21px; border-radius: 50%; background: var(--gray-soft); display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; margin-top: 1px; }
.phone { background: #dfe7e3; border-radius: 14px; padding: 14px; }
.phone .bubble { background: #fff; border-radius: 12px 12px 12px 4px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.phone .keys { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }
.phone .keys span { background: rgba(255,255,255,.72); border-radius: 7px; text-align: center; padding: 6px 4px; font-size: 12.5px; color: #25604c; }
.phone .keys span.custom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 「我的机器人」页右边那一栏（预览 + 可以改的地方）：左边很长，往下滑的时候它一直跟着；屏幕矮放不下时它自己能滚 */
.grid.split > .sticky-col { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 2px; scrollbar-width: thin; }
.sticky-col > .card:last-child { margin-bottom: 0; }
.phone [data-goto] { cursor: pointer; border-radius: 4px; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .12s; }
.phone .keys [data-goto] { border-radius: 7px; outline-offset: 0; }
.phone [data-goto]:hover, .phone .pointed { outline-color: var(--brand); }
.goto-box { border-top: 1px solid var(--line); padding: 12px 18px 16px; }
.goto-box__title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.goto-box__title b { font-weight: 620; font-size: 13.5px; }
.goto-box__title span { color: var(--ink-3); font-size: 12px; }
.goto-list { display: flex; flex-wrap: wrap; gap: 7px; }
.goto { display: inline-flex; align-items: center; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.goto:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.goto:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.card[data-sec] { scroll-margin-top: 16px; transition: box-shadow .25s, border-color .25s; }
.card[data-sec]:focus { outline: none; }
.card[data-sec].flash { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 157, 118, .28); }
@media (max-width: 1020px) { .grid.split > .sticky-col { position: static; max-height: none; overflow: visible; padding-bottom: 0; } }
@media (max-width: 820px) { .card[data-sec] { scroll-margin-top: 64px; } }
/* 使用指南：顶上的搜索框和分类一直跟着（这一页很长），下面一节一张卡片、一条功能一行 */
.guide-top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0 12px; margin: -10px 0 4px; }
.guide-search { width: 100%; height: 42px; font-size: 15px; padding: 0 14px; }
.guide-chips { margin-top: 10px; }
.guide-count { margin: 8px 2px 0; font-size: 12.5px; }
.guide-sec .card-head h2 { white-space: nowrap; }
.guide-sec:focus { outline: none; }
.guide-item { display: flex; align-items: flex-start; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); }
.guide-item:first-child { border-top: 0; }
.guide-item[hidden] { display: none; }
.guide-item > div { flex: 1; min-width: 0; }
.guide-item b { font-weight: 620; }
.guide-item p { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; }
.guide-item code { font-family: var(--mono); font-size: 12.5px; background: var(--gray-soft); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.guide-item .btn { flex: none; white-space: nowrap; }
@media (max-width: 820px) {
  /* 手机上：顶上还有一条深色的栏；分类排成一行、左右滑，不然十几个分类要占掉半屏 */
  .guide-top { top: 46px; }
  .guide-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .guide-chips::-webkit-scrollbar { display: none; }
  .guide-chips .goto { flex: none; }
  .guide-item { flex-direction: column; gap: 8px; }
}
/* 「我的机器人」页：首页自定义按钮的编辑行 */
.cbtn { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; display: grid; gap: 8px; background: var(--surface-2); }
.cbtn__head { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; align-items: center; }
.cbtn textarea.input { min-height: 84px; }
@media (max-width: 560px) { .cbtn__head { grid-template-columns: 1fr; } }

/* ---------- 弹窗 / 提示 ---------- */
#modal-root:empty { display: none; }
.modal-back { position: fixed; inset: 0; background: rgba(13, 21, 18, 0.45); display: grid; place-items: center; padding: 20px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 460px; box-shadow: var(--shadow-pop); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px 12px; }
.modal-head h3 { font-size: 16px; font-weight: 640; }
.modal-head button { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--ink-3); padding: 4px; display: grid; border-radius: 6px; }
.modal-head button:hover { background: var(--gray-soft); color: var(--ink); }
.modal-body { padding: 4px 20px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.modal h4 { font-size: 13px; color: var(--ink-3); font-weight: 520; margin: 18px 0 8px; }

#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 9px; box-shadow: var(--shadow-pop); font-size: 13.5px; max-width: min(88vw, 480px); animation: pop 0.16s ease-out; }
.toast.bad { background: var(--red); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
/* 必须先做的一步（TRXX 回调地址）：做成醒目的一块，免得被当成普通说明略过去 */
.must-do { border: 2px solid var(--amber); background: var(--amber-soft); border-radius: 12px; padding: 14px 16px; color: #5c3a04; }
.must-do__title { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #7a4d05; }
.must-do__title svg { width: 20px; height: 20px; flex: none; }
.must-do p { margin-top: 8px; font-size: 13.5px; line-height: 1.65; }
.must-do ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 9px; font-size: 13.5px; line-height: 1.65; }
.must-do ol .btn { margin-left: 6px; vertical-align: middle; }
.must-do .codebox { background: #fff; border-color: #e6c88a; color: var(--ink); }
.must-do__foot { font-size: 12.5px !important; opacity: 0.85; }
.must-do.done { border-color: var(--line-strong); border-width: 1px; background: var(--surface-2); color: var(--ink-2); }
.must-do.done .must-do__title { color: var(--ink-2); }
.must-check { margin-top: 2px; padding: 10px 12px; border: 1.5px solid var(--amber); border-radius: 10px; background: var(--amber-soft);
  font-size: 13.5px; color: #5c3a04; }
.must-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); }

/* 二选一的卡片式单选（能量：实时价 / 固定价） */
.mode-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-pick label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line-strong);
  border-radius: 10px; cursor: pointer; background: var(--surface); }
.mode-pick label.on { border-color: var(--brand); background: var(--brand-soft); }
.mode-pick input { margin-top: 3px; flex: none; accent-color: var(--brand); }
.mode-pick b { font-size: 14px; }
.mode-pick p { margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }
@media (max-width: 640px) { .mode-pick { grid-template-columns: minmax(0, 1fr); } }

/* 定价页里一个渠道一段的小标题（会员：官方开通 / 低价开通） */
.channel-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.channel-head h3 { font-size: 14.5px; font-weight: 640; }
.channel-head .muted { font-size: 12.5px; }

/* ---------- 群发记录 ---------- */
.bc-item { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.bc-item:last-child { border-bottom: 0; }
.bc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.bc-top .actions { margin-left: auto; }
.bc-body { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 10px; }
.bc-thumb { flex: none; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.bc-photo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bc-photo .btn { cursor: pointer; }
.bc-preview { display: block; margin-top: 10px; max-width: 240px; max-height: 240px; border-radius: 10px; border: 1px solid var(--line); }
.bc-preview[hidden] { display: none; }
.bc-text { flex: 1; min-width: 0; margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); font-size: 13.5px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bc-bar { height: 6px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.bc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.3s ease-out; }
.bc-bar.running i { background: var(--blue); }
.bc-bar.interrupted i { background: var(--amber); }
.bc-bar.stopped i { background: var(--ink-3); }
.bc-nums { margin-top: 7px; font-size: 12.5px; color: var(--ink-3); }
.bc-nums b { color: var(--ink-2); font-weight: 560; }
.bc-note { margin-top: 4px; font-size: 12.5px; color: #7a4d05; }

/* 卡片底部折叠起来的说明（收款通道的到账规则等） */
details.more { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
details.more summary { cursor: pointer; font-size: 13px; font-weight: 520; color: var(--ink-2); }
details.more .txt { margin-top: 10px; font-size: 12.5px; line-height: 1.75; color: var(--ink-3); }
details.more .txt b { color: var(--ink-2); }

/* ---------- 免责声明：签署页 / 签好的那一份 ---------- */
.agree {
  min-height: 100dvh;
  padding: 28px 16px 60px;
  background:
    radial-gradient(900px 500px at 15% -10%, #d9f0e7 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 110%, #e3ece8 0%, transparent 60%),
    var(--bg);
}
.agree-card {
  max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px 30px 30px; box-shadow: 0 20px 60px rgba(13, 21, 18, 0.08);
}
.agree-top { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.agree-top .t { min-width: 0; flex: 1; display: grid; }
.agree-top .t b { font-size: 16px; }
.agree-top .t small { color: var(--ink-3); font-size: 13px; }
.agree-top .btn { flex: none; }

.agree-doc { font-size: 14.5px; line-height: 1.8; color: var(--ink); }
.agree-doc h2 { font-size: 20px; font-weight: 660; text-align: center; letter-spacing: 0.02em; }
.agree-doc .ver { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: 2px 0 16px; }
.agree-doc h3 { font-size: 15px; font-weight: 640; margin: 20px 0 6px; }
.agree-doc p { margin: 0 0 6px; color: var(--ink-2); }
.agree-doc .clause { display: grid; grid-template-columns: 22px minmax(0, 1fr); }
.agree-doc .confirm { margin-top: 18px; color: var(--ink); font-weight: 560; }
.agree-doc .clause > span:first-child { color: var(--ink-3); }
/* 「赔偿上限」这一节整节加重：这是整份声明里最要紧的一条 */
.agree-doc h3.key { color: #7a4d05; margin-top: 22px; padding: 10px 14px 0; background: var(--amber-soft); border-radius: 10px 10px 0 0; margin-bottom: 0; }
.agree-doc .clause.key { color: #5c3a04; font-weight: 520; background: var(--amber-soft); margin: 0; padding: 4px 14px; }
.agree-doc .clause.key > span:first-child { color: #a86a0a; }
.agree-doc h3.key + .clause.key { padding-top: 6px; }
.agree-doc .clause.key + :not(.clause.key) { margin-top: 0; }
.agree-doc .clause.key:has(+ :not(.clause.key)), .agree-doc .clause.key:last-child { border-radius: 0 0 10px 10px; padding-bottom: 12px; }

.agree-sign { display: grid; gap: 16px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.agree-sign h3 { font-size: 16px; font-weight: 640; }
.agree-sign .btn.primary { height: 44px; font-size: 15px; }
.agree-sign .check { font-size: 14px; color: var(--ink); line-height: 1.65; }
.agree-sign .check input { width: 16px; height: 16px; margin-top: 4px; }
.agree-sign .foot { font-size: 12.5px; color: var(--ink-3); text-align: center; line-height: 1.7; }
.sigpad { position: relative; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: #fff; overflow: hidden; }
.sigpad canvas { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.sigpad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #a5aea9; font-size: 14px; pointer-events: none; }
.sigpad-hint[hidden] { display: none; }
.sigpad-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.sigpad-tools .hint { margin: 0; flex: 1; }

.agree-record { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 22px; align-items: start;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.agree-record .kv { grid-template-columns: 78px minmax(0, 1fr); font-size: 13.5px; }
.sigbox { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; background: #fff; }
.sigbox .cap { font-size: 12px; color: var(--ink-3); }
.sigbox .sig { display: block; width: 100%; height: auto; color: var(--ink); }
.sigbox .who { border-top: 1px solid var(--line); padding-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.agree-paper .card-body { padding: 28px 32px; }
/* 管理员改声明的编辑框 */
textarea.agree-editor { min-height: 460px; line-height: 1.75; resize: vertical; font-size: 14px; }
.unsigned { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
@media (max-width: 720px) {
  .agree { padding: 0; }
  .agree-card { border-radius: 0; border-left: 0; border-right: 0; padding: 18px 16px 28px; }
  .agree-record { grid-template-columns: minmax(0, 1fr); }
  .agree-paper .card-body { padding: 18px 16px; }
}
/* 打印 / 另存为 PDF：只留签好的那一份 */
@media print {
  body { background: #fff; }
  .side, .topbar, .scrim, [data-banner], .page-head, .no-print, #toast-root, #modal-root { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .agree-paper { border: 0; box-shadow: none; }
  .agree-paper .card-body { padding: 0; }
  .agree-doc h3.key, .agree-doc .clause.key { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; }
  .side { position: fixed; z-index: 40; width: 244px; left: 0; top: 0; transform: translateX(-102%); transition: transform 0.18s ease-out; }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(13, 21, 18, 0.45); z-index: 30; }
  .page { padding: 18px 14px 50px; }
  .grid.c2 { grid-template-columns: minmax(0, 1fr); }
  .form.cols { grid-template-columns: minmax(0, 1fr); }
  .price-grid label { grid-template-columns: 62px minmax(0, 1fr) auto; }
  .price-grid.tiers label { grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr); }
  .price-grid.tiers label .btn, .price-grid.tiers label.head i { display: none; }
  .price-grid small { grid-column: 1 / -1; }
  .stat .value { font-size: 22px; }
  .card-body { padding: 14px; }
  .card-head, .toolbar { padding-left: 14px; padding-right: 14px; }
  .page-head .actions { margin-left: 0; width: 100%; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .mini-stats { grid-template-columns: minmax(0, 1fr); }
  .mini-stats > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .mini-stats > div:last-child { border-bottom: 0; }
  .kv { grid-template-columns: 80px minmax(0, 1fr); }
}

/* 充值记录页顶上那一行：现在开着哪些收款通道（只看不改，改去「收款设置」） */
.pay-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; font-size: 13px; color: var(--ink-2); }
.pay-strip .badge.off { color: var(--ink-3); }
.pay-strip .muted { margin-left: 4px; }
/* 收款设置页：两种通道并排，最低金额单独一张窄卡片 */
.pay-grid { align-items: start; margin-bottom: 16px; }
.pay-min { max-width: 520px; }
@media (max-width: 900px) { .pay-grid { grid-template-columns: minmax(0, 1fr); } }

/* 系统日志 / 操作日志 */
.log-table td { vertical-align: top; }
.log-table .log-text { min-width: 260px; max-width: 560px; line-height: 1.55; word-break: break-word; }
.log-foot { padding: 0 18px 14px; margin: 0; font-size: 12.5px; color: var(--ink-3); }
.log-status { margin-bottom: 16px; align-items: stretch; }
.log-status p { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.log-stat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.trace { margin: 0; padding: 12px 14px; background: var(--side); color: #d7e2dc; border-radius: 8px; font-size: 12px;
  line-height: 1.55; overflow: auto; max-height: 55vh; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 900px) { .log-status { grid-template-columns: minmax(0, 1fr); } }
