:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --brd: rgba(15, 23, 42, 0.085);
  --brd-2: rgba(15, 23, 42, 0.16);
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --primary: #111827;
  --primary-hover: #1f2937;
  --primary-active: #030712;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-brd: #bfdbfe;
  --good: #059669;
  --good-soft: #ecfdf5;
  --good-brd: #a7f3d0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-brd: #fde68a;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --err-brd: #fecaca;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.09);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.mp-root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.mp-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 248, 250, 0.88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--brd);
}

.mp-header-inner {
  max-width: 520px;
  width: 100%;
  height: 56px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.mp-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex: none;
}

.mp-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.mp-brand-text strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.mp-brand-text span {
  font-size: 11px;
  color: var(--ink-3);
}

.mp-readiness {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--brd);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.mp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f59e0b;
}

.mp-status-dot.is-ready {
  background: var(--good);
}

.mp-status-dot.is-offline {
  background: var(--err);
}

.mp-main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  .mp-main {
    padding: 32px 20px 104px;
  }
}

.mp-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: #eaeef3;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.mp-tab {
  height: 40px;
  border: none;
  border-radius: 9.5px;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.mp-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.mp-card {
  background: var(--surface);
  border: 1px solid var(--brd);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  .mp-card {
    padding: 26px;
  }
}

.mp-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  padding: 0 0 16px;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--brd);
}

.mp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mp-step-track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #e2e8f0;
}

.mp-step.is-done .mp-step-track {
  background: var(--good);
}

.mp-step.is-current .mp-step-track {
  background: var(--primary);
}

.mp-step-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}

.mp-step.is-current .mp-step-meta {
  color: var(--ink);
  font-weight: 650;
}

.mp-step.is-done .mp-step-meta {
  color: var(--good);
}

.mp-step-head {
  margin-bottom: 16px;
}

.mp-step-head h1,
.mp-step-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.mp-step-head p {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

.mp-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.mp-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.mp-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mp-chip-btn {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--brd);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.mp-chip-btn:hover {
  background: #e8ecf2;
  color: var(--ink);
}

.mp-input,
.mp-select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--brd-2);
  background: #ffffff;
  color: var(--ink);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 640px) {
  .mp-input,
  .mp-select {
    font-size: 14.5px;
  }
}

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

.mp-input:focus,
.mp-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

textarea.mp-input {
  min-height: 126px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 16px;
}

@media (min-width: 640px) {
  textarea.mp-input {
    font-size: 13px;
  }
}

.mp-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.mp-panel {
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--brd);
  padding: 14px 16px;
}

.mp-plan-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mp-plan-strip small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
}

.mp-plan-strip strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-kv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.mp-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 13.5px;
}

.mp-kv-row dt {
  flex: none;
  color: var(--ink-3);
}

.mp-kv-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.mp-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--brd);
  background: #fafbfc;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.mp-check-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--primary);
}

.mp-banner {
  margin-top: 14px;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  border: 1px solid transparent;
}

.mp-banner strong {
  display: block;
  margin-bottom: 3px;
}

.mp-banner p {
  margin: 0;
}

.mp-banner--err {
  background: var(--err-soft);
  color: var(--err);
  border-color: var(--err-brd);
}

.mp-banner--warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-brd);
}

.mp-banner--good {
  background: var(--good-soft);
  color: var(--good);
  border-color: var(--good-brd);
}

.mp-banner--info {
  background: var(--accent-soft);
  color: #1e40af;
  border-color: var(--accent-brd);
}

.mp-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid var(--brd);
  background: var(--surface-2);
  color: var(--ink-2);
}

.mp-badge--good {
  background: var(--good-soft);
  color: var(--good);
  border-color: var(--good-brd);
}

.mp-badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-brd);
}

.mp-badge--err {
  background: var(--err-soft);
  color: var(--err);
  border-color: var(--err-brd);
}

.mp-badge--info {
  background: var(--accent-soft);
  color: #1d4ed8;
  border-color: var(--accent-brd);
}

.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.mp-btn:active:not(:disabled) {
  transform: scale(0.985);
}

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

.mp-btn-primary {
  background: var(--primary);
  color: #ffffff;
}

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

.mp-btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--brd-2);
}

.mp-btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.mp-btn-sm {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
}

.mp-btn-full {
  width: 100%;
}

.mp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

@media (min-width: 480px) {
  .mp-actions--split {
    flex-direction: row-reverse;
  }
  .mp-actions--split .mp-btn-primary {
    flex: 1.5;
  }
  .mp-actions--split .mp-btn-secondary {
    flex: 1;
  }
}

.mp-disclosure {
  margin-top: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--brd);
  background: #fafbfc;
}

.mp-disclosure summary {
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.mp-disclosure-body {
  padding: 10px 14px 13px;
  border-top: 1px solid var(--brd);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}

.mp-disclosure-body ol {
  margin: 0;
  padding-left: 18px;
}

.mp-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 550;
}

.mp-link:hover {
  text-decoration: underline;
}

.mp-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
}

.mp-progress-cell {
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--brd);
}

.mp-progress-cell.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-brd);
  color: #1d4ed8;
}

.mp-progress-cell.is-done {
  background: var(--good-soft);
  border-color: var(--good-brd);
  color: var(--good);
}

.mp-timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 2px 0 0 18px;
  border-left: 1.5px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-timeline li {
  position: relative;
}

.mp-timeline-dot {
  position: absolute;
  left: -23.5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 2px solid #ffffff;
}

.mp-timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}

.mp-timeline-row strong {
  font-weight: 550;
  color: var(--ink);
}

.mp-timeline-row time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ── 非模态 Stripe 3DS / hCaptcha 底部倒计时浮条（绝不使用 showModal）──────── */
.mp-challenge-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  width: min(500px, calc(100vw - 24px));
  z-index: 40;
  background: #ffffff;
  border: 1px solid var(--warn-brd);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.mp-challenge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mp-challenge-meta {
  min-width: 0;
}

.mp-challenge-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.mp-challenge-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-challenge-timer {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 700;
  color: var(--warn);
}

.mp-challenge-track {
  height: 4px;
  margin: 9px 0 10px;
  border-radius: 999px;
  background: #fef3c7;
  overflow: hidden;
}

.mp-challenge-fill {
  height: 100%;
  width: 100%;
  background: #d97706;
  transition: width 0.2s linear;
}

.mp-synthetic-bar {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed #93c5fd;
  background: #eff6ff;
  font-size: 12.5px;
}

.mp-synthetic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.mp-footer {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}
