/* =============================================================================
   兑换中心 —— DeepSeek 风格独立站
   -----------------------------------------------------------------------------
   设计 token 取自 deepseek.com 实测：
     品牌蓝 #4176E6 · 浅蓝底 rgba(65,118,230,.12) · 页面底 #F9F8F8
     正文 #1E232C · 标题深蓝 #152443 · 边框 rgba(0,0,0,.06)
     圆角 18~24px · 胶囊 9999px · 字体 DM Sans
   ============================================================================= */

:root {
  --brand: #4176E6;
  --brand-hover: #3567D0;
  --brand-soft: rgba(65, 118, 230, .12);
  --brand-soft-2: rgba(65, 118, 230, .07);

  --bg: #F9F8F8;
  --surface: #FFFFFF;
  --text: #1E232C;
  --text-strong: #152443;
  --text-muted: #6B7280;
  --text-faint: #9AA1AC;
  --border: rgba(0, 0, 0, .08);
  --border-strong: rgba(0, 0, 0, .13);

  --danger: #D93A3A;
  --danger-soft: rgba(217, 58, 58, .1);
  --ok: #1F9D5C;
  --ok-soft: rgba(31, 157, 92, .1);
  --warn: #C8811A;
  --warn-soft: rgba(200, 129, 26, .1);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(21, 36, 67, .04);
  --shadow: 0 4px 20px rgba(21, 36, 67, .06);
  --shadow-lg: 0 12px 48px rgba(21, 36, 67, .1);

  --font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

/* hidden 属性必须优先于任何 display 声明
   （.sheet{display:grid} / .pill{display:inline-flex} 会让 hidden 失效 → 元素默认可见） */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── 背景：渐变 + 网格 ───────────────────────────────────── */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 50% -6%, rgba(65, 118, 230, .14), transparent 62%),
    radial-gradient(700px 420px at 82% 12%, rgba(65, 118, 230, .07), transparent 60%),
    linear-gradient(180deg, #F4F7FD 0%, #F9F8F8 42%, #F9F8F8 100%);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(21, 36, 67, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 36, 67, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.35) 34%, transparent 62%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.35) 34%, transparent 62%);
}

.wrap { width: min(100% - 40px, 860px); margin-inline: auto; }

/* ── 顶栏 ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  background: rgba(249, 248, 248, .72);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.topbar.stuck { border-bottom-color: var(--border); background: rgba(249,248,248,.9); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }

.brand {
  display: flex; align-items: center; gap: 9px;
  font-size: 17px; font-weight: 700; color: var(--brand); letter-spacing: -.01em;
}
.brand-mark { width: 22px; height: 22px; flex: none; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ── 英雄区 ───────────────────────────────────────────────── */
.hero { text-align: center; padding: 58px 0 34px; }
.hero h1 {
  margin: 0;
  font-size: clamp(30px, 5.4vw, 46px);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-strong);
  line-height: 1.24;
}
.hero-sub {
  margin: 16px 0 0;
  font-size: clamp(14px, 2vw, 16px);
  color: var(--text-muted);
  letter-spacing: .02em;
}

/* ── 主面板 ───────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ── 步骤条 ───────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 0;
  padding: 20px 26px;
  list-style: none;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #FCFDFF, #FFFFFF);
}
.step { display: flex; align-items: center; gap: 9px; min-width: 0; }
.step .dot {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--text-faint);
  transition: all .28s cubic-bezier(.4,0,.2,1);
}
.step .dot::after { content: attr(data-n); }
.step .st {
  font-size: 13px; color: var(--text-faint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: color .28s ease;
}
.step.done .dot { border-color: var(--brand); background: var(--brand); color: #fff; }
.step.done .dot::after { content: "✓"; }
.step.done .st { color: var(--text-muted); }
.step.now .dot {
  border-color: var(--brand); color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.step.now .st { color: var(--text-strong); font-weight: 600; }

.panel-body { padding: 30px 26px 30px; }
.view { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── 表单 ─────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.lbl { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-strong); margin-bottom: 9px; }
.input-wrap { position: relative; }
.input {
  width: 100%;
  padding: 13px 15px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #F7F9FC;
  border: 1px solid var(--border);
  border-radius: var(--r);
  outline: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.input::placeholder { color: var(--text-faint); }
.input:hover { border-color: var(--border-strong); }
.input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.textarea { resize: vertical; min-height: 118px; line-height: 1.55; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.hint { margin: 9px 0 0; font-size: 12.5px; color: var(--text-faint); }

/* ── 按钮 ─────────────────────────────────────────────────── */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.actions.center { justify-content: center; }
.btn {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 12px 26px;
  border-radius: var(--pill);
  transition: transform .14s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 10px rgba(65, 118, 230, .28);
}
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); box-shadow: 0 4px 18px rgba(65, 118, 230, .34); }
.btn.ghost {
  background: #fff; color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn.ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft-2); }
.btn.sm { padding: 8px 16px; font-size: 13px; }

/* ── 胶囊标签 ─────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px;
  font-size: 13px; font-weight: 500; color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
}
.pill.ghost { cursor: pointer; transition: border-color .18s, color .18s, background .18s; }
.pill.ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft-2); }
.pill.static { cursor: default; }
.pill b { color: var(--brand); font-variant-numeric: tabular-nums; }
.ic { width: 15px; height: 15px; flex: none; border-radius: 50%; background: var(--brand-soft); position: relative; }
.ic::after {
  content: ""; position: absolute; inset: 0;
  background: var(--brand);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
.ic[data-i="check"]::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.ic[data-i="shield"]::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z'/%3E%3C/svg%3E"); }
.ic[data-i="eye"]::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }

.pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 26px 0 0; }

/* ── 确认信息表 ───────────────────────────────────────────── */
.confirm-head { text-align: center; margin-bottom: 22px; }
.badge {
  display: inline-block; padding: 4px 13px; font-size: 12.5px; font-weight: 600;
  border-radius: var(--pill); margin-bottom: 12px;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.confirm-title { margin: 0; font-size: 20px; font-weight: 700; color: var(--text-strong); letter-spacing: -.01em; }
.confirm-sub { margin: 7px 0 0; font-size: 13.5px; color: var(--text-muted); }

.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0; }
.kv dt, .kv dd {
  margin: 0; padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.kv dt { color: var(--text-muted); white-space: nowrap; padding-right: 22px; }
.kv dd { color: var(--text-strong); text-align: right; word-break: break-all; }
.kv.compact dt, .kv.compact dd { padding: 8px 0; font-size: 13.5px; }
.kv > :nth-last-child(1), .kv > :nth-last-child(2) { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ── 处理中 ───────────────────────────────────────────────── */
.progress-wrap { text-align: center; }
.progress-track {
  height: 7px; border-radius: var(--pill); background: #EEF1F6; overflow: hidden; margin-bottom: 12px;
}
.progress-fill {
  height: 100%; width: 0%; border-radius: var(--pill);
  background: linear-gradient(90deg, #4176E6, #6E9BF0);
  transition: width .55s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.progress-fill::after {
  content: ""; position: absolute; inset: 0; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-120%);
  animation: shimmer 2.4s ease-in-out infinite;
}
@keyframes shimmer { 0%,20% { transform: translateX(-120%); } 75%,100% { transform: translateX(240%); } }
.progress-meta {
  display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-faint);
  font-variant-numeric: tabular-nums; margin-bottom: 22px;
}
.progress-card {
  background: #FAFBFD; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px 22px;
}
.spinner {
  width: 38px; height: 38px; margin: 0 auto 16px;
  border: 3px solid var(--brand-soft); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--text-strong); }
.progress-card > p { margin: 0 0 4px; font-size: 13.5px; color: var(--text-muted); }
.progress-card .kv { margin-top: 14px; text-align: left; }
.warn-line { margin: 18px 0 0; font-size: 13px; color: var(--warn); min-height: 20px; }

/* ── 结果 ─────────────────────────────────────────────────── */
.result { text-align: center; }
.result-icon {
  width: 62px; height: 62px; margin: 0 auto 18px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; font-weight: 700;
  background: var(--ok-soft); color: var(--ok);
}
.result-icon.fail { background: var(--danger-soft); color: var(--danger); }
.result-icon.warn { background: var(--warn-soft); color: var(--warn); }
.result h2 { margin: 0 0 8px; font-size: 23px; font-weight: 700; color: var(--text-strong); letter-spacing: -.01em; }
.result > p { margin: 0; font-size: 14px; color: var(--text-muted); }
.result .kv { margin-top: 22px; text-align: left; }

/* ── 浮层 ─────────────────────────────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(21, 36, 67, .34);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .2s ease both;
}
.sheet-card {
  width: min(100%, 480px); max-height: 86vh; overflow: auto;
  background: #fff; border-radius: var(--r-lg);
  box-shadow: 0 24px 70px rgba(21,36,67,.24);
  padding: 22px 24px 20px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text-strong); }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; color: var(--text-faint);
  font-size: 15px; width: 28px; height: 28px; border-radius: 50%; transition: background .16s;
}
.icon-btn:hover { background: #F1F3F7; color: var(--text); }
.sheet-body { font-size: 14px; color: var(--text); }
.sheet-body .kv dt, .sheet-body .kv dd { font-size: 13.5px; }

/* ── 提示条 ───────────────────────────────────────────────── */
.toasts {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(100% - 32px, 460px);
}
.toast {
  pointer-events: auto;
  padding: 11px 18px; border-radius: var(--pill);
  background: rgba(21, 36, 67, .93); color: #fff;
  font-size: 13.5px; line-height: 1.5;
  box-shadow: 0 8px 28px rgba(21,36,67,.22);
  animation: toastIn .24s cubic-bezier(.2,.8,.3,1) both;
  max-width: 100%;
}
.toast.err { background: rgba(178, 45, 45, .95); }
.toast.ok  { background: rgba(24, 128, 78, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── 页脚 ─────────────────────────────────────────────────── */
.foot { text-align: center; padding: 34px 0 40px; }
.foot p { margin: 0; font-size: 13px; color: var(--text-faint); }

/* ── 响应式 ───────────────────────────────────────────────── */
@media (max-width: 720px) {
  .wrap { width: min(100% - 26px, 860px); }
  .hero { padding: 38px 0 24px; }
  .steps { padding: 15px 14px; gap: 2px; }
  .step { flex-direction: column; gap: 5px; align-items: flex-start; }
  .step .st { font-size: 11px; }
  .panel-body { padding: 22px 16px 24px; }
  .actions .btn { flex: 1 1 auto; }
  .kv dt, .kv dd { font-size: 13px; }
  .kv dt { padding-right: 14px; }
}
@media (max-width: 420px) {
  .step .st { display: none; }
  .steps { grid-template-columns: repeat(5, auto); justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
