/* AI 会员自助充值（ai.<domain>，app/vcc）。独立样式表，品牌色为翠绿。
   与 GeekxyPro兑换站前台同一套规则：系统界面字体；字号 12 / 13 / 15 / 17 / 21 / 28 px；字重只用 400 与 600；
   间距取 4 的倍数；绿色是唯一强调色，琥珀只表示“注意”，红只表示失败。 */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-caption: 12px;
  --fs-footnote: 13px;
  --fs-sub: 15px;
  --fs-body: 17px;
  --fs-title3: 21px;
  --fs-title2: 28px;

  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eff4f1;
  --fill: rgba(19, 32, 27, 0.06);
  --line: #dde6e1;
  --line-strong: #b9c7c0;
  --text: #13201b;
  --muted: #5d6f67;
  --faint: #8a9a93;
  --accent: #0f9f6e;
  --accent-strong: #0b7d56;
  --accent-soft: #e0f5ec;
  --accent-ring: rgba(15, 159, 110, 0.22);
  --amber: #a86d00;
  --amber-soft: #fbf1dc;
  --danger: #c2413b;
  --danger-soft: #fbe7e5;
  --radius: 20px;
  --shadow: 0 0 0 1px rgba(16, 32, 26, 0.05), 0 8px 28px rgba(16, 32, 26, 0.06);
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1210;
    --surface: #131c18;
    --surface-2: #19241f;
    --fill: rgba(230, 239, 234, 0.08);
    --line: #26352e;
    --line-strong: #3a4c44;
    --text: #e6efea;
    --muted: #97aaa1;
    --faint: #73867d;
    --accent: #35c78f;
    --accent-strong: #5bd9a7;
    --accent-soft: #143428;
    --accent-ring: rgba(53, 199, 143, 0.3);
    --amber: #e3ad45;
    --amber-soft: #2f240d;
    --danger: #ef7a72;
    --danger-soft: #3a1b19;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

/* ── 基础 ─────────────────────────────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--fs-sub);
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
b, strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-ring); }
.hidden { display: none !important; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { top: 12px; left: 16px; z-index: 10; padding: 8px 12px; border-radius: 8px; background: var(--surface); }
/* 背景一抹柔光，只在右上角，不抢内容 */
.glow { position: fixed; z-index: 0; border-radius: 50%; filter: blur(96px); pointer-events: none; }
.glow-a { top: -200px; right: -160px; width: 460px; height: 460px; background: var(--accent); opacity: 0.16; }
.glow-b { display: none; }

/* ── 顶栏 ─────────────────────────────────────────────────────────────────────────────────────────── */
.top, .wrap { position: relative; z-index: 1; width: min(720px, 100%); margin: 0 auto; padding: 0 20px; }
/* 状态文字较长（暂停接单）时整块换到下一行，不把站名挤成两行 */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding-top: 24px; padding-bottom: 4px; }
.brand { display: flex; flex: 1 1 auto; align-items: center; gap: 12px; min-width: min(100%, 13em); }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px;
  background: linear-gradient(145deg, #19b981, var(--accent-strong)); color: #fff; font-size: var(--fs-sub); font-weight: 600;
  box-shadow: 0 2px 8px rgba(11, 125, 86, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy b { overflow: hidden; font-size: var(--fs-body); line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy small { overflow: hidden; color: var(--muted); font-size: var(--fs-caption); text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; color: var(--muted); background: var(--fill); font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--accent-strong); background: var(--accent-soft); }
.pill-off { color: var(--amber); background: var(--amber-soft); }
.pill-checking i { animation: blink 1.4s ease-in-out infinite; }

/* ── 标题与流程 ───────────────────────────────────────────────────────────────────────────────────── */
.intro { padding: 32px 0 8px; }
.intro h1 { margin: 0 0 8px; font-size: var(--fs-title2); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.intro p { max-width: 52ch; margin: 0 0 20px; color: var(--muted); font-size: var(--fs-sub); line-height: 1.7; }
/* 三步流程：一行步骤条，序号 + 文字，中间细线相连 */
.flow { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.flow li { display: flex; flex: 1 1 0; align-items: center; gap: 8px; min-width: 0; color: var(--text); font-size: var(--fs-footnote); white-space: nowrap; }
.flow li:not(:last-child)::after { content: ""; flex: 1 1 auto; min-width: 12px; height: 1px; margin: 0 12px 0 4px; background: var(--line-strong); }
.flow b { display: grid; place-items: center; flex: none; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }

/* ── 分段切换 ─────────────────────────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; width: max-content; margin: 28px 0 16px; padding: 3px; border-radius: 11px; background: var(--fill); }
.tab { min-height: 34px; padding: 0 20px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font: inherit; font-size: var(--fs-sub); cursor: pointer; transition: color 0.2s var(--ease), background-color 0.2s var(--ease); }
.tab:hover:not(.active) { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05); font-weight: 600; }

/* ── 卡片与表单 ───────────────────────────────────────────────────────────────────────────────────── */
.card { margin-bottom: 16px; padding: 28px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.field { margin-bottom: 24px; }
.field label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: var(--fs-sub); font-weight: 600; }
.step-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--accent); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.row.tools { flex-wrap: wrap; margin-top: 8px; }
.row.tools .right, .hint.right { margin: 0 0 0 auto; }
#sessionPreview { min-width: 0; overflow-wrap: anywhere; }
.row.end { justify-content: flex-end; }
input, textarea {
  width: 100%; min-width: 0; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; outline: none;
  color: var(--text); background: var(--surface); font: inherit; font-size: var(--fs-sub);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input { height: 48px; font-family: var(--font-mono); letter-spacing: 0.02em; }
textarea { min-height: 152px; padding: 12px 14px; resize: vertical; font-family: var(--font-mono); font-size: var(--fs-footnote); line-height: 1.6; }
textarea.lookup-input { min-height: 96px; font-size: var(--fs-sub); }
input::placeholder, textarea::placeholder { color: var(--faint); font-family: var(--font-sans); letter-spacing: 0; opacity: 1; }
input:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--muted); }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent); }

.btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; font: inherit; font-size: var(--fs-sub); font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { cursor: not-allowed; }
.btn.primary { color: #fff; background: var(--accent); }
.btn.primary:not(:disabled):hover { background: var(--accent-strong); }
/* 不可提交时用中性灰，不再是一块看不清字的淡绿 */
.btn.primary:disabled { color: var(--faint); background: var(--fill); }
.btn.ghost { color: var(--text); background: var(--fill); }
.btn.ghost:not(:disabled):hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.btn.ghost:disabled { opacity: 0.5; }
.btn.link { padding: 0 8px; color: var(--accent-strong); background: none; }
.btn.link:hover { background: var(--accent-soft); }
.btn.small { min-height: 32px; padding: 0 12px; border-radius: 8px; font-size: var(--fs-footnote); }
.btn.block { width: 100%; min-height: 52px; border-radius: 14px; font-size: var(--fs-body); }

.hint { min-height: 1em; margin: 8px 0 0; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.6; }
.hint.error { color: var(--danger); }
.hint.ok { color: var(--accent-strong); }
.plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }
.plan small { display: block; color: var(--muted); font-size: var(--fs-caption); }
.plan b { font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
/* 注意事项：中性底色，琥珀色圆点 */
.notes { margin: 0 0 24px; padding: 14px 16px; border-radius: 14px; color: var(--text); background: var(--surface-2); font-size: var(--fs-footnote); line-height: 1.7; list-style: none; }
.notes li { position: relative; padding-left: 16px; }
.notes li::before { content: ""; position: absolute; top: 0.75em; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); transform: translateY(-50%); }
.notes li + li { margin-top: 6px; }
.message { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; color: var(--danger); background: var(--danger-soft); font-size: var(--fs-sub); }

/* ── 订单进度 ─────────────────────────────────────────────────────────────────────────────────────── */
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-head small, .order-meta dt { color: var(--muted); font-size: var(--fs-caption); }
.mono { font-family: var(--font-mono); word-break: break-all; }
.num { font-variant-numeric: tabular-nums; }
.order-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 16px 0; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.order-meta div { min-width: 0; }
.order-meta dd { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-meta dd.wrap-any { white-space: normal; overflow-wrap: anywhere; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; top: 24px; bottom: 0; left: 9px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline i { flex: none; width: 20px; height: 20px; margin-top: 2px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); }
.timeline b { display: block; font-size: var(--fs-sub); }
.timeline span { color: var(--muted); font-size: var(--fs-footnote); }
.timeline .done i { border-color: var(--accent); background: var(--accent); }
.timeline .done::before { background: var(--accent); }
.timeline .active i { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.6s ease-in-out infinite; }
.timeline .warn i { border-color: var(--amber); background: var(--amber); }
.timeline .fail i { border-color: var(--danger); background: var(--danger); }
.result { margin: 16px 0 12px; padding: 12px 14px; border-radius: 12px; font-size: var(--fs-sub); line-height: 1.7; }
.result.ok { color: var(--accent-strong); background: var(--accent-soft); }
.result.warn { color: var(--amber); background: var(--amber-soft); }
.result.fail { color: var(--danger); background: var(--danger-soft); }
.verify { display: grid; gap: 12px; margin: 0 0 12px; padding: 16px; border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: 14px; background: var(--amber-soft); }
.verify-copy b { display: block; margin-bottom: 4px; color: var(--text); }
.verify-copy p { margin: 0; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.6; }
.verify-copy .hint { margin-top: 8px; }
.verify a.btn { display: grid; place-items: center; text-align: center; text-decoration: none; }

/* ── 订单查询结果：每个卡密一行，可展开 ───────────────────────────────────────────────────────────── */
.results { padding: 24px; }
.results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.results-head b { font-size: var(--fs-body); }
.results-head .hint { margin-top: 2px; }
.results-list { display: grid; gap: 8px; }
.result-item { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.result-item[open] { border-color: color-mix(in srgb, var(--line) 50%, var(--accent)); }
.result-item summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 14px; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; user-select: none; }
.result-item summary::-webkit-details-marker { display: none; }
.result-item summary::after { content: ""; justify-self: center; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform 0.2s var(--ease); }
.result-item[open] summary::after { transform: translateY(2px) rotate(225deg); }
.result-item summary:hover { background: var(--surface-2); }
.result-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 14px; }
.result-code { overflow: hidden; font-size: var(--fs-sub); text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
.result-plan { color: var(--muted); font-size: var(--fs-footnote); white-space: nowrap; }
.badge { padding: 2px 10px; border-radius: 999px; color: var(--muted); background: var(--fill); font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
.badge-ok { color: var(--accent-strong); background: var(--accent-soft); }
.badge-busy { color: var(--accent); background: var(--accent-soft); }
.badge-warn { color: var(--amber); background: var(--amber-soft); }
.badge-fail { color: var(--danger); background: var(--danger-soft); }
.result-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.result-body .order-meta { margin: 12px 0; }
.result-body > .hint { margin: 8px 0 12px; }

/* ── 页脚、说明弹窗、提示 ─────────────────────────────────────────────────────────────────────────── */
.foot { padding: 8px 0 40px; color: var(--muted); font-size: var(--fs-footnote); text-align: center; }
.foot .version { display: block; margin-top: 4px; color: var(--faint); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.guide { width: min(460px, calc(100% - 32px)); padding: 0; border: 0; border-radius: var(--radius); color: var(--text); background: var(--surface); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); }
.guide::backdrop { background: rgba(5, 12, 9, 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.guide-inner { padding: 28px; }
.guide h2 { margin: 0 0 16px; font-size: var(--fs-title3); font-weight: 600; }
.guide ol { margin: 0 0 16px; padding-left: 20px; }
.guide li p { margin: 2px 0 12px; color: var(--muted); font-size: var(--fs-footnote); }
.guide a { color: var(--accent-strong); word-break: break-all; }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 20; padding: 10px 16px; border-radius: 12px; color: var(--bg); background: var(--text); font-size: var(--fs-footnote); transform: translateX(-50%); }

@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
@keyframes blink { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .timeline .active i, .pill-checking i { animation: none; }
  .result-item summary::after { transition: none; }
}

@media (max-width: 560px) {
  .top, .wrap { padding: 0 16px; }
  .top { padding-top: 16px; }
  .brand-copy small { display: none; }
  .intro { padding-top: 24px; }
  .intro h1 { font-size: var(--fs-title3); }
  .flow li { font-size: var(--fs-caption); }
  .flow li:not(:last-child)::after { margin: 0 8px 0 2px; }
  .tabs { margin-top: 24px; }
  .card { padding: 20px 16px; border-radius: 18px; }
  .results { padding: 16px; }
  /* 手机上输入框字号不低于 16px，iOS 才不会在聚焦时放大页面 */
  input { font-size: var(--fs-body); }
  .plan, .order-meta { grid-template-columns: minmax(0, 1fr); }
  .result-item summary { grid-template-columns: minmax(0, 1fr) auto 14px; }
  .result-plan { display: none; }
}
