:root {
  --bg1: #eef2ff;
  --bg2: #e0f2fe;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent2: #06b6d4;
  --good: #16a34a;
  --shadow: 0 10px 30px rgba(37, 99, 235, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  min-height: 100vh;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 34px;
  margin: 0 0 8px;
  letter-spacing: 1px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.panel {
  background: var(--card);
  border-radius: 24px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
}

/* 仪表盘 */
.gauge-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 28px;
}

.gauge { width: 100%; height: 100%; transform: rotate(-90deg); }

.gauge-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 14;
}

.gauge-fg {
  fill: none;
  stroke: url(#g);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 502.65;
  stroke-dashoffset: 502.65;
  transition: stroke-dashoffset 0.25s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-value {
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.gauge-unit {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.gauge-phase {
  font-size: 13px;
  color: var(--accent2);
  margin-top: 10px;
  font-weight: 600;
}

.start-btn {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 32px;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.start-btn:hover { transform: translateY(-1px); }
.start-btn:active { transform: translateY(1px); }
.start-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 结果卡片 */
.results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.card {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}

.card-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.card-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
}

.card-value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

/* 历史记录 */
.history {
  margin-top: 30px;
  background: var(--card);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.history h2 { font-size: 18px; margin: 0 0 14px; }

.history-list { list-style: none; margin: 0; padding: 0; }

.history-list li {
  display: flex;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 14px;
}

.history-list li:last-child { border-bottom: none; }
.history-list .h-time { color: var(--muted); }
.history-list .h-metrics b { color: var(--accent); }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 26px;
  line-height: 1.6;
}

@media (max-width: 520px) {
  .results { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
}
