:root {
  --brand: #17191f;
  --brand-surface: #24272e;
  --canvas: #f3f5f7;
  --panel: #ffffff;
  --ink: #171a21;
  --muted: #626b78;
  --muted-soft: #88919e;
  --line: #e1e4e9;
  --line-strong: #cfd4dc;
  --blue: #356fe5;
  --blue-hover: #285fcf;
  --blue-soft: #edf3ff;
  --teal: #0f9f83;
  --teal-soft: #e3f6f0;
  --mint: #7ee0b8;
  --amber: #b97418;
  --amber-soft: #fff3df;
  --red: #d65353;
  --red-soft: #fff0f0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { min-height: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--canvas); font-size: 14px; line-height: 1.55; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; min-height: 40px; padding: 9px 12px; border-radius: 7px; color: #fff; background: var(--brand); font-weight: 700; text-decoration: none; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.public-shell:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.public-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.inline-icon { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.public-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1260px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}
.public-brand { display: inline-flex; min-height: 44px; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.public-mark {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}
.public-mark::after { position: absolute; right: 5px; bottom: 5px; width: 6px; height: 6px; border-radius: 2px; background: var(--mint); content: ""; }
.public-brand strong, .public-brand small { display: block; }
.public-brand strong { font-size: 16px; line-height: 1.05; }
.public-brand small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.public-tools { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; }
.language-pill { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.service-dot { display: inline-flex; align-items: center; gap: 7px; }
.service-dot i, .service-notice i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.service-dot.unavailable { color: #ad4141; }
.service-dot.unavailable i { background: var(--red); box-shadow: 0 0 0 3px rgba(214, 83, 83, .14); }

.public-shell { width: min(100%, 1160px); margin: 0 auto; padding: 42px 24px 64px; }
.public-heading { text-align: center; }
.public-eyebrow, .card-kicker { color: var(--blue); font-size: 11px; font-weight: 800; }
.public-heading h1 { margin: 7px 0 5px; color: var(--ink); font-size: clamp(34px, 4vw, 47px); line-height: 1.12; }
.public-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.support-pill { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; margin-top: 16px; padding: 0 14px; border-radius: 7px; color: #fff; background: var(--brand); font-size: 12px; font-weight: 700; text-decoration: none; transition: background .18s ease, transform .18s ease; }
.support-pill:hover { background: #2a2d34; transform: translateY(-1px); }
.service-notice { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; padding: 12px 16px; border: 1px solid #b8e6d8; border-radius: 7px; color: #087665; background: var(--teal-soft); font-size: 12px; font-weight: 700; }
.service-notice.checking { border-color: #d9dee6; color: #68717f; background: #f5f6f8; }
.service-notice.checking i { background: #88919e; box-shadow: 0 0 0 3px rgba(136, 145, 158, .16); }
.service-notice.unavailable { border-color: #f0c9c9; color: #ad4141; background: var(--red-soft); }
.service-notice.unavailable i { background: var(--red); box-shadow: 0 0 0 3px rgba(214, 83, 83, .14); }

.recharge-layout { display: grid; grid-template-columns: minmax(300px, .76fr) minmax(0, 1.24fr); gap: 16px; align-items: start; }
.guide-card, .flow-card { border-radius: 8px; box-shadow: 0 12px 34px rgba(27, 31, 39, .07); }
.guide-card { padding: 26px 24px 23px; border: 1px solid #2b2f37; background: var(--brand); color: #fff; }
.guide-card .card-kicker { color: var(--mint); }
.guide-card h2, .flow-head h2 { margin: 6px 0 0; font-size: 22px; line-height: 1.25; }
.guide-card h2 { color: #fff; }
.guide-intro { margin: 8px 0 22px; color: #aeb4bf; font-size: 12px; }
.guide-list { margin: 0; padding: 0; list-style: none; }
.guide-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 0 0 18px; }
.guide-item + .guide-item { padding-top: 18px; border-top: 1px solid #30343c; }
.guide-number { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #3b404a; border-radius: 7px; color: #cbd0d8; background: var(--brand-surface); font-size: 12px; font-weight: 800; }
.guide-item.active .guide-number { border-color: var(--mint); color: #122019; background: var(--mint); }
.guide-item strong { display: block; margin-top: 2px; color: #fff; font-size: 13px; }
.guide-item p { margin: 5px 0 9px; color: #aeb4bf; font-size: 12px; line-height: 1.65; }
.guide-link { display: inline-flex; min-height: 36px; align-items: center; gap: 6px; padding: 0 10px; border-radius: 6px; color: #fff; background: #356fe5; font-size: 11px; font-weight: 750; text-decoration: none; transition: background .18s ease; }
.guide-link:hover { background: #477eea; }
.support-note { margin-top: 4px; padding-top: 16px; border-top: 1px solid #30343c; color: #aeb4bf; font-size: 11px; }
.support-note strong { display: block; color: #fff; font-size: 12px; }
.support-note span { display: block; margin-top: 4px; }

.flow-card { min-width: 0; padding: 28px 30px 31px; border: 1px solid var(--line); background: var(--panel); }
.flow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.flow-head h2 { color: var(--ink); font-size: 23px; }
.flow-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.step-badge { flex: 0 0 auto; min-height: 28px; margin-top: 1px; padding: 5px 10px; border-radius: 999px; color: #68717f; background: #eef0f3; font-size: 11px; font-weight: 700; }
.step-content { margin-top: 30px; }
.redeem-form label, .session-form label { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; color: #424a56; font-size: 13px; font-weight: 700; }
label em { color: var(--red); font-style: normal; }
.card-key-row { display: flex; gap: 9px; }
.card-key-row input, .session-form textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.card-key-row input { min-width: 0; height: 46px; padding: 0 13px; font-size: 14px; }
.card-key-row input:focus, .session-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53, 111, 229, .13); outline: 0; }
.card-key-row input[aria-invalid="true"], .session-form textarea[aria-invalid="true"] { border-color: var(--red); }
.card-key-row input::placeholder, .session-form textarea::placeholder { color: #a0a7b2; }
.primary-action { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border-radius: 7px; color: #fff; background: var(--blue); box-shadow: 0 7px 16px rgba(53, 111, 229, .18); font-size: 13px; font-weight: 750; white-space: nowrap; transition: background .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease; }
.primary-action:hover { background: var(--blue-hover); box-shadow: 0 9px 20px rgba(53, 111, 229, .23); transform: translateY(-1px); }
.primary-action:disabled { opacity: .58; cursor: wait; transform: none; }
.field-hint { margin: 9px 0 0; color: var(--muted-soft); font-size: 11px; }
.field-error { margin: 8px 0 0; color: #bd4040; font-size: 12px; }
.order-summary { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 15px; align-items: center; padding: 15px 16px; border-left: 3px solid var(--blue); background: #f6f8fb; }
.order-summary span, .status-line > span:first-child { display: block; color: var(--muted-soft); font-size: 11px; }
.order-summary strong { display: block; margin-top: 3px; color: var(--ink); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.gift-plan { padding: 5px 8px; border-radius: 5px; color: #315fbf; background: var(--blue-soft); font-size: 11px; font-weight: 750; }
.status-line { display: flex; align-items: center; gap: 9px; margin: 16px 0 22px; }
.status-chip { display: inline-flex; min-height: 24px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-chip.pending { color: var(--amber); background: var(--amber-soft); }
.status-chip.processing { color: #315fbf; background: var(--blue-soft); }
.status-chip.success { color: #087665; background: var(--teal-soft); }
.status-chip.failed { color: #b63f43; background: var(--red-soft); }
.text-action { min-height: 36px; margin-left: auto; padding: 0 5px; color: var(--blue); background: transparent; font-size: 12px; font-weight: 650; }
.text-action:hover { text-decoration: underline; }
.session-form label a { min-height: 32px; margin-left: auto; padding-top: 6px; color: var(--blue); font-size: 11px; font-weight: 650; text-decoration: none; }
.session-form label a:hover { text-decoration: underline; }
.session-form textarea { display: block; min-height: 190px; padding: 12px 13px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.65; }
.session-form textarea[readonly] { color: #75808e; background: #f6f7f9; }
.submit-action { min-width: 138px; margin-top: 17px; }
.result-panel { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.result-head strong { display: block; margin-top: 4px; font-size: 13px; }
.result-panel textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 7px; color: #3f4957; background: #f6f7f9; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.65; }
.result-tip { margin: 8px 0 0; color: var(--muted-soft); font-size: 11px; }
.public-toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 10; display: flex; flex-direction: column; gap: 8px; }
.public-toast { max-width: min(360px, calc(100vw - 44px)); padding: 12px 14px; border: 1px solid #d6dbe2; border-radius: 7px; color: #fff; background: var(--brand); box-shadow: 0 14px 34px rgba(23, 25, 31, .2); font-size: 12px; animation: toast-in .18s ease; }

@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 820px) {
  .public-topbar { min-height: 62px; padding: 0 17px; }
  .public-tools .service-dot { display: none; }
  .public-shell { padding: 30px 15px 42px; }
  .recharge-layout { grid-template-columns: 1fr; }
  .guide-card { order: 2; }
  .flow-card { order: 1; }
}
@media (max-width: 520px) {
  .public-brand small { display: none; }
  .public-tools { gap: 8px; }
  .language-pill { padding: 6px 8px; font-size: 11px; }
  .public-heading h1 { font-size: 34px; }
  .public-heading p { font-size: 13px; }
  .flow-card { padding: 24px 17px 22px; }
  .flow-head { display: block; }
  .step-badge { display: inline-flex; margin-top: 13px; }
  .card-key-row { display: block; }
  .card-key-row input { display: block; }
  .card-key-row .primary-action { width: 100%; min-height: 46px; margin-top: 9px; }
  .order-summary { grid-template-columns: 1fr 1fr; }
  .gift-plan { grid-column: 1 / -1; justify-self: start; }
  .guide-card { padding: 23px 18px; }
  .submit-action { width: 100%; }
  input, textarea, select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
