:root {
  color-scheme: light;
  --bg: #f5efe2;
  --stage: #f9f3e6;
  --panel: #fcf8ee;
  --panel-2: #f9f3e6;
  --ink: #3a332b;
  --muted: #857d70;
  --faint: #a89e8e;
  --line: #ece3d2;
  --line-strong: #d8c3b1;
  --brass: #d9882c;
  --pitch: #d9882c;
  --breath: #d8775b;
  --onset: #cf6a4f;
  --tail: #d9a02c;
  --radar: #7e9e78;
  --shadow: 0 14px 40px rgba(133, 125, 112, 0.16);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(236, 227, 210, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 227, 210, 0.5) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 12px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 239, 226, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brass), #8a7048);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small,
.quiet-link,
.eyebrow,
.card-index,
.tool-tag,
.tool-pill,
.meta-grid dt,
.metric-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiet-link,
.back-link,
.primary-action,
.secondary-action,
.card-cta {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 253, 248, 0.85);
}

.back-link {
  width: max-content;
  color: var(--pitch);
}

.page-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(14px, 3vw, 28px) 104px;
}

.tools-home-shell {
  padding-top: clamp(14px, 2.4vw, 28px);
}

.tool-page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 14px clamp(10px, 2vw, 22px) 104px;
}

.hero-panel,
.practice-card,
.tool-card,
.metric-card,
.placeholder-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(217, 136, 44, 0.05), rgba(217, 136, 44, 0.012)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  min-height: 300px;
  display: grid;
  align-content: end;
  gap: 18px;
  padding: clamp(24px, 4vw, 42px);
}

.today-hero {
  border-color: rgba(126, 158, 120, 0.28);
  background:
    linear-gradient(135deg, rgba(126, 158, 120, 0.13), transparent 48%),
    linear-gradient(180deg, rgba(217, 136, 44, 0.05), rgba(217, 136, 44, 0.012)),
    var(--panel);
}

.eyebrow {
  margin: 0;
  color: var(--brass);
}

.tools-home-shell .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 2px 2px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
}

.tools-home-shell .eyebrow:first-of-type {
  margin-top: 4px;
}

.tools-home-shell .eyebrow::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brass), var(--breath));
}

h1,
h2,
p,
dl {
  margin: 0;
}

h1,
h2 {
  font-family: Georgia, "Songti SC", serif;
  font-weight: 400;
  line-height: 1.08;
}

h1 {
  max-width: 800px;
  font-size: clamp(38px, 7vw, 76px);
}

h2 {
  font-size: clamp(25px, 3vw, 36px);
}

.hero-panel p:not(.eyebrow),
.practice-card p,
.tool-card p,
.placeholder-panel p,
.metric-card p {
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-action,
.card-cta {
  border-color: var(--pitch);
  color: #fff;
  background: var(--pitch);
  font-weight: 800;
}

.secondary-action {
  color: var(--ink);
}

.session-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.85);
}

.session-chip strong {
  color: var(--ink);
  font-size: 22px;
}

.daily-grid,
.tool-grid,
.profile-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.daily-grid {
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(220px, 0.7fr));
}

.practice-card,
.metric-card,
.placeholder-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 20px;
}

.practice-card.is-featured {
  border-color: rgba(126, 158, 120, 0.34);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(236, 227, 210, 0.5);
}

.meta-grid dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.tool-card {
  --accent: var(--brass);
  position: relative;
  display: grid;
  min-height: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 54%),
    linear-gradient(180deg, rgba(217, 136, 44, 0.05), rgba(217, 136, 44, 0.012)),
    var(--panel);
}

.tool-card.is-ready,
.tool-card:first-child {
  --accent: var(--pitch);
}

.tool-card:nth-child(2) {
  --accent: var(--breath);
}

.tool-card:nth-child(3) {
  --accent: var(--radar);
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.tool-tag,
.tool-pill {
  position: absolute;
  top: 16px;
  z-index: 2;
}

.tool-tag {
  left: 16px;
  color: var(--accent);
}

.tool-pill {
  right: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(236, 227, 210, 0.6);
}

.tool-card-body {
  display: grid;
  gap: 3px;
  align-content: end;
  padding: 44px 18px 16px;
}

.tool-card h2 {
  font-size: 21px;
}

.tool-card p {
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-cn {
  color: var(--accent) !important;
  font-size: 13px;
}

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

.metric-card strong {
  color: var(--pitch);
  font-family: Georgia, "Songti SC", serif;
  font-size: 56px;
}

.tool-top {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.tool-title {
  min-width: 0;
}

.tool-title h1 {
  font-size: clamp(28px, 4vw, 48px);
}

.tool-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 106px);
  min-height: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f3e6;
}

body[data-tool-page="bird"] .tool-top {
  display: none;
}

body[data-tool-page] .tool-page-shell {
  max-width: none;
  padding: 0 0 82px;
}

body[data-tool-page] .tool-frame {
  height: calc(100dvh - 82px);
  min-height: 0;
  border: 0;
  border-radius: 0;
}

body[data-tool-page="breath"] .tool-frame {
  height: calc(100dvh - 82px);
  min-height: 0;
}

body[data-tool-page="tail"] .tool-frame {
  height: calc(100dvh - 82px);
  min-height: 0;
}

body[data-tool-page="radar"] .tool-frame {
  height: calc(100dvh - 82px);
  min-height: 0;
}

.placeholder-panel {
  max-width: 760px;
  margin: 0 auto;
  border-color: rgba(244, 168, 91, 0.28);
}

.placeholder-panel .tool-tag {
  position: static;
}

.onset-accent {
  border-color: rgba(255, 111, 126, 0.3);
}

.tail-accent {
  border-color: rgba(245, 200, 79, 0.32);
}

.bottom-tabs {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 14px;
  display: grid;
  grid-template-columns: minmax(132px, 1fr);
  width: min(190px, calc(100% - 28px));
  transform: translateX(-50%);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px;
  background: rgba(245, 239, 226, 0.92);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
}

.bottom-tabs a {
  min-height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
}

.bottom-tabs a.is-active {
  color: #fff;
  background: var(--brass);
}

/* 两个及以上 tab 时自动铺成等宽列 */
.bottom-tabs:has(a + a) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(300px, calc(100% - 28px));
}

@media (max-width: 880px) {
  .daily-grid,
  .tool-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .tool-top {
    grid-template-columns: 1fr;
  }

  .tool-frame {
    height: calc(100vh - 160px);
    min-height: 720px;
  }

  body[data-tool-page="breath"] .tool-frame {
    height: calc(100dvh - 82px);
    min-height: 0;
  }

  body[data-tool-page="tail"] .tool-frame {
    height: calc(100dvh - 82px);
    min-height: 0;
  }

  body[data-tool-page="radar"] .tool-frame {
    height: calc(100dvh - 82px);
    min-height: 0;
  }
}

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

  .meta-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 36px;
  }

  .tool-card {
    min-height: 0;
  }
}
