/* 网页收银台样式:颜色、字体沿用 frontend/website-v2/static/style.css(深色为主,系统浅色时跟随)。
   不引外部字体 / CDN;CSP 只允许本站样式,不要在 HTML / JS 里写 style 属性。 */

:root {
  --bg: #050811;
  --bg-alt: #080e1c;
  --surface: #0c1426;
  --surface-2: #111c33;
  --ink: #f1f5f9;
  --ink-2: #9fb0c9;
  --ink-3: #6b7d99;
  --line: rgba(148, 179, 255, 0.13);
  --line-strong: rgba(148, 179, 255, 0.24);
  --brand-cyan: #38bdf8;
  --brand-1: #14a5f6;
  --brand-2: #0a7be4;
  --brand-3: #2161d9;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-glow: rgba(20, 165, 246, 0.34);
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.14);
  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 48px -24px rgba(0, 0, 0, 0.85);
  --glass-header: rgba(5, 8, 17, 0.8);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'PingFang SC', 'Microsoft YaHei',
    'Noto Sans CJK SC', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafd;
    --bg-alt: #f0f4fa;
    --surface: #ffffff;
    --surface-2: #f4f7fc;
    --ink: #0b1220;
    --ink-2: #475569;
    --ink-3: #64748b;
    --line: rgba(15, 23, 42, 0.1);
    --line-strong: rgba(15, 23, 42, 0.18);
    --accent: #0a7be4;
    --accent-soft: rgba(10, 123, 228, 0.1);
    --accent-glow: rgba(10, 123, 228, 0.24);
    --emerald: #0f9f6e;
    --emerald-soft: rgba(15, 159, 110, 0.12);
    --rose: #e11d48;
    --rose-soft: rgba(225, 29, 72, 0.1);
    --amber: #b45309;
    --amber-soft: rgba(217, 119, 6, 0.12);
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 36px -18px rgba(15, 23, 42, 0.14);
    --glass-header: rgba(248, 250, 253, 0.86);
    color-scheme: light;
  }
}

:root:lang(zh-Hant) {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'PingFang TC', 'Microsoft JhengHei',
    'Noto Sans CJK TC', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: radial-gradient(1200px 520px at 50% -180px, var(--accent-soft), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--glass-header);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-in {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--line-strong), 0 4px 14px -2px var(--accent-glow);
}
.brand-sub {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 14px;
}
.lang select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 28px 5px 12px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ---------- 主体 ---------- */
.wrap {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.card.center {
  text-align: center;
  padding: 32px 22px;
}
.card.center .actions {
  justify-content: center;
}
.h1 {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.h2 {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.muted {
  color: var(--ink-2);
}
.small {
  font-size: 13px;
}
.tiny {
  font-size: 12px;
  color: var(--ink-3);
}
.mt8 {
  margin-top: 8px;
}
.mt12 {
  margin-top: 12px;
}
.mt16 {
  margin-top: 16px;
}
.center-text {
  text-align: center;
}
.mono {
  font-family: var(--mono);
}

/* ---------- 提示条 ---------- */
.notice {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--ink);
}
.notice.error {
  background: var(--rose-soft);
  border-color: rgba(251, 113, 133, 0.3);
}
.notice.ok {
  background: var(--emerald-soft);
  border-color: rgba(52, 211, 153, 0.3);
}
.err-text {
  color: var(--rose);
  font-size: 13px;
  min-height: 1em;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--ink);
  transition: box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 28px -8px rgba(10, 123, 228, 0.72);
}
.btn-primary:not(:disabled):hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.32) inset, 0 14px 36px -8px rgba(20, 165, 246, 0.85);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
}
.btn-ghost:not(:disabled):hover {
  border-color: var(--accent);
}
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  color: var(--accent);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}
.btn-block {
  width: 100%;
}
.btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.actions .btn {
  flex: 1 1 200px;
}

/* ---------- 加载 ---------- */
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
.spinner.sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
  margin: 0;
  display: inline-block;
  vertical-align: -2px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 登录 ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  margin: 18px 0 18px;
}
.tab {
  flex: 1;
  border: 0;
  background: none;
  border-radius: 999px;
  min-height: 38px;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
}
.tab[aria-selected='true'] {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.field {
  display: block;
  margin-bottom: 14px;
}
.field > span {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-alt);
  font-size: 16px; /* 小于 16px 时 iOS 会自动放大页面 */
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-row {
  display: flex;
  gap: 8px;
}
.input-row .input {
  flex: 1;
  min-width: 0;
}
.input-row .btn {
  flex: none;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  min-width: 112px;
}
.pair-code {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 18px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  border: 1px dashed var(--line-strong);
  user-select: all;
  -webkit-user-select: all;
}
.steps {
  margin: 14px 0 6px;
  font-size: 14px;
  color: var(--ink-2);
  text-align: center;
}
.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 12px;
}

/* ---------- 账号条 ---------- */
.account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.account-main {
  flex: 1;
  min-width: 0;
}
.account-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-member {
  font-size: 13px;
  color: var(--ink-2);
}
.account-member.active {
  color: var(--emerald);
}

/* ---------- 套餐 ---------- */
.tier + .tier {
  margin-top: 18px;
}
.tier-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tier-badge.svip {
  background: var(--amber-soft);
  color: var(--amber);
}
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.plan {
  position: relative;
  text-align: left;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 12px 12px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 112px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.plan:not(:disabled):hover {
  border-color: var(--accent);
}
.plan[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.plan:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.plan-period {
  font-weight: 650;
  font-size: 14px;
  color: var(--ink-2);
}
.plan-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 4px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.plan-list {
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: line-through;
  font-weight: 500;
}
.plan-approx {
  font-size: 12px;
  color: var(--ink-3);
}
.plan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.tag.bonus {
  background: var(--emerald-soft);
  color: var(--emerald);
}
.tag.block {
  background: var(--rose-soft);
  color: var(--rose);
}
.plan-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
}
.plan[aria-pressed='true'] .plan-check {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface);
}

/* ---------- 折扣券 ---------- */
.select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-alt);
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* ---------- 付款 ---------- */
.methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--bg-alt);
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.method small {
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-3);
}
.method[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.method-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: var(--ink-3);
}
.m-alipay {
  background: #1677ff;
}
.m-wechat {
  background: #07c160;
}
.m-unionpay {
  background: #e60012;
}
.m-usdt {
  background: #26a17b;
}

.paybar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -12px 32px -18px rgba(0, 0, 0, 0.45);
  margin: 0 -16px -24px;
}
.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.total-label {
  color: var(--ink-2);
  font-size: 14px;
}
.total-amount {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.total-detail {
  text-align: right;
  font-size: 12px;
  color: var(--ink-3);
}
.strike {
  text-decoration: line-through;
  margin-right: 6px;
}
.placeholder {
  color: var(--ink-3);
  font-size: 14px;
  padding: 6px 0;
}

/* ---------- 订单状态 ---------- */
.state-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}
.state-icon.ok {
  background: var(--emerald-soft);
  color: var(--emerald);
}
.state-icon.bad {
  background: var(--rose-soft);
  color: var(--rose);
}
.state-icon.warn {
  background: var(--amber-soft);
  color: var(--amber);
}
.big-amount {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-top: 10px;
}
.countdown {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 14px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
}
.kv {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- 页脚 ---------- */
.foot {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.foot a {
  color: var(--ink-2);
  white-space: nowrap;
}
.foot .sep {
  margin: 0 8px;
  opacity: 0.5;
}

/* ---------- 桌面 ---------- */
@media (max-width: 380px) {
  .card {
    padding: 18px 16px;
  }
  .plan-price {
    font-size: 20px;
  }
}

@media (min-width: 640px) {
  .wrap {
    padding-top: 36px;
    gap: 16px;
  }
  .card {
    padding: 26px 28px;
  }
  .card.account {
    padding: 16px 20px;
  }
  .paybar {
    margin: 0;
    padding: 16px 22px;
    border-radius: var(--radius);
    bottom: 12px;
  }
  .h1 {
    font-size: 24px;
  }
}
