:root {
  --bg: #f8efe7;
  --bg-soft: rgba(255, 249, 243, 0.78);
  --panel: rgba(255, 252, 248, 0.84);
  --panel-strong: rgba(255, 247, 240, 0.96);
  --line: rgba(107, 78, 58, 0.12);
  --text: #33231b;
  --muted: #7d6756;
  --accent: #dd765d;
  --accent-deep: #b9543e;
  --teal: #4e8d90;
  --teal-soft: rgba(78, 141, 144, 0.12);
  --warm-soft: rgba(223, 120, 95, 0.12);
  --shadow: 0 22px 60px rgba(86, 58, 40, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(243, 193, 157, 0.3), transparent 28%),
    radial-gradient(circle at top right, rgba(96, 172, 176, 0.2), transparent 24%),
    linear-gradient(180deg, #fff7f1 0%, var(--bg) 54%, #f3e8dc 100%);
  font-family: "Segoe UI Variable Text", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

body {
  position: relative;
}

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

.page-glow {
  position: fixed;
  z-index: 0;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(32px);
  opacity: 0.66;
  pointer-events: none;
}

.page-glow-left {
  top: -90px;
  left: -120px;
  background: rgba(241, 161, 126, 0.26);
}

.page-glow-right {
  right: -120px;
  bottom: 10%;
  background: rgba(107, 176, 180, 0.24);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 28px));
  margin: 18px auto 40px;
}

.panel,
.hero,
.welcome-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.welcome-shell {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.welcome-card {
  width: min(1080px, 100%);
  padding: 28px;
  border-radius: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 24px;
}

.welcome-copy,
.hero-copy {
  align-self: center;
}

.eyebrow,
.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  letter-spacing: 0.01em;
}

.welcome-card h1,
.hero h1 {
  margin-top: 10px;
  font-size: clamp(38px, 5vw, 64px);
}

.welcome-description,
.hero-description,
.helper-text {
  color: var(--muted);
  line-height: 1.72;
}

.welcome-description,
.hero-description {
  margin: 12px 0 0;
  max-width: 56ch;
}

.welcome-points {
  margin: 22px 0 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.8;
}

.panel {
  padding: 22px;
  border-radius: var(--radius-xl);
}

.form-panel {
  align-self: stretch;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 30px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.86fr);
  gap: 20px;
  padding: 28px;
  border-radius: 34px;
}

.hero-pills,
.hero-actions,
.form-actions,
.preset-bar,
.chip-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-pills {
  margin-top: 18px;
}

.hero-actions {
  margin-top: 18px;
}

.helper-banner {
  margin: -2px 0 6px;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--teal);
  background: rgba(78, 141, 144, 0.09);
  box-shadow: inset 0 0 0 1px rgba(78, 141, 144, 0.12);
  line-height: 1.6;
}

.simple-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

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

.simple-log-panel {
  display: grid;
  gap: 14px;
}

.simple-entry-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: center;
}

.simple-record-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.simple-record-item {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(223, 120, 95, 0.24);
}

.simple-edit-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  padding-top: 6px;
}

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

.simple-record-top,
.simple-record-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.simple-record-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.baby-badge-a,
.baby-badge-b,
.poo-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.baby-badge-a {
  background: #e6f7ff;
  color: #1890ff;
}

.baby-badge-b {
  background: #fff0f6;
  color: #eb2f96;
}

.poo-badge {
  background: #fef7e0;
  color: #faad14;
}

.simple-record-value {
  font-size: 16px;
  font-weight: 800;
}

.simple-quick-button {
  min-height: 92px;
  padding: 16px 14px;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 241, 234, 0.96)),
    #fff;
  box-shadow:
    inset 0 0 0 1px rgba(107, 78, 58, 0.08),
    0 10px 24px rgba(86, 58, 40, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.simple-quick-button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(107, 78, 58, 0.08),
    0 14px 30px rgba(86, 58, 40, 0.12);
}

.simple-quick-title {
  display: block;
  font-size: 22px;
  font-weight: 800;
}

.simple-quick-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.data-pill,
.metric-pill,
.member-chip,
.type-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(107, 78, 58, 0.08);
}

.data-pill strong {
  margin-left: 6px;
}

.status-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--teal);
  font-weight: 600;
}

body.simple-mode .advanced-only,
body.simple-mode .advanced-panel,
body.simple-mode #filterTypeField,
body.simple-mode #eventTypeField,
body.simple-mode #summaryGrid,
body.simple-mode .hero-pills,
body.simple-mode #familyMetaText,
 body.simple-mode #quickPresetBar,
 body.simple-mode .helper-banner,
 body.simple-mode .simple-quick-actions {
  display: none !important;
}

body.simple-mode .main-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.simple-mode .hero-actions {
  align-items: center;
}

.hero-side {
  display: grid;
  gap: 14px;
}

.insight-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 248, 241, 0.92)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.accent-card {
  background:
    linear-gradient(135deg, rgba(78, 141, 144, 0.14), rgba(255, 232, 207, 0.65)),
    rgba(255, 255, 255, 0.82);
}

.insight-label,
.section-note {
  font-size: 13px;
  color: var(--muted);
}

.insight-card strong {
  font-size: 22px;
  line-height: 1.34;
}

.toolbar-panel {
  margin-top: 18px;
}

.twin-board {
  margin-top: 18px;
}

.toolbar-grid,
.record-form,
.baby-list {
  display: grid;
  gap: 14px;
}

.twin-quick-bar,
.twin-event-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.twin-quick-bar {
  margin-top: 14px;
}

.twin-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.twin-card {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 241, 234, 0.95)),
    #fff;
  box-shadow: inset 0 0 0 1px rgba(107, 78, 58, 0.08);
  display: grid;
  gap: 12px;
}

.twin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.twin-card h3 {
  font-size: 24px;
}

.twin-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.twin-stat {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(107, 78, 58, 0.08);
}

.twin-stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.twin-stat-value {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
}

.checkbox-row {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(107, 78, 58, 0.09);
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.toolbar-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.94fr) minmax(0, 1.26fr);
  gap: 18px;
  margin-top: 18px;
}

.timeline-panel,
.family-panel,
.babies-panel {
  min-width: 0;
}

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

.field > span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.compact-field {
  min-width: 180px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(223, 120, 95, 0.62);
  box-shadow: 0 0 0 4px rgba(223, 120, 95, 0.12);
}

.suffix-input,
.triple-input {
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.suffix-input {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-right: 14px;
}

.triple-input {
  grid-template-columns: minmax(0, 1fr) minmax(88px, 120px);
  gap: 10px;
  padding: 0 10px 0 0;
}

.suffix-input input,
.triple-input input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.suffix-input span {
  color: var(--muted);
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#eventGrowthField {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.primary-button,
.ghost-button,
.preset-button,
.record-action {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button:hover,
.ghost-button:hover,
.preset-button:hover,
.record-action:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 13px 18px;
  border-radius: 14px;
  color: #fff8f5;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 12px 28px rgba(181, 82, 58, 0.28);
  font-weight: 700;
}

.ghost-button,
.preset-button,
.record-action {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(107, 78, 58, 0.09);
}

.align-end {
  align-self: end;
}

.preset-button.active {
  background: linear-gradient(180deg, rgba(255, 238, 230, 0.96), rgba(244, 232, 219, 0.96));
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.summary-card {
  min-height: 130px;
  padding: 16px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 241, 234, 0.95)),
    #fff;
  box-shadow: inset 0 0 0 1px rgba(107, 78, 58, 0.08);
}

.summary-card:nth-child(2n) {
  background:
    linear-gradient(180deg, rgba(249, 244, 236, 0.96), rgba(255, 255, 255, 0.95)),
    #fff;
}

.summary-card-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-card-value {
  margin-top: 10px;
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.16;
  font-weight: 800;
}

.summary-card-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.56;
}

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

.records-panel,
.members-block {
  margin-top: 20px;
}

.records-list,
.baby-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.record-card,
.baby-card,
.empty-state {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 241, 234, 0.95)),
    #fff;
  box-shadow: inset 0 0 0 1px rgba(107, 78, 58, 0.08);
}

.record-card,
.baby-card {
  display: grid;
  gap: 12px;
}

.record-top,
.record-bottom,
.baby-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.record-title-row,
.baby-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.record-time,
.baby-name {
  font-size: 22px;
  font-weight: 800;
}

.type-chip {
  background: var(--warm-soft);
  color: var(--accent-deep);
  font-weight: 700;
}

.metric-pill {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
}

.record-note,
.baby-note {
  color: var(--muted);
  line-height: 1.65;
}

.record-actions,
.baby-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .welcome-card,
  .hero,
  .main-grid,
  .summary-grid,
  .twin-summary-grid {
    grid-template-columns: 1fr;
  }

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

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

  .simple-home-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 16px, 100%);
    margin-top: 8px;
  }

  .welcome-card,
  .hero,
  .panel {
    padding: 18px;
    border-radius: 26px;
  }

  .toolbar-grid,
  .form-row,
  #eventGrowthField,
  .twin-card-stats,
  .record-top,
  .record-bottom,
  .baby-top,
  .hero-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .summary-grid {
    gap: 10px;
  }

  .simple-quick-actions {
    grid-template-columns: 1fr;
  }

  .simple-entry-row,
  .simple-edit-box {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions > button,
  .record-actions > button,
  .simple-edit-box > button {
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
  }

  .simple-record-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .simple-record-top,
  .simple-record-bottom {
    align-items: flex-start;
    gap: 10px;
  }

  .simple-record-value {
    width: 100%;
    font-size: 18px;
    line-height: 1.4;
  }

  .record-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simple-log-panel {
    gap: 12px;
  }

  .primary-button,
  .ghost-button,
  .record-action,
  input,
  select,
  textarea {
    min-height: 48px;
  }

  .triple-input {
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: calc(100vw - 12px);
  }

  .welcome-card,
  .hero,
  .panel {
    padding: 16px;
    border-radius: 22px;
  }

  .hero-actions,
  .record-actions {
    grid-template-columns: 1fr;
  }

  .simple-record-meta {
    width: 100%;
  }

  .simple-record-top,
  .simple-record-bottom {
    gap: 8px;
  }

  .data-pill,
  .metric-pill,
  .member-chip,
  .type-chip {
    min-height: 40px;
    width: 100%;
    justify-content: center;
  }
}
