@font-face {
  font-family: ButterflyKai;
  src: url("../../public/fonts/kai.woff2") format("woff2");
  font-display: swap;
}
:root {
  --ink: #292e28; --hint: #62675d; --muted: #64685e; --faint: #62655b;
  --paper: #f5f2e9; --panel: #fffdf7; --line: #d9d7c9;
  --vermilion: #903f32; --jade-ink: #335347;
  --display: ButterflyKai, "Kaiti SC", STKaiti, "Songti SC", serif;
  --reading: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
html, body { background: #dfdfd3; }
body { font-family: var(--reading); }
.phone-shell, .view-shell { background: var(--paper); }
.phone-shell { padding-inline: clamp(14px, 4.8vw, 25px); border-color: transparent; }
.topbar { height: 84px; height: clamp(76px, 11dvh, 104px); border-bottom: 1px solid #bbbdae; align-items: center; }
.topbar-mark { display: flex; align-items: center; gap: 9px; margin: 0; font: 500 32px/1 var(--display); color: var(--ink); letter-spacing: .08em; }
.topbar-mark::before { content: ""; width: 25px; height: 31px; background: url("../../public/favicon.svg") center/contain no-repeat; }
.almanac { display: grid; justify-items: end; gap: 3px; font: 11px/1.4 var(--reading); letter-spacing: .08em; color: #5a6157; }
.topbar-time { font-variant-numeric: tabular-nums; font-size: 12px; }
.home-content { padding: 14px 0 18px; justify-content: center; gap: 14px; }
.memory-card { min-height: 0; height: 215px; height: clamp(174px, 30dvh, 270px); padding: 0; background: #3c4d40; border: 0; border-radius: 5px; box-shadow: none; isolation: isolate; }
.garden-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 53%; z-index: -2; }
.memory-card::before { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; box-shadow: none; background: linear-gradient(90deg,rgba(17,34,29,.84), rgba(23,37,30,.36) 47%, transparent 79%); z-index: -1; }
.memory-card::after { content: ""; position: absolute; inset: 7px; border: 1px solid #fff8dc63; pointer-events: none; }
.garden-copy { position: absolute; left: 23px; bottom: 25px; }
.memory-title { font: 400 clamp(36px, 10vw, 48px)/1.15 var(--display); letter-spacing: .11em; color: #fff9e9; }
.memory-line { font: 12px/1.5 var(--reading); color: #faf3df; letter-spacing: .08em; }
.memory-seal-img { width: 33px; height: 33px; bottom: 18px; right: 18px; padding: 3px; background: #f6eed7; mix-blend-mode: normal; opacity: .94; }
.memory-curtain { left: auto; width: 59%; }
.home-widgets { grid-template-columns: 1fr 1.05fr; gap: 12px; margin: 0; }
.record-widget,.note-widget { height: 190px; height: clamp(170px, 24dvh, 220px); border-radius: 4px; box-shadow: none; }
.record-widget { background: #dee4d8; border: 1px solid #c4cebd; }
.window-scene { width: clamp(86px, 24vw, 112px); height: auto; aspect-ratio: 1; top: 8%; }
.record-label,.note-label,.contact-name { font: 500 22px/1.15 var(--display); letter-spacing: .07em; }
.record-label { bottom: 29px; color: #263e32; }
.record-caption { display: block; color: #4a5b4b; bottom: 12px; }
.note-widget { padding: 18px 15px 14px; background: #fffaf0; border: 1px solid #d7ccba; }
.note-widget::before { content: ""; position: absolute; top: 0; left: 15px; width: 24px; height: 3px; background: #a14836; }
.note-body { border: 0; padding: 0; }
.note-text { font: 16px/1.7 var(--display); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-status { background: transparent; border: 0; padding: 0; font-size: 10px; }
.contact-strip { border-block: 1px solid var(--line); padding: 9px 0; min-height: 63px; gap: 10px; }
.contact-avatar { border: 1px solid #b5b9a8; border-radius: 50%; background: #e2e7d8; color: #3e5746; box-shadow: none; overflow: hidden; }
.contact-name { font-size: 20px; }
.contact-state { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.round-action { border-color: #c1c7b7; background: transparent; box-shadow: none; }
.video-action { background: #e5e9dd; }
.bottom-nav { height: 72px; }
.seal-chat { margin: 0; height: 36px; }
.seal-chat svg { width: 37px; height: 37px; }
.nav-symbol { height: 35px; }
.view-bar { border-bottom: 1px solid var(--line); }
.view-title, .list-name, .pane-title { font-family: var(--display); }
.view-title { font-size: 21px; }
.pane { background: #fcfaf3; border: 1px solid var(--line); border-radius: 8px; }
.pane-title { font-size: 17px; color: var(--jade-ink); }
.settings-index { border-top: 1px solid #869383; }
.settings-index .list-item { padding: 15px 8px; border-radius: 0; border-bottom: 1px solid var(--line); }
.settings-index .list-name { font-size: 20px; }
.settings-index .list-sub { margin-top: 3px; color: #63685e; }
.chat-scroll { padding: 18px 15px 12px; gap: 11px; }
.bubble { font: 16px/1.72 var(--reading); letter-spacing: .01em; padding: 10px 14px; max-width: 86%; flex: none; }
.bubble-user { border: 1px solid #c9d2bf; border-radius: 13px 13px 3px 13px; background: #dde6d6; }
.bubble-ai { border: 1px solid #dfdbce; border-radius: 13px 13px 13px 3px; background: #fffdf7; }
.chat-empty { margin: auto; text-align: center; color: var(--hint); }
.chat-empty span { font: 30px var(--display); color: #3d5444; }
.chat-empty p { font-size: 14px; }
.chat-compose { padding: 9px 13px max(10px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #f8f6ef; }
.chat-compose textarea { min-width: 0; font-size: 16px; border-radius: 10px; max-height: 144px; }
.chat-send { width: auto; min-width: 55px; padding: 0 10px; border-radius: 9px; background: #375648; border: 0; font-size: 14px; }
.chat-feedback,.chat-setup { flex: none; font-size: 13px; color: #544c3c; padding: 2px 15px; }
.chat-feedback:empty,.chat-setup:empty { display: none; }
.chat-setup { background: #e9edde; }
.text-action,.history-more { min-height: 44px; color: #355849; padding: 4px 8px; }
.history-more { align-self: center; font-size: 13px; }
.story-books { padding: 12px 0; }
.story-books summary { cursor: pointer; }
.editor-body > textarea { width: 100%; min-height: 110px; padding: 10px; font: 16px/1.6 var(--reading); }
.field input,.field textarea { font-size: 16px; }
.picker-head { white-space: pre-line; max-height: 45dvh; overflow-y: auto; }
@media(max-height:650px) {
  .home-content { padding-block: 9px; gap: 9px; }
  .topbar { height: 62px; }
  .memory-card { height: 155px; }
  .note-widget,.record-widget { height: 152px; }
  .window-scene { width: 81px; }
  .bottom-nav { height: 60px; }
}
@media(min-width:481px) { .phone-shell { border-radius: 14px; box-shadow: 0 10px 44px #30352922; } }

@supports not (height: 100dvh) { .phone-shell { min-height: 100vh; } }
/* 给仍在使用旧内核的内置浏览器提供相同的图像定位。 */
.home-content { justify-content: flex-start; }
.garden-scene,.memory-card::before { top: 0; left: 0; }
.memory-curtain { opacity: .72; }
.window-scene { width: clamp(86px, 24vw, 112px); height: clamp(86px, 24vw, 112px); }
.window-outside,.window-frame { top: 0; left: 0; }
@media (min-height: 701px) {
  .home-content { justify-content: space-evenly; }
  .memory-card { min-height: 235px; }
}
@media (max-height: 650px) { .window-scene { width: 81px; height: 81px; } }
