/* GeekxyPro兑换站（原强兑换站）前台样式。
   一份独立的样式表：不再叠在权威站的 styles / workspace 之上，也不再有层层覆盖。
   设计参照苹果《人机界面准则》：清晰（文字和留白优先）、让位于内容（少装饰，一个强调色）、层次（毛玻璃导航、柔和的表面）。

   字体：只用系统界面字体（苹方 / SF / 微软雅黑 UI / 思源黑体），不加载外部字体。
   字号：12 / 13 / 15 / 17 / 21 / 28 / 36 px 七级，页面上不出现这七级以外的字号，也没有小于 12px 的字。
   字重：只用 400 和 600。中文字体大多只有常规与粗体两档，其余字重会被浏览器伪造或四舍五入，同一页上看起来忽粗忽细。
   间距：4 的倍数（4 / 8 / 12 / 16 / 24 / 32 / 48）。
   颜色：浅色与深色各一套，只有一个强调色（蓝）；绿、橙、红只表示成功、注意、失败。 */

/* ═══ 1. 令牌 ═══════════════════════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: light;

  --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", "WenQuanYi Micro Hei", 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;
  --fs-title1: 36px;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-hover: rgba(120, 120, 128, 0.18);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: #c7c7cc;

  --primary: #0071e3;
  --primary-hover: #0077ed;
  --primary-soft: rgba(0, 113, 227, 0.1);
  --primary-ring: rgba(0, 113, 227, 0.22);
  --btn: #0071e3;
  --btn-hover: #0077ed;
  --on-primary: #ffffff;
  --success: #248a3d;
  --danger: #d70015;
  --warning: #b25000;

  --bar-bg: rgba(245, 245, 247, 0.78);
  --ring: 0 0 0 1px rgba(0, 0, 0, 0.05);
  --lift: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.12);

  /* 旧页面和测试读取的控件令牌，保留名字 */
  --control-bg: #ffffff;
  --control-text: #1d1d1f;
  --control-placeholder: #86868b;
  --control-border: #c7c7cc;
  --control-hover: #8e8e93;
  --control-focus: #0071e3;
  --control-ring: rgba(0, 113, 227, 0.22);
  --control-muted-bg: #f5f5f7;
  --control-muted-text: #6e6e73;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --content: 1120px;
}

html.dark {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-soft: #2c2c2e;
  --fill: rgba(120, 120, 128, 0.24);
  --fill-hover: rgba(120, 120, 128, 0.32);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #8e8e93;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: #48484a;

  --primary: #2997ff;
  --primary-hover: #4aa8ff;
  --primary-soft: rgba(41, 151, 255, 0.18);
  --primary-ring: rgba(41, 151, 255, 0.34);
  --success: #30d158;
  --danger: #ff6961;
  --warning: #ff9f0a;

  --bar-bg: rgba(0, 0, 0, 0.72);
  --ring: 0 0 0 1px rgba(255, 255, 255, 0.07);
  --lift: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 16px 48px rgba(0, 0, 0, 0.6);

  --control-bg: #1c1c1e;
  --control-text: #f5f5f7;
  --control-placeholder: #8e8e93;
  --control-border: #48484a;
  --control-hover: #8e8e93;
  --control-focus: #2997ff;
  --control-ring: rgba(41, 151, 255, 0.34);
  --control-muted-bg: #2c2c2e;
  --control-muted-text: #a1a1a6;
}

/* ═══ 2. 基础 ═══════════════════════════════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
html:has(.session-help-dialog[open]) { overflow: hidden; }

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--fs-sub);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  font-synthesis: none;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, ol, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { min-width: 0; padding: 0; border: 0; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: 0; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
b, strong { font-weight: 600; }
code, kbd { font-family: var(--font-mono); font-size: var(--fs-footnote); letter-spacing: 0; }
small { font-size: var(--fs-caption); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-ring); }

.hidden { display: none !important; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; border: 0 !important; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 10px 16px; border-radius: var(--r-md); background: var(--btn); color: var(--on-primary); }
.skip-link:focus { top: 12px; }
.ambient { display: none; }

/* 图标：用蒙版着色，跟随文字颜色 */
.ui-icon { display: block; width: 16px; height: 16px; flex: 0 0 16px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.icon-lock { --icon: url("/assets/icons/lock.svg"); }
.icon-external-link { --icon: url("/assets/icons/external-link.svg"); }
.icon-close { --icon: url("/assets/icons/close.svg"); }
.icon-arrow-right { --icon: url("/assets/icons/arrow-right.svg"); }
.icon-alert { --icon: url("/assets/icons/alert.svg"); }
.theme-glyph { display: block; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("/assets/icons/moon.svg") center / contain no-repeat; mask: url("/assets/icons/moon.svg") center / contain no-repeat; }
html.dark .theme-glyph { -webkit-mask-image: url("/assets/icons/sun.svg"); mask-image: url("/assets/icons/sun.svg"); }

/* ═══ 3. 顶栏：品牌、分段导航、状态 ═════════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}
/* 两行：上面品牌与状态，下面业务导航。业务再多也只是导航变长（可横向滑动），不会压到品牌。 */
.topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand actions" "tabs tabs";
  align-items: center;
  column-gap: 16px;
  max-width: calc(var(--content) + 48px);
  margin: 0 auto;
  padding: 0 24px;
}
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 12px; justify-self: start; min-width: 0; max-width: 100%; height: 60px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, #2f95ff, #0058d6);
  box-shadow: 0 1px 2px rgba(0, 60, 150, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 6px 4px;
  background: #fff;
  -webkit-mask: url("/assets/brand/logo-mark-mask.png?v=082a02d3bb8eb63a") center / contain no-repeat;
  mask: url("/assets/brand/logo-mark-mask.png?v=082a02d3bb8eb63a") center / contain no-repeat;
}
.brand-copy { min-width: 0; }
.brand-copy b { display: block; overflow: hidden; font-size: var(--fs-body); font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: var(--fs-caption); text-overflow: ellipsis; white-space: nowrap; }

/* 业务导航：一行文字标签，当前项下方一条强调色细线；放不下时横向滑动，两端渐隐提示还有内容 */
.tabs {
  grid-area: tabs;
  display: flex;
  justify-self: stretch;
  gap: 4px;
  margin: 0 -12px;
  padding: 0 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-padding-inline: 24px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs.is-overflowing { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 32px), transparent); }
.tabs button {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: var(--fs-sub);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.tabs button::after { content: ""; position: absolute; right: 12px; bottom: 0; left: 12px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; transition: background-color 0.2s var(--ease); }
.tabs button:hover:not(.active):not(:disabled) { color: var(--text); }
.tabs button:hover:not(.active):not(:disabled)::after { background: var(--line-strong); }
.tabs button.active { color: var(--text); }
.tabs button.active::after { background: var(--primary); }
.tabs button:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }
.tabs button:disabled { opacity: 0.5; cursor: not-allowed; }
.tabs button[hidden], .tabs button.is-closed { display: none; }
.intake-paused .tabs button[data-product] { opacity: 0.6; }
.tab-copy b { font-weight: 400; }
.tabs button.active .tab-copy b { font-weight: 400; }
.tab-cost { padding: 0 6px; border-radius: 999px; color: var(--muted); background: var(--fill); font-size: var(--fs-caption); line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab-cost:empty { display: none; }
.tabs button.active .tab-cost { color: var(--primary); background: var(--primary-soft); }

.topbar-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 8px; justify-self: end; }
.service-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-footnote); white-space: nowrap; }
.service-pill i, .queue-dot, .progress-sync i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--warning); }
.service-pill.ready i, .queue-dot.live { background: var(--success); }
.service-pill.degraded i { background: var(--danger); }
.service-pill.checking i { animation: pulse 1.4s ease-in-out infinite; }
.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: var(--fill);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-button:hover { background: var(--fill-hover); }
.icon-button:active { transform: scale(0.94); }

/* ═══ 4. 页面容器与提示 ═════════════════════════════════════════════════════════════════════════════ */
.shell { max-width: calc(var(--content) + 48px); margin: 0 auto; padding: 40px 24px 32px; }
.content-column { min-width: 0; }
.content-column:focus { outline: none; }

.announcement { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 12px 16px; border-radius: 14px; background: var(--primary-soft); font-size: var(--fs-sub); }
.announcement-label { flex: 0 0 auto; color: var(--primary); font-size: var(--fs-footnote); font-weight: 600; }
#announcementText { max-height: 64px; overflow-y: auto; overflow-wrap: anywhere; }
.network-notice { margin: 0 0 24px; padding: 12px 16px; border-radius: 14px; color: var(--text); background: color-mix(in srgb, var(--warning) 14%, var(--surface)); font-size: var(--fs-sub); }
.pause-banner, .verify-alert, .orders-verify-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--warning) 13%, var(--surface));
  font-size: var(--fs-sub);
}
.pause-banner { align-items: flex-start; }
.pause-banner b, .verify-alert b, .orders-verify-note b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.pause-banner small, .verify-alert small, .orders-verify-note small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-footnote); overflow-wrap: anywhere; }
.pause-banner > .ui-icon, .verify-alert > .ui-icon { margin-top: 4px; color: var(--warning); }
.verify-alert-copy, .orders-verify-note > div { flex: 1 1 auto; min-width: 0; }
.verify-alert .button, .orders-verify-note .button { flex: none; }
.orders-verify-note { margin: 16px 0 0; }

/* ═══ 5. 访问密钥 ═══════════════════════════════════════════════════════════════════════════════════ */
.key-locked .content-column > .view { display: none !important; }
.key-panel { max-width: 440px; margin: 8vh auto 0; text-align: center; }
.key-panel-copy { display: grid; justify-items: center; gap: 8px; margin-bottom: 32px; }
.key-mark { width: 64px; height: 64px; flex-basis: 64px; margin-bottom: 16px; border-radius: 18px; box-shadow: 0 8px 24px rgba(0, 88, 214, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.key-mark::before { inset: 13px 8px; }
.key-panel .page-kicker { display: none; }
.key-panel-copy h2, .key-panel-copy h1 { font-size: var(--fs-title2); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.key-panel-copy p { max-width: 380px; color: var(--muted); font-size: var(--fs-sub); line-height: 1.6; }
.key-form { display: grid; gap: 12px; text-align: left; }
.key-form > label:first-child { color: var(--text); font-size: var(--fs-footnote); font-weight: 600; }
.key-form-row { display: grid; gap: 12px; }
.key-form-row input[type="password"], .key-form-row input[type="text"] { height: 52px; font-family: var(--font-mono); font-size: var(--fs-sub); }
.key-form-row .button { height: 52px; width: 100%; }
.key-remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-footnote); cursor: pointer; }
.key-remember input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--btn); }

.key-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "id points actions" "hint hint hint";
  align-items: center;
  gap: 0 32px;
  margin: 0 0 32px;
  padding: 18px 24px 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--ring);
}
.key-bar-id { grid-area: id; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.key-bar-label { flex: 0 0 100%; color: var(--muted); font-size: var(--fs-caption); }
.key-bar-id b { overflow: hidden; min-width: 0; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-body); font-weight: 600; }
.key-bar-note { overflow: hidden; min-width: 0; color: var(--muted); font-size: var(--fs-footnote); text-overflow: ellipsis; white-space: nowrap; }
.key-bar-note:empty { display: none; }
.key-bar-id code { padding: 2px 8px; border-radius: 6px; color: var(--muted); background: var(--fill); font-size: var(--fs-caption); }
/* 四个余额：标签在上、数字在下，竖线分隔，数字等宽对齐 */
.key-bar-points { grid-area: points; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(72px, auto); color: var(--muted); font-size: var(--fs-caption); }
.key-bar-points > span { display: flex; flex-direction: column-reverse; gap: 2px; padding: 0 20px; border-left: 1px solid var(--line); white-space: nowrap; }
.key-bar-points > span:first-child { padding-left: 0; border-left: 0; }
.key-bar-points b { color: var(--text); font-size: var(--fs-title3); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.key-bar-points span:first-child b { color: var(--primary); }
.key-bar-hint { grid-area: hint; margin-top: 16px; padding: 12px 0 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-footnote); }
.key-bar-hint:empty { display: none; }
.key-bar:has(.key-bar-hint:empty) { padding-bottom: 18px; }
.key-bar.is-empty .key-bar-hint { color: var(--warning); font-weight: 600; }
.key-bar-actions { grid-area: actions; display: flex; gap: 8px; }

/* ═══ 6. 页面标题、特点、步骤 ═══════════════════════════════════════════════════════════════════════ */
.view { animation: arrive 0.32s var(--ease); }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 20px; }
.page-intro-copy { min-width: 0; }
.page-kicker { display: block; margin-bottom: 8px; color: var(--primary); font-size: var(--fs-footnote); font-weight: 600; letter-spacing: 0.02em; }
.page-intro h1, .section-heading h1 { font-size: var(--fs-title2); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.page-intro p { max-width: 720px; margin-top: 8px; color: var(--muted); font-size: var(--fs-sub); line-height: 1.6; }
.step-badge { display: none; }

/* 服务特点：一行带勾的短句，不再占一整条带边框的格子 */
.byoc-highlights { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 32px; }
.byoc-highlights li { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: var(--fs-footnote); }
.byoc-highlights li::before { content: ""; flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%; background: var(--primary-soft) url("/assets/icons/check-white.svg") center / 10px no-repeat; background-color: var(--primary); }
.byoc-highlights b { color: var(--text); font-size: var(--fs-footnote); font-weight: 600; }
.byoc-highlights small { font-size: var(--fs-footnote); }
.is-tracking .byoc-highlights, .is-tracking .steps { display: none; }

.steps { display: flex; align-items: center; margin: 0 0 24px; color: var(--muted); font-size: var(--fs-footnote); }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps li:not(:last-child)::after { content: ""; width: 32px; height: 1px; margin: 0 12px; background: var(--line-strong); }
.steps b { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 50%; color: var(--muted); background: var(--fill); font-size: var(--fs-caption); }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active b, .steps li.done b { color: var(--on-primary); background: var(--btn); }
.steps li.done::after { background: var(--btn); }

/* ═══ 7. 卡片、表单、按钮 ═══════════════════════════════════════════════════════════════════════════ */
.panel { min-width: 0; padding: 32px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--ring); }
.panel-heading { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 24px; }
.panel-heading b { display: block; font-size: var(--fs-title3); font-weight: 600; line-height: 1.3; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: var(--fs-sub); line-height: 1.5; }
.panel-index { display: none; }
.section-label { display: flex; align-items: center; min-width: 0; gap: 8px; margin: 0 0 16px; font-size: var(--fs-body); }
.section-label b { font-weight: 600; }
.section-meta { margin-left: auto; color: var(--muted); font-size: var(--fs-footnote); }
.section-label .text-button { margin-left: auto; }

.field { display: block; margin: 0 0 16px; }
.field > span, .field-label-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 8px; font-size: var(--fs-footnote); font-weight: 600; line-height: 1.5; }
.field-label-row small { color: var(--muted); font-size: var(--fs-caption); font-weight: 400; }
.field-actions { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-weight: 400; }
.field-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px 16px; margin: 8px 0 0; color: var(--muted); font-size: var(--fs-caption); line-height: 1.6; }
.card-paste-hint { display: block; margin-top: 8px; color: var(--muted); font-size: var(--fs-caption); font-weight: 400; line-height: 1.5; }

input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="range"]), textarea, select {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--r-md);
  outline: 0;
  color: var(--control-text);
  background: var(--control-bg);
  font-family: var(--font-sans);
  font-size: var(--fs-sub);
  font-weight: 400;
  line-height: 1.4;
  caret-color: var(--control-focus);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
textarea { height: auto; min-height: 144px; padding: 12px 16px; resize: vertical; font-family: var(--font-mono); font-size: var(--fs-footnote); line-height: 1.7; overflow-wrap: anywhere; }
input::placeholder, textarea::placeholder { color: var(--control-placeholder); opacity: 1; }
textarea::placeholder { font-family: var(--font-sans); }
input:not([type="radio"]):not([type="checkbox"]):hover:not(:focus):not(:disabled):not([readonly]), textarea:hover:not(:focus):not(:disabled):not([readonly]) { border-color: var(--control-hover); }
input:not([type="radio"]):not([type="checkbox"]):focus, textarea:focus { border-color: var(--control-focus); box-shadow: 0 0 0 4px var(--control-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); }
input:disabled, textarea:disabled, input[readonly], textarea[readonly] { color: var(--control-muted-text); -webkit-text-fill-color: var(--control-muted-text); background: var(--control-muted-bg); cursor: not-allowed; }
input[readonly], textarea[readonly] { cursor: default; }
input:autofill { -webkit-text-fill-color: var(--control-text); box-shadow: 0 0 0 1000px var(--control-bg) inset; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
#cardExpInput { font-variant-numeric: tabular-nums; }
#sessionInput { height: 168px; min-height: 144px; max-height: 360px; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-md);
  font-size: var(--fs-sub);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
a.button:hover { text-decoration: none; }
.button.primary { color: var(--on-primary); background: var(--btn); }
.button.primary:hover:not(:disabled) { background: var(--btn-hover); }
.button.ghost { color: var(--text); background: var(--fill); }
.button.ghost:hover:not(:disabled) { background: var(--fill-hover); }
.button.compact { min-height: 34px; padding: 0 14px; border-radius: 10px; font-size: var(--fs-footnote); }
.button:active:not(:disabled) { transform: scale(0.98); }
.button:disabled { opacity: 0.4; cursor: not-allowed; }
.button .ui-icon { width: 16px; height: 16px; }
.text-button { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; padding: 0 8px; border: 0; border-radius: var(--r-sm); color: var(--primary); background: transparent; font-size: var(--fs-footnote); font-weight: 400; white-space: nowrap; cursor: pointer; transition: background-color 0.2s var(--ease); }
.text-button:hover:not(:disabled) { background: var(--primary-soft); }
.text-button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 提交中：保留原文字占位，叠一个转圈和提示，按钮宽度不跳 */
.button[aria-busy="true"] { display: inline-grid; grid-template-columns: minmax(0, 1fr); place-items: center; cursor: progress; transform: none; }
.button-label-reserve, .button-label-feedback { grid-area: 1 / 1; display: inline-flex; min-inline-size: max-content; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.button-label-reserve { visibility: hidden; pointer-events: none; }
.button-label-feedback { white-space: nowrap; }
.button-label-feedback::before { content: ""; flex: 0 0 14px; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.75s linear infinite; }

.message { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--r-md); font-size: var(--fs-sub); line-height: 1.6; overflow-wrap: anywhere; }
.message.info { color: var(--primary); background: var(--primary-soft); }
.message.success { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.message.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.actions-end { justify-content: flex-end; }
.actions .button { min-width: 112px; }

/* 开关 */
.renewal-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-soft); cursor: pointer; }
.renewal-copy { display: grid; gap: 2px; min-width: 0; }
.renewal-switch b { font-size: var(--fs-sub); font-weight: 600; }
.renewal-switch small { color: var(--muted); font-size: var(--fs-footnote); line-height: 1.5; }
.renewal-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.renewal-switch > i { position: relative; flex: 0 0 51px; width: 51px; height: 31px; border-radius: 16px; background: var(--line-strong); transition: background-color 0.25s var(--ease); }
.renewal-switch > i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--ease); }
.renewal-switch input:checked + i { background: var(--success); }
.renewal-switch input:checked + i::after { transform: translateX(20px); }
.renewal-switch input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 3px; }
.renewal-switch:has(input:disabled) { opacity: 0.55; cursor: wait; }

.privacy-note { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.6; }
.privacy-note b { flex: 0 0 auto; color: var(--text); font-weight: 600; }
.session-footnote { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.6; }
.session-footnote .ui-icon { margin-top: 3px; }

/* ═══ 8. 充值页 ═════════════════════════════════════════════════════════════════════════════════════ */
.recharge-editor { display: grid; gap: 16px; }
.recharge-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.recharge-details > .panel > .section-label { min-height: 32px; }
.access-panel { padding: 24px 32px 28px; }
.access-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.access-heading .section-label { margin: 0; }
.access-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.access-controls:has(#verifyCdkBtn.hidden) { grid-template-columns: minmax(0, 1fr); }
.access-controls .field { margin: 0; }
.access-panel .field-meta { margin-top: 12px; }
.verified-plan { padding: 4px 12px; border-radius: 999px; color: var(--muted); background: var(--fill); font-size: var(--fs-footnote); }
.verified-plan.verified { color: var(--primary); background: var(--primary-soft); }
.session-field { margin-bottom: 0; }

/* 套餐：一排大卡片，选中的蓝色描边加对勾 */
.recharge-plan-picker { margin: 0; }
.recharge-plan-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.plan-card { position: relative; display: block; cursor: pointer; }
.plan-card input, .plan-country-options input, .upgrade-plan-options input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.plan-card > span {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.plan-card:hover > span { box-shadow: inset 0 0 0 1px var(--line-strong); }
.plan-card b { font-size: var(--fs-body); font-weight: 600; line-height: 1.25; }
.plan-card small { color: var(--muted); font-size: var(--fs-footnote); }
.plan-country { margin-top: 4px; padding: 2px 10px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: var(--fs-caption); font-style: normal; }
.plan-country.hidden { display: none; }
.plan-card input:checked + span { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); box-shadow: inset 0 0 0 2px var(--primary); }
.plan-card input:checked + span::after { content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; background: var(--btn) url("/assets/icons/check-white.svg") center / 12px no-repeat; }
.plan-card input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 3px; }

.plan-country-picker { margin: 24px 0 0; }
.plan-country-picker.hidden { display: none; }
.plan-country-picker legend { margin-bottom: 12px; padding: 0; font-size: var(--fs-footnote); font-weight: 600; }
.plan-country-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.plan-country-options label { position: relative; display: block; cursor: pointer; }
.plan-country-options label > span { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 12px 16px; border-radius: 14px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--line); transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.plan-country-options label:hover > span { box-shadow: inset 0 0 0 1px var(--line-strong); }
.plan-country-options b { font-size: var(--fs-sub); font-weight: 600; }
.plan-country-options small { color: var(--muted); font-size: var(--fs-footnote); font-variant-numeric: tabular-nums; }
.plan-country-options .country-default { position: absolute; top: 12px; right: 12px; padding: 0 8px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: var(--fs-caption); font-style: normal; line-height: 20px; }
.plan-country-options input:checked + span { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); box-shadow: inset 0 0 0 2px var(--primary); }
.plan-country-options input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 3px; }
.plan-country-options input:disabled + span { opacity: 0.55; cursor: not-allowed; }
.plan-country-hint { margin-top: 12px; color: var(--muted); font-size: var(--fs-footnote); }

/* 支付卡 */
.payment-card:not(.panel) { padding: 0; }
.payment-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 0 16px; }
.payment-card-number { grid-column: 1 / -1; }
.payment-card .field { min-width: 0; margin-bottom: 16px; }
.payment-card .message { grid-column: 1 / -1; margin-top: 0; }
.payment-card #cardNumberInput { letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.bill-name-field { margin: 0 0 16px; }
.automatic-card-note { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 16px; border-radius: var(--r-md); color: var(--primary); background: var(--primary-soft); }
.automatic-card-note b { font-size: var(--fs-sub); }
.automatic-card-note p { margin-top: 2px; color: var(--muted); font-size: var(--fs-footnote); }
.payment-card-icon { position: relative; width: 36px; height: 26px; flex: 0 0 36px; border: 2px solid currentColor; border-radius: 6px; }
.payment-card-icon::before { content: ""; position: absolute; inset: 6px 0 auto; height: 4px; background: currentColor; }
.payment-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.payment-card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.payment-card-title-row em { padding: 2px 10px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: var(--fs-caption); font-style: normal; }

/* 底部操作栏：浮在内容之上的毛玻璃条 */
.editor-bottom { display: grid; gap: 12px; }
.action-dock {
  position: sticky;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 5;
  padding: 16px 20px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--lift);
}
.editor-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.editor-actionbar > div { display: grid; gap: 2px; min-width: 0; }
#editorPlanSummary, #upgradeEditorSummary { font-size: var(--fs-sub); font-weight: 600; }
#editorActionHint, #upgradeEditorHint { color: var(--muted); font-size: var(--fs-footnote); }
#validateSessionBtn, #upgradeReviewBtn { flex-shrink: 0; min-width: 168px; }

/* 核对页 */
.step-panel { padding: 32px; }
.confirm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.confirm-grid > div { min-width: 0; padding: 16px 20px; border-radius: 14px; background: var(--surface-soft); }
.confirm-grid small { display: block; color: var(--muted); font-size: var(--fs-footnote); }
.confirm-grid strong { display: block; margin-top: 4px; font-size: var(--fs-body); font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.confirm-amount { background: var(--primary-soft) !important; }
.confirm-amount strong { color: var(--primary); font-size: var(--fs-title3); }
/* 2026-11-02：账户邮箱下方注明是否已与 OpenAI 核对（第二步刷新 Session 后拿到的账号邮箱）。 */
.confirm-grid .confirm-email-check { margin-top: 4px; font-size: var(--fs-caption); }
.confirm-grid .confirm-email-check.is-verified { color: var(--success); }
.confirm-renew { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.confirm-renew small, .confirm-renew strong { margin: 0; }
.confirm-renew strong { color: var(--primary); }
.confirm-renew.is-off strong { color: var(--muted); font-weight: 400; }
#rechargeSubmitActions { justify-content: flex-end; }

.is-tracking > .page-intro { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
#view-recharge.is-tracking { display: block; }
.is-tracking .step-panel { max-width: 760px; margin: 0 auto; padding: 40px; }

/* ═══ 9. 进度与安全验证 ═════════════════════════════════════════════════════════════════════════════ */
.recharge-progress, .credits-progress, .upgrade-progress { --tone: var(--primary); --progress-tone: var(--primary); }
.recharge-progress.pending, .upgrade-progress.pending, .recharge-progress.warning, .upgrade-progress.warning { --tone: var(--warning); --progress-tone: var(--warning); }
.recharge-progress.success, .upgrade-progress.success, .credits-progress.is-completed { --tone: var(--success); --progress-tone: var(--success); }
.recharge-progress.error, .upgrade-progress.error, .credits-progress.is-failed { --tone: var(--danger); --progress-tone: var(--danger); }
.recharge-progress.neutral, .upgrade-progress.neutral { --tone: var(--muted); --progress-tone: var(--muted); }
.credits-progress.is-review { --tone: var(--warning); --progress-tone: var(--warning); }
.credits-progress, .upgrade-progress { display: grid; gap: 24px; }
.credits-progress.hidden, .upgrade-progress.hidden { display: none; }

.progress-header { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 32px; text-align: center; }
.progress-state-icon { order: 1; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); font-size: var(--fs-title3); font-weight: 600; }
.progress-state-icon svg { display: block; width: 32px; height: 32px; }
.progress-state-icon svg > * { display: none; }
.recharge-progress.pending .progress-icon-clock, .upgrade-progress.pending .progress-icon-clock,
.recharge-progress.active .progress-icon-spinner, .upgrade-progress.active .progress-icon-spinner,
.recharge-progress.success .progress-icon-check, .upgrade-progress.success .progress-icon-check,
.recharge-progress.error .progress-icon-alert, .recharge-progress.warning .progress-icon-alert,
.upgrade-progress.error .progress-icon-alert, .upgrade-progress.warning .progress-icon-alert,
.recharge-progress.neutral .progress-icon-minus, .upgrade-progress.neutral .progress-icon-minus { display: block; }
.progress-icon-spinner { transform-origin: 12px 12px; animation: spin 1.2s linear infinite; }
.progress-status, .status { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 3px 12px; border-radius: 999px; font-size: var(--fs-footnote); font-weight: 600; white-space: nowrap; }
.progress-status { order: 2; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); }
.progress-heading-copy { order: 3; min-width: 0; }
.progress-header h2 { font-size: var(--fs-title2); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.progress-header h2:focus { outline: none; }
.progress-header p { max-width: 460px; margin: 8px auto 0; color: var(--muted); font-size: var(--fs-sub); line-height: 1.6; }
.credits-progress .progress-state-icon { color: var(--tone); }
.status.submitted, .status.pending { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.status.manual_review { color: var(--primary); background: var(--primary-soft); }
.status.completed { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.status.failed, .status.cancelled { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

.progress-task-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px 14px 20px; border-radius: var(--r-md); background: var(--surface-soft); }
.progress-task-row > div { min-width: 0; }
.progress-task-row small { display: block; color: var(--muted); font-size: var(--fs-caption); }
.progress-task-row code { display: block; margin-top: 2px; color: var(--text); font-size: var(--fs-footnote); overflow-wrap: anywhere; user-select: all; }
.progress-task-hint { margin-top: 16px; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.6; text-align: center; }

.progress-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 32px 0; }
.progress-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 88px; text-align: center; color: var(--muted); }
.progress-steps li:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: calc(50% + 24px); width: calc(100% - 48px); height: 2px; background: var(--line); }
.progress-steps li.done:not(:last-child)::after { background: var(--tone); }
.progress-steps b { position: relative; z-index: 1; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--muted); background: var(--fill); font-size: var(--fs-caption); }
.progress-steps strong { display: block; color: var(--text); font-size: var(--fs-footnote); }
.progress-steps small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); }
.progress-steps li.done b { color: var(--on-primary); background: var(--tone); }
.progress-steps li.active b { color: var(--on-primary); background: var(--tone); box-shadow: 0 0 0 5px color-mix(in srgb, var(--tone) 18%, transparent); }
.progress-steps li.active strong { color: var(--tone); }
.progress-steps li.error b { color: #fff; background: var(--danger); box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 16%, transparent); }
.progress-steps li.error strong { color: var(--danger); }
.progress-steps li.warning b { color: #fff; background: var(--warning); box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 16%, transparent); }
.progress-steps li.warning strong { color: var(--warning); }
.charge-substeps { margin: 0 0 8px; padding: 8px 20px; border-radius: var(--r-md); background: var(--surface-soft); }
.charge-substeps li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.55; }
.charge-substeps li + li { border-top: 1px solid var(--line); }
.charge-substeps i { display: inline-grid; width: 20px; height: 20px; margin-top: 1px; place-items: center; border-radius: 50%; background: var(--fill); font-size: var(--fs-caption); font-style: normal; }
.charge-substeps strong { display: block; color: var(--text); font-size: var(--fs-footnote); }
.charge-substeps small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); }
.charge-substeps li.done i { color: #fff; background: var(--success); }
.charge-substeps li.active i { color: #fff; background: var(--primary); }
.charge-substeps li.active strong { color: var(--primary); }
.charge-substeps li.error i { color: #fff; background: var(--danger); }
.charge-substeps li.error, .charge-substeps li.error strong { color: var(--danger); }
.charge-substeps li.warning i { color: #fff; background: var(--warning); }
.charge-substeps li.warning, .charge-substeps li.warning strong { color: var(--warning); }
.charge-substeps li.pending i { color: transparent; }

.credits-progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: var(--fill); }
.credits-progress-track i { display: block; width: 16%; height: 100%; border-radius: inherit; background: var(--tone); transition: width 0.4s var(--ease); }
.credits-progress.is-completed .credits-progress-track i { width: 100%; }
.credits-progress-detail { padding: 12px 16px; border-radius: var(--r-md); color: var(--muted); background: var(--surface-soft); font-size: var(--fs-sub); }

.progress-footer { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.progress-sync { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: var(--fs-footnote); font-variant-numeric: tabular-nums; text-align: center; }
.progress-sync i { width: 6px; height: 6px; flex-basis: 6px; background: var(--tone); }
.recharge-progress.pending .progress-sync i, .recharge-progress.active .progress-sync i, .recharge-progress.warning .progress-sync i { animation: pulse 1.2s ease-in-out infinite; }
.is-terminal .progress-sync i, .upgrade-progress .progress-sync.paused i { animation: none; }
.progress-footer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.progress-footer-actions .button { min-width: 112px; }

.verification-panel { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; margin: 24px 0; padding: 24px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--warning) 11%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 30%, transparent); }
.upgrade-progress .verification-panel { margin: 0; }
.verification-shield { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, transparent); }
.verification-shield svg { width: 26px; height: 26px; }
.verification-panel-body { min-width: 0; }
.verification-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.verification-kicker { color: var(--warning); font-size: var(--fs-footnote); font-weight: 600; }
.verification-countdown { color: var(--warning); font-family: var(--font-mono); font-size: var(--fs-footnote); font-variant-numeric: tabular-nums; }
.verification-panel h3 { margin: 4px 0 8px; font-size: var(--fs-title3); font-weight: 600; line-height: 1.35; }
.verification-panel-body > p { color: var(--muted); font-size: var(--fs-sub); line-height: 1.6; }
.verification-assurances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.verification-assurances li { display: flex; min-width: 0; align-items: flex-start; gap: 8px; padding: 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--surface) 80%, transparent); }
.verification-assurances i { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; border-radius: 50%; color: #fff; background: var(--btn); font-size: var(--fs-caption); font-style: normal; }
.verification-assurances b, .verification-assurances small { display: block; }
.verification-assurances b { font-size: var(--fs-footnote); }
.verification-assurances small { margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); line-height: 1.5; }
.verification-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.verification-prepare { color: var(--muted); font-size: var(--fs-footnote); }
.verification-link-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 10px 10px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.verification-link-text { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: var(--fs-caption); line-height: 1.5; -webkit-user-select: all; user-select: all; cursor: text; }
.verification-message { margin-top: 12px !important; color: var(--muted); font-size: var(--fs-footnote); }
.verification-message.error { color: var(--danger); }
.verification-message.success { color: var(--success); }

.result-card { padding: 20px; border-radius: 18px; background: var(--surface); box-shadow: var(--ring); }
.result-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result-top > div { min-width: 0; }
.result-top h3 { overflow-wrap: anywhere; font-size: var(--fs-sub); }
.result-top small { color: var(--muted); font-size: var(--fs-caption); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.detail-grid > div { min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-footnote); }
.detail-grid span { display: block; color: var(--muted); font-size: var(--fs-caption); }
.result-verification-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--warning) 11%, var(--surface-soft)); }
.result-verification-action b, .result-verification-action small { display: block; }
.result-verification-action small { margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); }
.empty-state { display: grid; align-content: center; min-height: 200px; padding: 32px 24px; border-radius: var(--r-lg); color: var(--muted); text-align: center; }
.empty-state b { color: var(--text); font-size: var(--fs-body); }
.empty-state p { margin-top: 4px; font-size: var(--fs-footnote); }
.skeleton-card { padding: 20px; border-radius: 18px; background: var(--surface); }
.skeleton-line { height: 10px; margin-top: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--fill), var(--fill-hover), var(--fill)); background-size: 220% 100%; animation: skeleton 1.4s ease-in-out infinite; }
.skeleton-line:first-child { width: 42%; margin-top: 0; }
.skeleton-line:last-child { width: 68%; }
.recent-task-button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ═══ 10. Business、Codex 额度、订阅升级 ═══════════════════════════════════════════════════════════ */
.business-editor, .credits-editor, .upgrade-editor { display: grid; gap: 16px; }
.business-confirmation, .credits-confirmation, .upgrade-confirmation { display: grid; gap: 16px; }
.business-confirmation.hidden, .credits-confirmation.hidden, .upgrade-confirmation.hidden, .business-progress.hidden { display: none; }
.business-account-panel .panel-heading, .credits-account-panel .panel-heading, .upgrade-account-panel .panel-heading,
.business-confirmation .panel-heading, .credits-confirmation .panel-heading, .upgrade-confirmation .panel-heading { margin-bottom: 20px; }
.business-account-panel textarea, .credits-account-panel textarea, .upgrade-account-panel textarea { min-height: 156px; }

.business-seats { display: block; min-width: 0; margin: 24px 0 0; padding: 0 20px 16px; border-radius: 16px; background: var(--surface-soft); }
.business-seats legend { float: left; width: 100%; margin: 0; padding: 16px 0 4px; font-size: var(--fs-footnote); font-weight: 600; }
.business-seats legend + .business-seat-row { clear: both; }
.business-seats.hidden { display: none; }
.business-seat-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.business-seat-row + .business-seat-row { border-top: 1px solid var(--line); }
.business-seat-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.business-seat-copy b { font-size: var(--fs-sub); font-weight: 600; }
.business-seat-copy small { color: var(--muted); font-size: var(--fs-footnote); }
.business-seat-stepper { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.business-seat-stepper button { flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; color: var(--text); background: var(--fill); font-size: var(--fs-body); line-height: 1; cursor: pointer; transition: background-color 0.2s var(--ease), transform 0.2s var(--ease); }
.business-seat-stepper button:hover { background: var(--fill-hover); }
.business-seat-stepper button:active { transform: scale(0.92); }
.business-seat-stepper input { flex: 0 0 72px; width: 72px; height: 36px; padding: 0 8px; border-radius: 10px; text-align: center; font-size: var(--fs-sub); }
.business-presets { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.business-presets button, .credits-presets button { min-height: 32px; padding: 0 16px; border: 0; border-radius: 999px; color: var(--text); background: var(--fill); font-size: var(--fs-footnote); cursor: pointer; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.business-presets button:hover:not(:disabled), .credits-presets button:hover { background: var(--fill-hover); }
.business-presets button:disabled { opacity: 0.45; cursor: not-allowed; }
.credits-presets button.active { color: var(--on-primary); background: var(--btn); }
.business-seat-summary { padding-top: 8px; color: var(--muted); font-size: var(--fs-footnote); font-variant-numeric: tabular-nums; }
.business-seat-summary.is-error { color: var(--danger); font-weight: 600; }
.business-quote { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px 0 0; padding: 16px 20px; border-radius: 16px; background: var(--primary-soft); }
.business-quote span { color: var(--muted); font-size: var(--fs-sub); }
.business-quote strong { color: var(--primary); font-size: var(--fs-title3); font-variant-numeric: tabular-nums; }
.business-quote strong.is-error { color: var(--danger); font-size: var(--fs-sub); }
.business-summary, .halfprice-summary { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.2fr) minmax(0, 1fr); }
.business-summary .confirm-amount, .halfprice-summary .confirm-amount { grid-column: 1 / -1; }
.renewal-note { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); color: var(--muted); background: var(--surface-soft); font-size: var(--fs-footnote); line-height: 1.65; }
.renewal-note b, .renewal-note strong { color: var(--text); }

.credits-quantity-picker { min-width: 0; margin: 24px 0 0; }
.credits-quantity-picker legend { margin-bottom: 8px; padding: 0; font-size: var(--fs-footnote); font-weight: 600; float: none; }
.credits-quantity-row { display: grid; grid-template-columns: minmax(0, 200px) auto; align-items: center; gap: 12px; }
.credits-quantity-row .field { margin: 0; }
.credits-unit { color: var(--muted); font-size: var(--fs-sub); }
.credits-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#creditsAmountPreview { color: var(--primary); font-size: var(--fs-footnote); font-variant-numeric: tabular-nums; }
.credits-eligibility { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--success) 11%, var(--surface)); }
.credits-eligibility > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; color: #fff; background: var(--success); font-weight: 600; }
.credits-eligibility div { display: grid; gap: 2px; }
.credits-eligibility b { font-size: var(--fs-sub); }
.credits-eligibility small { color: var(--muted); font-size: var(--fs-footnote); }
.credits-summary .credits-amount { grid-column: 1 / -1; }
.credits-payment-card, .business-payment-card, .halfprice-payment-card { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.credits-payment-card .section-label, .business-payment-card .section-label, .halfprice-payment-card .section-label { margin: 16px 0 12px; }
.credits-payment-card .bill-name-field, .business-payment-card .bill-name-field, .halfprice-payment-card .bill-name-field { max-width: 360px; }
.credits-amount-guard, .upgrade-amount-guard { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); color: var(--muted); background: var(--surface-soft); font-size: var(--fs-footnote); line-height: 1.6; }
.credits-amount-guard .ui-icon, .upgrade-amount-guard .ui-icon { margin-top: 3px; color: var(--primary); }
.credits-amount-guard b, .upgrade-amount-guard b { color: var(--text); }

.upgrade-account-panel, .upgrade-payment-panel { align-content: start; }
.upgrade-payment-panel { display: grid; }
.upgrade-plan-picker { min-width: 0; margin: 24px 0 0; }
.upgrade-plan-picker legend { margin-bottom: 12px; padding: 0; font-size: var(--fs-footnote); font-weight: 600; float: none; }
.upgrade-plan-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.upgrade-plan-options label { position: relative; display: flex; min-width: 0; cursor: pointer; }
.upgrade-plan-options span { position: relative; display: grid; gap: 2px; width: 100%; padding: 14px 16px; border-radius: 14px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--line); transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.upgrade-plan-options label:hover span { box-shadow: inset 0 0 0 1px var(--line-strong); }
.upgrade-plan-options b { font-size: var(--fs-sub); font-weight: 600; }
.upgrade-plan-options small { color: var(--muted); font-size: var(--fs-footnote); }
.upgrade-plan-options input:checked + span { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); box-shadow: inset 0 0 0 2px var(--primary); }
.upgrade-plan-options input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 3px; }
.upgrade-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.upgrade-progress .progress-header { padding: 8px 0 24px; }
.upgrade-progress .progress-steps { margin-block: 8px; }
.upgrade-account-panel [readonly], .upgrade-confirmation [readonly] { cursor: progress; }
.upgrade-progress .progress-heading-copy { overflow-wrap: anywhere; }
.upgrade-progress .progress-footer-actions { flex-wrap: wrap; }

/* ═══ 10b. 半价 Plus ════════════════════════════════════════════════════════════════════════════════ */
.halfprice-editor, .halfprice-confirmation { display: grid; gap: 16px; }
.halfprice-confirmation.hidden, .halfprice-progress.hidden { display: none; }
.halfprice-account-panel .panel-heading, .halfprice-confirmation .panel-heading { margin-bottom: 20px; }
.halfprice-account-panel textarea { min-height: 156px; }
.halfprice-offer-column { display: grid; gap: 16px; margin-top: 24px; align-content: start; }
.halfprice-offer-column .plan-country-picker { margin: 0; }
.halfprice-status { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-soft); }
.halfprice-status-dot { flex: 0 0 10px; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--faint); }
.halfprice-status b { display: block; font-size: var(--fs-sub); font-weight: 600; }
.halfprice-status p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.5; }
.halfprice-status.is-loading .halfprice-status-dot { background: var(--primary); animation: halfprice-pulse 1.2s var(--ease) infinite; }
.halfprice-status.is-ok { background: color-mix(in srgb, var(--success) 11%, var(--surface)); }
.halfprice-status.is-ok .halfprice-status-dot { background: var(--success); }
.halfprice-status.is-error { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.halfprice-status.is-error .halfprice-status-dot { background: var(--danger); }
@keyframes halfprice-pulse { 50% { opacity: 0.35; } }
.halfprice-offer { padding: 16px 20px; border-radius: 16px; background: var(--primary-soft); }
.halfprice-offer.hidden { display: none; }
.halfprice-offer-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: var(--fs-sub); }
.halfprice-offer-head em { color: var(--primary); font-style: normal; font-size: var(--fs-footnote); font-weight: 600; }
.halfprice-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.halfprice-price strong { color: var(--primary); font-size: var(--fs-title2); font-weight: 600; font-variant-numeric: tabular-nums; }
.halfprice-price s { color: var(--faint); font-size: var(--fs-sub); font-variant-numeric: tabular-nums; }
.halfprice-campaign { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-caption); line-height: 1.5; overflow-wrap: anywhere; }
.halfprice-actions { margin-top: 24px; }
.halfprice-progress { display: grid; gap: 24px; width: 100%; max-width: 760px; margin-inline: auto; }
.halfprice-original { margin-left: 8px; color: var(--faint); font-size: var(--fs-sub); font-weight: 400; }
.halfprice-progress .progress-footer-actions { justify-content: center; }

/* ═══ 11. 任务查询 ═════════════════════════════════════════════════════════════════════════════════ */
.orders-panel { padding: 24px 32px 20px; }
.orders-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.orders-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.orders-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; color: var(--muted); background: var(--fill); font-size: var(--fs-footnote); cursor: pointer; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.orders-filter b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.orders-filter:hover { background: var(--fill-hover); }
.orders-filter.active { color: var(--on-primary); background: var(--btn); }
.orders-filter.active b { color: var(--on-primary); }
.orders-search { display: flex; align-items: center; gap: 8px; }
.orders-search input[type="search"] { width: 240px; max-width: 100%; height: 36px; padding: 0 14px; border-radius: 10px; font-family: var(--font-mono); font-size: var(--fs-footnote); }
.orders-search input::placeholder { font-family: var(--font-sans); }
.orders-list { margin-top: 16px; overflow-x: auto; }
.orders-list[aria-busy="true"] .orders-table { opacity: 0.55; }
.orders-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--fs-footnote); }
.orders-table :is(th, td):nth-child(1) { width: 20%; }
.orders-table :is(th, td):nth-child(2) { width: 11%; }
.orders-table :is(th, td):nth-child(3) { width: 9%; }
.orders-table :is(th, td):nth-child(4) { width: 18%; }
.orders-table :is(th, td):nth-child(5) { width: 16%; }
.orders-table :is(th, td):nth-child(6) { width: 10%; }
.orders-table :is(th, td):nth-child(7) { width: 8%; }
.orders-table :is(th, td):nth-child(8) { width: 8%; }
.orders-table th { padding: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--fs-caption); font-weight: 400; text-align: left; white-space: nowrap; }
.orders-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.orders-table tbody tr:last-child td { border-bottom: 0; }
.orders-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); line-height: 1.5; }
.orders-id { font-family: var(--font-mono); font-size: var(--fs-caption); line-height: 1.5; overflow-wrap: anywhere; }
.orders-table :is(td[data-label="提交时间"], td[data-label="套餐"], td[data-label="积分"]) { white-space: nowrap; }
.orders-table td[data-label="提交时间"] small { white-space: normal; }
.orders-table td[data-label="账号"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-table th { overflow: hidden; text-overflow: ellipsis; }
.orders-copy { margin-left: 4px; padding: 1px 8px; border: 0; border-radius: 6px; color: var(--primary); background: var(--primary-soft); font-size: var(--fs-caption); cursor: pointer; }
.orders-copy:hover { background: var(--primary-ring); }
.orders-status { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
.orders-status.is-ok { color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent); }
.orders-status.is-bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 11%, transparent); }
.orders-status.is-warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.orders-status.is-active { color: var(--primary); background: var(--primary-soft); }
.orders-status.is-muted { color: var(--muted); background: var(--fill); }
.orders-cancel { display: flex; width: fit-content; margin-top: 8px; white-space: nowrap; }
.orders-cancel.is-confirming { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.orders-table td small.orders-cancel-note { color: var(--warning); }
.orders-renew.is-ok { color: var(--success); }
.orders-renew.is-warn { color: var(--warning); font-weight: 600; }
.orders-table tr.needs-verification td { background: color-mix(in srgb, var(--warning) 7%, transparent); }
.orders-table td[data-label="安全验证"] { white-space: nowrap; }
.orders-table td[data-label="安全验证"] small { white-space: normal; }
.orders-verify-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.orders-verify-none { color: var(--muted); }
.orders-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.orders-range { color: var(--muted); font-size: var(--fs-footnote); }
.orders-pager-buttons { display: flex; gap: 8px; }

/* ═══ 12. 页脚、对话框、提示 ═══════════════════════════════════════════════════════════════════════ */
.queue-strip { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 24px; margin: 48px 0 0; color: var(--muted); font-size: var(--fs-footnote); }
.queue-label { display: flex; align-items: center; gap: 8px; }
.queue-label > span:last-child { display: flex; align-items: baseline; gap: 8px; }
.queue-label b { color: var(--text); font-weight: 600; }
.queue-label small { font-size: var(--fs-footnote); }
.queue-value { display: flex; align-items: baseline; gap: 6px; }
.queue-value strong { color: var(--text); font-size: var(--fs-sub); font-variant-numeric: tabular-nums; }
footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-caption); text-align: center; }

.session-help-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 32px; overflow-y: auto; border: 0; border-radius: 24px; color: var(--text); background: var(--surface); box-shadow: var(--lift); overscroll-behavior: contain; }
.session-help-dialog::backdrop { background: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.session-help-dialog[open] { animation: sheet 0.28s var(--ease); }
.help-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 20px; }
.help-dialog-heading > div { min-width: 0; }
.help-dialog-heading h2 { margin: 4px 0 8px; font-size: var(--fs-title2); font-weight: 600; line-height: 1.25; }
.help-dialog-heading p { color: var(--muted); font-size: var(--fs-sub); line-height: 1.55; }
.help-dialog-heading .icon-button { flex: 0 0 32px; }
.session-guide-body { padding: 0; }
.session-guide-steps { display: grid; gap: 20px; margin: 0; padding: 20px 0 24px; border-top: 1px solid var(--line); }
.session-guide-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.session-guide-number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--on-primary); background: var(--btn); font-size: var(--fs-caption); font-weight: 600; font-variant-numeric: tabular-nums; }
.session-guide-steps b { display: block; font-size: var(--fs-sub); line-height: 28px; }
.session-guide-steps p { margin-top: 4px; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.6; }
.session-guide-steps strong { color: var(--text); }
.session-guide-link { display: inline-flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; min-height: 36px; margin-top: 12px; padding: 0 14px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-size: var(--fs-footnote); font-weight: 600; }
.session-guide-link:hover { text-decoration: none; background: var(--primary-ring); }
.session-guide-tip { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-soft); }
.session-guide-tip > .ui-icon { margin-top: 3px; color: var(--muted); }
.session-guide-tip b { display: block; font-size: var(--fs-footnote); }
.session-guide-tip p { margin-top: 2px; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.65; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60; max-width: min(420px, calc(100% - 32px)); padding: 12px 20px; border-radius: 14px; color: #f5f5f7; background: rgba(29, 29, 31, 0.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); font-size: var(--fs-sub); text-align: center; transform: translateX(-50%); }
.toast:not(.hidden) { animation: toast 0.28s var(--ease); }

/* ═══ 13. API 文档页（byoc-docs.html 共用本表） ════════════════════════════════════════════════════ */
.docs-topbar { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "brand title actions"; }
.docs-topbar-title { grid-area: title; justify-self: center; color: var(--muted); font-size: var(--fs-sub); }
.docs-app .docs-shell, .docs-app .topbar-inner { max-width: 1160px; }
.docs-app .docs-gate { margin-top: 8vh; }
.docs-app .docs-gate.hidden, .docs-app .docs-layout.hidden { display: none; }
.docs-app .docs-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 32px; align-items: start; }
.docs-app .docs-toc { position: sticky; top: 80px; display: grid; gap: 2px; padding: 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--ring); font-size: var(--fs-footnote); }
.docs-app .docs-toc b { margin: 4px 8px 8px; color: var(--muted); font-size: var(--fs-caption); }
.docs-app .docs-toc a { padding: 8px 12px; border-radius: 8px; color: var(--text); }
.docs-app .docs-toc a:hover, .docs-app .docs-toc a:focus-visible { color: var(--primary); background: var(--primary-soft); text-decoration: none; outline: none; }
.docs-app .docs-body { min-width: 0; padding: 40px 48px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--ring); font-size: var(--fs-sub); line-height: 1.75; }
.docs-app .docs-body h1 { margin: 0 0 16px; font-size: var(--fs-title1); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.docs-app .docs-body h2 { margin: 48px 0 16px; padding-top: 24px; border-top: 1px solid var(--line); font-size: var(--fs-title2); font-weight: 600; line-height: 1.25; scroll-margin-top: 80px; }
.docs-app .docs-body h3 { margin: 32px 0 8px; font-size: var(--fs-title3); font-weight: 600; }
.docs-app .docs-body p, .docs-app .docs-body ul, .docs-app .docs-body ol { margin: 0 0 16px; }
.docs-app .docs-body ul, .docs-app .docs-body ol { padding-left: 24px; list-style: revert; }
.docs-app .docs-body code { padding: 2px 6px; border-radius: 6px; background: var(--fill); font-size: var(--fs-footnote); overflow-wrap: anywhere; }
.docs-app .docs-body pre { margin: 0 0 16px; padding: 16px 20px; overflow-x: auto; border-radius: var(--r-md); background: var(--surface-soft); line-height: 1.6; }
.docs-app .docs-body pre code { padding: 0; background: none; font-size: var(--fs-footnote); overflow-wrap: normal; }
.docs-app .docs-table { margin: 0 0 16px; overflow-x: auto; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); }
.docs-app .docs-table table { width: 100%; border-collapse: collapse; font-size: var(--fs-footnote); }
.docs-app .docs-table th, .docs-app .docs-table td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs-app .docs-table th { color: var(--muted); background: var(--surface-soft); font-weight: 600; white-space: nowrap; }
.docs-app .docs-table tr:last-child td { border-bottom: 0; }

/* ═══ 14. 动效 ═════════════════════════════════════════════════════════════════════════════════════ */
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes skeleton { from { background-position: 100% 0; } to { background-position: -120% 0; } }

/* ═══ 15. 响应式 ═══════════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .recharge-plan-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .topbar-inner { padding: 0 16px; }
  .tabs { margin: 0 -16px; padding: 0 16px; }
  .shell { padding: 32px 16px 24px; }
  .key-bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id actions" "points points" "hint hint"; row-gap: 16px; }
  .key-bar-points { grid-auto-columns: minmax(0, 1fr); }
  .recharge-details, .confirm-grid, .upgrade-summary { grid-template-columns: minmax(0, 1fr); }
  .business-summary, .halfprice-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .business-summary > div:first-child, .halfprice-summary > div:first-child { grid-column: 1 / -1; }
  .verification-assurances { grid-template-columns: minmax(0, 1fr); }
  .docs-app .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-app .docs-toc { position: static; grid-auto-flow: column; overflow-x: auto; }
  .docs-app .docs-toc b { display: none; }
  .docs-app .docs-toc a { white-space: nowrap; }
  .docs-app .docs-body { padding: 24px 20px; }
}
@media (min-width: 961px) {
  /* 宽屏：业务模块第一步分左右两栏，左边账号 Session，右边席位 / 额度 / 目标与支付卡 */
  .business-account-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; align-content: start; }
  .business-account-panel > * { grid-column: 1 / -1; }
  .business-account-panel > .field { grid-column: 1; grid-row: 2 / span 3; display: flex; flex-direction: column; margin: 0; }
  .business-account-panel > .field textarea { flex: 1 1 auto; min-height: 240px; }
  .business-account-panel > #businessSessionMeta { grid-column: 1; grid-row: 5; }
  .business-account-panel > .business-seats { grid-column: 2; grid-row: 2; margin-top: 0; }
  .business-account-panel > #businessCountryPicker { grid-column: 2; grid-row: 3; margin-top: 16px; }
  .business-account-panel > .business-quote { grid-column: 2; grid-row: 4; align-self: start; margin-top: 16px; }
  .halfprice-account-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; align-content: start; }
  .halfprice-account-panel > * { grid-column: 1 / -1; }
  .halfprice-account-panel > .halfprice-session { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; margin: 0; }
  .halfprice-account-panel > .halfprice-session textarea { flex: 1 1 auto; min-height: 240px; }
  .halfprice-account-panel > .halfprice-session-meta { grid-column: 1; grid-row: 3; }
  .halfprice-account-panel > .halfprice-offer-column { grid-column: 2; grid-row: 2 / span 2; margin-top: 0; }
  .credits-account-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; align-content: start; }
  .credits-account-panel > * { grid-column: 1 / -1; }
  .credits-account-panel > .field { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; margin: 0; }
  .credits-account-panel > .field textarea { flex: 1 1 auto; min-height: 200px; }
  .credits-account-panel > #creditsSessionMeta { grid-column: 1; grid-row: 3; }
  .credits-account-panel > .credits-quantity-picker { grid-column: 2; grid-row: 2 / span 2; align-self: start; margin-top: 0; }
  .upgrade-editor { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); align-items: stretch; }
  .upgrade-editor > .editor-bottom { grid-column: 1 / -1; }
}
/* 表格最窄需要约 930px；再窄时每单一张卡片，列名放在值前面 */
@media (max-width: 1100px) {
  .orders-list { overflow-x: visible; }
  .orders-table, .orders-table tbody, .orders-table tr, .orders-table td { display: block; width: 100%; }
  /* 桌面版的固定列宽（:nth-child，优先级更高）不能带进卡片：否则每行只剩原列宽，订单号一字一行（10-23 起） */
  .orders-table :is(th, td):nth-child(n) { width: 100%; }
  .orders-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .orders-table tbody tr { margin-bottom: 12px; padding: 4px 16px; border-radius: 16px; background: var(--surface-soft); }
  .orders-table td { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; white-space: normal !important; }
  .orders-table td:last-child { border-bottom: 0; }
  .orders-table td > .orders-status { justify-self: start; }
  .orders-table td::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-caption); }
  .orders-table td > small, .orders-table td > .orders-cancel, .orders-table td > .orders-copy { grid-column: 2; }
  .orders-table td > :is(.orders-cancel, .orders-copy) { justify-self: start; }
  .orders-table td > .orders-copy { margin-left: 0; }
  .orders-table td[data-label="安全验证"] > :is(.button, .orders-verify-actions) { justify-self: start; }
  .orders-table tbody tr.needs-verification { background: color-mix(in srgb, var(--warning) 10%, var(--surface-soft)); }
  .orders-table tr.needs-verification td { background: none; }
}
@media (max-width: 640px) {
  .topbar-inner { padding-inline: 12px; }
  .tabs { margin: 0 -12px; padding: 0 12px; }
  .tabs button { padding: 0 10px; }
  .tabs button::after { right: 10px; left: 10px; }
  .tab-cost { display: none; }
  .brand { height: 56px; }
  .brand-copy b { font-size: var(--fs-sub); }
  input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="range"]), select { height: 48px; font-size: var(--fs-body); }
  .service-pill { gap: 6px; }
  .service-pill:not(.degraded) #servicePillText { display: none; }
  .shell { padding: 24px 12px 20px; }
  .panel, .step-panel, .orders-panel, .access-panel { padding: 20px 16px; border-radius: 18px; }
  .is-tracking .step-panel { padding: 24px 16px; }
  .page-intro { margin-bottom: 24px; }
  .byoc-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 24px; }
  .byoc-highlights small { display: none; }
  .recharge-plan-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .recharge-plan-options .plan-card:last-child { grid-column: 1 / -1; }
  .plan-card > span { min-height: 80px; padding: 14px; }
  .payment-card-grid { grid-template-columns: minmax(0, 1fr); }
  .payment-card-grid .field:nth-child(3) { margin-top: 0; }
  .access-controls { grid-template-columns: minmax(0, 1fr) auto; }
  .upgrade-plan-options, .upgrade-summary, .business-summary, .halfprice-summary { grid-template-columns: minmax(0, 1fr); }
  .credits-quantity-row { grid-template-columns: minmax(0, 1fr) auto; }
  .credits-presets, .business-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .credits-presets button, .business-presets button { min-width: 0; padding-inline: 4px; }
  .business-seat-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .business-seat-stepper { align-self: stretch; }
  .business-seat-stepper input { flex: 1 1 auto; width: auto; }
  .business-seat-stepper button { width: 44px; height: 44px; }
  .business-quote { flex-direction: column; align-items: flex-start; gap: 4px; }
  .editor-actionbar { flex-wrap: wrap; }
  #editorActionHint, #upgradeEditorHint { display: none; }
  .action-dock { padding: 12px 14px; bottom: max(8px, env(safe-area-inset-bottom)); }
  #validateSessionBtn, #upgradeReviewBtn { min-width: 0; margin-left: auto; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .button { width: 100%; }
  .progress-footer-actions { width: 100%; }
  .progress-footer-actions .button { flex: 1; min-width: 0; min-height: 44px; }
  .progress-steps { grid-template-columns: minmax(0, 1fr); gap: 0; margin: 24px 0 0; }
  .progress-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 16px; min-height: 64px; text-align: left; }
  .progress-steps li:not(:last-child)::after { top: 50%; bottom: -1px; left: 13px; width: 2px; height: auto; }
  .progress-steps li:not(:first-child)::before { content: ""; position: absolute; top: 0; bottom: 50%; left: 13px; width: 2px; background: var(--line); }
  .progress-steps li.done + li::before { background: var(--tone); }
  .progress-task-row { flex-direction: column; align-items: stretch; }
  .progress-task-row .button { align-self: flex-end; }
  .verification-panel { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
  .verification-panel-heading { flex-direction: column; align-items: flex-start; gap: 4px; }
  .verification-panel-actions, .verification-panel-actions .button, .result-verification-action .button, .verification-link-box .button { width: 100%; }
  .verification-link-box, .result-verification-action { flex-direction: column; align-items: stretch; }
  /* Stacked, the 220px horizontal basis would become the link's height. */
  .verification-link-text { flex: 0 1 auto; }
  .key-panel { margin-top: 4vh; }
  .key-bar { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "points" "hint" "actions"; padding: 16px 16px 0; }
  .key-bar:has(.key-bar-hint:empty) { padding-bottom: 16px; }
  .key-bar-points > span { padding: 0 12px; }
  .key-bar-points b { font-size: var(--fs-body); }
  .key-bar-hint { margin-top: 0; }
  .key-bar-actions { padding-bottom: 16px; }
  .key-bar:has(.key-bar-hint:empty) .key-bar-actions { padding-bottom: 0; }
  .key-bar-actions .button { flex: 1 1 0; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .orders-search { width: 100%; }
  .orders-search input[type="search"] { flex: 1 1 0; width: auto; min-width: 0; }
  .pause-banner, .verify-alert, .orders-verify-note { flex-wrap: wrap; }
  .verify-alert .button, .orders-verify-note .button { width: 100%; }
  .session-help-dialog { padding: 24px 20px; }
  footer span + span { flex-basis: 100%; }
}
@media (max-width: 420px) {
  .recharge-plan-options { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .credits-presets, .business-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .action-dock, .toast { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topbar { background: var(--bg); }
  .action-dock { background: var(--surface); }
}
@media (forced-colors: active) {
  .tabs button.active, .plan-card input:checked + span, .upgrade-plan-options input:checked + span, .plan-country-options input:checked + span { outline: 2px solid Highlight; }
}

/* Server-side captcha progress; the challenge itself remains in the payment worker. */
.captcha-status { display:flex; align-items:center; gap:10px; margin:14px 0 0; padding:11px 13px; border:1px solid color-mix(in srgb,var(--primary) 28%,var(--line)); border-radius:12px; background:color-mix(in srgb,var(--primary) 7%,var(--surface)); color:var(--text); }
.captcha-status.hidden { display:none; }
.captcha-status-dot { width:9px; height:9px; flex:0 0 9px; border-radius:50%; background:var(--primary); box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 14%,transparent); animation:captcha-status-pulse 1.6s ease-in-out infinite; }
.captcha-status strong,.captcha-status small { display:block; }
.captcha-status strong { font-size:var(--fs-caption); }
.captcha-status small { margin-top:2px; color:var(--muted); font-size:var(--fs-caption); }
@keyframes captcha-status-pulse { 50% { opacity:.42; transform:scale(.82); } }
@media(prefers-reduced-motion:reduce) { .captcha-status-dot { animation:none; } }
