:root {
  color-scheme: light;
  --background: #f3f5f7;
  --surface: #ffffff;
  --text: #18212f;
  --muted: #6b7280;
  --line: #dde2e8;
  --accent: #246bfe;
  --accent-dark: #174fc0;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(36, 107, 254, 0.10), transparent 28rem),
    var(--background);
}

button, select { font: inherit; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

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

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

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.04em;
}

.subtitle { margin: 10px 0 0; color: var(--muted); }

.refresh-button,
.filter-button {
  border: 0;
  border-radius: 9px;
  padding: 11px 18px;
  color: white;
  background: var(--accent);
  cursor: pointer;
}

.refresh-button:hover,
.filter-button:hover { background: var(--accent-dark); }

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) auto auto;
  align-items: end;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.filters label span {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.filters select {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: white;
}

.reset-link {
  align-self: center;
  color: var(--muted);
  text-decoration: none;
}

.log-list { display: grid; gap: 14px; }

.log-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(29, 43, 67, 0.045);
}

.log-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badges { display: flex; flex-wrap: wrap; gap: 7px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.badge--phone { color: #7a3e00; background: #fff0d8; }
.badge--feishu { color: #174ea6; background: #e9f1ff; }
.badge--status { color: #4b5563; background: #eef0f3; }
.badge--succeeded { color: #17643a; background: #e7f8ee; }
.badge--failed, .badge--timed_out { color: #9f2a20; background: #ffedeb; }
.badge--queued, .badge--sending, .badge--claimed { color: #76520d; background: #fff6d8; }

.notification-id { color: var(--muted); font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }

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

.metadata div { min-width: 0; }
.metadata dt { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.metadata dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; }

.content-block h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

pre {
  max-height: 330px;
  margin: 0;
  padding: 13px 14px;
  overflow: auto;
  border-radius: 9px;
  color: #263246;
  background: #f6f8fa;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.error-block {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 8px;
  color: var(--danger);
  background: var(--danger-bg);
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 72px 24px;
  border: 1px dashed #c9d0d9;
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.empty-state h2 { margin: 0 0 8px; color: var(--text); }
.empty-state p { margin: 0; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  color: var(--muted);
}

.pagination a { color: var(--accent); text-decoration: none; font-weight: 650; }

@media (max-width: 800px) {
  .container { width: min(100% - 20px, 680px); padding-top: 28px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:last-of-type { grid-column: 1 / -1; }
  .metadata { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .filters { grid-template-columns: 1fr; }
  .filters label:last-of-type { grid-column: auto; }
  .metadata { grid-template-columns: 1fr; }
  .refresh-button { width: 100%; }
}
