/* ===== 基础设置 - 大字体、高对比 ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --bg: #faf6f1;
  --bg-accent: #fff0e8;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --text: #2c2419;
  --text-secondary: #7a6f63;
  --feeding: #e85d4a;
  --feeding-light: #fff0ec;
  --feeding-dark: #c0392b;
  --feeding-soft: rgba(232, 93, 74, 0.12);
  --poop: #b8860b;
  --poop-light: #fff8e8;
  --poop-text: #8b6914;
  --safe: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --shadow: 0 8px 32px rgba(44, 36, 25, 0.08);
  --shadow-soft: 0 2px 12px rgba(44, 36, 25, 0.05);
  --item-bg: #ffffff;
  --item-border: rgba(232, 93, 74, 0.1);
  --item-shadow: 0 1px 3px rgba(44, 36, 25, 0.04), 0 6px 16px rgba(44, 36, 25, 0.04);
  --border: rgba(44, 36, 25, 0.08);
  --border-active: rgba(44, 36, 25, 0.12);
  --separator: rgba(44, 36, 25, 0.16);
  --muted: #a89f94;
  --actions-bg: rgba(44, 36, 25, 0.04);
  --input-bg: #faf8f5;
  --input-border: rgba(44, 36, 25, 0.1);
  --btn-cancel-bg: #f3eee8;
  --btn-disabled: #ccc4bb;
  --today-active: #ffd4cc;
  --delete-color: #a89f94;
  --delete-active-bg: #fdecea;
  --hero-end: #f0806a;
  --hero-warning-end: #f5b041;
  --hero-danger-end: #ec7063;
  --hero-safe-end: #58d68d;
  --glass: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.28);
  --btn-ad-bg: #f3eefb;
  --btn-ad-text: #5e35b1;
  --btn-ad-border: #b39ddb;
  --btn-vaccine-bg: #edf7ee;
  --btn-vaccine-text: #2e7d32;
  --btn-vaccine-border: #81c784;
  --btn-diaper-bg: #e8f5f3;
  --btn-diaper-text: #00695c;
  --btn-diaper-border: #4db6ac;
  --btn-bath-bg: #eaf4fd;
  --btn-bath-text: #1565c0;
  --btn-bath-border: #64b5f6;
  --btn-height-bg: #fceef3;
  --btn-height-text: #ad1457;
  --btn-height-border: #f48fb1;
  --btn-weight-bg: #fff8e6;
  --btn-weight-text: #ef6c00;
  --btn-weight-border: #ffb74d;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --font-base: 18px;
  --font-lg: 22px;
  --font-xl: 28px;
  --font-hero: clamp(52px, 6.5vw, 68px);
  --gap: 16px;
}

[data-theme="night"] {
  color-scheme: dark;
  --bg: #141210;
  --bg-accent: #1c1916;
  --surface: #1f1c19;
  --surface-elevated: #282420;
  --text: #f2ebe4;
  --text-secondary: #a89f94;
  --feeding: #e87868;
  --feeding-light: #3a2520;
  --feeding-dark: #ff9a8a;
  --feeding-soft: rgba(232, 120, 104, 0.15);
  --poop: #c9a030;
  --poop-light: #2a2418;
  --poop-text: #d4b060;
  --safe: #3ddc84;
  --warning: #f5b041;
  --danger: #ef6b5c;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --item-bg: #282420;
  --item-border: rgba(232, 120, 104, 0.12);
  --item-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  --border: #3a3530;
  --border-active: #454038;
  --separator: #5a524a;
  --muted: #7a7268;
  --actions-bg: #302b26;
  --input-bg: #2a2622;
  --input-border: #454038;
  --btn-cancel-bg: #35302b;
  --btn-disabled: #4a4540;
  --today-active: #4a3028;
  --delete-color: #8a8278;
  --delete-active-bg: #3a2824;
  --hero-end: #b85545;
  --hero-warning-end: #c9922e;
  --hero-danger-end: #c95548;
  --hero-safe-end: #35b86a;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.16);
  --btn-ad-bg: #2a2438;
  --btn-ad-text: #b39ddb;
  --btn-ad-border: #7e57c2;
  --btn-vaccine-bg: #1b2e1f;
  --btn-vaccine-text: #81c784;
  --btn-vaccine-border: #66bb6a;
  --btn-diaper-bg: #1a2e2c;
  --btn-diaper-text: #4db6ac;
  --btn-diaper-border: #26a69a;
  --btn-bath-bg: #1a2838;
  --btn-bath-text: #64b5f6;
  --btn-bath-border: #42a5f5;
  --btn-height-bg: #301824;
  --btn-height-text: #f48fb1;
  --btn-height-border: #ec407a;
  --btn-weight-bg: #2a2418;
  --btn-weight-text: #ffca28;
  --btn-weight-border: #ffb300;
}

html {
  font-size: var(--font-base);
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(232, 93, 74, 0.09), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(243, 156, 18, 0.07), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

/* ===== 左右布局 ===== */
.app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  width: 100%;
  height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--gap) 28px;
}

.panel {
  min-height: 0;
  min-width: 0;
}

.panel--left {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 10px;
}

.panel--right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: background-color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.profile-card {
  flex-shrink: 0;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

/* ===== 页头 ===== */
.header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.header__avatar {
  flex-shrink: 0;
  padding: 3px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(232, 93, 74, 0.35), rgba(243, 156, 18, 0.25));
}

.header__logo {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow-soft);
}

.header__info {
  min-width: 0;
}

.header__title {
  font-size: var(--font-xl);
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.header__title::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--feeding), #f5b041);
}

.header__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.baby-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.baby-info__item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px;
  text-align: center;
}

.baby-info__item + .baby-info__item {
  border-left: 1px solid var(--border);
}

.baby-info__item:first-child {
  padding-left: 0;
}

.baby-info__item:last-child {
  padding-right: 0;
}

.baby-info__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.baby-info__value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-all;
}

/* ===== 计时区 + 上次记录 ===== */
.timer-dashboard {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hero {
  min-height: 0;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(145deg, var(--feeding) 0%, var(--hero-end) 55%, #f0956a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 18px 18px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(232, 93, 74, 0.28), inset 0 1px 0 var(--glass-border);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
  isolation: isolate;
}

.hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.22), transparent 42%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.1), transparent 38%);
}

.hero--warning {
  background: linear-gradient(135deg, var(--warning) 0%, var(--hero-warning-end) 100%);
}

.hero--danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--hero-danger-end) 100%);
}

.hero--safe {
  background: linear-gradient(135deg, var(--safe) 0%, var(--hero-safe-end) 100%);
}

.hero--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100vw;
  min-height: 100vh;
  border-radius: 0;
  padding: clamp(28px, 5vh, 48px) clamp(28px, 5vw, 48px);
  gap: clamp(20px, 4vh, 40px);
  box-shadow: none;
  transition: background 0.4s ease;
  overflow: auto;
  justify-content: center;
  align-items: center;
  text-align: center;
  --hero-fs-date: clamp(26px, 3.8vh, 40px);
  --hero-fs-clock: clamp(42px, 6vh, 68px);
  --hero-fs-label: clamp(20px, 2.8vh, 32px);
  --hero-fs-timer: clamp(80px, 16vh, 150px);
  --hero-fs-last: clamp(22px, 3.2vh, 38px);
  --hero-fs-next: clamp(24px, 3.5vh, 42px);
  --hero-fs-hint: clamp(20px, 2.8vh, 32px);
}

body.hero-fullscreen-active {
  overflow: hidden;
}

.hero--fullscreen .hero__glow {
  display: none;
}

.hero--fullscreen .hero__top {
  margin-bottom: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.hero--fullscreen .hero__center {
  padding: 0;
  flex: 0 0 auto;
  width: 100%;
}

.hero--fullscreen .hero__bottom {
  gap: clamp(12px, 2vh, 20px);
  padding-top: 0;
  width: 100%;
  max-width: 960px;
  align-items: center;
  text-align: center;
}

.hero--fullscreen .hero__now {
  padding: 0;
  border: none;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  gap: clamp(8px, 1.5vh, 16px);
}

.hero--fullscreen .hero__date {
  font-size: var(--hero-fs-date);
  font-weight: 600;
  opacity: 0.92;
  letter-spacing: 0.02em;
}

.hero--fullscreen .hero__clock {
  font-size: var(--hero-fs-clock);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: none;
}

.hero--fullscreen .hero__label {
  font-size: var(--hero-fs-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: clamp(6px, 1.2vh, 12px);
  opacity: 0.95;
}

.hero--fullscreen .hero__timer {
  font-size: var(--hero-fs-timer);
  font-weight: 800;
  text-shadow: none;
  line-height: 1;
}

.hero--fullscreen .hero__meta {
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(10px, 2vh, 20px);
}

.hero--fullscreen .hero__last {
  font-size: var(--hero-fs-last);
  font-weight: 600;
  opacity: 1;
  line-height: 1.35;
  text-align: center;
  width: 100%;
}

.hero--fullscreen .hero__next {
  font-size: var(--hero-fs-next);
  font-weight: 700;
  margin-top: 0;
  line-height: 1.35;
  text-align: center;
  width: 100%;
}

.hero--fullscreen .hero__hint {
  font-size: var(--hero-fs-hint);
  font-weight: 600;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  line-height: 1.4;
  opacity: 0.95;
  text-align: center;
  width: 100%;
}

.hero__top {
  flex-shrink: 0;
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}

.hero__center {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2px 0;
  position: relative;
  z-index: 1;
}

.hero__bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  position: relative;
  z-index: 1;
}

.hero__now {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero__date {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hero__clock {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hero__label {
  font-size: 14px;
  opacity: 0.92;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  white-space: nowrap;
  text-transform: uppercase;
}

.hero__timer {
  font-size: var(--font-hero);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}

.hero__meta {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero__last {
  font-size: 14px;
  opacity: 0.92;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hero__next {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #fff;
}

.timer-dashboard .hero__timer {
  font-size: clamp(32px, 3.8vw, 48px);
}

.timer-dashboard .hero__clock {
  font-size: 18px;
}

.timer-dashboard .hero__date {
  font-size: 12px;
}

.timer-dashboard .hero__last,
.timer-dashboard .hero__next {
  font-size: 12px;
}

.timer-dashboard .hero__hint {
  font-size: 11px;
  padding: 6px 12px;
}

.timer-dashboard .hero {
  padding: 16px 12px 14px;
  gap: 6px;
}

/* 全屏时覆盖半宽计时区的字号限制 */
.timer-dashboard .hero.hero--fullscreen .hero__timer {
  font-size: var(--hero-fs-timer);
}

.timer-dashboard .hero.hero--fullscreen .hero__clock {
  font-size: var(--hero-fs-clock);
}

.timer-dashboard .hero.hero--fullscreen .hero__date {
  font-size: var(--hero-fs-date);
}

.timer-dashboard .hero.hero--fullscreen .hero__last {
  font-size: var(--hero-fs-last);
}

.timer-dashboard .hero.hero--fullscreen .hero__next {
  font-size: var(--hero-fs-next);
}

.timer-dashboard .hero.hero--fullscreen .hero__hint {
  font-size: var(--hero-fs-hint);
  padding: 0;
  background: none;
  border: none;
}

.last-records {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 12px 12px 10px;
  overflow: hidden;
}

.last-records__title {
  flex-shrink: 0;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.last-records__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.last-records__item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(44, 36, 32, 0.04);
}

[data-theme="night"] .last-records__item {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.last-records__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 15px;
  line-height: 1;
  background: rgba(232, 93, 74, 0.1);
  flex-shrink: 0;
}

[data-theme="night"] .last-records__icon {
  background: rgba(255, 255, 255, 0.08);
}

.last-records__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.last-records__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.last-records__title-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.last-records__label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.last-records__time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap;
}

.last-records__ago {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
}

.last-records__detail {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.last-records__detail--empty {
  font-style: italic;
  color: var(--muted);
  opacity: 0.85;
}

.hero__hint {
  font-size: 13px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.4;
  max-width: 100%;
}

/* ===== 记录按钮 ===== */
.actions-bar {
  flex-shrink: 0;
  padding: 10px 12px 12px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.actions-bar__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  padding-left: 2px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--item-shadow);
}

.btn:active {
  transform: scale(0.97);
}

.btn__icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.btn__text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.btn--feeding {
  background: var(--feeding-light);
  color: var(--feeding-dark);
  border-color: rgba(232, 93, 74, 0.25);
}

.btn--poop {
  background: var(--poop-light);
  color: var(--poop-text);
  border-color: rgba(184, 134, 11, 0.28);
}

.btn--ad {
  background: var(--btn-ad-bg);
  color: var(--btn-ad-text);
  border-color: rgba(126, 87, 194, 0.28);
}

.btn--vaccine {
  background: var(--btn-vaccine-bg);
  color: var(--btn-vaccine-text);
  border-color: rgba(102, 187, 106, 0.35);
}

.btn--diaper {
  background: var(--btn-diaper-bg);
  color: var(--btn-diaper-text);
  border-color: rgba(38, 166, 154, 0.3);
}

.btn--bath {
  background: var(--btn-bath-bg);
  color: var(--btn-bath-text);
  border-color: rgba(66, 165, 245, 0.32);
}

.btn--height {
  background: var(--btn-height-bg);
  color: var(--btn-height-text);
  border-color: rgba(236, 64, 122, 0.28);
}

.btn--weight {
  background: var(--btn-weight-bg);
  color: var(--btn-weight-text);
  border-color: rgba(255, 179, 0, 0.35);
}

/* ===== 区块标题 ===== */
.section-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-head--history {
  margin-bottom: 2px;
}

.section-head__title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* ===== 日期切换 ===== */
.date-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-accent);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.date-nav__btn {
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 10px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.date-nav__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.date-nav__btn:not(:disabled):active {
  background: var(--border-active);
}

.date-nav__current {
  text-align: center;
  padding: 4px 8px;
}

.date-nav__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--feeding);
}

.date-nav__text {
  display: block;
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
  color: var(--text);
}

.date-nav__today {
  flex-shrink: 0;
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid rgba(232, 93, 74, 0.25);
  border-radius: 10px;
  background: var(--feeding-light);
  color: var(--feeding-dark);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.date-nav__today-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.date-nav__today-text {
  white-space: nowrap;
}

.date-nav__today[hidden] {
  display: none;
}

.date-nav__today:active {
  background: var(--today-active);
}

.report-mail-btn[hidden] {
  display: none;
}

.report-mail-btn {
  flex-shrink: 0;
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 0;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.report-mail-btn:active:not(:disabled) {
  background: var(--border-active);
  transform: scale(0.99);
}

.report-mail-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.report-mail-btn__icon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.report-mail-btn__text {
  white-space: nowrap;
}

/* ===== 当日概览 ===== */
.summary {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.summary__item {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.summary__item:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 93, 74, 0.18);
}

.summary__num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--feeding);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.summary__meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  line-height: 1.3;
}

/* ===== 记录列表 ===== */
.history {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.history__title {
  margin-bottom: 0;
}

.history__scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin: 0 -4px;
  padding: 4px 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 93, 74, 0.25) transparent;
}

.history__scroll::-webkit-scrollbar {
  width: 6px;
}

.history__scroll::-webkit-scrollbar-thumb {
  background: rgba(232, 93, 74, 0.25);
  border-radius: 999px;
}

.history__list {
  list-style: none;
}

.history__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--item-bg);
  border-radius: var(--radius-sm);
  padding: 12px 10px 12px 12px;
  margin-bottom: 6px;
  box-shadow: var(--item-shadow);
  border: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.history__item:hover {
  border-color: rgba(232, 93, 74, 0.16);
  transform: translateX(2px);
}

.history__icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--feeding-soft);
  border-radius: 10px;
  line-height: 1;
}

.history__info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
}

.history__info > span + span::before {
  content: '·';
  margin: 0 8px;
  color: var(--separator);
  font-weight: 700;
}

.history__type {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text);
}

.history__time {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--feeding);
  font-variant-numeric: tabular-nums;
}

.history__detail {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.history__time-ago {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history__actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  padding: 3px;
  background: var(--actions-bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: background-color 0.2s ease;
}

.history__btn {
  width: 34px;
  height: 34px;
  padding: 0;
  font-family: inherit;
  border-radius: 9px;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.history__btn-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.history__btn--edit {
  color: var(--feeding);
}

.history__btn--edit:active {
  background: var(--feeding-light);
}

.history__btn--delete {
  color: var(--delete-color);
}

.history__btn--delete:active {
  background: var(--delete-active-bg);
  color: var(--danger);
}

.history__empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-base);
  padding: 32px 16px;
}

/* ===== 弹窗 ===== */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 36, 25, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal__content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 64px rgba(44, 36, 25, 0.2);
  border: 1px solid var(--border);
  transition: background-color 0.4s ease;
}

.modal__content--small {
  max-width: 420px;
}

.modal__title {
  font-size: var(--font-xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

.modal__time {
  font-size: var(--font-lg);
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.modal__label {
  font-size: var(--font-lg);
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.modal__confirm-text {
  font-size: var(--font-lg);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.amount-btn {
  min-height: 72px;
  font-size: var(--font-xl);
  font-weight: 700;
  font-family: inherit;
  border: 3px solid var(--input-border);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.amount-btn:active,
.amount-btn.selected {
  border-color: var(--feeding);
  background: var(--feeding-light);
  color: var(--feeding-dark);
}

.amount-btn--custom {
  font-size: var(--font-lg);
}

.custom-amount {
  margin-bottom: 20px;
  text-align: center;
}

.custom-amount label {
  display: block;
  font-size: var(--font-base);
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.custom-amount input {
  width: 100%;
  max-width: 200px;
  font-size: var(--font-xl);
  font-family: inherit;
  padding: 16px;
  border: 3px solid var(--input-border);
  border-radius: 12px;
  text-align: center;
  background: var(--input-bg);
  color: var(--text);
}

.custom-amount input:focus {
  outline: none;
  border-color: var(--feeding);
}

.record-remark {
  margin-bottom: 20px;
}

.record-remark label {
  display: block;
  font-size: var(--font-base);
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.record-remark__input {
  width: 100%;
  font-size: var(--font-base);
  font-family: inherit;
  padding: 14px 16px;
  border: 3px solid var(--input-border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.record-remark__input:focus {
  outline: none;
  border-color: var(--feeding);
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal__btn {
  min-height: 64px;
  font-size: var(--font-lg);
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 14px;
  cursor: pointer;
}

.modal__btn--cancel {
  background: var(--btn-cancel-bg);
  color: var(--text-secondary);
}

.modal__btn--confirm {
  background: var(--feeding);
  color: #fff;
}

.modal__btn--confirm:disabled {
  background: var(--btn-disabled);
  cursor: not-allowed;
}

.modal__btn--poop {
  background: var(--poop);
}

.modal__btn--danger {
  background: var(--danger);
  color: #fff;
}

.time-edit__label {
  display: block;
  font-size: var(--font-lg);
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.time-edit__picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.time-edit__select {
  flex: 1;
  max-width: 160px;
  font-size: 40px;
  font-family: inherit;
  font-weight: 700;
  text-align: center;
  padding: 14px 8px;
  border: 3px solid var(--input-border);
  border-radius: 14px;
  color: var(--text);
  background: var(--input-bg);
  appearance: none;
  -webkit-appearance: none;
}

.time-edit__select:focus {
  outline: none;
  border-color: var(--feeding);
}

.time-edit__sep {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
}

/* ===== 提示 ===== */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 36, 25, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 999px;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.3s ease;
}

.toast[hidden] {
  display: none;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ===== 主题切换 ===== */
.theme-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle__icon {
  width: 24px;
  height: 24px;
  display: block;
}

.theme-toggle__icon--sun {
  display: none;
}

[data-theme="night"] .theme-toggle__icon--sun {
  display: block;
}

[data-theme="night"] .theme-toggle__icon--moon {
  display: none;
}

/* ===== 窄屏回退为上下布局 ===== */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    padding: 16px;
  }

  .panel--right {
    min-height: 360px;
  }

  .timer-dashboard {
    grid-template-columns: 1fr;
    min-height: 240px;
  }

  .hero {
    min-height: 200px;
    height: auto;
  }

  .last-records {
    min-height: 220px;
  }

  .actions {
    margin-bottom: 0;
    gap: 4px;
  }

  .actions-bar {
    padding: 10px;
  }

  .btn {
    min-height: 48px;
  }

  .profile-card {
    padding: 14px;
  }

  .baby-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 0;
  }

  .baby-info__item {
    padding: 6px 8px;
  }

  .baby-info__item + .baby-info__item {
    border-left: none;
  }

  .baby-info__item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }
}

@media (max-width: 400px) {
  :root {
    --font-base: 20px;
    --font-lg: 24px;
    --font-xl: 30px;
  }

  .summary__num {
    font-size: 30px;
  }

  .actions {
    gap: 3px;
  }

  .btn {
    min-height: 44px;
    padding: 3px 1px;
  }

  .btn__icon {
    font-size: 16px;
  }

  .btn__text {
    font-size: 10px;
  }

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