/* 暖色米白底 + 赤陶橙强调色，参考 Claude 的配色与气质 */
:root {
  --bg: #f5f4ee;
  --bg-deep: #efede4;
  --surface: #fffefb;
  --surface-2: #faf9f5;
  --line: #e6e3d8;
  --line-strong: #d9d5c7;
  --text: #1f1e1d;
  --text-2: #3d3c38;
  --muted: #84827b;
  --accent: #c96442;
  --accent-hover: #b4553a;
  --accent-soft: #f6e9e2;
  --accent-ink: #a04a2f;
  --ok: #3f7d58;
  --ok-soft: #e5efe7;
  --warn: #b7791f;
  --warn-soft: #f8eedb;
  --bad: #b8433a;
  --bad-soft: #f7e3e0;
  --radius-lg: 20px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 30, 29, .04), 0 12px 32px -12px rgba(31, 30, 29, .12);
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(245, 244, 238, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff; }
.nav { display: flex; gap: 2px; padding: 3px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 999px; }
.nav-item {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: color .15s, background .15s;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(31, 30, 29, .08); }

/* ---------- 标题 ---------- */
.main { flex: 1; padding-bottom: 40px; }
.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; letter-spacing: .01em; margin: 0 0 8px; color: var(--text); }
.hero p { margin: 0 auto; max-width: 520px; color: var(--muted); }

/* ---------- 面板 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px 36px;
}

/* ---------- 步骤条 ---------- */
.stepper { list-style: none; display: flex; align-items: center; gap: 12px; margin: 0 0 32px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.stepper li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.stepper .dot {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 600;
  transition: all .2s;
}
.stepper .bar { flex: 1; height: 2px; border-radius: 2px; background: var(--line); min-width: 16px; }
.stepper li.active { color: var(--text); font-weight: 600; }
.stepper li.active .dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper li.done { color: var(--text-2); }
.stepper li.done .dot { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.stepper .bar.done { background: var(--accent); opacity: .55; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 22px; }
.field label, .label { display: block; font-weight: 600; font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type=text], input[type=password], textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #a9a69c; }
.input-lg { font-size: 17px; padding: 15px 16px; letter-spacing: .02em; font-family: var(--mono); }
.input-lg::placeholder { font-family: var(--sans); letter-spacing: 0; }
textarea { resize: vertical; min-height: 180px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.choice { position: relative; margin: 0 !important; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice-body b { font-size: 15px; color: var(--text); }
.choice-body small { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.choice:hover .choice-body { border-color: var(--line-strong); }
.choice input:checked + .choice-body { border-color: var(--accent); background: var(--accent-soft); }
.choice input:checked + .choice-body small { color: var(--accent-ink); }
.choice input:focus-visible + .choice-body { box-shadow: 0 0 0 4px var(--accent-soft); }
.choice.disabled { cursor: not-allowed; }
.choice.disabled .choice-body { opacity: .4; }
.choice.disabled:hover .choice-body { border-color: var(--line); }
.card-detect.ok { color: var(--accent-ink); }
.card-detect.bad { color: var(--bad); }

/* ---------- 第 2 步信息与引导 ---------- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.info { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; min-width: 0; }
.info.wide { grid-column: 1 / -1; }
.info span { display: block; font-size: 12px; color: var(--muted); }
.info b { display: block; font-size: 14.5px; color: var(--text); word-break: break-all; }

.guide { display: grid; gap: 12px; margin-bottom: 22px; }
.guide-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.guide-no {
  flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px;
}
.guide-text { flex: 1; min-width: 0; }
.guide-text b { display: block; font-size: 15px; }
.guide-text small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- 按钮 ---------- */
.actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.actions.center { justify-content: center; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  padding: 12px 24px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(201, 100, 66, .55); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: var(--bg-deep); color: var(--text-2); border-color: var(--line); }
.btn.ghost:hover { background: #e8e5da; }
.btn.outline { background: var(--surface); color: var(--accent-ink); border-color: #e8c9bb; }
.btn.outline:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn.sm { padding: 8px 16px; font-size: 14px; }

.alert { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; }
.alert.error { background: var(--bad-soft); color: var(--bad); }

/* ---------- 查询 ---------- */
.inline { display: flex; gap: 10px; margin-bottom: 16px; }
.inline input { flex: 1; min-width: 0; }
.history { margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.history h2 { font-size: 15px; margin: 0 0 8px; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.h-title { font-weight: 600; font-size: 14px; }
.h-sub { color: var(--muted); font-size: 12.5px; }
.h-badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg-deep); color: var(--muted); margin-left: 6px; font-weight: 500; }
.empty { color: var(--muted); margin: 0; font-size: 14px; }

/* ---------- 进度 / 结果 ---------- */
.progress { margin-top: 0; }
.state { text-align: center; padding: 8px 0 20px; }
.state h2 { font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 16px 0 6px; }
.state-sub { margin: 0 auto; max-width: 460px; color: var(--muted); }

.state-icon { position: relative; width: 76px; height: 76px; margin: 0 auto; display: grid; place-items: center; }
.state-icon .ico { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; display: none; position: relative; }
.state-icon[data-state=ok] { background: var(--ok); border-radius: 50%; box-shadow: 0 0 0 8px var(--ok-soft); animation: pop .35s ease-out; }
.state-icon[data-state=ok] .ico-ok { display: block; }
.state-icon[data-state=bad] { background: var(--bad); border-radius: 50%; box-shadow: 0 0 0 8px var(--bad-soft); }
.state-icon[data-state=bad] .ico-bad { display: block; }
.state-icon[data-state=warn] { background: var(--warn); border-radius: 50%; box-shadow: 0 0 0 8px var(--warn-soft); }
.state-icon[data-state=warn] .ico-warn { display: block; }
.state-icon:not([data-state=running]) .ring { display: none; }

/* 充值中：彩色渐变圆环旋转 */
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(201, 100, 66, 0) 0deg, #e8a87c 90deg, #d97757 200deg, #c96442 300deg, #9c4a8c 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  animation: spin 1.1s linear infinite;
}
.ring::after {
  content: ""; position: absolute; top: 0; left: 50%; width: 7px; height: 7px; margin-left: -3.5px;
  border-radius: 50%; background: #9c4a8c;
}
.state-icon[data-state=running]::before {
  content: ""; position: absolute; inset: 18px; border-radius: 50%;
  background: var(--accent-soft); animation: breathe 1.8s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(.82); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.verify {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--warn-soft); border: 1px solid #efd9ad; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px;
}
.verify b { display: block; }
.verify small { color: var(--text-2); font-size: 13px; }

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 24px;
}
.detail-grid div { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.detail-grid div:nth-last-child(-n+1) { border-bottom: 0; }
.detail-grid .wide { grid-column: 1 / -1; }
.detail-grid dt { font-size: 12px; color: var(--muted); }
.detail-grid dd { margin: 2px 0 0; font-weight: 600; font-size: 14.5px; word-break: break-all; }
.detail-grid code { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.copy { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 0 0 0 10px; }

.footer { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 12.5px; text-align: center; padding: 24px 20px 36px; }

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  .choices { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-direction: column; align-items: stretch; gap: 10px; }
  .nav { justify-content: space-between; }
  .nav-item { flex: 1; padding: 6px 8px; font-size: 13px; }
  .hero { padding: 28px 0 20px; }
  .hero h1 { font-size: 26px; }
  .panel { padding: 22px 18px; border-radius: 16px; }
  .stepper { gap: 8px; margin-bottom: 24px; padding-bottom: 18px; }
  .stepper .txt { font-size: 12.5px; }
  .stepper li { gap: 6px; }
  .field-row, .info-grid, .detail-grid { grid-template-columns: 1fr; }
  .detail-grid { padding: 4px 16px; }
  .guide-row { flex-wrap: wrap; padding: 14px; }
  .guide-row .btn { width: 100%; }
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
  .actions.center { flex-direction: column; }
  .verify { flex-direction: column; align-items: stretch; }
  .state h2 { font-size: 24px; }
}

/* ---------- 提交前确认弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(31, 30, 29, .38); animation: fade-in .15s ease-out; }
.modal[hidden] { display: none; }
.modal-card { width: min(460px, 100%); padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); animation: pop-in .18s ease-out; }
.modal-card h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 20px; }
.modal-sub { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 10px; }
.confirm-grid > div { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.confirm-grid .wide { grid-column: 1 / -1; }
.confirm-grid dt { font-size: 12px; color: var(--muted); }
.confirm-grid dd { margin: 4px 0 0; font-weight: 600; word-break: break-all; }
.confirm-target { font-size: 17px; color: var(--accent-ink); }
.modal .actions { margin-top: 16px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 处理提示：充值中动画 ---------- */
.working { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-ink); font-weight: 600; }
.working .bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.working .bars i { width: 3px; height: 100%; border-radius: 2px; background: var(--accent); animation: bar-bounce 1s ease-in-out infinite; }
.working .bars i:nth-child(2) { animation-delay: .15s; }
.working .bars i:nth-child(3) { animation-delay: .3s; }
.working .bars i:nth-child(4) { animation-delay: .45s; }
@keyframes bar-bounce { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.ago { color: var(--muted); font-weight: 400; margin-left: 4px; }
@media (prefers-reduced-motion: reduce) { .working .bars i, .modal, .modal-card { animation: none; } }
