/* 兑换站样式 —— 对齐主站 AI自助充值系统视觉 */
:root {
  --brand: #0877f9;
  --brand-dark: #0866d6;
  --brand-light: #e6f0fe;
  --ink: #1b2733;
  --muted: #5b6672;
  --faint: #8a95a2;
  --line: #e4e9f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #1aa46b;
  --warn: #d98324;
  --bad: #d7443e;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(16, 42, 67, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.6 -apple-system, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.sr-only-heading {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }

/* ---------- 头部 ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.brand-name { font-size: 18px; font-weight: 600; }
.header-controls { display: flex; align-items: center; gap: 12px; }
.tutorial-nav { color: #fff; background: var(--brand); border-radius: 9px; text-decoration: none; font-size: 18px; font-weight: 600; padding: 7px 14px; white-space: nowrap; }
.tutorial-nav:hover { background: var(--brand-dark); }
.tutorial-nav:focus-visible { outline: 3px solid #80b8ff; outline-offset: 3px; }
.header-inner:has(.tutorial-nav) { flex-wrap: wrap; }
.header-inner:has(.tutorial-nav) .header-controls { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .tutorial-nav { font-size: 16px; } .header-inner:has(.tutorial-nav) { gap: 8px 16px; } .header-inner:has(.tutorial-nav) .header-controls { margin-left: auto; } }
.language-control select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; color: var(--ink);
  background: #fff; cursor: pointer;
}
.header-action {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.header-action:hover { border-color: var(--brand); color: var(--brand); }
.subscription-refresh { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.subscription-refresh svg { flex-shrink: 0; }
.recharge-controls svg { width: 18px; height: 18px; flex-shrink: 0; }
.recharge-controls > a, .recharge-controls > button, .recharge-controls > .recharge-language {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.6;
  min-height: 40px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 9px; white-space: nowrap; text-decoration: none;
}
.recharge-controls .tutorial-nav { background: #c6defa; border-color: #97bfea; color: #193f6b; }
.recharge-controls .tutorial-nav:hover { background: #b1d1f6; }
.recharge-controls .subscription-refresh { background: #ffdab0; border-color: #eeb87b; color: #6e3d11; }
.recharge-controls .subscription-refresh:hover { background: #ffcb91; }
.recharge-controls #query-toggle { background: #bee5cc; border-color: #8fc7a4; color: #194d2f; }
.recharge-controls #query-toggle:hover { background: #a8dab9; }
.recharge-controls #back-home { background: #dce0e5; border-color: #b8c0c9; color: #343d48; }
.recharge-controls #back-home:hover { background: #cbd1d9; }
.recharge-controls .recharge-language { background: #f5cddd; border-color: #dfa6bd; color: #702d49; }
.recharge-controls .recharge-language:hover { background: #efb9d0; }
.recharge-language select { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; padding: 0; max-width: 100%; }
.recharge-language select:focus-visible { outline: 2px solid #a54d75; outline-offset: 3px; }

/* ---------- 页面框架 ---------- */
.page-shell { flex: 1; }
.primary-layout { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
.hero { text-align: center; margin: 8px 0 28px; }
.hero h1 { font-size: 28px; margin: 0 0 10px; font-weight: 700; }
.hero-description { color: var(--muted); margin: 0; }

/* ---------- 工作区卡片 ---------- */
.workspace {
  max-width: 760px; margin: 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px;
}
.service-switcher { margin-bottom: 6px; }
.provider-readiness { font-size: 16px; margin: 0; text-align: center; }
.provider-readiness.is-available { color: var(--ok); }
.provider-readiness.is-unavailable { color: var(--bad); }

/* ---------- 步骤条 ---------- */
.stepper {
  list-style: none; display: flex; align-items: flex-start; gap: 0; margin: 0 0 26px; padding: 0;
  counter-reset: step;
}
.stepper .step { flex: 1; text-align: center; position: relative; color: var(--faint); font-size: 15px; }
.stepper .step span {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 6px;
  background: #fff; position: relative; z-index: 2;
}
/* 连接横线：只在相邻 step 之间的间隔处画一段短直线，放在圆点下方水平居中，不复盖文字 */
.stepper .step::before, .stepper .step::after {
  content: ""; position: absolute; top: 15px; height: 1.5px; background: var(--line); width: 50%; z-index: 1;
}
.stepper .step::before { right: 50%; }
.stepper .step::after { left: 50%; }
/* 首尾不画多余的半段，让线段只在两格之间 */
.stepper .step:first-child::before, .stepper .step:last-child::after { display: none; }
.stepper .step em { display: block; font-style: normal; font-size: 15px; margin-top: 2px; position: relative; z-index: 2; }
.stepper .step.is-current { color: var(--brand); }
.stepper .step.is-current span { border-color: var(--brand); background: var(--brand); color: #fff; }
.stepper .step.is-current::after { background: var(--brand); }

/* ---------- 步骤面板 ---------- */
.flow-stage { }
.flow-step { display: none; }
.flow-step.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.section-heading .heading-index {
  font-size: 26px; font-weight: 800; color: var(--brand-light); line-height: 1.1; min-width: 36px;
}
.section-heading h2 { margin: 0 0 4px; font-size: 18px; font-weight: 650; }
.section-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.flow-step .section-heading .heading-index { color: #000; }
.inspect-heading h2 { color: #000; font-size: 18px; line-height: 1.5; }
.inspect-heading .heading-index { font: inherit; min-width: 0; margin-right: 8px; }
.inspect-heading .inspect-note { font: inherit; }

/* 表单 */
.field-label { display: block; font-weight: 600; margin: 0 0 6px; font-size: 14px; }
.required-mark { color: var(--bad); }
input[type="text"], textarea, input:not([type]), select.plan-select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px;
  font: inherit; color: var(--ink); background: #fff; resize: vertical; transition: border-color .15s;
}
input:focus, textarea:focus, select.plan-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,119,249,.12); }
.field-error { color: var(--bad); font-size: 13px; margin: 6px 0 0; }
.field-help { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.field-counter { color: var(--faint); font-size: 12px; text-align: right; margin-top: 4px; }
.dynamic-field { margin: 16px 0; }
.dynamic-field.has-error input, .dynamic-field.has-error textarea { border-color: var(--bad); }
.dynamic-field textarea { min-height: 110px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.primary-button {
  width: 100%; background: var(--brand); color: #fff; border: none; border-radius: 9px;
  padding: 12px 20px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s;
}
.primary-button:hover { background: var(--brand-dark); }
.primary-button:disabled { opacity: .6; cursor: not-allowed; }
.button-row { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.button-row .primary-button { flex: 1; margin-top: 0; }
.secondary-button, .ghost-button {
  flex: 1; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 9px;
  padding: 12px 20px; font-size: 15px; cursor: pointer; transition: border-color .15s;
}
.secondary-button:hover { border-color: var(--faint); }

/* 商品概要 / 动态表单区 */
.product-card { margin: 18px 0; }
.product-card .product-name {
  display: inline-block; background: var(--brand-light); color: var(--brand);
  font-weight: 650; padding: 8px 14px; border-radius: 8px; font-size: 15px;
}
.details-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.form-error { margin: 12px 0 0; }

/* ---------- 结果卡片 ---------- */
.result-card {
  text-align: center; padding: 30px 20px; border-radius: var(--radius); background: #fff;
  border: 1px solid var(--line); animation: fade .25s ease;
}
.result-icon {
  width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; margin-bottom: 14px; background: var(--brand-light); color: var(--brand);
}
.result-card.is-success .result-icon { background: #e3f6ee; color: var(--ok); }
.result-card.is-processing .result-icon { background: var(--brand-light); color: var(--brand); }
.result-card.is-fail .result-icon { background: #fbe9e8; color: var(--bad); }
.result-card h2 { margin: 0 0 6px; font-size: 20px; }
.result-card p { margin: 0; color: var(--muted); }
.result-detail { margin-top: 16px; text-align: left; }
.kv-list { margin: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.kv-list div { display: flex; border-bottom: 1px solid var(--line); }
.kv-list div:last-child { border-bottom: none; }
.kv-list dt { width: 38%; background: #f8fafc; color: var(--muted); padding: 9px 12px; margin: 0; font-weight: 500; }
.kv-list dd { flex: 1; margin: 0; padding: 9px 12px; word-break: break-all; }

/* ---------- 查询面板 ---------- */
.query-layout { display: block; }
.query-layout > div { }
.query-input-summary { color: var(--faint); font-size: 12px; margin: 5px 0 0; }
.query-result { margin-top: 18px; }
.empty-state { text-align: center; color: var(--muted); padding: 22px 10px; border: 1px dashed var(--line); border-radius: 9px; }
.empty-state span { font-size: 28px; display: block; margin-bottom: 6px; color: var(--faint); }
.empty-state h3 { margin: 0 0 4px; font-size: 15px; }
.empty-state p { margin: 0; font-size: 13px; }
.query-summary { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.badge-success { color: var(--ok); }
.badge-warn { color: var(--warn); }
.badge-fail { color: var(--bad); }
.badge-ok { color: var(--ok); }
.query-row {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.query-card { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; flex: 1; }
.query-status { font-size: 13px; font-weight: 600; }
.row-success .query-status { color: var(--ok); }
.row-warn .query-status { color: var(--warn); }
.row-fail .query-status { color: var(--bad); }
.query-detail { width: 100%; margin-top: 6px; font-size: 13px; border-top: 1px dashed var(--line); padding-top: 6px; }
.query-detail div { display: flex; gap: 8px; padding: 2px 0; }
.query-detail span { color: var(--muted); min-width: 110px; }
.query-detail code { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.result-actions { }
.ghost-button { flex: 0 0 auto; }

/* ---------- 服务说明 ---------- */
.assurance {
  max-width: 760px; margin: 26px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.assurance > div {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; text-align: center;
}
.assurance span { font-size: 32px; color: var(--brand); display: block; margin-bottom: 8px; }
.assurance strong { display: block; font-size: 16px; margin-bottom: 6px; }
.assurance small { color: var(--muted); font-size: 13px; line-height: 1.55; display: block; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--card); margin-top: 40px;
}
.site-footer {
  max-width: 100%; padding: 16px 24px; display: flex; justify-content: space-between;
  gap: 12px; color: var(--muted); font-size: 13px; flex-wrap: wrap;
}
.site-footer span { }
.site-footer > span:first-child { display: flex; gap: 4px; }

/* ---------- 确认弹窗 ---------- */
.confirm-mask {
  position: fixed; inset: 0; background: rgba(15, 30, 46, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.confirm-mask[hidden] { display: none; }
.confirm-sheet {
  background: #fff; border-radius: var(--radius); max-width: 480px; width: 100%; padding: 26px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.confirm-sheet h2 { margin: 0 0 8px; font-size: 18px; }
.confirm-sheet > p { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.confirm-kv { margin: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.confirm-kv div { display: flex; border-bottom: 1px solid var(--line); }
.confirm-kv div:last-child { border-bottom: none; }
.confirm-kv dt { width: 36%; background: #f8fafc; color: var(--muted); padding: 9px 12px; margin: 0; }
.confirm-kv dd { flex: 1; margin: 0; padding: 9px 12px; word-break: break-all; }

@media (max-width: 640px) {
  .workspace { padding: 20px 16px; }
  .assurance { grid-template-columns: 1fr; }
  .header-inner { padding: 12px 16px; }
  .brand-name { font-size: 16px; }
}

/* ---------- 页面级 Tab（菲区卡付：充值/卡密查询/充值查询） ---------- */
.page-tabs {
  max-width: 760px; margin: -6px auto 18px; display: flex; gap: 8px;
  flex-wrap: wrap; justify-content: center;
}
.page-tab {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 9px 20px; border-radius: 999px; font-size: 14px; cursor: pointer;
  transition: all .15s;
}
.page-tab:hover { border-color: var(--brand); color: var(--brand); }
.page-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-panel { display: block; }
.page-panel[hidden] { display: none; }

/* 查询结果表 */
.query-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 16px; }
.query-list-header, .query-list-row {
  display: grid; grid-template-columns: 1.2fr 0.9fr 0.7fr 1fr 0.9fr;
  gap: 8px; align-items: center; padding: 10px 14px; font-size: 13px;
}
.query-list-header {
  background: #f6f8fc; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.query-list-row { border-bottom: 1px solid var(--line); word-break: break-all; }
.query-list-row:last-child { border-bottom: none; }
.query-list-row .cell-code { font-family: ui-monospace, Consolas, monospace; }
.qs-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.qs-ok { background: #e3f6ee; color: var(--ok); }
.qs-warn { background: #fff3e0; color: var(--warn); }
.qs-bad { background: #fbe9e8; color: var(--bad); }
.qs-info { background: var(--brand-light); color: var(--brand); }
.order-result-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.order-result-card .kv { display: flex; padding: 4px 0; font-size: 14px; }
.order-result-card .kv dt { width: 30%; color: var(--muted); margin: 0; }
.order-result-card .kv dd { flex: 1; margin: 0; word-break: break-all; }


/* Session account check shared by both channels. */
.session-preview { margin: 12px 0; font-size: 14px; }
.session-preview > p { color: var(--muted); margin: 8px 0; }
.field-help a { color: var(--primary, #0877f9); text-decoration: underline; }
.session-instructions { margin: 12px 0 18px; padding: 18px; border: 1px solid #d5e4f8; border-radius: 12px; background: #f5f9ff; font-size: 14px; line-height: 1.6; }
.session-instructions h3 { margin: 0 0 16px; font-size: 16px; font-weight: 700; }
.session-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.session-instructions .session-jump { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 11px 14px; border: 1px solid #0877f9; border-radius: 9px; background: #0877f9; color: #fff; font-size: 16px; font-weight: 650; line-height: 1.5; text-align: center; text-decoration: none; }
.session-instructions .session-login { background: #e1edff; color: #175594; border-color: #b9d2f5; }
.session-instructions .session-login:hover { background: #cfE1fc; }
.session-actions p { margin: 9px 0 0; color: var(--muted); font-size: 13px; font-weight: 400; }
.session-instructions .session-tab-hint { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.session-paste-label { margin: 0 0 8px; font-size: 14px; font-weight: 650; }
.session-preview.is-valid { padding: 14px; background: #eef8f2; border: 1px solid #baddc7; border-radius: 10px; }
.session-preview.is-valid > p { color: #24563b; font-weight: 650; margin-top: 0; }
.session-preview.is-valid .confirm-kv { background: #fff; }
@media (max-width: 560px) { .session-actions { grid-template-columns: 1fr; } }
.session-instructions .session-jump:not(.session-login):hover { background: #0562d1; }
.session-instructions .session-jump:focus-visible { outline: 3px solid #80b8ff; outline-offset: 2px; }
.service-switcher[hidden] { display: none; }
.claude-guide { margin: 16px 0; padding: 18px; border: 1px solid #c9ddff; border-left: 4px solid #78aaff; border-radius: 12px; background: #eff6ff; color: #235a9f; }
.claude-guide h3 { margin: 0 0 12px; font-size: 16px; }
.claude-guide p { margin: 0; line-height: 1.7; }
.claude-guide a { color: #0866df; text-decoration: underline; overflow-wrap: anywhere; }
#recovery-orders button { width: 100%; margin-top: 8px; white-space: normal; overflow-wrap: anywhere; }
