:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --panel: #ffffff;
  --text: #15201d;
  --muted: #65716c;
  --line: #dce3dc;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #c2410c;
  --green: #15803d;
  --red: #b91c1c;
  --yellow: #a16207;
  --blue: #1d4ed8;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  min-height: 220px;
  padding: 40px min(5vw, 64px);
  color: #fff;
  background:
    linear-gradient(100deg, rgba(8, 47, 73, 0.86), rgba(15, 118, 110, 0.76)),
    url("https://images.unsplash.com/photo-1520607162513-77705c0f0d4a?auto=format&fit=crop&w=1800&q=80") center/cover;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.topbar h1 {
  max-width: 720px;
  margin: 6px 0 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: currentColor;
  opacity: 0.72;
  font-size: 13px;
  font-weight: 700;
}

.wechat-status {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  font-size: 14px;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: -34px auto 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(20, 32, 29, 0.08);
}

.subscribe-panel,
.test-panel {
  grid-column: 1 / -1;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.form-grid,
.test-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.identity-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8faf9;
}

.identity-strip strong {
  display: block;
  margin-bottom: 2px;
}

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

input,
select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

.check-row {
  grid-column: span 3;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  line-height: 1.45;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.compact {
  grid-column: auto;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 750;
}

.primary {
  background: var(--primary);
  color: #fff;
}

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

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.subscription-list,
.log-list {
  display: grid;
  gap: 12px;
}

.subscription-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-head h3 {
  margin: 0;
  font-size: 18px;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.badge {
  align-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: #e5e7eb;
  color: #374151;
}

.badge.positive {
  background: #dcfce7;
  color: var(--green);
}

.badge.neutral {
  background: #dbeafe;
  color: var(--blue);
}

.badge.danger {
  background: #fee2e2;
  color: var(--red);
}

.badge.warning {
  background: #fef3c7;
  color: var(--yellow);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions button {
  min-height: 36px;
  padding: 0 12px;
}

.detail-card {
  display: grid;
  gap: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.reminder-copy,
.log-box {
  border-radius: 8px;
  background: #f8faf7;
  border: 1px solid var(--line);
  padding: 14px;
  color: #2f3d38;
  line-height: 1.7;
}

.empty-state {
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.log-item {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.log-item:last-child {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .form-grid,
  .test-controls,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .check-row {
    grid-column: auto;
  }
}
