:root {
  --bg: #fff7ed;
  --bg-soft: #ffedd5;
  --panel: #ffffff;
  --panel-soft: #fffaf5;
  --text: #121826;
  --muted: #697386;
  --line: #f3d6bc;
  --orange: #f97316;
  --orange-dark: #c2410c;
  --orange-soft: #ffedd5;
  --green: #10b981;
  --red: #dc2626;
  --shadow: 0 18px 55px rgba(194, 65, 12, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 237, 213, 0.9), transparent 30%),
    linear-gradient(120deg, #fff7ed 0%, #fffaf5 45%, #eaf3ff 100%);
}

button,
input {
  font: inherit;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(243, 214, 188, 0.9);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  font-size: 13px;
  letter-spacing: 0;
}

.top-actions,
.button-row,
.form-row,
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-shell {
  width: min(1060px, calc(100vw - 32px));
  margin: 24px auto 52px;
}

.access-panel,
.summary-panel,
.card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(243, 214, 188, 0.88);
  box-shadow: var(--shadow);
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 32px;
  align-items: center;
  padding: 28px 26px;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.18;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

.muted {
  color: var(--muted);
}

.cdk-form label {
  display: block;
  margin-bottom: 8px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}

.cdk-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #e6c8aa;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.cdk-form input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.primary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  border: 0;
  color: #fff;
  background: #111827;
}

.primary-button:hover {
  background: var(--orange-dark);
}

.ghost-button {
  color: #1f2937;
  background: #fff;
  border: 1px solid #e6c8aa;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ghost-button:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
}

.ghost-button:disabled,
.ghost-button[disabled] {
  cursor: not-allowed;
  color: #9ca3af;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

[hidden] {
  display: none !important;
}

.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.service-badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  font-size: 13px;
  font-weight: 800;
}

.pill.ok {
  color: #047857;
  background: #d1fae5;
}

.pill.orange {
  color: var(--orange-dark);
}

.form-hint {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 13px;
}

.form-hint.success {
  color: #059669;
}

.form-hint.error {
  color: var(--red);
}

.form-hint.loading {
  color: var(--orange-dark);
}

.alert {
  padding: 12px 14px;
  color: #991b1b;
  background: #fee2e2;
  border-radius: 8px;
  font-size: 14px;
}

.setup-alert {
  margin-bottom: 16px;
}

.summary-panel {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 16px 24px;
  border-radius: 8px;
}

.metric {
  border-right: 1px solid var(--line);
  padding-right: 18px;
}

.metric span {
  display: block;
  margin-bottom: 6px;
  color: #8b98aa;
  font-size: 12px;
}

.metric strong {
  font-size: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.card {
  border-radius: 8px;
  padding: 26px;
}

.card-head {
  justify-content: space-between;
  margin-bottom: 24px;
}

.phone-number {
  min-height: 52px;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
  word-break: break-all;
}

.country-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-top: 8px;
  padding: 0 12px;
  color: #7c2d12;
  background: #ffedd5;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.sms-code {
  min-height: 64px;
  margin-top: 22px;
  color: #ea580c;
  font-size: 50px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 5px;
  word-break: break-all;
}

.sms-text {
  min-height: 24px;
  color: #4b5563;
}

.notice {
  margin: 16px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.notice.success {
  color: #047857;
  background: #ecfdf5;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 10px 12px;
  color: #8b98aa;
  background: #fff7ed;
  border-radius: 8px;
  font-size: 13px;
}

.info-row.soft {
  background: #fffaf5;
}

.small-note {
  margin: 12px 0 0;
  color: var(--orange-dark);
  font-size: 13px;
}

.records-card {
  margin-top: 16px;
}

.records-list {
  display: grid;
  gap: 8px;
}

.record-item {
  display: grid;
  grid-template-columns: 110px minmax(180px, 1fr) 160px 190px;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--panel-soft);
  border-radius: 8px;
  color: #4b5563;
  font-size: 14px;
}

.record-item strong {
  color: var(--orange-dark);
  font-size: 16px;
}

.record-item time {
  color: #8b98aa;
  text-align: right;
}

.empty-state {
  padding: 34px;
  color: #8b98aa;
  text-align: center;
  background: var(--panel-soft);
  border-radius: 8px;
}

@media (max-width: 800px) {
  .topbar {
    padding: 0 16px;
  }

  .service-badge {
    display: none;
  }

  .access-panel,
  .summary-panel,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    align-items: stretch;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
  }

  .form-row {
    align-items: stretch;
    flex-direction: column;
  }

  .record-item {
    grid-template-columns: 1fr;
  }

  .record-item time {
    text-align: left;
  }

  .sms-code {
    font-size: 42px;
  }
}
