@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
  --bg-main: #fff7df;
  --ink: #153057;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(31, 69, 120, 0.14);
  --accent-a: #ff7b54;
  --accent-b: #4c8dff;
  --accent-c: #2ac9a1;
  --accent-d: #f7b731;
  --shadow: 0 14px 38px rgba(24, 59, 100, 0.16);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 10% 0%, #fff4d2 0%, #ffe9d1 30%, #dff8ff 95%);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.bg-shape {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(0.2px);
  opacity: 0.48;
  pointer-events: none;
}

.bg-shape-a {
  width: 240px;
  height: 240px;
  right: -70px;
  top: -70px;
  background: linear-gradient(135deg, #ffd56f, #ff8f70);
}

.bg-shape-b {
  width: 280px;
  height: 280px;
  left: -90px;
  bottom: -120px;
  background: linear-gradient(135deg, #66d9ff, #6f9bff);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 14px 28px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 18px 18px 16px;
  background: linear-gradient(165deg, #fff7ec, #fffdf8 40%, #f0f8ff);
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-tag {
  margin: 0;
  font-size: 12px;
  color: #ff5f45;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.settings-trigger {
  border: 0;
  background: #edf3ff;
  color: #2f5f9f;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
}

h1 {
  margin: 6px 0 6px;
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
  font-size: 34px;
  line-height: 1;
}

.hero-line {
  margin: 0;
  font-size: 15px;
  color: #2f4d7a;
  font-weight: 500;
}

.hero-summary {
  margin-top: 8px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.suggestions {
  padding: 14px 14px 8px;
}

.hidden {
  display: none !important;
}

.suggestions-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.suggestion-item {
  border-radius: 16px;
  padding: 10px 12px;
  background: linear-gradient(145deg, #fff7f2, #fff2ed);
  border: 1px solid rgba(255, 123, 84, 0.34);
  font-weight: 600;
  font-size: 15px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.gauge-card {
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 8px;
  overflow: hidden;
}

.gauge-main {
  border-radius: 18px;
  border: 1px solid rgba(39, 82, 140, 0.12);
  background: linear-gradient(160deg, #fffefd, #f9fcff);
  padding: 8px 12px 6px;
}

.gauge-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gauge-title h3 {
  margin: 0;
  font-size: 18px;
}

.emoji {
  font-size: 22px;
}

.gauge-wrap {
  position: relative;
  width: 138px;
  margin: 6px auto 4px;
}

.gauge-svg {
  width: 138px;
  height: 138px;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: rgba(31, 69, 120, 0.14);
  stroke-width: 12;
}

.gauge-progress {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
  transition: stroke-dashoffset 0.6s ease;
}

.gauge-svg.satiety .gauge-progress {
  stroke: var(--accent-a);
}

.gauge-svg.cleanliness .gauge-progress {
  stroke: var(--accent-c);
}

.gauge-svg.energy .gauge-progress {
  stroke: var(--accent-b);
}

.gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: "Baloo 2", "Noto Sans SC", sans-serif;
}

.gauge-value span {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}

.gauge-value .unit {
  font-size: 18px;
  margin-top: 12px;
  color: #43638d;
}

.gauge-hint {
  margin: 0;
  text-align: center;
  color: #2f4d7a;
  font-size: 13px;
}

.quick-input {
  border-radius: 16px;
  border: 1px solid rgba(39, 82, 140, 0.14);
  background: #fafdff;
  padding: 9px;
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.quick-nav {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.quick-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 12px;
  background: #f2f7ff;
}

.icon-page-btn {
  border: 1px solid rgba(35, 78, 133, 0.2);
  background: #edf4ff;
  color: #2d5c99;
  border-radius: 12px;
  width: 40px;
  height: 34px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.quick-mode-text {
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #2d538b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-viewport {
  border-radius: 12px;
  border: 1px dashed rgba(39, 82, 140, 0.24);
  background: #fff;
  padding: 9px;
  overflow: hidden;
  min-height: 102px;
  touch-action: pan-y;
}

.quick-stack {
  display: grid;
  gap: 9px;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-pill {
  border: 1px solid rgba(35, 78, 133, 0.2);
  background: #f4f8ff;
  color: #1f4f8a;
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.quick-pill.active {
  background: linear-gradient(135deg, #7ac8ff, #5d96ff);
  color: #fff;
  border-color: transparent;
}

.quick-pill.warn {
  background: #fff2ef;
  border-color: rgba(223, 83, 57, 0.36);
  color: #a74230;
}

.quick-badge {
  font-size: 13px;
  color: #4b6d99;
  font-weight: 600;
  align-self: center;
}

.quick-count {
  font-size: 16px;
  font-weight: 700;
  color: #1f4f8a;
}

.quick-tip {
  margin: 0;
  font-size: 13px;
  color: #6280ab;
}

.quick-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-cta .mini-ghost,
.quick-cta .mini-primary {
  width: 100%;
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 10px;
  font-size: 15px;
  font-weight: 700;
}

.quick-cta .mini-ghost {
  justify-self: auto;
}

.mini-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #ff7b54, #ff5169);
  box-shadow: 0 6px 12px rgba(255, 87, 95, 0.24);
}

.quick-cta button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.quick-time-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
}

.quick-time-single {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.quick-time-item {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #55759f;
  font-weight: 600;
}

.quick-time-item input {
  width: 100%;
  border: 1px solid rgba(39, 82, 140, 0.2);
  border-radius: 10px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 14px;
  color: #1d3c67;
  background: #fff;
}

.tiny-time-btn {
  border: 1px solid rgba(39, 82, 140, 0.2);
  background: #edf4ff;
  color: #2b5a9a;
  border-radius: 10px;
  min-width: 52px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.logs-card {
  padding: 8px 12px 12px;
}

.section-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 0;
  cursor: pointer;
  color: inherit;
}

.section-toggle span {
  font-size: 14px;
  font-weight: 700;
  color: #486da3;
}

.logs-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.logs-panel.collapsed {
  max-height: 0;
  overflow: hidden;
}

.logs-panel.expanded {
  max-height: min(62vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.logs-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.log-item {
  border-radius: 15px;
  border: 1px solid rgba(46, 91, 150, 0.16);
  padding: 10px 10px 9px;
  background: #fff;
}

.log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.log-main {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 15px;
}

.log-time {
  color: #607ea8;
  font-size: 12px;
}

.log-sub {
  margin: 6px 0 0;
  color: #2f4d7a;
  font-size: 13px;
}

.log-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.log-actions button {
  border: 0;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.edit-btn {
  background: #e6f0ff;
  color: #215497;
}

.delete-btn {
  background: #ffebe8;
  color: #b53f2e;
}

.empty {
  margin: 10px 0 4px;
  color: #5977a3;
  font-size: 14px;
  text-align: center;
}

.logs-more {
  width: 100%;
  margin-top: 8px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.settings-form {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.settings-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
button {
  font-family: inherit;
}

.settings-form input,
.settings-form select,
.time-field input {
  width: 100%;
  border: 1px solid rgba(39, 82, 140, 0.23);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 16px;
  color: #1d3c67;
  background: #fff;
}

.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #ff7b54, #ff5169);
  box-shadow: 0 8px 18px rgba(255, 87, 95, 0.3);
}

.ghost-btn {
  background: #edf3ff;
  color: #2b5a9a;
}

.mini-ghost {
  justify-self: flex-start;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.sleep-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: #285289;
  background: #f6f9ff;
  border: 1px solid rgba(39, 82, 140, 0.17);
  border-radius: 12px;
  padding: 9px 10px;
}

.summary {
  margin: 12px 0 0;
  color: #2f4d7a;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 12px;
  background: rgba(7, 21, 44, 0.45);
  z-index: 10;
}

.modal-card {
  width: min(560px, 100%);
  border-radius: 24px;
  padding: 16px;
  background: #fffdf8;
  border: 1px solid rgba(35, 78, 133, 0.2);
  box-shadow: 0 16px 34px rgba(5, 25, 50, 0.3);
  animation: slide-up 0.25s ease;
}

@keyframes slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.icon-btn {
  border: 0;
  background: #edf3ff;
  color: #2e5e9d;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  font-size: 18px;
  cursor: pointer;
}

.modal-subtitle {
  margin: 8px 0 12px;
  font-size: 13px;
  color: #4b6a93;
}

.entry-form {
  display: grid;
  gap: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 7px;
}

.segmented button {
  border: 1px solid rgba(40, 88, 150, 0.2);
  background: #f3f7ff;
  color: #25538f;
  border-radius: 12px;
  padding: 10px;
  font-size: 15px;
  font-weight: 700;
}

.segmented button.active {
  background: linear-gradient(135deg, #66bbff, #4f89ff);
  color: #fff;
  border-color: transparent;
}

.option-list {
  display: grid;
  gap: 8px;
}

.option-btn {
  width: 100%;
  border: 1px solid rgba(34, 78, 132, 0.18);
  background: #fff;
  border-radius: 14px;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.option-label {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.option-desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: #4a6891;
}

.option-btn.active {
  border-color: #ff7b54;
  background: #fff5f2;
  box-shadow: inset 0 0 0 1px rgba(255, 123, 84, 0.4);
}

.diaper-group {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(39, 82, 140, 0.17);
  border-radius: 14px;
  padding: 10px;
  background: #fbfdff;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
}

.checkbox-item input {
  width: 20px;
  height: 20px;
}

.mini-tip {
  margin: 0;
  color: #5978a3;
  font-size: 12px;
}

.settings-tip {
  margin-top: -2px;
}

.time-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.time-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tiny-clear {
  border: 0;
  background: transparent;
  color: #5f7ea8;
  font-size: 12px;
  padding: 0;
  line-height: 1;
}

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

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: #c9d7ee;
  border-radius: 999px;
  transition: 0.2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 4px rgba(22, 44, 79, 0.25);
}

.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, #6bb8ff, #4f89ff);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
}

@media (min-width: 520px) {
  .app-shell {
    max-width: 620px;
    padding-left: 16px;
    padding-right: 16px;
  }
}
