/* 拾光日记手机端：暖白纸面、森林绿和低对比留白。 */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --canvas: #f5f6f0;
  --paper: #fffefa;
  --paper-soft: #f0f2e9;
  --ink: #30392f;
  --muted: #889084;
  --leaf: #52734e;
  --leaf-deep: #36543a;
  --leaf-light: #e8efe4;
  --border: #e8eadf;
  --amber: #c49c5a;
  --danger: #ab6258;
  --shadow: 0 12px 38px rgb(58 67 50 / 6%);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); }
body { min-height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
button, input, textarea, select { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #95ad8a; outline-offset: 2px; }
button:disabled { opacity: .55; }
.shell { min-height: 100dvh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px 13px; background: rgb(245 246 240 / 94%); backdrop-filter: blur(18px); border-bottom: 1px solid rgb(232 234 223 / 68%); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 14px; background: var(--leaf); color: white; font-family: "Songti SC", serif; font-size: 22px; box-shadow: 0 4px 12px rgb(82 115 78 / 23%); }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-family: "Songti SC", "Noto Serif CJK SC", serif; font-size: 18px; font-weight: 650; letter-spacing: .08em; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .055em; }
.top-actions { display: flex; align-items: center; gap: 5px; }
.icon-button, .quiet-button, .secondary-button, .primary-button, .text-button, .danger-button, .mood-button, .action-chip, .tab { border: 0; cursor: pointer; }
.icon-button { display: grid; width: 41px; height: 41px; place-items: center; border-radius: 14px; background: transparent; color: var(--leaf-deep); font-size: 19px; }
.icon-button:hover { background: var(--leaf-light); }
.online-status { width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #82a075; box-shadow: 0 0 0 4px #e8efe4; }
.page { width: min(100% - 36px, 540px); margin: 0 auto; }
.home-page { padding: 28px 0 20px; }
.eyebrow { margin: 0 0 10px; color: var(--leaf); font-size: 10px; font-weight: 700; letter-spacing: .2em; }
.greeting { margin: 0; font-family: "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(25px, 8vw, 33px); font-weight: 570; line-height: 1.37; letter-spacing: .035em; }
.subgreeting { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.85; }
.streak-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 23px; padding: 18px; border: 1px solid #e9ecdf; border-radius: 22px; background: linear-gradient(130deg, #ebefe4, #f6f3e9 92%); }
.streak-card p { margin: 0; color: var(--muted); font-size: 11px; }
.streak-card strong { display: block; margin-top: 5px; color: var(--leaf-deep); font-family: "Songti SC", serif; font-size: 21px; font-weight: 600; }
.streak-symbol { color: var(--amber); font-size: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 27px 0 11px; }
.section-heading h2 { margin: 0; font-family: "Songti SC", serif; font-size: 18px; font-weight: 580; }
.section-heading span { color: var(--muted); font-size: 10px; }
.entry-list { display: grid; gap: 10px; }
.entry-card { display: grid; width: 100%; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--border); border-radius: 19px; background: var(--paper); text-align: left; box-shadow: 0 4px 16px rgb(58 67 50 / 2%); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.entry-card:active { transform: scale(.986); box-shadow: var(--shadow); }
.entry-date { padding: 7px 4px; border-radius: 13px; background: var(--paper-soft); color: var(--leaf-deep); text-align: center; }
.entry-date b { display: block; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.entry-date small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.entry-info { min-width: 0; }
.entry-info h3 { overflow: hidden; margin: 3px 0 6px; color: var(--ink); font-size: 14px; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.entry-preview { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; margin-top: 9px; color: var(--muted); font-size: 9px; }
.tag { padding: 3px 7px; border-radius: 7px; background: #f0f2e9; color: #68755f; }
.entry-arrow { align-self: center; color: #a5ad9d; font-size: 20px; }
.entry-image { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.empty-state { display: grid; min-height: 213px; place-items: center; padding: 24px; border: 1px dashed #dfe4d8; border-radius: 22px; color: var(--muted); text-align: center; }
.empty-state b { display: block; margin: 9px 0 6px; color: var(--ink); font-family: "Songti SC", serif; font-size: 17px; font-weight: 560; }
.empty-state p { margin: 0; font-size: 11px; line-height: 1.8; }
.empty-icon { color: var(--amber); font-size: 35px; }
.bottom-nav { position: fixed; z-index: 8; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 8px max(13px, calc((100vw - 540px) / 2)) calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid rgb(232 234 223 / 94%); background: rgb(255 254 250 / 96%); backdrop-filter: blur(22px); }
.tab { display: grid; min-height: 52px; justify-items: center; align-content: center; gap: 4px; border-radius: 15px; background: transparent; color: var(--muted); font-size: 10px; }
.tab-icon { font-size: 18px; line-height: 1; }
.tab[aria-current="page"] { background: var(--leaf-light); color: var(--leaf-deep); font-weight: 680; }
.fab { position: fixed; z-index: 7; right: max(21px, calc((100vw - 540px) / 2)); bottom: calc(91px + env(safe-area-inset-bottom)); display: flex; min-height: 54px; align-items: center; gap: 10px; padding: 0 20px; border: 0; border-radius: 18px; background: var(--leaf); color: white; font-size: 13px; font-weight: 640; box-shadow: 0 8px 22px rgb(51 80 53 / 26%); cursor: pointer; transition: transform .13s; }
.fab:active { transform: scale(.96); }
.fab span { font-size: 20px; }
.list-page { padding: 22px 0 26px; }
.list-title { margin: 0 0 7px; font-family: "Songti SC", serif; font-size: 25px; font-weight: 570; }
.list-caption { margin: 0 0 19px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.search-box { display: flex; align-items: center; gap: 9px; margin: 14px 0; padding: 0 15px; border: 1px solid var(--border); border-radius: 15px; background: var(--paper); }
.search-box input { width: 100%; min-height: 45px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-box span { color: var(--muted); font-size: 18px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px 15px; padding: 0 18px 3px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--paper); color: var(--muted); font-size: 11px; }
.filter-chip.active { border-color: var(--leaf); background: var(--leaf-light); color: var(--leaf-deep); font-weight: 650; }
.month-picker { width: 143px; min-height: 34px; padding: 0 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 12px; }
.detail-wrap { padding: 22px 0 31px; }
.back-link { display: inline-flex; min-height: 39px; align-items: center; gap: 7px; padding: 0 8px 0 0; border: 0; background: transparent; color: var(--leaf); font-size: 12px; font-weight: 650; cursor: pointer; }
.detail-date { margin: 17px 0 7px; color: var(--muted); font-size: 11px; }
.detail-title { margin: 0; font-family: "Songti SC", serif; font-size: 29px; font-weight: 570; line-height: 1.45; overflow-wrap: anywhere; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 11px; align-items: center; margin: 14px 0 19px; color: var(--muted); font-size: 11px; }
.detail-body { color: #424a40; font-size: 15px; line-height: 2.04; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-body p { margin: 0; }
.article-photo { display: block; width: 100%; max-height: 65dvh; margin: 14px 0 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--paper-soft); object-fit: contain; cursor: zoom-in; }
.photo-label { margin: 3px 0 10px; color: var(--muted); font-size: 10px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 23px; padding-top: 15px; border-top: 1px solid var(--border); }
.action-chip { min-height: 35px; padding: 0 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); color: var(--muted); font-size: 11px; }
.action-chip.danger { color: var(--danger); }
.form-page { padding: 15px 0 29px; }
.form-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.back-button { display: inline-flex; min-height: 40px; align-items: center; gap: 6px; padding: 0 8px 0 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.save-status { color: var(--muted); font-size: 10px; }
.form-paper { overflow: hidden; padding: 19px; border: 1px solid var(--border); border-radius: 21px; background: var(--paper); box-shadow: var(--shadow); }
.form-date { width: 100%; min-height: 38px; padding: 0; border: 0; background: transparent; color: var(--leaf); font-family: Georgia, "Songti SC", serif; font-size: 12px; font-weight: 600; }
.title-input { display: block; width: 100%; min-height: 48px; padding: 4px 0 8px; border: 0; border-bottom: 1px solid #eef0e8; border-radius: 0; outline: 0; background: transparent; color: var(--ink); font-family: "Songti SC", serif; font-size: 23px; font-weight: 570; }
.title-input::placeholder { color: #bdc2b7; }
.field-caption { display: block; margin: 16px 0 8px; color: var(--muted); font-size: 10px; }
.mood-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.mood-button { display: grid; min-height: 54px; justify-items: center; align-content: center; gap: 4px; padding: 5px 1px; border: 1px solid transparent; border-radius: 14px; background: #f6f7f1; color: #7c8277; font-size: 9px; transition: .14s; }
.mood-button span { color: #879978; font-size: 17px; }
.mood-button.active { border-color: #d3dfca; background: var(--leaf-light); color: var(--leaf-deep); font-weight: 650; }
.mood-button.active span { color: var(--leaf); }
.write-label { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.write-label .field-caption { margin: 0 0 8px; }
.write-label small { margin-bottom: 8px; color: #a4aa9d; font-size: 9px; }
.body-input { display: block; width: 100%; min-height: 37dvh; max-height: 57dvh; padding: 10px 0 14px; resize: vertical; border: 0; outline: 0; background: transparent; color: #41493e; font-size: 14px; line-height: 1.97; overflow-wrap: anywhere; }
.body-input::placeholder { color: #b8beb2; }
.tag-input { display: block; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; outline: 0; background: #fbfbf7; color: var(--ink); font-size: 12px; }
.compose-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.secondary-button, .primary-button, .quiet-button, .danger-button, .text-button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border-radius: 13px; font-size: 12px; font-weight: 620; cursor: pointer; }
.secondary-button { border: 1px solid var(--border); background: white; color: var(--leaf-deep); }
.primary-button { border: 0; background: var(--leaf); color: white; box-shadow: 0 4px 12px rgb(82 115 78 / 18%); }
.primary-button:active { background: var(--leaf-deep); }
.danger-button { border: 1px solid #ead9d5; background: #fbf3f1; color: var(--danger); }
.text-button { min-height: 36px; padding: 0 9px; background: transparent; color: var(--leaf); }
.quiet-button { border: 1px solid var(--border); background: transparent; color: var(--muted); }
.full-button { width: 100%; }
.submit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
.photo-list { display: grid; gap: 8px; margin-top: 9px; }
.photo-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 13px; background: #fcfcf9; }
.photo-thumb { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 10px; background: var(--paper-soft); object-fit: cover; }
.photo-description { min-width: 0; flex: 1; }
.photo-description b { display: block; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.photo-description span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.photo-control { display: flex; flex-direction: column; gap: 2px; }
.photo-control button { min-width: 32px; min-height: 29px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; }
.photo-control button:active { background: var(--leaf-light); color: var(--leaf); }
.photo-item > .danger-remove { min-width: 36px; min-height: 37px; border: 0; border-radius: 9px; background: transparent; color: var(--danger); font-size: 18px; }
.auth-shell { display: grid; min-height: 100dvh; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 410px); padding: 27px 23px; border: 1px solid var(--border); border-radius: 25px; background: var(--paper); box-shadow: var(--shadow); }
.auth-brand { display: grid; justify-items: center; margin-bottom: 17px; text-align: center; }
.auth-brand .brand-mark { width: 53px; height: 53px; border-radius: 19px; font-size: 28px; }
.auth-brand h1 { margin: 12px 0 5px; font-family: "Songti SC", serif; font-size: 22px; font-weight: 590; letter-spacing: .08em; }
.auth-brand p { max-width: 285px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.auth-heading { margin: 19px 0 8px; color: var(--leaf-deep); font-family: "Songti SC", serif; font-size: 18px; font-weight: 570; }
.auth-fields { display: grid; gap: 10px; margin: 15px 0; }
.auth-fields input { width: 100%; min-height: 47px; padding: 0 13px; border: 1px solid var(--border); border-radius: 13px; outline: 0; background: #fbfbf7; color: var(--ink); font-size: 13px; }
.auth-tip { padding: 11px 13px; border-radius: 12px; background: #f1f4eb; color: #71806b; font-size: 10px; line-height: 1.85; }
.auth-error { min-height: 17px; margin: 6px 0; color: var(--danger); font-size: 10px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 17px; margin-top: 13px; }
.settings-page { padding: 21px 0 30px; }
.settings-card { margin: 14px 0; padding: 17px; border: 1px solid var(--border); border-radius: 18px; background: var(--paper); }
.settings-card h2 { margin: 0 0 9px; font-size: 14px; font-weight: 600; }
.settings-card p { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.85; }
.inline-actions { display: grid; gap: 8px; }
.backup-label { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 43px; padding: 0 14px; border: 1px solid var(--border); border-radius: 13px; background: white; color: var(--leaf-deep); font-size: 12px; font-weight: 620; cursor: pointer; }
.recovery-box { margin: 12px 0; padding: 14px; border: 1px dashed #c9d5bd; border-radius: 13px; background: #f6f8f0; }
.recovery-button { margin-top: 10px; }
.install-footnote { margin-top: 12px !important; }
.recovery-code { display: block; margin: 8px 0 12px; color: var(--leaf-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; letter-spacing: .08em; line-height: 1.8; overflow-wrap: anywhere; }
.week-strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; margin: 15px 0 5px; }
.day-cell { display: grid; justify-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.day-dot { width: 14px; height: 14px; border: 1px solid #e6e9df; border-radius: 50%; background: white; }
.day-dot.active { border-color: #73906a; background: #89a37b; box-shadow: inset 0 0 0 3px #e5ede0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.stat-card { padding: 15px; border: 1px solid var(--border); border-radius: 15px; background: var(--paper); }
.stat-card strong { display: block; color: var(--leaf-deep); font-family: "Songti SC", serif; font-size: 22px; font-weight: 570; }
.stat-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.modal-backdrop { position: fixed; z-index: 15; inset: 0; display: grid; align-items: end; padding-top: 40px; background: rgb(35 43 34 / 43%); backdrop-filter: blur(5px); }
.modal { overflow: auto; width: 100%; max-height: 82dvh; padding: 23px 21px calc(22px + env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; background: var(--paper); animation: rise .18s ease-out; }
.modal h2 { margin: 0 0 8px; font-family: "Songti SC", serif; font-size: 20px; font-weight: 570; }
.modal p { margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.modal-list { display: grid; gap: 8px; margin: 15px 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.lock-overlay { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; background: #f5f6f0; }
.notice { position: fixed; z-index: 50; right: 18px; bottom: calc(81px + env(safe-area-inset-bottom)); left: 18px; width: max-content; max-width: min(90vw, 430px); margin: 0 auto; padding: 12px 16px; border: 1px solid #e1e5da; border-radius: 15px; background: #303b31; color: white; font-size: 12px; line-height: 1.65; text-align: center; box-shadow: 0 8px 26px rgb(30 39 29 / 21%); animation: appear .2s ease-out; }
.notice[hidden] { display: none; }
.boot { display: grid; min-height: 80dvh; place-content: center; justify-items: center; color: var(--muted); font-size: 12px; }
.boot .brand-mark { width: 48px; height: 48px; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 760px) {
  .topbar { padding-right: max(25px, calc((100vw - 540px) / 2)); padding-left: max(25px, calc((100vw - 540px) / 2)); }
  .home-page, .list-page, .detail-wrap, .form-page, .settings-page { padding-top: 30px; }
  .modal-backdrop { align-items: center; justify-items: center; padding: 24px; }
  .modal { width: min(100%, 470px); max-height: min(80dvh, 740px); border-radius: 24px; }
}
@media (max-width: 369px) {
  .page { width: calc(100% - 28px); }
  .topbar { padding-right: 13px; padding-left: 13px; }
  .mood-row { gap: 2px; }
  .entry-card { grid-template-columns: 42px 1fr auto; gap: 9px; padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
