/* Xiaowo: a family notebook, shaped around the real memo and recipe workflows. */
:root {
  --bg: #f2f0e9;
  --paper: #fffdf8;
  --ink: #302f29;
  --muted: #79776e;
  --line: #dedbd0;
  --green: #365b49;
  --pale: #e8eee5;
  --orange: #bd6848;
  --green-dark: #294b3c;
  --green-mid: #54735b;
  --green-soft: #819675;
  --green-muted: #647d63;
  --muted-strong: #5e5b51;
  --muted-warm: #8a735e;
  --muted-light: #98958b;
  --accent: #a75d40;
  --accent-soft: #f2e7df;
  --line-soft: #ebe8de;
  --paper-bright: #fffefa;
  --field: #faf9f4;
  --nav-bg: #f8f6f0;
  --page-bg: #f2f0e9;
  --sea: #365b49;
  --sea-deep: #294b3c;
  --sea-bright: #819675;
  --shadow: 0 5px 16px rgba(50, 48, 39, .045);
}

html { background: var(--bg); }
body {
  color: var(--ink);
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
button, input, textarea, select { font-family: inherit; letter-spacing: inherit; }
h1, h2, h3, .brand { font-family: ui-serif, "Songti SC", STSong, "Noto Serif CJK SC", serif; }
.shell { max-width: 1180px; padding-inline: 32px; }
.top {
  height: 70px;
  border-bottom: 1px solid var(--line);
}
.brand, .brand i { color: var(--green); }
.brand { font-size: 23px; letter-spacing: .02em; }
.topright { gap: 12px; }
.chat-entry {
  color: var(--green);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: none;
}
.layout { grid-template-columns: 190px minmax(0, 1fr); gap: 32px; padding-top: 26px; }
.profile-mini {
  border: 0;
  border-left: 3px solid var(--green-soft);
  border-radius: 0;
  padding: 11px 14px;
  background: transparent;
  box-shadow: none;
}
.nav { gap: 3px; }
.nav button {
  border-radius: 4px;
  padding: 11px 12px;
  color: var(--muted);
}
.nav button.active {
  background: var(--pale);
  color: var(--green-dark);
  box-shadow: inset 3px 0 var(--green-mid);
}
.nav button:hover { transform: none; }
.heading h1, .section .heading h1 { color: var(--ink); }
.datebox {
  padding: 7px 0;
  border: 0;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  background: transparent;
  color: var(--muted-strong);
  box-shadow: none;
}
.panel, .metric, .reminder-panel, .member-health-card, .dish-card, .chat-card, .modal, .sync-gate-card {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.panel, .reminder-panel { border-radius: 8px; }
.btn {
  border-radius: 5px;
  background: var(--green);
  box-shadow: none;
}
.btn:hover { background: var(--green-dark); box-shadow: none; transform: none; }
.btn.secondary, .route-bar button {
  border-radius: 5px;
  background: var(--pale);
  color: var(--green);
  box-shadow: none;
}
.input, textarea.input {
  border-color: var(--line);
  border-radius: 5px;
  background: var(--paper-bright);
  color: var(--ink);
}
.input:focus { border-color: var(--green-mid); box-shadow: 0 0 0 2px rgba(75, 111, 82, .12); }
.mobilebar, #mobile-nav {
  background: var(--nav-bg) !important;
  border-top: 1px solid var(--line);
  box-shadow: none !important;
  backdrop-filter: none;
}
.mobilebar button { border-radius: 3px !important; }
.mobilebar button.active { background: transparent; color: var(--green-dark); box-shadow: inset 0 -2px var(--green-mid) !important; }
.mobilebar i, .nav .ico { color: var(--green-muted); }

/* Daily records: matching ledger panels, natural list height, no nested scroll box. */
.home-heading {
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 4px 0 22px;
}
.home-title-block { min-width: 0; }
.home-kicker {
  display: block;
  color: var(--muted-warm);
  font-size: 11px;
  letter-spacing: .08em;
}
.home-heading h1 {
  margin: 3px 0 2px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
}
.home-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.home-heading .datebox { flex: none; white-space: nowrap; text-align: right; }
.home-lower {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(286px, auto);
  align-items: stretch;
  gap: 16px;
  margin-top: 0;
}
.home-lower > .home-list-panel {
  width: 100%;
  height: auto;
  min-height: 286px;
  display: flex;
  flex-direction: column;
  padding: 18px 19px 15px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--green-soft);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(50, 48, 39, .04);
}
.home-lower > .shopping-panel { border-top-color: var(--accent); }
#page-home .memo-panel, #page-home .shopping-panel { background: var(--paper); }
#page-home .home-lower .memo-panel .reminder-entry,
#page-home .home-lower .shopping-panel .reminder-entry { background: var(--field) !important; }
.reminder-head { margin-bottom: 12px; }
.reminder-title { gap: 10px; }
.reminder-title h3 { color: var(--ink); font-family: inherit; font-size: 17px; font-weight: 650; letter-spacing: 0; }
.reminder-list-icon {
  width: 29px;
  height: 29px;
  border-radius: 4px;
  background: var(--pale);
  color: var(--green);
  font-size: 18px;
}
.shopping-panel .reminder-list-icon { background: var(--accent-soft); color: var(--accent); }
.reminder-count {
  padding: 2px 0 3px 8px;
  border-radius: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.reminder-entry {
  min-height: 46px;
  margin: 5px 0 8px;
  padding: 3px 4px 3px 10px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--field);
}
.reminder-entry:focus-within {
  border-color: var(--green-mid);
  background: white;
  box-shadow: 0 0 0 2px rgba(75, 111, 82, .1);
}
.entry-plus { display: none; }
.reminder-entry .input, .reminder-entry .input:focus {
  min-height: 36px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px;
}
.entry-submit, .memo-entry .entry-submit, .shopping-entry .entry-submit {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: var(--green);
  color: white;
  font-size: 20px;
}
.shopping-entry .entry-submit { background: var(--accent); }
.entry-submit:hover { transform: none; box-shadow: none; }
.home-lower .home-checklist {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
  align-content: start;
}
.home-checklist:empty::before {
  content: "暂时没有要记的事";
  display: block;
  padding: 13px 2px;
  color: var(--muted-light);
  font-size: 12px;
}
.shopping-panel .home-checklist:empty::before { content: "买完的东西可以勾掉"; }
.home-list-row, .home-list-row:hover {
  min-height: 43px;
  padding: 4px 2px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}
.home-list-row label { color: var(--ink); font-size: 13px; }
.home-list-row label input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1.5px solid #aaa99d;
  border-radius: 50%;
  background: var(--paper);
}
.home-list-row label input:checked { border-color: var(--green-mid); background: var(--green-mid); }
.shopping-row label input:checked { border-color: var(--accent); background: var(--accent); }
.home-row-remove { opacity: .4; }
.home-row-remove:hover, .home-row-remove:focus-visible { background: var(--accent-soft); color: var(--accent); }

/* Cookbook: real family food photos lead; labels and controls stay quiet. */
.dish-hub-head {
  margin: 0 0 17px;
  padding: 10px 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.dish-hub-head .eyebrow, .dish-heading .eyebrow { display: none; }
.dish-hub-head h1 { margin: 0 0 5px; color: var(--ink); font-size: 29px; letter-spacing: 0; }
.dish-hub-head p { margin: 0; color: var(--muted); font-size: 13px; }
.dish-tabbar {
  gap: 22px;
  margin: 0 0 24px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.dish-tab {
  position: relative;
  min-width: 0;
  padding: 10px 2px 12px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}
.dish-tab[aria-selected="true"] {
  background: transparent;
  color: var(--green);
  box-shadow: none;
}
.dish-tab[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--green-mid);
  content: "";
}
.dish-section-head h2 { margin: 0 0 4px; color: var(--ink); font-size: 21px; }
.dish-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.dish-decision-panel {
  margin-top: 13px;
  padding: 14px 0 16px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.dish-ingredient-input { gap: 8px; }
.dish-ingredient-input input { min-height: 44px; }
.dish-decision-submit { min-height: 43px; border-radius: 5px; }
.dish-decision-note { color: var(--muted); }
.dish-suggestions button, .dish-chip { border-radius: 4px; }
.dish-gallery-tools { margin: 0 0 15px; }
.dish-gallery-tools .input { max-width: 460px; min-height: 43px; }
.dish-gallery { align-items: start; gap: 17px; }
.dish-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 3px 12px rgba(50, 48, 39, .045);
}
.dish-card:hover { transform: translateY(-1px); box-shadow: 0 7px 17px rgba(50, 48, 39, .09); }
.dish-card-photo { background: #e8e4d9; }
.dish-card-body { padding: 13px 14px 15px; }
.dish-card-body h3 { color: var(--ink); font-size: 16px; }
.dish-card-body p, .dish-card-body .dish-card-ingredients { color: var(--muted); }
.dish-card-body .dish-card-ingredients span { border-radius: 3px; background: var(--pale); color: var(--green); }
.dish-editor-inline {
  border: 1px solid var(--line) !important;
  border-top: 3px solid var(--green-mid) !important;
  border-radius: 7px !important;
  background: var(--paper) !important;
  box-shadow: var(--shadow) !important;
}
.dish-file-picker { border-radius: 5px; }

@media (max-width: 820px) {
  .shell { padding-inline: 18px; }
  .top { height: 62px; }
  .layout { padding-top: 17px; }
  .home-heading { margin: 3px 0 16px; }
  .home-heading h1 { font-size: 27px; }
  .home-lower {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: auto;
    gap: 13px;
  }
  .home-lower > .home-list-panel {
    height: auto;
    min-height: 205px;
    padding: 15px 15px 12px;
  }
  .home-lower .home-checklist { overflow: visible; }
  .dish-hub-head { margin-bottom: 12px; padding: 7px 0 13px; }
  .dish-hub-head h1 { font-size: 25px; }
  .dish-tabbar { top: 0; z-index: 2; background: var(--bg); }
  .dish-gallery-tools .input { max-width: none; }
}
@media (max-width: 520px) {
  .home-heading { align-items: end; gap: 12px; }
  .home-heading h1 { font-size: 25px; }
  .home-heading p { max-width: 230px; font-size: 11px; }
  .home-heading .datebox { flex: none; font-size: 10px; }
  .dish-gallery { grid-template-columns: 1fr; }
  .dish-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); }
  .dish-card-photo { height: 100%; min-height: 138px; }
  .dish-card-body { padding: 11px 12px; }
  .dish-card-body h3 { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .dish-card, .dish-tab, .nav button { transition: none !important; }
}


/* User-selectable color palettes; layout and component structure stay consistent. */
html[data-color-theme="sky"] {
  --bg: #eaf6ff;
  --page-bg: linear-gradient(135deg, #d8f2fb 0%, #fbfcfd 48%, #ffeaf1 100%);
  --paper: rgba(255, 255, 255, .88);
  --ink: #183b4b;
  --muted: #6c818d;
  --line: #d5e7ee;
  --green: #087f95;
  --green-dark: #07677d;
  --green-mid: #168d9d;
  --green-soft: #9adce3;
  --green-muted: #168396;
  --pale: #e0f3f7;
  --accent: #c86d87;
  --accent-soft: #f9e8ed;
  --muted-warm: #977786;
  --line-soft: #e5edf0;
  --paper-bright: rgba(255,255,255,.94);
  --field: rgba(255,255,255,.76);
  --nav-bg: rgba(255,255,255,.94);
  --shadow: 0 5px 18px rgba(59, 111, 132, .075);
}
html[data-color-theme="mint"] {
  --bg: #edf4ef;
  --page-bg: linear-gradient(145deg, #e5f1e9 0%, #f4f6ef 58%, #f5efe3 100%);
  --paper: rgba(255, 255, 252, .91);
  --ink: #263a31;
  --muted: #718077;
  --line: #d8e3d9;
  --green: #28715e;
  --green-dark: #1e5849;
  --green-mid: #4f8b72;
  --green-soft: #8caf96;
  --green-muted: #4f8068;
  --pale: #e1eee4;
  --accent: #b58a4f;
  --accent-soft: #f4eddf;
  --muted-warm: #89785e;
  --line-soft: #e5e9de;
  --paper-bright: rgba(255,255,252,.96);
  --field: rgba(255,255,252,.8);
  --nav-bg: rgba(255,255,252,.94);
  --shadow: 0 5px 17px rgba(52, 91, 68, .065);
}
html[data-color-theme="sky"] body,
html[data-color-theme="mint"] body { background: var(--page-bg); background-attachment: fixed; }

.theme-picker { position: relative; z-index: 30; }
.theme-picker > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 39px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.theme-picker > summary::-webkit-details-marker { display: none; }
.theme-picker > summary span:first-child { font-size: 18px; line-height: 1; }
.theme-picker > summary:hover, .theme-picker[open] > summary { border-color: var(--green-mid); }
.theme-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 244px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-bright);
  box-shadow: 0 12px 32px rgba(28, 47, 42, .15);
  backdrop-filter: blur(14px);
}
.theme-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 11px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.theme-menu button:hover, .theme-menu button[aria-pressed="true"] { background: var(--pale); }
.theme-menu button[aria-pressed="true"]::after { content: "✓"; margin-left: auto; color: var(--green); font-weight: 700; }
.theme-menu button span { display: grid; gap: 2px; }
.theme-menu button b { font-size: 13px; font-weight: 650; }
.theme-menu button small { color: var(--muted); font-size: 10px; }
.theme-swatch { width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid var(--line); border-radius: 50%; }
.theme-swatch-paper { background: linear-gradient(135deg,#f2f0e9 0 50%,#365b49 50%); }
.theme-swatch-sky { background: linear-gradient(135deg,#d8f2fb 0 48%,#ffeaf1 49% 100%); }
.theme-swatch-mint { background: linear-gradient(135deg,#e5f1e9 0 50%,#28715e 50%); }
@media (max-width: 700px) {
  .theme-picker > summary { width: 36px; min-height: 36px; padding: 0; border-radius: 50%; }
  .theme-picker-label { display: none; }
  .theme-menu { right: -48px; }
}
