:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --primary: #6c8cef;
  --primary-dark: #4a6cd4;
  --inhale: #5b9d6f;   /* 吸气 - 绿 */
  --hold: #e0a93a;     /* 屏息 - 金 */
  --exhale: #6c8cef;   /* 呼气 - 蓝 */
  --text: #2c3e50;
  --muted: #7a8ba0;
  --border: #e6ebf2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  padding: 20px 32px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
}
.logo-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Container */
.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px 60px;
  flex: 1;
}

.hero { text-align: center; margin: 24px 0 28px; }
.hero h1 { font-size: 26px; font-weight: 700; }
.subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* Tool card */
.tool-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 4px 24px rgba(74, 108, 212, 0.08);
  text-align: center;
}

/* 圆环可视化 */
.visual {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 24px;
}
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 14;
}
.ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 540;
  stroke-dashoffset: 540;
  transition: stroke-dashoffset 0.2s linear, stroke 0.4s;
}
.phase-label {
  position: absolute;
  top: 38%;
  left: 0; right: 0;
  font-size: 20px;
  font-weight: 600;
  transform: translateY(-50%);
}
.timer {
  position: absolute;
  top: 56%;
  left: 0; right: 0;
  font-size: 44px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
}
.cycle-count {
  position: absolute;
  top: 78%;
  left: 0; right: 0;
  font-size: 13px;
  color: var(--muted);
}

/* 阶段进度条 */
.phases {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.phase {
  flex: 1;
  padding: 10px 6px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 13px;
  color: var(--muted);
  transition: all 0.3s;
}
.phase .num {
  display: block;
  font-size: 20px;
  font-weight: 700;
}
.phase.active-inhale { background: rgba(91,157,111,0.15); color: var(--inhale); }
.phase.active-hold  { background: rgba(224,169,58,0.15); color: var(--hold); }
.phase.active-exhale{ background: rgba(108,140,239,0.15); color: var(--exhale); }

/* 按钮 */
.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}
.btn {
  padding: 12px 26px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  min-width: 120px;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: transparent; border: 1px solid var(--border); }

/* 设置 */
.settings {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
}
.settings select {
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* 科普区 */
.info {
  margin-top: 32px;
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}
.info h2 { font-size: 18px; margin-bottom: 10px; }
.info h3 { font-size: 15px; margin: 16px 0 8px; }
.info p, .info li { font-size: 14px; color: #4a5a6a; }
.info ol { padding-left: 20px; }
.info li { margin-bottom: 6px; }

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fff8e6;
  border-left: 3px solid var(--hold);
  border-radius: 8px;
  font-size: 13px;
  color: #8a6d1f;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 420px) {
  .visual { width: 200px; height: 200px; }
  .timer { font-size: 36px; }
}
