/* 卡密兑换中心 — 样式表 */
:root {
  --sun-bg: #f4f8ff;
  --sun-bg-soft: #e7effc;
  --sun-card: #ffffff;
  --sun-popover: #ffffff;
  --sun-text: #16233b;
  --sun-text-muted: #5b6b85;
  --sun-border: #d9e4f5;
  --sun-primary: #2563eb;
  --sun-primary-hover: #1d4ed8;
  --sun-gold: #3b82f6;
  --sun-olive: #64748b;
  --sun-olive-soft: #e8effc;
  --sun-success: #16a34a;
  --sun-warning: #b45309;
  --sun-danger: #dc2626;
  --sun-link: #1d4ed8;
  --sun-shadow: rgba(15, 23, 42, 0.12);
  --sun-footer: #ffffff;

  --page: var(--sun-bg);
  --surface: var(--sun-card);
  --surface-hover: var(--sun-bg-soft);
  --border: var(--sun-border);
  --input-border: var(--sun-border);
  --text: var(--sun-text);
  --text-secondary: var(--sun-text-muted);
  --primary: var(--sun-primary);
  --primary-hover: var(--sun-primary-hover);
  --secondary: var(--sun-olive);
  --highlight: var(--sun-gold);
  --on-accent: #fff;
  --danger: var(--sun-danger);
  --radius-control: 12px;
  --radius-card: 18px;
  --radius-hero: 22px;
  --max-width: 680px;
  --gutter: 16px;
  --motion: 180ms ease;
  --font: -apple-system, BlinkMacSystemFont, "HarmonyOS SC", "MiSans", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  --font-title: var(--font);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 兜底：图片等元素带 display 会盖掉浏览器默认的 [hidden]{display:none}，
   导致「隐藏」失效（空图框仍显示）。前台多处靠 hidden 切换，必须兜住。 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 4%, rgba(59, 130, 246, 0.18), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.1), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 72%);
}

a {
  color: var(--sun-link);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.glow {
  pointer-events: none;
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
}

.glow-a {
  width: 360px;
  height: 360px;
  top: -100px;
  right: -60px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
}

.glow-b {
  width: 280px;
  height: 280px;
  bottom: 8%;
  left: -50px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, transparent 70%);
  opacity: 0.35;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--sun-shadow);
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.hero-with-logo {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.hero-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 4px;
  display: block;
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

/* 页脚：一条极简横排 —— LOGO + 站名 + 分隔线 + 标语，版权贴右侧。
   固定在底部，所以 body 要留出它的高度。 */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  box-shadow: 0 -6px 20px rgba(37, 99, 235, .06);
}

.site-footer-row {
  position: relative;
  width: min(100% - var(--gutter) * 2, 1120px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

body {
  padding-bottom: 62px;
}

/* 页脚 LOGO：图片直接铺满小方框，不留内边距。
   原来有 padding:3px + 淡蓝底，等于给图片套了一层"框"，看起来像没铺满。 */
.site-footer-logo {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 7px;
  object-fit: cover;
  background: transparent;
}

.site-footer-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.site-footer-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.site-footer-tagline {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.site-footer-copy {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
}

.nav {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topbar-spacer {
  justify-self: end;
}

.nav button,
.nav a.btn-ghost {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--motion), color var(--motion), border-color var(--motion);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav button:hover,
.nav a.btn-ghost:hover {
  background: var(--sun-bg-soft);
  color: var(--text);
  text-decoration: none;
}

.nav button.active {
  color: var(--primary-hover);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.12);
}

.main {
  width: min(100% - var(--gutter) * 2, var(--max-width));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ══════════════════ 立即兑换：左侧子页签 + 右侧内容 ══════════════════ */

.redeem-layout {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* 侧栏两项目间距取适中：既分明又不散 */
.redeem-side {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.redeem-side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--text-secondary);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: background var(--motion), border-color var(--motion), color var(--motion),
    box-shadow var(--motion);
}

.redeem-side-item svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--text-secondary);
  transition: color var(--motion);
}

.redeem-side-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.redeem-side-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.redeem-side-text small {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.72;
}

.redeem-side-item:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--text);
}

.redeem-side-item:hover svg {
  color: var(--primary);
}

.redeem-side-item.active {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.5);
  color: var(--primary-hover);
  box-shadow: inset 3px 0 0 var(--primary);
}

.redeem-side-item.active svg {
  color: var(--primary);
}

.redeem-side-item.active strong {
  color: var(--primary-hover);
}

.redeem-body {
  min-width: 0;
}

.redeem-sub {
  display: none;
}

.redeem-sub.active {
  display: block;
  animation: panelIn 260ms ease both;
}

/* 兑换区内的标题区比全局 hero 更收敛，给表单留白 */
.redeem-sub .hero {
  margin-bottom: 22px;
}

.redeem-sub .hero .eyebrow {
  margin-bottom: 8px;
  font-size: 12.5px;
}

.redeem-sub .hero h1 {
  font-size: clamp(22px, 3vw, 28px);
}

.redeem-sub .hero .subtitle {
  font-size: 14.5px;
  line-height: 1.75;
}

/* ══════════════════ 客服微信：弹窗卡片（左选客服 / 右二维码） ══════════════════ */

.cs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(5, 12, 28, 0.55);
  backdrop-filter: blur(6px);
}

.cs-backdrop[hidden] {
  display: none !important;
}

.cs-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 30px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(3, 12, 34, 0.3);
  animation: csDialogIn 220ms ease both;
}

@keyframes csDialogIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cs-dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #5b6b85;
  background: #eef2f9;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cs-dialog__close:hover {
  color: var(--text);
  background: #e2e8f4;
}

.cs-dialog__head {
  margin-bottom: 20px;
  padding: 0 34px;
  text-align: center;
}

.cs-dialog__eyebrow {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.cs-dialog__head h2 {
  margin: 8px 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cs-dialog__sub {
  margin: 0;
  color: #55617a;
  font-size: 13px;
  line-height: 1.6;
}

/* 弹窗主体：左客服列表 + 右二维码卡片 */
.cs-dialog__body {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.cs-side {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f7faff;
}

.cs-side-title {
  margin: 0 0 10px;
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
}

.cs-side-item {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.cs-side-item:last-child {
  margin-bottom: 0;
}

.cs-side-item:hover {
  border-color: #2563eb;
  background: #f4f8ff;
}

.cs-side-item.active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  box-shadow: inset 3px 0 0 #2563eb;
}

.cs-side-empty {
  margin: 0;
  padding: 18px 12px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.cs-body {
  min-width: 0;
}

.cs-detail-card {
  max-width: 300px;
  margin: 0 auto;
  padding: 22px 20px 20px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(37, 99, 235, 0.1);
  text-align: center;
}

.cs-detail-card img {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: #f4f8ff;
  object-fit: contain;
}

.cs-detail-card h3 {
  margin: 16px 0 4px;
  font-size: 17px;
  font-weight: 800;
}

.cs-detail-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.cs-detail-empty {
  margin: 0;
  padding: 48px 16px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 640px) {
  /* 窄屏弹窗改上下结构：客服列表收成横排小胶囊，二维码卡片独占一行 */
  .cs-dialog {
    padding: 24px 18px;
  }
  .cs-dialog__head {
    padding: 0 26px;
  }
  .cs-dialog__body {
    grid-template-columns: 1fr;
  }
  .cs-side-item {
    display: inline-block;
    width: auto;
    margin: 0 8px 8px 0;
  }
  .cs-side-title {
    width: 100%;
  }
}

@media (max-width: 860px) {
  .redeem-layout {
    grid-template-columns: 1fr;
  }
  .redeem-side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .redeem-side-item {
    flex: 1 1 160px;
  }
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--highlight);
}

.hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-title);
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 30px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 12px 32px rgba(37, 99, 235, 0.07);
}

.card h2 {
  display: flex;
  align-items: center;
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.panel-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.card .hint {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 密码强度提示：默认次要灰，达标转绿 */
.pw-hint {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.pw-hint--ok {
  color: #15803d;
  font-weight: 600;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.field label span {
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 6px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-row .btn {
  flex: 1;
  min-width: 140px;
}

.session-helper {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: var(--sun-olive-soft);
  font-size: 14px;
  color: var(--text-secondary);
}

.session-helper p {
  margin: 0 0 8px;
  color: var(--text);
}

.session-helper ol {
  margin: 0;
  padding-left: 20px;
}

.session-helper li {
  margin-bottom: 6px;
}

.session-helper kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-wrap {
  flex: 1;
  position: relative;
}

input[type="text"],
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--input-border);
  background: #fff;
  color: var(--text);
  transition: border-color var(--motion), box-shadow var(--motion);
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 48px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--motion), transform var(--motion), opacity var(--motion), box-shadow var(--motion);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #4d82ff 0%, #2563eb 58%, #1d4ed8 100%);
  color: var(--on-accent);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #e88955 0%, #4d82ff 58%, #2563eb 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
  background: var(--surface);
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--sun-olive-soft);
}

.btn-block {
  width: 100%;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 24px 0 20px;
}

.step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: left;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 12.5px;
  color: var(--text-secondary);
  min-width: 0;
}

.step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sun-bg-soft);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: background var(--motion), color var(--motion), box-shadow var(--motion);
}

.step b {
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step.active {
  color: var(--primary-hover);
}

.step.active span {
  background: var(--primary);
  color: var(--on-accent);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}

.step.done span {
  background: rgba(37, 99, 235, 0.14);
  color: var(--primary);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-control);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(173, 78, 66, 0.1);
  border: 1px solid rgba(173, 78, 66, 0.35);
  color: var(--danger);
}

.alert-info {
  background: var(--sun-olive-soft);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: var(--text);
}

.alert-warn {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #7a5a18;
}

.summary-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row .k {
  color: var(--text-secondary);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.2);
  color: #9a6a12;
}

.tag-purple {
  background: var(--sun-olive-soft);
  color: var(--secondary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.status-pill.processing {
  color: var(--primary-hover);
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.08);
}

.status-pill.success {
  color: var(--sun-success);
  background: rgba(79, 123, 87, 0.12);
  border-color: rgba(79, 123, 87, 0.35);
}

.status-pill.fail {
  color: var(--danger);
  border-color: rgba(173, 78, 66, 0.35);
  background: rgba(173, 78, 66, 0.08);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 16px 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.timeline li strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}

.privacy {
  display: none;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
}

.modal-mask[hidden] {
  display: none !important;
}

.modal-card {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px 24px 22px;
  border-radius: var(--radius-hero);
  border: 1px solid var(--border);
  background: var(--sun-popover);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--sun-bg-soft);
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
  background: var(--border);
}

.modal-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-right: 28px;
}

.modal-brand h2 {
  margin: 0 0 4px;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-steps {
  margin: 0 0 16px;
  padding-left: 22px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.modal-steps li {
  margin-bottom: 10px;
}

.modal-steps code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--primary-hover);
  word-break: break-all;
}

.modal-steps kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-check input {
  accent-color: var(--primary);
}

.help-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
}

.help-list li {
  margin-bottom: 10px;
}

.help-list a {
  font-weight: 600;
}

.panel-step {
  display: none;
}

.panel-step.active {
  display: block;
  animation: panelIn 240ms ease both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.check-row input {
  margin-top: 4px;
  accent-color: var(--primary);
}

.check-progress {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.06);
}

.check-progress-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 14px;
}

.check-progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.check-progress-steps li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--motion);
}

.check-progress-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  box-sizing: border-box;
}

.check-progress-steps li.active {
  color: var(--text);
}

.check-progress-steps li.active::before {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.25);
  animation: progress-pulse 1.2s ease infinite;
}

.check-progress-steps li.done {
  color: var(--sun-success);
}

.check-progress-steps li.done::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  top: 0.2em;
  left: -1px;
  border: none;
  background: rgba(79, 123, 87, 0.18);
  color: var(--sun-success);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

@keyframes progress-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0);
  }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(37, 99, 235, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  /* 页脚在窄屏折成两行：品牌行 + 版权行，body 相应多留一点高度 */
  .site-footer-row {
    gap: 6px 8px;
  }

  .site-footer-copy {
    position: static;
    width: 100%;
    text-align: center;
    transform: none;
    font-size: 11px;
  }

  body {
    padding-bottom: 78px;
  }

  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px var(--gutter);
  }

  .topbar-spacer {
    display: none;
  }

  .brand-title {
    font-size: 15px;
  }

  .hero-with-logo {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-logo {
    width: 64px;
    height: 64px;
    margin-top: 0;
  }

  .eyebrow {
    justify-content: center;
  }

  .nav {
    justify-content: center;
  }

  .input-row {
    flex-direction: column;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .step {
    padding: 12px 10px;
    gap: 6px;
  }

  .card {
    padding: 22px 18px;
  }

  .main {
    padding-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ══════════════════ 选择套餐（照抄参考站 /tutorial，白底蓝线） ══════════════════ */

.main--wide {
  width: min(100% - var(--gutter) * 2, 1180px);
  max-width: 1180px;
}

/* 立即兑换：侧栏 + 表单两栏。容器取适中宽度——比窄栏（680）舒展，
   又不至于像套餐页（1180）那样把表单行拉太长；正文约 660px 阅读宽度 */
.main--redeem {
  width: min(100% - var(--gutter) * 2, 900px);
  max-width: 900px;
}

.tutorial-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto;
}

.tutorial-plan-section {
  padding: 28px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.08);
}

.tutorial-section-title {
  margin-bottom: 22px;
}

.tutorial-section-title h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tutorial-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tutorial-plan-card {
  --plan-accent: #2563eb;
  --plan-soft: #eff6ff;
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px;
  border: 1px solid #e2e8f4;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 13px 34px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tutorial-plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.14);
}

/* 单击卡片选中：整卡变色 + 右上角「✓ 已选择」 */
.tutorial-plan-card {
  cursor: pointer;
}

.tutorial-plan-card.is-chosen {
  border-color: var(--plan-accent);
  box-shadow: 0 0 0 2px var(--plan-accent), 0 18px 40px rgba(15, 23, 42, 0.12);
}

.plan-chosen-mark {
  position: absolute;
  top: 14px;
  right: 14px;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--plan-accent);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.tutorial-plan-card.is-chosen .plan-chosen-mark {
  display: inline-flex;
}

.tutorial-plan-card.is-chosen .tutorial-plan-card__badge {
  margin-right: 76px;
}

/* 色调体系（8 色）：按色轮均匀分布，每张套餐卡一个色相。
   主色必须与下方 soft 底色组合出 ≥4.5:1 的对比度（角标与特性勾都是小字号）。
   价格数字用深墨色 #0f172a，不随色调变化。 */
.tutorial-plan-card--olive {
  --plan-accent: #4d7c0f;
  --plan-soft: #f7fee7;
}

.tutorial-plan-card--emerald {
  --plan-accent: #047857;
  --plan-soft: #ecfdf5;
}

.tutorial-plan-card--fuchsia {
  --plan-accent: #a21caf;
  --plan-soft: #fdf4ff;
}

.tutorial-plan-card--rose {
  --plan-accent: #be123c;
  --plan-soft: #fff1f2;
}

/* 深色档（与默认四色同色相、明度更低，用于区分档位层次） */
.tutorial-plan-card--navy {
  --plan-accent: #1e3a8a;
  --plan-soft: #eef2ff;
}

.tutorial-plan-card--teal {
  --plan-accent: #0e5c7a;
  --plan-soft: #ecfeff;
}

.tutorial-plan-card--crimson {
  --plan-accent: #9f1239;
  --plan-soft: #fff1f2;
}

.tutorial-plan-card--amberD {
  --plan-accent: #92400e;
  --plan-soft: #fff7e8;
}

.tutorial-plan-card--pro5 {
  --plan-accent: #6d4aff;
  --plan-soft: #f3f0ff;
}

/* 橙：原 #d97706 的角标文字在 #fff7e8 上只有 2.99:1（AA 要求 4.5:1）。
   保持色相按比例压暗到 #ab5e05 → 4.55:1。 */
.tutorial-plan-card--pro20 {
  --plan-accent: #ab5e05;
  --plan-soft: #fff7e8;
}

/* 青：原 #0891b2 的角标文字在 #ecfeff 上只有 3.54:1，压暗到 #077e9b → 4.52:1 */
.tutorial-plan-card--pro500 {
  --plan-accent: #077e9b;
  --plan-soft: #ecfeff;
}

.tutorial-plan-card__badge {
  align-self: flex-start;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--plan-accent);
  background: var(--plan-soft);
  font-size: 13px;
  font-weight: 800;
}

.tutorial-plan-card h3 {
  margin: 22px 0 13px;
  font-size: clamp(23px, 2vw, 29px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.tutorial-plan-card__price {
  display: grid;
  min-width: 0;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 6px;
  white-space: nowrap;
}

.tutorial-plan-card__price small {
  color: #7b8190;
  font-size: 26px;
  font-weight: 700;
}

.tutorial-plan-card__price strong {
  color: #0f172a;
  font-size: clamp(44px, 3.6vw, 58px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.tutorial-plan-card__price span {
  color: #6f7480;
  font-size: 16px;
  font-weight: 700;
}

.tutorial-plan-card__description {
  min-height: 44px;
  margin: 22px 0 16px;
  color: #55617a;
  font-size: 14px;
  line-height: 1.7;
}

.tutorial-plan-card__features {
  display: grid;
  min-height: 132px;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #3f4a63;
  font-size: 14px;
}

.tutorial-plan-card__features li {
  position: relative;
  padding-left: 24px;
  line-height: 1.5;
}

.tutorial-plan-card__features li::before {
  position: absolute;
  left: 0;
  color: var(--plan-accent);
  content: "✓";
  font-size: 16px;
  font-weight: 900;
}

.tutorial-plan-card .plan-pick-btn {
  width: 100%;
  margin-top: auto;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--plan-accent);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.tutorial-plan-card .plan-pick-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.94);
}

.tutorial-footer {
  padding: 30px 10px 0;
  color: #7d8aa5;
  font-size: 13px;
  text-align: center;
}

/* ── 付款卡片（左栏：付款方式 + 预设客服 / 右栏：图片） ── */

/* 付款弹窗比客服卡片更窄：主体只有一张收款码 + 两条动作，
   跟着客服卡片 640px 会让两侧空出两百多像素，看着散。 */
.cs-dialog--pay {
  width: min(520px, 100%);
  padding: 24px 24px 22px;
  border-radius: 24px;
}

/* 头部金额块 */
.pay-amount {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, .18);
  background: rgba(37, 99, 235, .07);
}

.pay-amount span {
  color: var(--text-secondary);
  font-size: 12.5px;
}

.pay-amount strong {
  color: #dc2626;
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 付款方式切换（微信 / 支付宝） */
.pay-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 14px;
  padding: 4px;
  border-radius: 15px;
  background: #f1f5fb;
}

.pay-methods > button {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.pay-methods > button small { font-size: 11px; font-weight: 700; }

.pay-methods > button strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #22304a;
  font-size: 14px;
}

.pay-methods__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 7px;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.pay-methods__icon--wechat { background: #07c160; }
.pay-methods__icon--alipay { background: #1677ff; }

.pay-methods > button.active {
  border-color: #bdd2ff;
  background: #fff;
  box-shadow: 0 6px 16px rgba(32, 73, 151, .1);
}

.pay-methods > button.active small { color: var(--primary); }

/* 收款码图（含下方说明） */
.pay-stage__figure {
  width: min(286px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .07);
}

.pay-stage__figure img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

.pay-stage__figure figcaption {
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

/* 付款后提醒 */
.pay-notice {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sun-olive-soft);
  text-align: left;
}

.pay-notice > i {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-style: normal;
  font-weight: 800;
}

.pay-notice p { display: grid; gap: 3px; margin: 0; }
.pay-notice strong { color: var(--text); font-size: 14px; }
.pay-notice span { color: var(--text-secondary); font-size: 12px; }

/* 付款弹窗的紧凑覆盖：通用 .cs-dialog__head 带 34px 侧内缩 + 20px 下外距，
   在只有 520px 宽的付款卡里既显空又顶高度，这里单独收一档，
   保证 900px 高的常见视口里能一屏看全（不出现卡内滚动）。 */
.cs-dialog--pay .cs-dialog__head {
  margin-bottom: 12px;
  padding: 0;
}

.cs-dialog--pay .cs-dialog__head h2 {
  margin: 6px 0 4px;
  font-size: 21px;
}

.cs-dialog--pay .pay-notice > i {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.cs-dialog--pay .pay-act {
  padding: 12px 16px;
}

/* 底部动作区：主按钮（付款完成）+ 次级按钮（扫码加客服） */
.cs-dialog__foot {
  margin-top: 16px;
  display: grid;
  gap: 9px;
}

.pay-act {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, background .18s ease, border-color .18s ease;
}

.pay-act--primary {
  border: 0;
  color: #fff;
  background: #2563eb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .24);
}

.pay-act--primary:hover {
  transform: translateY(-1px);
  filter: brightness(.94);
}

/* 次级入口：不想跳转的，可以扫码加客服微信 */
.pay-act--ghost {
  border: 1px solid var(--border);
  background: #f4f8ff;
  color: #2563eb;
  font-size: 14px;
  padding: 11px 18px;
}

.pay-act--ghost:hover {
  background: #e8f0fe;
  border-color: #2563eb;
}


/* ══════════════════ 右侧竖排客服标签（照参考网页） ══════════════════ */

.cs-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  border-radius: 14px 0 0 14px;
  /* 深色取自全站文字色 --sun-text 一族的延续，压暗后与白底蓝线不打架 */
  background: linear-gradient(180deg, #26385c 0%, #16233b 100%);
  box-shadow: 0 14px 34px rgba(22, 35, 59, 0.32);
}

.cs-rail-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 0 7px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: color var(--motion), background var(--motion);
}

.cs-rail-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cs-rail-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform var(--motion);
}

.cs-rail.is-collapsed .cs-rail-toggle svg {
  transform: rotate(180deg);
}

.cs-rail-kf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 11px 14px;
  color: #fff;
  text-decoration: none;
  transition: background var(--motion);
}

.cs-rail-kf:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

.cs-rail-kf svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.cs-rail-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 5px;
  line-height: 1;
}

/* 收起后只剩一条细竖条 + 箭头，点箭头展开 */
.cs-rail.is-collapsed .cs-rail-kf {
  display: none;
}

.cs-rail-toggle:focus-visible,
.cs-rail-kf:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* 超窄屏上标签别贴太满，稍微缩一点 */
@media (max-width: 400px) {
  .cs-rail-kf {
    padding: 8px 9px 12px;
  }
  .cs-rail-text {
    font-size: 13px;
    letter-spacing: 3px;
  }
}

.plan-card:focus-visible,
.nav button:focus-visible,
.btn:focus-visible,
.plan-pick-btn:focus-visible,
.redeem-side-item:focus-visible,
.cs-side-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 960px) {
  .tutorial-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  /* 付款弹窗窄屏紧凑档：避免在 390×844 这类屏高下超出 max-height 出现卡内滚动 */
  .cs-dialog--pay {
    padding: 20px 18px 18px;
  }

  .cs-dialog--pay .cs-dialog__head h2 {
    font-size: 19px;
  }

  .cs-dialog--pay .pay-stage__figure {
    width: min(238px, 100%);
  }

  .cs-dialog--pay .pay-notice span {
    font-size: 11.5px;
  }

  .cs-dialog--pay .pay-act {
    padding: 11px 14px;
    font-size: 15px;
  }

  .tutorial-plan-section {
    padding: 16px;
    border-radius: 22px;
  }

  .tutorial-section-title h2 {
    font-size: 18px;
  }

  .tutorial-plan-grid {
    gap: 12px;
  }

  .tutorial-plan-card {
    padding: 18px;
    border-radius: 20px;
  }

  .tutorial-plan-card h3 {
    margin-top: 18px;
    font-size: 24px;
  }

  .tutorial-plan-card__price strong {
    font-size: 44px;
  }

  .tutorial-plan-card__price span {
    font-size: 14px;
  }

}

@media (max-width: 400px) {
  .tutorial-plan-grid {
    grid-template-columns: 1fr;
  }
}
