:root {
  --ink: #302d39;
  --muted: #8f8993;
  --paper: #fffaf2;
  --card: #ffffff;
  --coral: #f48b6d;
  --coral-dark: #e87355;
  --peach: #ffe5d8;
  --lavender: #ece8ff;
  --line: #eee8e2;
  --shadow: 0 18px 50px rgba(65, 52, 52, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 88% 4%, #fff0dd 0 10%, transparent 28%), var(--paper); font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
.app-shell { max-width: 540px; min-height: 100vh; margin: 0 auto; padding: 26px 22px 30px; overflow: hidden; }
.topbar, .greeting-section, .summary-topline, .summary-foot, .section-heading, .sheet-header, .field-label { display: flex; align-items: center; justify-content: space-between; }
.topbar { margin-bottom: 38px; }
.brand-lockup { display: flex; gap: 11px; align-items: center; }
.brand-mark { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--coral); box-shadow: 0 8px 17px rgba(244,139,109,.26); font-size: 18px; }
.eyebrow, .section-kicker { margin: 0; color: #c1a89e; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.brand-lockup h1 { margin: 2px 0 0; font-size: 17px; letter-spacing: .08em; }
.icon-button { width: 37px; height: 37px; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.64); font-size: 16px; transition: .2s ease; }
.icon-button:hover { background: #fff; transform: translateY(-1px); }
.greeting-section { align-items: flex-start; margin-bottom: 25px; }
.date-label { margin: 0 0 9px; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.greeting-section h2 { margin: 0; font-size: 24px; line-height: 1.35; letter-spacing: -.04em; }
.greeting-section h2 span { display: inline-block; margin-left: 3px; color: #a89ee6; font-size: 22px; transform: rotate(-12deg); }
.baby-orbit { position: relative; width: 68px; height: 63px; margin-top: 3px; border-radius: 50%; background: var(--lavender); transform: rotate(-12deg); }
.baby-face { position: absolute; left: 20px; top: 12px; width: 34px; height: 34px; display: grid; place-items: center; color: #665a7d; border: 2px solid #8f83bd; border-radius: 50%; font-size: 21px; transform: rotate(12deg); }
.orbit-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }.orbit-dot-one { left: 6px; top: 7px; }.orbit-dot-two { right: 7px; bottom: 7px; width: 5px; height: 5px; background: #bcaef5; }
.summary-card { padding: 20px 21px 18px; border: 1px solid rgba(255,255,255,.75); border-radius: 24px; background: linear-gradient(135deg, #fff 0%, #fff8f1 100%); box-shadow: var(--shadow); }
.summary-caption { color: var(--muted); font-size: 12px; }.summary-number { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; }.summary-number strong { font-size: 36px; line-height: 1; letter-spacing: -.04em; }.summary-number span { color: var(--coral-dark); font-size: 14px; font-weight: 700; }.summary-count { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--coral-dark); }.summary-count span { font-size: 25px; font-weight: 800; }.summary-count small { color: var(--muted); font-size: 11px; }.progress-track { height: 8px; margin-top: 20px; overflow: hidden; border-radius: 99px; background: #f4ebe4; }.progress-fill { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f6af8e, var(--coral)); transition: width .35s ease; }.summary-foot { margin-top: 9px; color: var(--muted); font-size: 10px; }
.record-cta { width: 100%; display: flex; align-items: center; gap: 12px; margin: 18px 0 35px; padding: 14px 17px; color: #fff; border-radius: 18px; background: var(--coral); box-shadow: 0 12px 25px rgba(244,139,109,.26); font-size: 14px; font-weight: 700; text-align: left; transition: transform .2s ease, background .2s ease; }.record-cta:hover { background: var(--coral-dark); transform: translateY(-2px); }.plus-circle { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; font-size: 23px; font-weight: 300; line-height: 1; }.cta-arrow { margin-left: auto; font-size: 21px; font-weight: 400; }
.section-heading { align-items: flex-end; margin-bottom: 14px; }.section-heading h3 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.03em; }.text-button { padding: 0 0 3px; color: var(--coral-dark); background: transparent; font-size: 12px; }.record-list { display: flex; flex-direction: column; gap: 9px; }.empty-state { padding: 35px 10px 34px; color: var(--muted); text-align: center; border: 1px dashed #eadfd8; border-radius: 18px; }.empty-icon { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto 11px; color: var(--coral); border-radius: 50%; background: var(--peach); font-size: 21px; }.empty-state p { margin: 0 0 5px; color: var(--ink); font-size: 14px; font-weight: 600; }.empty-state small { font-size: 11px; }
.record-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.75); animation: rise .35s ease both; }.record-icon { width: 37px; height: 37px; display: grid; place-items: center; color: var(--coral-dark); border-radius: 13px; background: var(--peach); font-size: 17px; }.record-main strong { display: block; font-size: 15px; }.record-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }.record-amount { color: var(--coral-dark); font-size: 17px; font-weight: 800; }.record-amount small { color: var(--muted); font-size: 10px; font-weight: 500; }.bottom-note { margin-top: 38px; color: #b7aaa3; font-size: 10px; text-align: center; letter-spacing: .04em; }.bottom-note span { color: var(--coral); margin-right: 4px; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0; background: rgba(48,45,57,.3); backdrop-filter: blur(4px); }.modal-backdrop[hidden] { display: none; }.record-sheet { width: min(540px, 100%); max-height: 94vh; padding: 12px 22px 27px; overflow-y: auto; border-radius: 27px 27px 0 0; background: #fffdfb; box-shadow: 0 -20px 50px rgba(48,45,57,.14); animation: sheet-up .3s ease; }.sheet-handle { width: 40px; height: 4px; margin: 0 auto 21px; border-radius: 99px; background: #e4dcd6; }.sheet-header { align-items: flex-start; margin-bottom: 26px; }.sheet-header h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.04em; }.close-button { width: 32px; height: 32px; color: var(--muted); border-radius: 50%; background: #f8f3ee; font-size: 23px; line-height: 1; }.field-group { margin-bottom: 23px; }.field-label { align-items: baseline; margin-bottom: 10px; }.field-label span { font-size: 14px; font-weight: 700; }.field-label small { color: var(--muted); font-size: 10px; }.time-input-wrap { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }.time-input-wrap span { color: var(--coral); font-size: 17px; }.time-input-wrap input { width: 100%; color: var(--ink); outline: none; border: 0; background: transparent; font-size: 15px; font-weight: 600; }.choice-grid { display: grid; gap: 8px; }.two-col { grid-template-columns: repeat(2, 1fr); }.three-col { grid-template-columns: repeat(3, 1fr); }.choice-button, .milk-button { min-height: 47px; color: #736b73; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-size: 12px; transition: .18s ease; }.choice-button { display: flex; align-items: center; justify-content: center; gap: 7px; }.choice-button span { color: #bdafb0; font-size: 16px; }.choice-button:hover, .milk-button:hover { border-color: #f5bdab; background: #fff9f6; }.choice-button.selected, .milk-button.selected { color: var(--coral-dark); border-color: #f7a185; background: #fff0e9; box-shadow: inset 0 0 0 1px rgba(244,139,109,.09); }.choice-button.selected span { color: var(--coral); }.milk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.milk-button { font-size: 14px; font-weight: 700; }.save-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 3px; padding: 15px; color: #fff; border-radius: 15px; background: var(--coral); box-shadow: 0 9px 19px rgba(244,139,109,.23); font-size: 14px; font-weight: 700; }.save-button span { font-size: 20px; line-height: 12px; }
@keyframes sheet-up { from { transform: translateY(35px); opacity: .5; } to { transform: translateY(0); opacity: 1; } } @keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 600px) { .app-shell { padding-top: 38px; }.modal-backdrop { align-items: center; padding: 20px; }.record-sheet { border-radius: 27px; max-height: 90vh; } }

/* Inline quick entry */
.quick-entry { margin: 18px 0 35px; padding: 20px 17px 17px; border: 1px solid #f0e5dc; border-radius: 22px; background: rgba(255,255,255,.78); box-shadow: 0 12px 30px rgba(65,52,52,.055); }
.quick-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.quick-heading h3 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.03em; }
.live-time { display: flex; align-items: center; gap: 5px; padding: 6px 9px; color: var(--coral-dark); border-radius: 10px; background: var(--peach); font-size: 12px; }
.live-time span { font-size: 15px; }.live-time strong { font-size: 13px; letter-spacing: .04em; }
.quick-field { margin-bottom: 19px; }.quick-field .field-label { margin-bottom: 9px; }
.milk-field { margin-bottom: 21px; }
.quick-entry .record-cta { margin: 0; }

/* 页面直接从内容开始，保留更多可视空间 */
.app-shell { padding-top: 18px; }
@media (min-width: 600px) { .app-shell { padding-top: 26px; } }

/* Storage mode and identifier */
.storage-panel { margin-bottom: 19px; padding: 16px 17px 14px; border: 1px solid #f0e5dc; border-radius: 19px; background: rgba(255,255,255,.78); }
.storage-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.storage-heading h3 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.03em; }
.storage-status { padding: 5px 8px; color: var(--muted); border-radius: 8px; background: #f7f1ed; font-size: 10px; }
.storage-status.ready { color: #5b9779; background: #e8f5ed; }.storage-status.error { color: #c95e4b; background: #fff0eb; }
.storage-modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.storage-mode { min-height: 38px; color: #81777b; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 12px; }.storage-mode span { margin-right: 5px; color: #b5a9ab; }.storage-mode.selected { color: var(--coral-dark); border-color: #f7a185; background: #fff0e9; }.storage-mode.selected span { color: var(--coral); }
.code-row { display: flex; gap: 8px; }.code-input-wrap { display: flex; flex: 1; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }.code-input-wrap span { color: var(--coral); font-weight: 800; }.code-input-wrap input { width: 100%; min-width: 0; padding: 10px 0; color: var(--ink); outline: none; border: 0; background: transparent; font-size: 13px; }.enter-button { min-width: 58px; padding: 0 13px; color: #fff; border-radius: 11px; background: var(--coral); font-size: 12px; font-weight: 700; }.enter-button:disabled { opacity: .6; }
.storage-hint { margin: 8px 1px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }.record-cta:disabled, #clearButton:disabled { cursor: not-allowed; opacity: .5; }

/* 首次进入时选择保存方式 */
.storage-backdrop { position: fixed; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(48,45,57,.34); backdrop-filter: blur(5px); }
.storage-backdrop.hidden { display: none; }
.storage-backdrop .storage-panel { width: min(420px, 100%); margin: 0; padding: 22px 19px 18px; background: #fffdfb; box-shadow: 0 20px 60px rgba(48,45,57,.18); animation: sheet-up .25s ease; }

/* iPhone Safari 聚焦输入框时不会自动放大页面 */
.code-input-wrap input,
.time-input-wrap input { font-size: 16px; }
@media (max-width: 599px) {
  .code-input-wrap input,
  .time-input-wrap input { font-size: 16px; }
}
