/* ============================================================================
   GPT 卡密兑换中心 · 样式表
   ----------------------------------------------------------------------------
   设计基调参考 redeemgpt：
     · 冷白底 + 135° 淡蓝渐变
     · 内容宽 1100，入口卡 696，圆角 22，内距 32
     · 卡片 0 20px 45px 深阴影，hover 上浮 3px
     · Inter 优先，标题居中 34px，字距收紧
     · 主按钮深色实心 #0f172a，次按钮白底描边
   2026-09-23 重写（原「暖色奶油风」已废弃）
   ============================================================================ */

:root {
  /* ── 色板 ── */
  --ink:        #0f172a;
  --ink-2:      #1e293b;
  --ink-3:      #334155;
  --muted:      #6b7280;
  --slate-400:  #94a3b8;
  --line:       #e2e8f0;
  --line-soft:  rgba(148, 163, 184, 0.22);
  --surface:    #ffffff;
  --surface-2:  #f7fbff;
  --page:       #f7faff;
  --tint:       #eef6ff;

  --blue:       #2563eb;
  --blue-soft:  #eef2ff;
  --blue-line:  rgba(37, 99, 235, 0.28);

  --ok:         #059669;
  --ok-soft:    rgba(5, 150, 105, 0.10);
  --ok-line:    rgba(5, 150, 105, 0.32);
  --bad:        #dc2626;
  --bad-soft:   rgba(220, 38, 38, 0.08);
  --bad-line:   rgba(220, 38, 38, 0.32);
  --warn:       #d97706;
  --warn-soft:  rgba(217, 119, 6, 0.12);
  --warn-line:  rgba(217, 119, 6, 0.30);

  /* ── 尺寸 ── */
  --max-width:  1100px;
  --entry-width: 696px;
  --radius-card: 22px;
  --radius-ctl:  12px;
  --card-pad:    32px;
  --gutter:      20px;

  --shadow-card:  0 20px 45px rgba(15, 23, 42, 0.12);
  --shadow-hover: 0 28px 60px rgba(15, 23, 42, 0.14);
  --shadow-btn:   0 8px 18px rgba(59, 130, 246, 0.18);
  --shadow-deep:  0 8px 20px rgba(15, 23, 42, 0.18);

  --motion: 180ms ease;
  --font: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei UI", "Segoe UI",
          system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 整体布局：135° 淡蓝渐变，占满视口 ── */
.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f7faff 0%, #eef6ff 48%, #f8fafc 100%);
}

/* ══════════════════════════════════════════════════════════════════════════
   顶栏
   ══════════════════════════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter) 0;
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

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

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand small {
  font-size: 11px;
  font-weight: 500;
  color: var(--slate-400);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.nav { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.nav button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--motion), box-shadow var(--motion), color var(--motion);
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.nav button.active {
  background: rgba(255, 255, 255, 0.86);
  border-color: var(--line-soft);
  color: var(--blue);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* ══════════════════════════════════════════════════════════════════════════
   主体
   ══════════════════════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 var(--gutter) 48px;
}

.view { display: none; }
.view.active { display: block; animation: fadeDown 0.4s ease; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 居中大标题 ── */
.page-head {
  padding: 36px 0 22px;
  text-align: center;
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* ── 内容栈：入口卡宽度，居中 ── */
.stack {
  width: min(100%, var(--entry-width));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── 卡片 ── */
.card {
  background: linear-gradient(145deg, #ffffff, var(--surface-2));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #111827;
}

.muted {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════
   步骤条
   ══════════════════════════════════════════════════════════════════════════ */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--radius-ctl);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 12px;
  transition: border-color var(--motion), background var(--motion), color var(--motion);
}

.step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.22);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
}

.step b { font-weight: 600; line-height: 1.25; }

.step.active {
  border-color: var(--blue-line);
  background: rgba(37, 99, 235, 0.07);
  color: var(--ink);
  font-weight: 600;
}

.step.active span { background: var(--blue); color: #fff; }

.step.done span { background: var(--ok-soft); color: var(--ok); }

/* ══════════════════════════════════════════════════════════════════════════
   表单
   ══════════════════════════════════════════════════════════════════════════ */
.panel-step { display: none; }
.panel-step.active { display: block; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

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

.input-row { display: flex; gap: 10px; }
.input-wrap { flex: 1; position: relative; min-width: 0; }

input[type="text"],
textarea {
  font: inherit;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-ctl);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  transition: border-color var(--motion), box-shadow var(--motion);
}

input[type="text"]::placeholder,
textarea::placeholder { color: var(--slate-400); }

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════════════════════
   按钮
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  min-height: 46px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background var(--motion),
              border-color var(--motion), color var(--motion);
}

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

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-deep);
}

.btn-primary:hover:not(:disabled) {
  background: var(--ink-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
}

.btn-secondary {
  background: #fff;
  color: var(--ink-3);
  border-color: var(--line);
}

.btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: var(--slate-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn);
}

.btn-block { width: 100%; display: block; }

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

.btn-block + .btn-block,
.panel-step > .btn-block + .btn-block { margin-top: 10px; }

.panel-step > .btn-secondary.btn-block { margin-top: 10px; }

/* ══════════════════════════════════════════════════════════════════════════
   提示条 / 标签 / 状态
   ══════════════════════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-ctl);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.55;
}

.alert-error { background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--bad); }
.alert-info  { background: var(--blue-soft); border: 1px solid var(--blue-line); color: var(--ink); }
.alert-warn  { background: var(--warn-soft); border: 1px solid var(--warn-line); color: #b45309; }

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  font-family: var(--font-mono);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-3);
}

.status-pill.processing { color: var(--blue); border-color: var(--blue-line); background: rgba(37, 99, 235, 0.07); }
.status-pill.success    { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.status-pill.fail       { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }

.result-msg { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* ══════════════════════════════════════════════════════════════════════════
   确认信息表
   ══════════════════════════════════════════════════════════════════════════ */
.summary-grid {
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  overflow: hidden;
  margin-bottom: 18px;
  background: #fff;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  font-size: 14px;
}

.summary-row + .summary-row { border-top: 1px solid var(--line); }
.summary-row .k { color: var(--muted); flex-shrink: 0; }
.summary-row span:last-child { font-weight: 600; text-align: right; word-break: break-all; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--ink-3);
  cursor: pointer;
  line-height: 1.55;
}

.check-row input { margin-top: 3px; accent-color: var(--blue); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   进度条（预检）
   ══════════════════════════════════════════════════════════════════════════ */
.check-progress {
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: #fff;
  padding: 16px;
  margin-bottom: 18px;
}

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

.check-progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--slate-400);
}

.check-progress-steps li { display: flex; align-items: center; gap: 8px; }
.check-progress-steps li::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}
.check-progress-steps li.active { color: var(--blue); font-weight: 600; }
.check-progress-steps li.active::before { background: var(--blue); }
.check-progress-steps li.done { color: var(--ok); }
.check-progress-steps li.done::before { background: var(--ok); }

.spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* ══════════════════════════════════════════════════════════════════════════
   时间线
   ══════════════════════════════════════════════════════════════════════════ */
.timeline { list-style: none; margin: 18px 0 0; padding: 0; }

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

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

.timeline li::after {
  content: "";
  position: absolute;
  left: 7.5px; top: 19px; bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline li:last-child::after { display: none; }
.timeline li strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.timeline li span { font-size: 12px; color: var(--slate-400); }

/* ══════════════════════════════════════════════════════════════════════════
   教程列表
   ══════════════════════════════════════════════════════════════════════════ */
.help-list {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.8;
}

.help-list li { margin-bottom: 10px; }
.help-list strong { color: var(--ink); }

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

kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  color: #1d4ed8;
}

.session-helper {
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: #fff;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--ink-3);
}

.session-helper p { margin: 0 0 8px; }
.session-helper ol { margin: 0; padding-left: 20px; line-height: 1.8; }

/* ══════════════════════════════════════════════════════════════════════════
   页脚
   ══════════════════════════════════════════════════════════════════════════ */
.site-footer {
  margin-top: auto;
  padding: 28px var(--gutter) 24px;
  text-align: center;
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.site-footer-tagline {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.site-footer-bottom {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--slate-400);
}

/* ══════════════════════════════════════════════════════════════════════════
   弹窗
   ══════════════════════════════════════════════════════════════════════════ */
.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.42);
  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: 30px 28px 24px;
  border-radius: var(--radius-card);
  background: linear-gradient(145deg, #ffffff, var(--surface-2));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 32px 70px rgba(15, 23, 42, 0.3);
  animation: fadeDown 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--motion), color var(--motion);
}

.modal-close:hover { background: var(--line); color: var(--ink); }

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

.modal-brand h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.modal-sub { margin: 0; font-size: 13px; color: var(--muted); }

.modal-steps {
  margin: 0 0 18px;
  padding-left: 22px;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.7;
}

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

.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(--muted);
  cursor: pointer;
}

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

/* ══════════════════════════════════════════════════════════════════════════
   信息区（卡片下方的三格卖点）
   ══════════════════════════════════════════════════════════════════════════ */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-ctl);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.62);
}

.feature-ico {
  font-size: 17px;
  line-height: 1.2;
  flex-shrink: 0;
}

.feature b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.4;
}

.feature small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}

/* 弱化版卡片（用来收尾，不抢主卡视觉） */
.card-quiet {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  padding: 24px;
}

.card-quiet h2 { font-size: 18px; }
.card-quiet .muted { margin-bottom: 14px; }

/* 验证卡密按钮：跟输入框留出间距 */
.btn-verify { margin-top: 12px; }

/* ══════════════════════════════════════════════════════════════════════════
   响应式
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --card-pad: 24px; --gutter: 16px; }

  .topbar { flex-wrap: wrap; gap: 12px; padding-top: 14px; }
  .nav { width: 100%; justify-content: flex-start; }
  .nav button { padding: 6px 14px; font-size: 12.5px; }

  .page-head { padding: 26px 0 18px; }
  .page-head h1 { font-size: 27px; }
  .page-head p { font-size: 14px; }

  .card h2 { font-size: 20px; }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .step { padding: 10px 6px; font-size: 11.5px; }
  .step span { width: 20px; height: 20px; font-size: 11px; }

  .input-row { flex-direction: column; }
  .input-row .btn { width: 100%; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { min-width: 0; }

  .summary-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .summary-row span:last-child { text-align: left; }

  .features { grid-template-columns: 1fr; gap: 8px; }
  .feature { padding: 13px 14px; }
  .card-quiet { padding: 20px; }
}

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

/* ── 品牌图标（勇哥 logo，透明底盾牌）── */
.brand-logo { width: 40px; height: 40px; flex: none; }
.hero-logo { width: 72px; height: 72px; display: block; margin: 0 auto 12px; }
@media (max-width: 520px) {
  .brand-logo { width: 34px; height: 34px; }
  .hero-logo { width: 60px; height: 60px; }
}
