:root {
  --bg: #eef3ea;
  --ink: #102a27;
  --muted: #66736f;
  --card: rgba(255, 255, 248, 0.9);
  --line: rgba(16, 42, 39, 0.12);
  --accent: #e56b39;
  --accent-deep: #0d3b36;
  --gold: #f5c15d;
  --green: #4a7c59;
  --shadow: 0 22px 55px rgba(13, 59, 54, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    "Avenir Next",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  background:
    radial-gradient(circle at 14% 4%, rgba(245, 193, 93, 0.55), transparent 28rem),
    radial-gradient(circle at 94% 0%, rgba(74, 124, 89, 0.28), transparent 22rem),
    linear-gradient(145deg, #f6efe2 0%, #eef3ea 44%, #dfeae0 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(13, 59, 54, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 59, 54, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.hero-card,
.status-card,
.metric-card,
.content-card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  display: flex;
  position: relative;
  overflow: hidden;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 132px;
  padding: 20px 24px;
  border-radius: 32px;
  color: #fff9ea;
  background:
    linear-gradient(135deg, rgba(13, 59, 54, 0.96), rgba(25, 91, 77, 0.92)),
    radial-gradient(circle at 100% 0%, rgba(245, 193, 93, 0.8), transparent 18rem);
}

.hero-card::after {
  position: absolute;
  right: -52px;
  bottom: -74px;
  width: 188px;
  height: 188px;
  border: 26px solid rgba(245, 193, 93, 0.34);
  border-radius: 999px;
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
}

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

.hero-card .eyebrow {
  color: var(--gold);
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(30px, 9vw, 44px);
  line-height: 0.96;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.refresh-button {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: #122e2a;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  background: var(--gold);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ghost-button {
  flex: 0 0 auto;
  border: 1px solid rgba(13, 59, 54, 0.18);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--accent-deep);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 248, 0.72);
}

.status-card {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  padding: 13px 16px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(245, 193, 93, 0.2);
}

.status-card.is-success .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(74, 124, 89, 0.18);
}

.status-card.is-error .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(229, 107, 57, 0.18);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 130px;
  padding: 18px;
  border-radius: 26px;
}

.metric-card:first-child {
  grid-column: 1 / -1;
  min-height: 118px;
  background:
    linear-gradient(135deg, rgba(255, 255, 248, 0.94), rgba(245, 193, 93, 0.22)),
    var(--card);
}

.metric-label,
.metric-note {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  display: block;
  margin: 12px 0 9px;
  font-size: clamp(34px, 13vw, 56px);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.content-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 28px;
}

.section-title,
.site-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

#updateTime {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.site-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.site-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 248, 0.72);
}

.site-name {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.25;
}

.site-domain {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.site-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff9ea;
  font-size: 12px;
  font-weight: 800;
  background: var(--accent-deep);
}

.site-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.stat-chip {
  min-width: 0;
  border-radius: 16px;
  padding: 10px;
  background: rgba(13, 59, 54, 0.06);
}

.stat-chip span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-chip strong {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-chip small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  border: 1px dashed rgba(16, 42, 39, 0.22);
  border-radius: 22px;
  padding: 24px 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 248, 0.55);
}

.raw-panel pre {
  overflow: auto;
  max-height: 360px;
  margin: 14px 0 0;
  border-radius: 18px;
  padding: 14px;
  color: #eaf5ec;
  font-size: 12px;
  line-height: 1.65;
  background: #102a27;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 36px;
  }
}
