:root {
  color-scheme: light;
  --paper: #faf7f0;
  --ink: #30251d;
  --muted: #6f5e50;
  --accent: #934e36;
  --line: #dbcec0;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", Georgia, serif;
  font-family: "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 4px; }
h1, h2, h3, .brand { font-family: var(--serif); line-height: 1.19; }
h1 { font-size: clamp(2.15rem, 5vw, 3.7rem); margin: 0 0 12px; letter-spacing: -.035em; }
h2 { font-size: 1.65rem; margin: 0 0 14px; }
h3 { font-size: 1.25rem; margin: 0 0 4px; }
p { margin: 0 0 16px; }
small, .muted, #draft-status { color: var(--muted); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button, input:not([type=checkbox]), textarea, select { border: 1px solid var(--line); border-radius: 9px; background: transparent; padding: 10px 12px; }
button, summary { cursor: pointer; }
button:disabled { opacity: .68; cursor: default; }
img, video { display: block; max-width: 100%; border-radius: 10px; }
audio { width: 100%; }
header { max-width: 1180px; margin: auto; padding: 19px 26px 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); }
header span { font-size: .8rem; color: var(--muted); }
.brand { font-size: 1.5rem; font-weight: 700; text-decoration: none; color: var(--ink); }
main { max-width: 1120px; margin: auto; padding: 30px 24px 105px; outline: none; }
nav { position: fixed; inset: auto 0 0; z-index: 2; display: flex; justify-content: center; gap: clamp(0px, 4vw, 58px); border-top: 1px solid var(--line); background: var(--paper); padding-bottom: env(safe-area-inset-bottom); }
nav a { display: grid; justify-items: center; align-content: center; gap: 3px; min-width: 74px; padding: 9px 4px; text-decoration: none; color: var(--ink); font-size: .78rem; }
nav a[aria-current] { color: var(--accent); font-weight: 750; }
section + section { margin-top: 30px; }
.cover { display: grid; grid-template-columns: 1.45fr 1fr; gap: clamp(20px, 4vw, 52px); align-items: center; }
.cover img { width: 100%; aspect-ratio: 1.9; object-fit: cover; object-position: center 45%; }
.cover p { color: var(--muted); }
.button { display: inline-block; background: var(--accent); color: white; border: 1px solid var(--accent); border-radius: 10px; padding: 12px 18px; font-weight: 680; text-decoration: none; }
.stage { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; margin: 24px 0 30px; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.stage span { color: var(--muted); font-size: .85rem; }
.stage svg { margin-left: auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.recent { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.story { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding: 13px 0; color: var(--ink); text-decoration: none; min-width: 0; }
.story:hover h3 { color: var(--accent); }
.story div { min-width: 0; overflow-wrap: anywhere; }
.story img { width: 106px; height: 80px; object-fit: cover; }
.story svg { margin-left: auto; flex: 0 0 18px; }
.story p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.record-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; color: var(--muted); font-size: .8rem; }
.recent .story { position: relative; display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 26px 12px 12px; }
.recent .story img { width: 100%; height: auto; aspect-ratio: 1.8; margin-bottom: 8px; }
.recent .story svg { position: absolute; right: 5px; top: 9px; }
.capture, .reader { max-width: 680px; margin: auto; }
.capture h1 { margin-bottom: 2px; }
#draft-status { font-size: .78rem; text-align: right; }
.picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 26px 0; }
.picker > div { display: grid; justify-items: center; border: 1px dashed #9b8574; border-radius: 13px; padding: 14px 4px 6px; }
.picker strong { margin-top: 5px; }
.picker label, .picker button { cursor: pointer; position: relative; border: 0; padding: 6px; min-height: 32px; background: transparent; color: var(--accent); font-size: .85rem; }
.picker label:focus-within { outline: 2px solid var(--accent); }
.picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.field { display: block; margin: 16px 0; font-weight: 650; }
.field :is(input, textarea) { display: block; width: 100%; margin-top: 8px; font-weight: 400; }
textarea { resize: vertical; }
details { padding: 12px 0; border-block: 1px solid var(--line); }
details input { margin: 10px 0 0; }
summary span { float: right; color: var(--muted); }
.save { width: 100%; margin-top: 24px; }
#save-status { margin: 8px 0 0; color: var(--accent); }
.gallery { display: grid; gap: 10px; }
.gallery figure { margin: 0; overflow-wrap: anywhere; }
.gallery figcaption { font-size: .8rem; }
.gallery img, .gallery video { max-height: 470px; object-fit: contain; }
.filters, .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters { margin-bottom: 30px; }
.filters .search input { max-width: 180px; }
.reader h1 { margin-top: 18px; overflow-wrap: anywhere; }
.reader-cover { width: 100%; max-height: 420px; object-fit: cover; }
.original { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.06rem; line-height: 1.9; margin: 20px 0 28px; }
#organize { border-block: 1px solid var(--line); padding: 18px 0; margin: 24px 0; }
@media (max-width: 767px) {
  main { padding: 20px 18px 90px; }
  header { padding: 12px 18px; }
  .cover { grid-template-columns: 1fr; gap: 14px; }
  .cover img { aspect-ratio: 2.25; }
  .recent { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent .story:nth-child(n+3) { display: none; }
  nav a { flex: 1; }
  .story img { width: 92px; height: 72px; }
}
main:focus-visible { outline: none; }
@media (min-width: 768px) {
  header { align-items: center; }
  nav { position: static; border: 0; gap: clamp(4px, 2vw, 22px); }
  nav a { display: flex; align-items: center; gap: 6px; min-width: auto; font-size: .9rem; }
  nav svg { width: 18px; height: 18px; }
  nav a span { color: inherit; font-size: inherit; }
  main { padding-bottom: 56px; }
}
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags:not(:empty) { margin-top: 7px; }
.detail-tags:not(:empty) { margin-bottom: 16px; }
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--accent);
  font-size: .78rem;
  text-decoration: none;
}
a.tag:hover { text-decoration: underline; }
.assistant { max-width: 820px; margin: auto; }
.message { padding: 16px 0; border-bottom: 1px solid var(--line); }
.message .original { margin: 8px 0 12px; font-size: 1rem; }
#chat-form { margin: 24px 0; }
#chat-form button { margin-right: 8px; }
.plan { border-top: 1px solid var(--line); padding: 24px 0; }
.task-item { display: flex; gap: 10px; align-items: baseline; padding: 10px 0; }
.task-item small { display: block; }
.calendar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; }
.task-group { border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.task-groups { display: grid; gap: 12px; margin-top: 16px; }
.task-groups section + section { margin-top: 0; }
.plan-editor { padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.plan-editor fieldset { min-width: 0; border: 1px solid var(--line); margin: 12px 0; }
.plan-editor input { max-width: 100%; }
@media(max-width: 767px) { nav a { min-width: 0; } .assistant h1 { font-size: 2rem; } }
.calendar-scroll { overflow-x: auto; margin: 16px 0; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(80px, 1fr)); min-width: 630px; gap: 5px; }
.calendar-day { margin: 0 !important; border: 1px solid var(--line); padding: 7px; min-height: 90px; }
.calendar-day .task-item { font-size: .8rem; gap: 4px; align-items: start; }
.calendar-day .task-item small { font-size: .7rem; }
.calendar-day input { margin: 5px 0 0; }
.assistant > .section-head { align-items: start; }
.assistant > .section-head .button { white-space: nowrap; flex-shrink: 0; font-size: .9rem; margin-top: 7px; }
@media(max-width: 767px) { .assistant h1 { font-size: 1.7rem; } }
.module-switch { display: block; margin: 12px 0; }
#interactions { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
#interactions button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
#family-manage form { margin: 12px 0; }
#invite-result { overflow-wrap: anywhere; }
