:root {
  color-scheme: light;
  --bg: #fff5f8;
  --surface: #ffffff;
  --surface-strong: #fff0f5;
  --ink: #35212a;
  --muted: #9a6374;
  --line: #f2c8d5;
  --accent: #df5f8f;
  --accent-strong: #c94077;
  --accent-soft: #ffe1eb;
  --violet: #8b6fe8;
  --danger: #c13f5a;
  --shadow: 0 16px 42px rgba(198, 64, 119, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top left, #ffe4ee 0, transparent 34%), var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.page {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.auth-page {
  display: grid;
  align-content: center;
  min-height: 100vh;
  padding-bottom: 18px;
}

.brand {
  margin-bottom: 24px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff9ab9);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.brand h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

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

.panel,
.record-card,
.baby-card,
.user-card,
.menu-list {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(242, 200, 213, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.section-label,
.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 4px;
  font-weight: 700;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.textarea {
  min-height: 78px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(223, 95, 143, 0.16);
}

.btn {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.btn:hover {
  background: var(--accent-strong);
}

.btn.secondary {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.btn.block {
  width: 100%;
}

.hero {
  display: grid;
  gap: 16px;
  padding-top: 6px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topline h2,
.page-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.baby-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 48%;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  border: 1px solid var(--line);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  min-height: 206px;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #ffe4ee 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.summary::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -44px;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  background: rgba(223, 95, 143, 0.18);
}

.summary-kicker,
.muted {
  color: var(--muted);
}

.summary-kicker {
  margin: 0 0 8px;
  font-size: 13px;
}

.summary-main {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.metric {
  min-width: 94px;
}

.metric strong {
  display: block;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.record-fab {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff9ab9);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(223, 95, 143, 0.28);
}

.toolbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.page-title {
  text-align: center;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--accent-strong);
  font-size: 24px;
  line-height: 1;
}

.soft-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  line-height: 1.6;
  font-size: 13px;
}

.chart-wrap {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.chart-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 900;
}

.chart-scroll {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.chart-scroll.scrollable {
  overflow-x: auto;
}

.chart-canvas {
  display: block;
  height: 270px;
}

.record-list,
.baby-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.record-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 13px;
  box-shadow: none;
}

.record-values {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.record-values strong {
  font-size: 18px;
}

.text-btn {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0 4px;
}

.record-actions {
  display: grid;
  align-content: start;
  gap: 4px;
}

.small {
  font-size: 12px;
}

.load-more {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.menu-list {
  overflow: hidden;
}

.menu-item {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  text-align: left;
}

.menu-item:last-child {
  border-bottom: 0;
}

.danger-text {
  color: var(--danger);
}

.baby-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  box-shadow: none;
}

.baby-card.selected {
  border-color: var(--accent);
  background: #fff8fb;
}

.baby-pick {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.baby-pick strong,
.baby-name {
  font-size: 18px;
  font-weight: 900;
}

.baby-pick span {
  color: var(--muted);
  font-size: 13px;
}

.about {
  line-height: 1.75;
  color: var(--muted);
}

.about h3 {
  margin: 10px 0 4px;
  color: var(--ink);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 760px);
  min-height: calc(64px + env(safe-area-inset-bottom));
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  transform: translateX(-50%);
}

.tab {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.tab.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tab-icon {
  font-size: 22px;
  line-height: 1;
}

.empty {
  padding: 30px 16px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 30;
  max-width: min(88vw, 420px);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(53, 33, 42, 0.92);
  color: #fff;
  transform: translateX(-50%);
  box-shadow: var(--shadow);
}

@media (min-width: 720px) {
  .page {
    padding: 30px 24px 36px;
  }

  .auth-page {
    grid-template-columns: 0.9fr 1fr;
    gap: 32px;
    align-items: center;
  }

  .brand h1 {
    font-size: 42px;
  }

  .summary {
    min-height: 230px;
    padding: 28px;
  }
}
