:root {
  color-scheme: light;
  --bg: #f4efe6;
  --paper: #fffaf0;
  --ink: #18201d;
  --muted: #6c746e;
  --line: #d8d0c0;
  --green: #14624b;
  --red: #a4432f;
  --amber: #e6a32e;
  --blue: #23627a;
  --shadow: 0 22px 70px rgba(24, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(20, 98, 75, 0.09), transparent 32%),
    linear-gradient(315deg, rgba(230, 163, 46, 0.16), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
  position: relative;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.96;
}

h2 {
  font-size: 24px;
}

.button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(24, 32, 29, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 rgba(24, 32, 29, 0.16);
}

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

.unlock,
.panel {
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.unlock {
  max-width: 560px;
  padding: 24px;
}

.unlock label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.unlock-row {
  display: flex;
  gap: 10px;
}

.unlock input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.help,
.status,
.timestamp {
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.metrics article {
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 14px 34px rgba(24, 32, 29, 0.08);
}

.metrics article.accent {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.metrics span,
.metrics small {
  display: block;
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin: 14px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.panel {
  padding: 20px;
  margin-top: 16px;
}

.panel.compact {
  box-shadow: none;
}

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

.chart-panel {
  overflow: hidden;
}

#trendChart {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.chart-grid {
  stroke: #e7dfd1;
  stroke-width: 1;
}

.chart-area {
  fill: rgba(20, 98, 75, 0.13);
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: var(--amber);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  font-size: 14px;
}

.site-name {
  display: block;
  font-weight: 850;
}

.domain,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.positive {
  color: var(--green);
  font-weight: 850;
}

.negative {
  color: var(--red);
  font-weight: 850;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(35, 98, 122, 0.1);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.warn {
  background: rgba(230, 163, 46, 0.17);
  color: #7a520b;
}

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

.sync-item {
  display: grid;
  grid-template-columns: 110px 80px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.sync-item strong {
  color: var(--ink);
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 1240px);
    padding-top: 20px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics article:last-child {
    grid-column: 1 / -1;
  }

  .unlock-row {
    flex-direction: column;
  }

  .panel {
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .metrics article {
    min-height: 112px;
  }
}
