:root {
  --bg: #faf7ef;
  --surface: rgba(255, 255, 255, .72);
  --line: rgba(62, 48, 24, .12);
  --line-2: rgba(62, 48, 24, .07);
  --text: #2b2620;
  --text-2: #6b6152;
  --dim: #9c9282;
  --temp: #d9772f;
  --temp-soft: #f0a35e;
  --hum: #5a82b5;
  --hum-soft: #8fb0da;
  --ok: #34a853;
  --warn: #d99b2b;
  --bad: #d9534f;
  --chart-grid: rgba(62, 48, 24, .08);
  --chart-tick: #9c9282;
  --point-border: #fffdf8;
  --tip-bg: rgba(255, 253, 248, .98);
  --tip-line: rgba(62, 48, 24, .12);
  --tip-title: #2b2620;
  --tip-body: #6b6152;
  --r: 18px;
  --shadow: 0 1px 2px rgba(80, 60, 30, .04), 0 14px 34px -20px rgba(80, 60, 30, .28);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(52% 42% at 14% 0%, rgba(240, 190, 120, .28), transparent 70%),
    radial-gradient(46% 38% at 88% 5%, rgba(226, 205, 160, .34), transparent 72%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  padding: clamp(22px, 3.2vw, 44px) clamp(16px, 4vw, 56px) 64px;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.brand { display: flex; flex-direction: column; gap: 7px; }

h1 {
  font-size: clamp(21px, 2.6vw, 26px);
  font-weight: 620;
  letter-spacing: -.025em;
  margin: 0;
}

.stamp { margin: 0; color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 2px;
}

.pill i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dim);
}

.pill.ok i { background: var(--ok); animation: pulse 2.4s infinite; }
.pill.warn i { background: var(--warn); }
.pill.bad i { background: var(--bad); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 168, 83, .45); }
  70% { box-shadow: 0 0 0 6px rgba(52, 168, 83, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 168, 83, 0); }
}

.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
  transition: color .16s, background .16s, box-shadow .16s;
  white-space: nowrap;
}

.seg button:hover { color: var(--text); }

.seg button.on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(80, 60, 30, .1);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px 24px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.tag { color: var(--text-2); font-size: 13px; letter-spacing: .01em; display: inline-flex; align-items: center; gap: 8px; }

.tag::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dim);
}

.stat--temp .tag::before { background: var(--temp); }
.stat--hum .tag::before { background: var(--hum); }

.ico { width: 18px; height: 18px; opacity: .3; color: var(--text); }

.value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: clamp(44px, 6.4vw, 58px);
  font-weight: 620;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.value i { font-style: normal; font-size: .28em; font-weight: 400; color: var(--dim); letter-spacing: 0; margin-left: 2px; }

.stat--temp .value {
  background: linear-gradient(100deg, var(--temp), var(--temp-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.stat--hum .value {
  background: linear-gradient(100deg, var(--hum), var(--hum-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.meter {
  height: 3px;
  border-radius: 99px;
  background: var(--line-2);
  margin: 20px 0 12px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}

.stat--temp .meter span { background: linear-gradient(90deg, var(--temp), var(--temp-soft)); }
.stat--hum .meter span { background: linear-gradient(90deg, var(--hum), var(--hum-soft)); }

.foot { color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
}

.cell {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 1px solid var(--line);
}

.cell:first-child { border-left: 0; }

.k { color: var(--dim); font-size: 12px; }

.v { font-size: 20px; font-weight: 590; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.v b { font-weight: inherit; }
.v i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--dim); margin-left: 3px; }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }

.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 22px 14px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }

.box-head h2 { font-size: 13.5px; font-weight: 590; margin: 0; letter-spacing: -.005em; }

.hint { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }

.canvas-wrap { position: relative; height: 210px; }

.hide { display: none; }

@media (max-width: 700px) {
  .mini { grid-template-columns: repeat(2, 1fr); }
  .cell:nth-child(3) { border-left: 0; }
  .cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  header { align-items: flex-start; flex-direction: column; }
  .seg { width: 100%; overflow-x: auto; }
  .value { font-size: 42px; }
}
