:root {
  --ink: #1c1c1d;
  --ink-soft: #3a3a3c;
  --muted: #6b6b70;
  --line: #e5e8f5;
  --line-strong: #d3d8e8;
  --bg: #f5f6fa;
  --card: #ffffff;
  --accent: #ff5a1f;
  --accent-dark: #d9440e;
  --accent-soft: #fff3ed;
  --ok: #0f8a67;
  --ok-soft: #e9f8f2;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 30px 60px -44px rgba(17, 26, 51, 0.5);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(760px 380px at 92% -8%, rgba(255, 90, 31, 0.1), transparent 68%),
    radial-gradient(520px 340px at 2% 18%, rgba(28, 28, 29, 0.045), transparent 72%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }

a { color: var(--accent-dark); }

.wrap { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }

/* 顶栏 */
.topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark { display: block; border-radius: 10px; }

.topnav { display: flex; align-items: center; gap: 20px; font-size: 13.5px; }

.topnav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.topnav a:hover { color: var(--accent-dark); }

.topnav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

/* 主体布局 */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: start;
  padding: 56px 0 76px;
}

.intro { padding-top: 12px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.intro h1 {
  margin-top: 16px;
  font-size: clamp(34px, 4.4vw, 50px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.intro h1 .accent {
  color: var(--accent);
  background: linear-gradient(180deg, transparent 68%, rgba(255, 90, 31, 0.16) 68%);
  padding: 0 3px;
}

.lede { margin-top: 18px; max-width: 33em; font-size: 15px; color: #4a4a4f; }

.points { margin-top: 28px; padding: 0; list-style: none; }

.points li {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.points li:last-child { border-bottom: 1px solid var(--line); }

.points strong { display: block; font-size: 14px; font-weight: 700; }

.points span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

.intro-note { margin-top: 22px; font-size: 12.5px; color: var(--muted); }

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

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }

.api-chip {
  max-width: 54%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: #f7f8fc;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* 设备码提示条 */
.device-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 9px 12px;
  background: var(--accent-soft);
  border: 1px dashed #ffc3a6;
  border-radius: 10px;
}

.device-strip-label { font-size: 12px; color: #8a4a20; }

.device-strip-code {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.auth-loading { padding: 26px 0 6px; font-size: 13.5px; color: var(--muted); }

/* 表单 */
.form { display: grid; gap: 10px; margin-top: 20px; }

.form-label { font-size: 13px; font-weight: 700; }

.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.16);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fff7f6;
}

.input-code {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.4em;
  text-align: center;
  padding-left: 18px;
}

.sent-hint {
  padding: 10px 12px;
  font-size: 13px;
  color: #8a4a20;
  background: var(--accent-soft);
  border: 1px solid #ffe0ce;
  border-radius: 9px;
}

.field-error { font-size: 12.5px; color: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.btn-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 24px -16px rgba(255, 90, 31, 0.9);
}

.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }

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

.btn-ghost:hover:not(:disabled) { border-color: #b9c1d3; background: #fafbfe; }

.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: #e8a9a4; background: var(--danger-soft); }

.btn-block { width: 100%; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.form .form-row { margin-top: 4px; }

.form-note { margin-top: 16px; font-size: 12px; line-height: 1.7; color: var(--muted); }

/* 账户信息 */
.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
}

.account-label { font-size: 12px; color: var(--muted); }

.account-email {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  word-break: break-all;
}

.status-chip {
  flex: 0 0 auto;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0b6b51;
  background: var(--ok-soft);
  border: 1px solid #c8ecdf;
  border-radius: 999px;
}

.credit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.credit {
  padding: 12px 14px;
  background: #f7f8fc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.credit-label { display: block; font-size: 11.5px; color: var(--muted); }
.credit-scope { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }

.credit-value {
  display: block;
  margin-top: 2px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.section { margin-top: 24px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-head h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.section-hint { font-size: 11.5px; color: var(--muted); }

.empty {
  margin-top: 10px;
  padding: 13px 14px;
  font-size: 13px;
  color: var(--muted);
  background: #f7f8fc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 12px;
}

.kv-grid dt { font-size: 11.5px; color: var(--muted); }

.kv-grid dd { margin-top: 1px; font-size: 13px; font-weight: 600; word-break: break-all; }

.progress {
  margin-top: 16px;
  height: 8px;
  background: #eceef6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.progress-text { margin-top: 6px; font-size: 12px; color: var(--muted); }

.account-meta { margin-top: 20px; font-size: 12.5px; color: var(--muted); }

/* 设备绑定 */
.device-bind {
  margin-top: 24px;
  padding: 18px 18px 20px;
  background: var(--accent-soft);
  border: 1px dashed #ffc3a6;
  border-radius: 14px;
}

.device-bind-top {
  margin-top: 14px;
  margin-bottom: 18px;
}

.device-bind-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.device-bind-head h3 { font-size: 14px; font-weight: 800; color: #7f3608; }

.code-pill {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ffd3bd;
  border-radius: 8px;
  padding: 3px 9px;
}

.device-bind-hint { margin-top: 8px; font-size: 13px; color: #8a4a20; }

.device-bind .btn { margin-top: 12px; }

.bind-result {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.bind-result[data-kind="success"] {
  color: #0b6b51;
  background: var(--ok-soft);
  border-color: #c8ecdf;
}

.bind-result[data-kind="error"] {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f4c9c5;
}

.panel-error {
  margin-top: 18px;
  padding: 11px 13px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f4c9c5;
  border-radius: 10px;
}

/* 页脚与提示 */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  font-size: 12px;
  color: var(--muted);
}

.footer-api a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.footer-api a:hover { color: var(--accent-dark); }

.noscript {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto 24px;
  padding: 12px 14px;
  font-size: 13px;
  color: #8a3b06;
  background: var(--accent-soft);
  border: 1px solid #ffd9bb;
  border-radius: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border-radius: 10px;
  box-shadow: 0 16px 34px -18px rgba(17, 26, 51, 0.75);
}

.toast[data-kind="success"] { background: #0f7a5c; }
.toast[data-kind="error"] { background: var(--danger); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 34px; padding: 40px 0 60px; }
  .intro { padding-top: 0; }
  .intro h1 { font-size: clamp(30px, 7vw, 40px); }
  .panel { max-width: 620px; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-inner { min-height: 58px; }
  .topnav { gap: 14px; font-size: 12.5px; }
  .brand { font-size: 14px; }
  .panel { padding: 20px 16px 22px; border-radius: 16px; }
  .panel-head h2 { font-size: 18px; }
  .api-chip { max-width: 50%; font-size: 10px; }
  .credit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .credit { padding: 10px 10px; }
  .credit-value { font-size: 20px; }
  .kv-grid { grid-template-columns: 1fr; }
  .form-row { gap: 8px; }
  .btn { padding: 0 12px; font-size: 13.5px; }
  .input-code { font-size: 20px; }
}

@media (max-width: 400px) {
  .credit-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- 邀请好友 / 历史订单 ---------- */
.invite-copy {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}
.invite-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.invite-link-row .input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.invite-link-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.invite-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.invite-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf8;
}
.invite-stat span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.invite-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.invite-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.invite-ref-note {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--accent-soft);
  border: 1px solid #ffd9c8;
  color: var(--accent-dark);
  font-size: 12px;
}
.account-orders {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.account-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.account-order-main { min-width: 0; }
.account-order-title {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.account-order-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.account-order-side {
  flex: 0 0 auto;
  text-align: right;
  display: grid;
  gap: 4px;
}
.account-order-amount { font-weight: 800; font-size: 13px; }
.account-order-status {
  font-size: 11px;
  color: var(--muted);
}
.account-order-status.is-paid { color: #0f8a61; }
.account-order-status.is-pending { color: #b46a00; }
.account-order-link {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.account-orders-empty {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 620px) {
  .invite-link-row { flex-direction: column; }
  .invite-stats { grid-template-columns: 1fr; }
  .account-order { align-items: flex-start; flex-direction: column; }
  .account-order-side { text-align: left; }
}.credit-frozen-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #fff7ed;
  border: 1px solid #f3dcc3;
  color: #8a5825;
  font-size: 12px;
  line-height: 1.65;
}.turnstile-slot {
  margin-top: 14px;
  min-height: 65px;
  display: flex;
  justify-content: center;
}
.turnstile-slot[hidden] { display: none; }