:root {
  --bg: #f6f4ee;
  --panel: #fffdf7;
  --ink: #1d211c;
  --muted: #697164;
  --line: #ded8ca;
  --accent: #0c7c59;
  --accent-dark: #075b41;
  --warn: #9f3a18;
  --shadow: 0 18px 60px rgba(52, 45, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(12, 124, 89, 0.12), transparent 34rem),
    linear-gradient(135deg, #f6f4ee 0%, #ece7da 100%);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

.sms-ui {
  min-height: 100vh;
  padding: 16px;
  color: #1e293b;
  background: #f0f4f8;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

.sms-wrap {
  width: min(1024px, 100%);
  margin: 0 auto;
  padding: 16px 0 32px;
}

.artifact-hero,
.artifact-card {
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
}

.artifact-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 24px;
}

.artifact-hero-orb {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  background: #eff6ff;
  opacity: 0.62;
  pointer-events: none;
}

.artifact-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.artifact-hero-main {
  display: grid;
  gap: 16px;
}

.artifact-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.artifact-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker-icon {
  font-size: 10px;
}

.artifact-auto {
  display: inline-flex;
  align-items: center;
  color: #64748b;
  font-size: 14px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #3b82f6;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.artifact-phone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.artifact-country {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 64px;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.04);
  color: #475569;
  font-size: 17px;
}

.artifact-country strong {
  font-size: 13px;
}

.artifact-phone-row h1 {
  margin: 0;
  max-width: 100%;
  color: #1e293b;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.copy-number-btn {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 22px;
  transition: color 0.2s ease, background 0.2s ease;
}

.copy-number-btn:hover {
  background: #eff6ff;
  color: #2563eb;
}

.copy-number-btn.copied {
  color: #16a34a;
}

.artifact-subtitle {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.sms-ui .status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  color: #475569;
  padding: 9px 16px;
  font-weight: 700;
}

.sms-ui .status-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.sms-ui .status-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.status-icon {
  color: #94a3b8;
}

.artifact-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
}

.artifact-card {
  padding: 24px;
}

.artifact-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: #1e293b;
  font-size: 18px;
}

.section-icon {
  color: #3b82f6;
  font-size: 20px;
}

.history-icon {
  color: #94a3b8;
}

.artifact-latest {
  display: flex;
  min-height: 360px;
  flex-direction: column;
}

.artifact-message-box {
  position: relative;
  display: flex;
  min-height: 188px;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.55);
  padding: 24px;
  text-align: center;
}

.quote-mark {
  position: absolute;
  top: 10px;
  left: 14px;
  color: #bfdbfe;
  font-size: 42px;
  line-height: 1;
  opacity: 0.72;
}

.artifact-message-box p,
.artifact-message-box pre {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #64748b;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.7;
}

.artifact-message-box pre {
  color: #334155;
  text-align: left;
}

.artifact-meta {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
  font-size: 14px;
}

.artifact-meta div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.artifact-meta span {
  color: #64748b;
}

.artifact-meta strong {
  color: #334155;
  font-family: Consolas, "Segoe UI", "Microsoft YaHei", monospace;
  font-weight: 700;
}

.count-chip,
.refresh-chip {
  border-radius: 6px;
  padding: 2px 8px;
}

.count-chip {
  background: #f1f5f9;
}

.refresh-chip {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #2563eb !important;
}

.artifact-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.artifact-card-head h2 {
  margin: 0;
}

.refresh-link {
  color: #2563eb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.refresh-link:hover {
  color: #1d4ed8;
}

.artifact-history {
  min-height: 360px;
}

.artifact-history-list {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.artifact-history-item {
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 14px;
  transition: background 0.2s ease;
}

.artifact-history-item:hover {
  background: #f8fafc;
}

.artifact-history-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #94a3b8;
  font-size: 12px;
}

.artifact-history-item p {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.artifact-empty-state {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #e2e8f0;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.58);
  padding: 32px;
  text-align: center;
}

.artifact-empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: #cbd5e1;
  font-size: 28px;
}

.artifact-empty-title {
  margin: 0 0 4px;
  color: #475569;
  font-weight: 700;
}

.artifact-empty-text {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.page.narrow {
  width: min(720px, calc(100% - 32px));
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.panel,
.hero {
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.admin-grid {
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 42px;
  line-height: 1.05;
}

.phone-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.flag-badge {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 8px 20px rgba(52, 45, 31, 0.1);
  font-size: 28px;
  line-height: 1;
}

h2 {
  margin-bottom: 14px;
  font-size: 20px;
}

.muted {
  color: var(--muted);
  line-height: 1.7;
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4efe3;
  color: #20251f;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dff3ea;
  color: var(--accent-dark);
  font-weight: 800;
  padding: 10px 14px;
}

.latest-message,
.sms-card pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.65;
}

.latest-message {
  min-height: 112px;
  padding: 16px;
  border: 1px solid #cbded4;
  border-radius: 8px;
  background: #effaf5;
  font-size: 18px;
}

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

.warning {
  margin: 12px 0 0;
  color: var(--warn);
}

.notice {
  margin-bottom: 18px;
  border: 1px solid #b8d6c7;
  border-radius: 8px;
  background: #e9f7ef;
  color: var(--accent-dark);
  padding: 14px 16px;
  font-weight: 700;
}

.warning-notice {
  border-color: #f2c2ad;
  background: #fff2eb;
  color: var(--warn);
}

.meta {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.meta div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
}

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

.meta dd {
  margin: 0;
  min-width: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffaf0;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.history {
  display: grid;
  gap: 12px;
}

.sms-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.sms-time {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.output-box {
  min-height: 140px;
  background: #f8f3e8;
  font-family: Consolas, "Microsoft YaHei", monospace;
}

.checkbox-line {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.number-list {
  display: grid;
  gap: 12px;
}

.number-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px;
}

.number-row p {
  margin: 6px 0 0;
}

.warning-block {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--warn);
}

.announcement-locked {
  overflow: hidden;
}

.announcement-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(29, 33, 28, 0.62);
  backdrop-filter: blur(6px);
}

.announcement-box {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.24);
  padding: 24px;
}

.announcement-content {
  max-height: 42vh;
  overflow: auto;
  margin: 14px 0 18px;
  color: var(--ink);
  line-height: 1.8;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 820px) {
  .sms-ui {
    padding: 12px;
  }

  .sms-wrap {
    padding-top: 4px;
  }

  .artifact-hero-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .artifact-layout {
    grid-template-columns: 1fr;
  }

  .artifact-phone-row h1 {
    font-size: 32px;
  }

  h1 {
    font-size: 34px;
  }

  .artifact-card {
    padding: 18px;
  }

  .artifact-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .artifact-meta div,
  .artifact-history-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

@media (max-width: 560px) {
  .sms-ui {
    padding: 8px;
  }

  .sms-wrap {
    padding: 0 0 18px;
  }

  .artifact-hero {
    margin-bottom: 14px;
    border-radius: 12px;
    padding: 16px;
  }

  .artifact-hero-main {
    gap: 12px;
  }

  .artifact-kicker-row {
    gap: 8px;
  }

  .artifact-kicker {
    padding: 5px 9px;
    font-size: 11px;
  }

  .artifact-auto {
    font-size: 13px;
  }

  .artifact-phone-row {
    gap: 10px;
  }

  .artifact-country {
    width: 56px;
    height: 36px;
    font-size: 15px;
  }

  .artifact-country strong {
    font-size: 12px;
  }

  .artifact-phone-row h1 {
    flex: 1 1 min(220px, 100%);
    font-size: 28px;
    line-height: 1.14;
  }

  .copy-number-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .sms-ui .status-pill {
    width: 100%;
    justify-content: center;
    border-radius: 8px;
    padding: 10px 12px;
  }

  .artifact-card {
    border-radius: 12px;
    padding: 14px;
  }

  .artifact-latest,
  .artifact-history {
    min-height: 0;
  }

  .artifact-message-box {
    min-height: 140px;
    border-radius: 12px;
    padding: 18px 14px;
  }

  .quote-mark {
    top: 8px;
    left: 10px;
    font-size: 32px;
  }

  .artifact-meta {
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
  }

  .artifact-card-head {
    gap: 10px;
    margin-bottom: 12px;
  }

  .refresh-link {
    display: inline-flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
  }

  .artifact-history-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .artifact-history-meta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .artifact-empty-state {
    min-height: 160px;
    padding: 22px 16px;
  }

  .artifact-empty-icon {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .page,
  .page.narrow {
    width: min(100% - 20px, 1120px);
    padding: 20px 0;
  }

  .panel,
  .hero {
    padding: 16px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.12;
  }

  .grid {
    gap: 14px;
  }

  .output-box {
    min-height: 180px;
    font-size: 13px;
  }

  .button {
    width: 100%;
  }

  .number-row code {
    display: block;
  }

  .announcement-mask {
    padding: 10px;
  }

  .announcement-box {
    max-height: calc(100vh - 20px);
    overflow: auto;
    padding: 18px;
  }
}
