:root {
  --bg: #f7f3e8;
  --surface: rgba(255, 252, 244, 0.92);
  --surface-strong: #fffaf0;
  --text: #26362a;
  --muted: #687466;
  --primary: #2f6b45;
  --primary-strong: #1f5134;
  --primary-soft: #dcebd7;
  --accent: #a06a35;
  --accent-soft: #f1dfc8;
  --line: rgba(74, 96, 72, 0.18);
  --shadow: 0 18px 50px rgba(60, 74, 47, 0.13);
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(217, 232, 198, 0.55), transparent 34rem),
    linear-gradient(135deg, #f7f3e8 0%, #edf4e8 58%, #fff8eb 100%);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button {
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 3px solid rgba(47, 107, 69, 0.32);
  outline-offset: 2px;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
  min-height: 210px;
  margin-bottom: 18px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}

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

h1 {
  max-width: 11em;
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.28rem;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-visual {
  min-height: 180px;
  overflow: hidden;
  border: 1px solid rgba(47, 107, 69, 0.12);
  border-radius: var(--radius);
  background: var(--primary-soft);
  box-shadow: var(--shadow);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.tea-picker {
  padding: 20px;
  margin-bottom: 18px;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.state-pill,
.brew-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.tea-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.tea-option {
  min-height: 72px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--text);
  text-align: left;
}

.tea-option span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.tea-option[aria-selected="true"] {
  border-color: rgba(47, 107, 69, 0.82);
  background: linear-gradient(180deg, #e6f2df, #f8fff2);
  box-shadow: inset 0 0 0 2px rgba(47, 107, 69, 0.16);
  color: var(--primary-strong);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.timer-card,
.records-card {
  padding: 22px;
}

.timer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

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

.param-strip > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 14px;
}

.param-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.param-strip strong {
  display: block;
  color: var(--primary-strong);
  font-size: 1.16rem;
}

.tip-text {
  min-height: 1.5em;
  margin-bottom: 22px;
  color: var(--muted);
}

.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 164px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(240, 247, 232, 0.78)),
    var(--surface-strong);
  border: 1px solid rgba(47, 107, 69, 0.16);
}

.timer-display span {
  color: var(--primary-strong);
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.2rem, 9vw, 6rem);
  font-weight: 800;
  line-height: 1;
}

.status-text {
  min-height: 1.5em;
  margin: 16px 0;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
}

.controls {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 10px;
}

.controls button,
.ghost-button {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(47, 107, 69, 0.14);
  background: #fffdf8;
  color: var(--primary-strong);
  font-weight: 750;
}

.controls button:hover,
.ghost-button:hover,
.tea-option:hover {
  box-shadow: 0 8px 20px rgba(47, 107, 69, 0.13);
}

.controls .primary-action {
  background: var(--primary);
  color: #fff;
}

.controls .primary-action:hover {
  background: var(--primary-strong);
}

.quiet-link {
  display: block;
  margin: 16px auto 0;
  min-height: 36px;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.records-list {
  display: grid;
  gap: 10px;
}

.record-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  padding: 13px 14px;
}

.record-main {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 7px;
  font-weight: 750;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(31, 81, 52, 0.94);
  color: #fff;
  box-shadow: 0 14px 40px rgba(31, 81, 52, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .hero,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-copy {
    padding: 16px 0 0;
  }

  .hero-visual {
    min-height: 160px;
  }

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

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 520px);
    padding: 18px 0 28px;
  }

  h1 {
    font-size: 2rem;
  }

  .hero-visual {
    min-height: 120px;
  }

  .tea-picker,
  .timer-card,
  .records-card {
    padding: 15px;
  }

  .section-heading,
  .timer-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

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

  .tea-option {
    min-height: 62px;
  }

  .param-strip,
  .controls {
    grid-template-columns: 1fr;
  }

  .timer-display {
    min-height: 136px;
  }

  .timer-display span {
    font-size: clamp(3.2rem, 17vw, 4.8rem);
  }

  .controls button {
    min-height: 52px;
  }

  .ghost-button {
    width: 100%;
  }

  .record-main {
    flex-direction: column;
    gap: 2px;
  }
}
