/* SubGoNow 前台补充样式（极简流程页：步骤条 / 兜底样式） */
.sg-wizard { margin-bottom: 26px; }
.sg-wizard .sg-steps { flex-wrap: wrap; row-gap: 10px; }
.sg-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-300);
  padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  transition: color .15s, border-color .15s, background .15s;
}
.sg-back:hover { color: var(--brand-400); border-color: var(--brand-500); background: rgba(59,130,246,.06); }

/* 进度条（充值等待页） */
.sg-bar { height: 10px; border-radius: 999px; background: var(--ink-600); overflow: hidden; }
.sg-bar > i {
  display: block; height: 100%; width: 6%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-400), var(--green-500));
  transition: width .6s ease;
}

/* Tailwind CDN 未就绪时的兜底 */
.hidden { display: none !important; }
.sg-nowrap { white-space: nowrap; }

/* 登录页「登录方式」分段切换（密码登录 / 验证码登录） */
.sg-seg {
  display: flex; width: 100%; gap: 4px; padding: 4px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--ink-800);
}
.sg-seg-btn {
  flex: 1; appearance: none; border: 0; cursor: pointer; background: transparent;
  padding: 8px 12px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-300);
  transition: color .15s, background .15s;
}
.sg-seg-btn:hover { color: var(--ink-100); }
.sg-seg-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  box-shadow: 0 6px 16px -8px rgba(37,99,235,.7);
}
html.sg-light .sg-seg { background: #f1f5f9; border-color: #e2e8f0; }
html.sg-light .sg-seg-btn { color: #475569; }
html.sg-light .sg-seg-btn:hover { color: #0f172a; }
html.sg-light .sg-seg-btn.active { color: #fff; }


/* ============================================================
 * 前台轻量布局：左侧流程菜单 + 右侧内容（参考 OpenAI 充值界面 / bewilder.ai）
 * 取代流程页顶部的横向步骤条；首页仍用 wizard 展示购买流程。
 * ============================================================ */
.sg-flow { display: flex; gap: 36px; align-items: flex-start; }
/* 顶栏不吸顶：侧栏贴近视口顶部吸附 */
.sg-flow-side { flex: 0 0 212px; position: sticky; top: 24px; }
/* 不设页面级最大宽度：内容随视口铺开（手机端仍由左右 padding 收口）
   但右侧功能块本身按参考站收窄到 70% 并居中，避免宽屏被拉散 */
.sg-flow-body { flex: 1; min-width: 0; max-width: none; }
@media (min-width: 1280px) {
  .sg-flow-body { width: 70%; max-width: 70%; margin-left: auto; margin-right: auto; }
}

.sg-flow-menu { display: flex; flex-direction: column; }
.sg-flow-cap {
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em; color: var(--ink-400);
  padding: 0 12px; margin: 18px 0 8px;
}
.sg-flow-cap:first-child { margin-top: 2px; }
.sg-flow-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.sg-flow-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-300);
  /* 激活态只靠底色区分，不使用任何边框颜色 */
  text-decoration: none; border: 0;
  transition: background .15s, color .15s;
}
.sg-flow-item .ic {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; line-height: 1;
  background: var(--ink-600); color: var(--ink-300);
  transition: background .15s, color .15s;
}
.sg-flow-item .ic.plain { border-radius: 7px; background: transparent; border: 1px solid var(--line-strong); }

.sg-flow-item.is-active {
  background: rgba(59,130,246,.10); color: var(--brand-400);
}
.sg-flow-item.is-active .ic { background: var(--brand-500); color: #fff; }

.sg-flow-item.is-done { color: var(--ink-200); }
.sg-flow-item.is-done .ic { background: rgba(16,185,129,.16); color: var(--green-400); }
.sg-flow-item.is-done:hover { background: rgba(59,130,246,.07); color: var(--brand-400); }

.sg-flow-item.is-todo { color: var(--ink-400); cursor: default; }
.sg-flow-item.is-todo .ic { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-400); }

.sg-flow-sep { height: 1px; background: var(--line-strong); margin: 16px 10px 6px; }
.sg-flow-home {
  display: block; padding: 8px 12px; border-radius: 10px;
  font-size: 13px; color: var(--ink-400); text-decoration: none;
  transition: color .15s, background .15s;
}
.sg-flow-home:hover { color: var(--brand-400); background: rgba(59,130,246,.07); }

/* 浅色主题：左菜单改浅底细边，强调色用可达的深蓝 */
html.sg-light .sg-flow-cap { color: #64748b; }
html.sg-light .sg-flow-item { color: #475569; }
html.sg-light .sg-flow-item .ic { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
html.sg-light .sg-flow-item .ic.plain { background: #fff; }
html.sg-light .sg-flow-item.is-active { background: #eff6ff; color: #1d4ed8; }
html.sg-light .sg-flow-item.is-active .ic { background: #2563eb; color: #fff; border-color: #2563eb; }
html.sg-light .sg-flow-item.is-done { color: #334155; }
html.sg-light .sg-flow-item.is-done .ic { background: #ecfdf5; color: #047857; }
html.sg-light .sg-flow-item.is-done:hover { background: #eff6ff; color: #1d4ed8; }
html.sg-light .sg-flow-item.is-todo { color: #94a3b8; }
html.sg-light .sg-flow-item.is-todo .ic { background: #fff; border-color: #e2e8f0; color: #94a3b8; }
html.sg-light .sg-flow-sep { background: #e2e8f0; }
html.sg-light .sg-flow-home { color: #64748b; }
html.sg-light .sg-flow-home:hover { color: #1d4ed8; background: #eff6ff; }

/* 窄屏：左菜单转为吸顶横向滚动（与用户中心侧栏同策略） */
@media (max-width: 1023px) {
  .sg-flow { flex-direction: column; gap: 16px; }
  .sg-flow-side {
    flex: none; width: 100%;
    position: sticky; top: 0; z-index: 20;
    background: var(--sg-nav-bg);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    margin: 0 -24px; padding: 10px 24px;
    border-bottom: 1px solid var(--line);
  }
  .sg-flow-menu { flex-direction: row; align-items: center; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .sg-flow-menu::-webkit-scrollbar { display: none; }
  /* 横滚 chip 行内不显示分组标题（占位且易被误认为菜单项） */
  .sg-flow-cap { display: none; }
  .sg-flow-list { flex-direction: row; gap: 8px; }
  .sg-flow-item { flex: 0 0 auto; white-space: nowrap; padding: 7px 14px; border-radius: 999px; background: var(--ink-700); border: 1px solid var(--line-strong); }
  /* chip 行里的激活态同样只用底色，不加边框色 */
  .sg-flow-item.is-active { border-color: transparent; }
  .sg-flow-item .ic { display: none; }
  .sg-flow-sep { display: none; }
  .sg-flow-home { flex: 0 0 auto; white-space: nowrap; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); }
  .sg-flow-body { max-width: 100%; }
}
@media (max-width: 640px) {
  .sg-flow-side { margin: 0 -16px; padding: 10px 16px; }
}

/* ============================================================
 * 套餐卡片（OpenAI 充值界面 / bewilder.ai 参考）：白底细边 + 13px 圆角
 * 选中态 = 1px 品牌蓝边 + 2px 内环（inset ring），不使用渐变/发光
 * ============================================================ */
.plan-card {
  position: relative; display: block; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 13px;
  background: var(--ink-700); padding: 18px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.plan-card:focus-visible { outline: none; border-color: rgba(59,130,246,.45); }
.plan-card.selected {
  border-color: var(--brand-600);
}
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.plan-brand { display: flex; align-items: center; gap: 6px; min-width: 0; }
.plan-img { width: 20px; height: 20px; object-fit: contain; }
.plan-service { font-size: 12.5px; font-weight: 600; color: var(--ink-400); }
/* ============================================================
 * ChatGPT 配色（仅前台 html.sg-front）——数值取自 chatgpt.com 结账组件原始令牌
 * 文本 #0d0d0d/#5d5d5d/#8f8f8f；按钮 浅=黑#0d0d0d(hover#2f2f2f) 暗=#f9f9f9(hover#ececec)；
 * 蓝色强调：亮 #3a83f7 / 可交互蓝 #2c67c5 / 暗 #63a8f8 / 浅蓝面 #a4cdfb、#e8f3fe；
 * 边框：浅 rgba(0,0,0,.15) 暗 rgba(255,255,255,.15)。成功绿/警示橙为语义色保留。
 * ============================================================ */
html.sg-front {
  --brand-300:#63a8f8; --brand-400:#3a83f7; --brand-500:#2c67c5; --brand-600:#3a83f7; --brand-700:#1d4788;
  --line: rgba(13,13,13,.08); --line-strong: rgba(13,13,13,.15);
  --shadow-card: 0 1px 2px rgba(13,13,13,.05), 0 12px 32px -20px rgba(13,13,13,.16);
  --shadow-lift: 0 2px 4px rgba(13,13,13,.10), 0 22px 48px -20px rgba(13,13,13,.28);
  --sg-nav-bg: rgba(255,255,255,.86);
}
html.sg-front:not(.sg-light) {
  --brand-300:#e8f3fe; --brand-400:#a4cdfb; --brand-500:#63a8f8; --brand-600:#3a83f7; --brand-700:#2c67c5;
  --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 22px 48px -20px rgba(0,0,0,.6);
}
/* 主按钮：官方令牌（浅=纯黑 hover #2f2f2f；暗=#f9f9f9 hover #ececec），扁平无渐变 */
html.sg-front:not(.sg-light) .sg-btn-primary { background: #3a83f7; color: #fff; }
html.sg-front:not(.sg-light) .sg-btn-primary:not(:disabled):hover { background: #2c67c5; }
/* 链接/强调文字（tailwind 调色板不走变量，按官方可交互蓝覆盖） */
html.sg-front .text-brand-400, html.sg-front .text-brand-500 { color: #2c67c5; }
html.sg-front:not(.sg-light) .text-brand-400, html.sg-front:not(.sg-light) .text-brand-500 { color: #a4cdfb; }
/* 导航 hover / 文字选中 */
html.sg-front.sg-light .sg-navlink:hover { color: #2c67c5; }
html.sg-front.sg-light ::selection { background: rgba(58,131,247,.20); }
html.sg-front:not(.sg-light) ::selection { background: rgba(164,205,251,.24); }
/* 品牌徽标：黑白方块（与 ChatGPT 标识一致） */
html.sg-front .sg-logo-mark { background: #0d0d0d; color: #fff; }
html.sg-front:not(.sg-light) .sg-logo-mark { background: #fff; color: #0d0d0d; }
/* 套餐卡：官方 theme-blue 主题卡（浅蓝底浅蓝边 / 暗蓝底），选中蓝描边强调 */
html.sg-front:not(.sg-light) .plan-card:hover { border-color: rgba(164,205,251,.6); }
html.sg-front:not(.sg-light) .plan-name { color: #e8f3fe; }
/* 「自动充值」标签：官方 theme-blue 色块 */
html.sg-front .plan-badge.sub { background: rgba(255,255,255,.14); color: #a4cdfb; border-color: rgba(255,255,255,.28); }

/* 月数 chips 加大点按热区 */
#monthsChips .sg-btn { min-height: 40px; padding-left: 16px; padding-right: 16px; }
.plan-name { font-size: 16.5px; font-weight: 700; color: var(--ink-100); line-height: 1.4; }
.plan-sub { font-size: 12.5px; color: var(--ink-400); margin-top: 5px; }
/* 计费模式标签：一次性（中性）/ 自动续订（品牌蓝，强调会持续扣费） */
.plan-badge {
  flex: none; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 6px;
  background: rgba(148,163,184,.12); color: var(--ink-400);
  border: 1px solid rgba(148,163,184,.25); white-space: nowrap;
}
.plan-badge.sub {
  background: rgba(59,130,246,.14); color: #60a5fa;
  border-color: rgba(59,130,246,.35);
}
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-top: 16px; }
.plan-price .num { font-size: 27px; font-weight: 800; letter-spacing: -.02em; color: var(--brand-500); }
.plan-price .unit { font-size: 12.5px; color: var(--ink-400); }

html.sg-light .plan-card:hover { border-color: #93c5fd; }
html.sg-light .plan-card:focus-visible { border-color: #93c5fd; }
html.sg-light .plan-name { color: #0f172a; }
html.sg-light .plan-sub, html.sg-light .plan-price .unit { color: #64748b; }

html.sg-light .plan-badge { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
html.sg-light .plan-badge.sub { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }


/* ============================================================
 * 侧栏选中态（取自 bewilder.ai 实测值）
 *   浅色：#F4F3F0 暖灰底 + #0A0A0A 近黑字（选中 fw500/600）+ 12px 圆角
 *   暗色：同结构，半透明白底
 * ============================================================ */
.sg-flow-item {
  padding: 10.5px 14px;           /* 与参考站一致 */
  border-radius: 12px;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-100);
}
.sg-flow-item .ic { display: none; }          /* 参考站菜单为纯文字 */
.sg-flow-item.is-active {
  background: rgba(255,255,255,.09);          /* 暗色：暖灰底的暗色等价物 */
  color: var(--ink-100);
  font-weight: 600;
}
.sg-flow-item:hover { background: rgba(255,255,255,.05); color: var(--ink-100); }
.sg-flow-item.is-active:hover { background: rgba(255,255,255,.11); }
html.sg-light .sg-flow-item { color: #0a0a0a; font-weight: 400; }
html.sg-light .sg-flow-item.is-active { background: #f4f3f0; color: #0a0a0a; font-weight: 600; }
html.sg-light .sg-flow-item:hover { background: rgba(10,10,10,.045); color: #0a0a0a; }
html.sg-light .sg-flow-item.is-active:hover { background: #f0efec; }
html.sg-light .sg-flow-cap { color: #979797; font-weight: 500; letter-spacing: .04em; }

/* ============================================================
 * 流程页右侧：横向步骤条（参考 bewilder 顶部 tab 行）
 *   底部 1px 分隔线 + 当前步黑色加粗 + 当前步下方 #3189ef 圆角短条
 *   只作用于 .sg-flow-body 内（首页的购买流程展示保持原样）
 * ============================================================ */
.sg-flow-body .sg-wizard { margin-bottom: 26px; }
.sg-flow-body .sg-steps {
  gap: 0; font-size: 15px;
  border-bottom: 1px solid var(--line-strong);
}
.sg-flow-body .sg-steps .seg { display: none; }
.sg-flow-body .sg-steps .node {
  position: relative; flex: 1; justify-content: center;
  padding: 0 6px 12px; gap: 6px; white-space: nowrap;
}
.sg-flow-body .sg-steps .dot { display: none; }        /* 去掉数字圆点，纯文字 tab */
.sg-flow-body .sg-steps .node .lbl { color: var(--ink-400); font-weight: 500; }
.sg-flow-body .sg-steps .node.done .lbl { color: var(--ink-300); }
.sg-flow-body .sg-steps .node.done:hover .lbl { color: var(--brand-400); }
.sg-flow-body .sg-steps .node.active .lbl {
  color: var(--ink-100); font-weight: 700;
}
.sg-flow-body .sg-steps .node.active::after {
  content: ''; position: absolute; left: 12%; right: 12%; bottom: -1px;
  height: 4px; border-radius: 999px; background: var(--brand-500);
}
html.sg-light .sg-flow-body .sg-steps { border-bottom-color: #e5e7eb; }
html.sg-light .sg-flow-body .sg-steps .node .lbl { color: #979797; }
html.sg-light .sg-flow-body .sg-steps .node.done .lbl { color: #64748b; }
html.sg-light .sg-flow-body .sg-steps .node.active .lbl { color: #000; }

/* ============================================================
 * 流程页右侧内容：不再套整体大卡片，内容直接铺开
 *   .sg-flow-panel = 原 sg-card 的替代（无底无边框）
 *   内部需要「块」的地方用 .sg-block（浅灰底细边圆角）
 * ============================================================ */
.sg-flow-panel {
  background: none; border: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  padding: 0; margin: 0; max-width: none;
}
.sg-flow-panel:hover { border-color: transparent; box-shadow: none; }
.sg-flow-panel > h1 { margin-bottom: 4px; }
.sg-block {
  border: 1px solid var(--line-strong); border-radius: 13px;
  background: rgba(255,255,255,.03); padding: 18px;
}
html.sg-light .sg-block { background: #fff; border-color: #e5e7eb; }


/* ============================================================
 * 登录/注册弹窗内的两个轻量文字入口
 *   .sg-auth-alt  = 登录按钮正上方、右对齐：「验证码登录」/「密码登录」
 *   .sg-auth-foot = 登录按钮正下方、居中：「还没有账号，立即注册」等
 * 两者都刻意做「轻」：小字号 + 弱化色 + 无边框无底色，仅 hover 提亮。
 * ============================================================ */
.sg-auth-alt {
  display: flex; justify-content: flex-end;
  margin: -4px 0 12px;
}
.sg-auth-alt button,
.sg-auth-foot button {
  appearance: none; background: none; border: 0; padding: 0;
  font-size: 12.5px; font-weight: 500; line-height: 1.5;
  color: var(--ink-400); cursor: pointer;
  transition: color .15s;
}
.sg-auth-alt button:hover,
.sg-auth-foot button:hover { color: var(--brand-400); text-decoration: underline; }
.sg-auth-foot {
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.sg-auth-foot button { font-size: 13px; }

/* 浅色主题：弱化文字换浅底可达色，hover 用深蓝 */
html.sg-light .sg-auth-alt button,
html.sg-light .sg-auth-foot button { color: #64748b; }
html.sg-light .sg-auth-alt button:hover,
html.sg-light .sg-auth-foot button:hover { color: #2563eb; }
html.sg-light .sg-auth-foot { border-top-color: #e5e7eb; }


/* ============================================================
 * 右侧功能块里的按钮：不整行显示，按内容宽度居中
 *   · .sg-btn-block（下一步 / 开始兑换）→ fit-content + 左右 auto 居中
 *   · 按钮行（确认页、结果页的 flex gap-3 行）→ 取消 flex-1 拉伸，整行居中
 * ============================================================ */
.sg-flow-body .sg-btn-block {
  display: flex; width: fit-content; min-width: 220px;
  margin-left: auto; margin-right: auto;
}
/* 只作用于「按钮行」（内含 .sg-btn），避免误伤普通 flex 行（进度页转圈、输入框行等） */
.sg-flow-body .flex.gap-3:has(> .sg-btn) { justify-content: center; }
.sg-flow-body .flex.gap-3:has(> .sg-btn) > .sg-btn { flex: 0 1 auto; min-width: 170px; }


/* ============================================================
 * 流程页底部统一「使用帮助」区块
 *   · 标题下的引导语一律不放（标题下方直接进内容）
 *   · 安全提示 / 退款承诺 / 操作指引这类内容统一收拢到页面底部，
 *     用同一个标题「使用帮助」，让每一页的结构一致：
 *     步骤条 → h1 标题 → 内容 → 主按钮 → 使用帮助
 * ============================================================ */
.sg-help {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.sg-help-title {
  font-size: 13.5px; font-weight: 700; color: var(--ink-200);
  margin-bottom: 10px; letter-spacing: .01em;
}
.sg-help-body { font-size: 13px; line-height: 1.7; color: var(--ink-400); }
.sg-help-body p { margin: 0 0 8px; }
.sg-help-body p:last-child { margin-bottom: 0; }
.sg-help-body b { color: var(--ink-200); font-weight: 600; }
.sg-help-body a { color: var(--brand-400); font-weight: 500; text-decoration: none; }
.sg-help-body a:hover { text-decoration: underline; }
.sg-help-body ol { margin: 0; padding-left: 18px; }
.sg-help-body ol li { margin-bottom: 8px; }
.sg-help-body ol li:last-child { margin-bottom: 0; }
.sg-help-note { margin-top: 10px; font-size: 12px; color: var(--ink-500); }

/* 浅色主题：弱化色换深一档保证对比度 */
html.sg-light .sg-help { border-top-color: #e5e7eb; }
html.sg-light .sg-help-title { color: #0f172a; }
html.sg-light .sg-help-body { color: #64748b; }
html.sg-light .sg-help-body b { color: #334155; }
html.sg-light .sg-help-body a { color: #2563eb; }
html.sg-light .sg-help-note { color: #94a3b8; }
