:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #171a1f;
  --muted: #68707d;
  --line: #dfe4ea;
  --accent: #a84a3d;
  --accent-hover: #913f35;
  --accent-soft: #f2e8df;
  --success: #147d4f;
  --success-bg: #e7f7ef;
  --failed: #b42318;
  --failed-bg: #fff0ee;
  --loading: #8a5a00;
  --loading-bg: #fff4d6;
  --code-bg: #161616;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  color: #ffffff;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.secondary-button {
  color: var(--accent);
  background: var(--accent-soft);
}

.secondary-button:hover {
  color: #ffffff;
  background: var(--accent);
}

.danger-button {
  background: #b42318;
}

.danger-button:hover {
  background: #8f1d14;
}

.ghost-button {
  min-height: 34px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
}

.ghost-button:hover {
  color: var(--text);
  background: #f5f6f8;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  width: min(1080px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  padding: 28px;
  box-shadow: 0 18px 45px rgba(31, 35, 40, 0.08);
}

.notice-panel {
  border: 1px solid #f0c36d;
  border-radius: 12px;
  background: #fff8e6;
  color: #6f4a00;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.payment-panel {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  padding: 18px;
  margin-bottom: 16px;
}

.payment-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.payment-copy {
  margin: 0;
  flex: 1 1 280px;
  color: var(--muted);
  line-height: 1.6;
}

.detect-status {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  border: 1px solid #f6d476;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--loading);
  background: var(--loading-bg);
  font-size: 13px;
  font-weight: 800;
}

.pay-card {
  display: grid;
  gap: 16px;
  width: min(460px, 100%);
  margin: 80px auto 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  padding: 28px;
  text-align: center;
  box-shadow: 0 18px 45px rgba(31, 35, 40, 0.08);
}

.pay-card h1 {
  margin: 0;
  font-size: 28px;
}

.pay-card p {
  margin: 0;
  color: var(--muted);
}

.pay-amount {
  font-size: 48px;
  font-weight: 900;
}

.pay-status {
  font-size: 13px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.loading {
  border-color: #f6d476;
  color: var(--loading);
  background: var(--loading-bg);
}

.status-badge.success {
  border-color: #a8e4c5;
  color: var(--success);
  background: var(--success-bg);
}

.status-badge.failed {
  border-color: #ffb8b0;
  color: var(--failed);
  background: var(--failed-bg);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.summary-card,
.phone-panel,
.code-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.summary-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.summary-label,
.section-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-card strong {
  font-size: 24px;
}

.summary-hint {
  color: var(--muted);
  font-size: 14px;
}

.phone-panel,
.code-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin-bottom: 16px;
}

.phone-number {
  margin-top: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.15;
  word-break: break-word;
}

.phone-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.primary-actions,
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.code-value {
  margin-top: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 34px;
  font-weight: 900;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.result-header h2 {
  margin: 0;
  font-size: 16px;
}

.result-output {
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 16px;
  color: var(--muted);
}

.log-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.log-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.log-title span {
  color: var(--muted);
  font-size: 12px;
}

.log-detail {
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .workspace {
    border-radius: 18px;
    padding: 18px;
  }

  .page-header,
  .summary-grid,
  .payment-panel,
  .phone-panel,
  .code-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
    flex-direction: column;
  }

  .phone-number {
    font-size: 32px;
  }

  .code-value {
    font-size: 28px;
  }

  .primary-actions,
  .order-actions {
    justify-content: stretch;
  }

  .primary-actions button,
  .order-actions button,
  .payment-form button,
  .summary-card button {
    width: 100%;
  }
}
