:root {
  --bg-canvas: #06090c;
  --bg-surface: #0d1319;
  --bg-surface-elevated: #121a22;
  --bg-surface-soft: #17212b;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-glow: rgba(16, 185, 129, 0.16);
  --arb-blue: #38bdf8;
  --poly-violet: #a78bfa;
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.1);
  --rose: #fb7185;
  --rose-bg: rgba(251, 113, 133, 0.1);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', 'PingFang TC', 'Microsoft JhengHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'Cascadia Mono', Consolas, ui-monospace, SFMono-Regular, monospace;
  --shadow-card: 0 20px 50px -20px rgba(0, 0, 0, 0.75);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* 氛圍背景 */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 25%, black 35%, transparent 80%);
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.35;
}

.ambient-glow-a {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -100px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.32), transparent 70%);
}

.ambient-glow-b {
  width: 460px;
  height: 460px;
  bottom: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 頂部導覽列 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(6, 9, 12, 0.84);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(56, 189, 248, 0.16));
  border: 1px solid rgba(16, 185, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-monogram {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--emerald-bright);
  letter-spacing: 0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-pill {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 13px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
}

.nav-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}

.nav-pill.active {
  color: var(--emerald-bright);
  border-color: rgba(16, 185, 129, 0.5);
  background: var(--emerald-glow);
}

.badge-count {
  background: var(--emerald);
  color: #032217;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
}

.lang-select {
  appearance: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.lang-select:focus {
  border-color: var(--emerald);
}

/* 主內容區 */
.main-container {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.view-section {
  animation: fadeSlideIn 0.25s ease-out;
}

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

.hero-strip {
  margin-bottom: 18px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--emerald-bright);
  background: var(--emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 方案選擇布局 */
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}

.checkout-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.panel-head {
  margin-bottom: 18px;
}

.panel-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-hint {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* 方案卡片格線 */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.plan-card {
  position: relative;
  text-align: left;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.plan-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.plan-card.selected {
  border-color: var(--emerald);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1), var(--bg-surface-elevated));
  box-shadow: 0 0 0 1px var(--emerald), 0 12px 30px -12px rgba(16, 185, 129, 0.35);
}

.plan-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.plan-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.plan-duration-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  white-space: nowrap;
}

.plan-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.plan-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.plan-currency {
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald-bright);
  margin-left: 4px;
}

.plan-select-indicator {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.plan-card.selected .plan-select-indicator {
  color: var(--emerald-bright);
}

/* 區塊鏈切換器 */
.chains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.chain-card {
  text-align: left;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.16s ease;
}

.chain-card:hover {
  border-color: var(--border-strong);
}

.chain-card.selected {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 0 1px var(--emerald);
}

.chain-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chain-name {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chain-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald);
}

.chain-dot.chain-42161 {
  background: var(--arb-blue);
}

.chain-dot.chain-137 {
  background: var(--poly-violet);
}

.chain-symbol {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.chain-confirmations {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* 結帳摘要 */
.summary-card {
  position: sticky;
  top: 88px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
}

.summary-label {
  color: var(--text-secondary);
}

.summary-value {
  font-weight: 600;
  text-align: right;
}

.summary-row-total {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.summary-total {
  font-size: 22px;
  font-weight: 800;
  color: var(--emerald-bright);
}

.meta-line {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.security-footnote {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* 警示與提示盒 */
.notice-box {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.notice-amber {
  background: var(--amber-bg);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.notice-rose {
  background: var(--rose-bg);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: #fecdd3;
}

.notice-slate {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.notice-title {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.notice-body {
  margin: 0;
}

/* 按鈕 */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.16s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #032217;
  box-shadow: 0 8px 20px -8px rgba(16, 185, 129, 0.6);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-soft);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--emerald);
  color: var(--emerald-bright);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}

.btn-danger {
  background: var(--rose-bg);
  border-color: rgba(251, 113, 133, 0.5);
  color: #fecdd3;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 15px;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

/* 專屬結帳頁 */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.order-no-chip {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 999px;
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.payment-card,
.qr-card,
.success-card,
.recover-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.payment-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.payment-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.countdown-pill {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-align: right;
}

.countdown-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.countdown-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--emerald-bright);
}

.status-banner {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.status-banner.status-CONFIRMING {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.status-banner.status-UNDERPAID,
.status-banner.status-LATE_PAID {
  border-color: rgba(245, 158, 11, 0.45);
  background: var(--amber-bg);
}

.status-banner.status-EXPIRED {
  border-color: rgba(251, 113, 133, 0.45);
  background: var(--rose-bg);
}

.status-banner.status-PAID {
  border-color: rgba(16, 185, 129, 0.5);
  background: var(--emerald-glow);
}

.status-banner-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-banner-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.pay-field-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pay-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.chain-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.pay-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pay-amount-display {
  font-size: 30px;
  font-weight: 800;
  color: var(--emerald-bright);
  letter-spacing: -0.02em;
}

.currency-unit {
  font-size: 15px;
  margin-left: 6px;
  color: var(--text-secondary);
}

.field-warning {
  margin: 0;
  font-size: 12.5px;
  color: #fde68a;
}

.deposit-address {
  font-size: 14.5px;
  font-weight: 600;
  word-break: break-all;
  color: var(--text-primary);
  flex: 1;
}

/* 進度面板 */
.progress-panel {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.progress-title {
  font-weight: 700;
}

.progress-counter {
  color: var(--emerald-bright);
  font-weight: 700;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 12%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--arb-blue));
  transition: width 0.35s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.step-item.active {
  color: var(--emerald-bright);
  font-weight: 700;
}

.pay-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 14px;
  font-weight: 700;
}

.tx-link-row {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tx-hash-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tx-hash-text {
  font-size: 12.5px;
  word-break: break-all;
  color: var(--text-secondary);
}

.polling-hint {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseRing 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* QR Code 卡片 */
.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.qr-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.qr-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.qr-frame {
  background: #ffffff;
  padding: 12px;
  border-radius: 14px;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.qr-image {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-meta {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.qr-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* 發卡成功與找回頁面 */
.success-card,
.recover-card {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.success-badge {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald-bright);
  background: var(--emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.success-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

.success-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.license-box {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), var(--bg-surface-elevated));
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.license-box-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald-bright);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.license-key-display {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  word-break: break-all;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.35);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.license-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.success-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.detail-cell {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-val {
  font-size: 13.5px;
  font-weight: 700;
}

.detail-active {
  color: var(--emerald-bright);
}

/* 表單元件 */
.recover-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13.5px;
  font-weight: 600;
}

.form-control {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.form-control:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

.form-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.recover-result {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recover-result-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.recover-result-sub {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* 最近訂單抽屜 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.recent-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.7);
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.drawer-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.recent-item-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.confirm-group {
  display: flex;
  gap: 8px;
}

/* 狀態頁與空態 */
.state-card {
  max-width: 520px;
  margin: 48px auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--emerald);
  animation: spin 0.8s linear infinite;
}

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

.empty-inline {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  text-align: center;
  color: var(--text-secondary);
}

.empty-title {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-body {
  margin: 0;
  font-size: 13px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--emerald);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.toast.toast-error {
  border-color: var(--rose);
  color: #fecdd3;
}

/* 響應式手機版調整 */
@media (max-width: 860px) {
  .checkout-layout,
  .payment-layout {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
  }

  .pay-amount-display {
    font-size: 24px;
  }

  .license-key-display {
    font-size: 16px;
  }
}
