/* A paper notebook on a quiet sage desk. No remote fonts or image requests. */
:root {
  color-scheme: light;
  --bg: #e8ebe4;
  --paper: #fffdf5;
  --panel: #f7f3e8;
  --ink: #343c32;
  --muted: #7c8070;
  --line: #deded0;
  --accent: #52684f;
  --serif: "Songti SC", "STSong", "SimSun", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 48% 16%, #f7f7f0 0%, transparent 66%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(87,103,80,.025) 3px 4px);
  font: 15px/1.8 system-ui, "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a, input, textarea { outline-offset: 5px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #6c8063; }
header {
  max-width: 1160px; margin: auto; padding: 24px 30px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(82,104,79,.16);
}
.journal-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.journal-brand svg { width: 23px; height: 23px; color: var(--accent); }
header nav { display: flex; gap: 28px; font-size: 13px; color: #777e70; }
header nav a { padding: 5px 0; }
header nav a[aria-current] { color: #3e533b; border-bottom: 1px solid #7e9175; }
header nav a:hover { color: #3e533b; }
main { max-width: 1080px; margin: 42px auto 32px; padding: 0 30px; }
.journal-heading { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin: 0 0 30px; }
.eyebrow, .cover-label { color: #7c8872; font: 10px/1.6 ui-monospace, Consolas, monospace; letter-spacing: .18em; }
.eyebrow { margin: 0 0 12px; }
h1 { margin: 0; font: 500 clamp(36px, 5vw, 52px)/1.3 var(--serif); letter-spacing: .08em; }
.intro { margin: 10px 0 0; color: #777f6c; font-size: 13px; letter-spacing: .1em; }
.journal-date { margin: 0 0 5px; color: #777f6c; font: 11px/1.7 ui-monospace, "Microsoft YaHei", monospace; text-align: right; }
.journal-date::before { content: ''; display: block; width: 22px; height: 1px; margin: 0 0 9px auto; background: #a2ae96; }
h2 { font: 600 25px/1.5 var(--serif); margin: 5px 0 18px; }
.lock-card {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  margin: 0; min-height: 475px; border: 1px solid #d6d8c8; border-radius: 5px 12px 12px 5px;
  background: var(--paper);
  box-shadow: 0 2px 0 #f8f5e9, 0 4px 0 #ced1c0, 0 7px 0 #f7f4e9,
    0 9px 0 #b7bda9, 0 28px 55px -30px rgba(59,70,48,.42);
  animation: page-in .4s ease-out;
}
.lock-card::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: calc(50% - 14px); width: 28px; z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(81,85,63,.1) 44%, rgba(81,85,63,.17) 49%, rgba(255,255,255,.7) 53%, transparent);
  pointer-events: none;
}
.lock-card::after {
  content: ''; position: absolute; top: -1px; right: 34px; width: 21px; height: 68px;
  background: #ae6f55; clip-path: polygon(0 0,100% 0,100% 100%,50% 83%,0 100%);
  box-shadow: 2px 2px 3px #0001;
}
.notebook-cover {
  position: relative; padding: 55px 52px 42px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(90deg,#f2efe3,var(--paper) 15%,#f8f6ec 100%);
  border-radius: 5px 0 0 5px;
}
.cover-label { display: block; margin: 0 0 24px; }
.cover-illustration { width: 112px; height: 100px; margin-bottom: 17px; color: #718364; }
.cover-title { margin: 0; font: 500 37px/1.45 var(--serif); letter-spacing: .16em; color: #44513e; }
.cover-note { margin: 14px 0 26px; font: 14px/2 var(--serif); color: #8a8b78; }
.cover-owner { margin-top: 20px; padding-top: 16px; border-top: 1px solid #dedecf; color: #8b8c7c; font-size: 10px; letter-spacing: .12em; }
.notebook-unlock {
  position: relative; padding: 76px 56px 35px;
  background-image: linear-gradient(transparent 31px,rgba(131,150,122,.12) 31px 32px);
  background-size: 100% 32px; background-position: 0 13px;
  border-radius: 0 12px 12px 0;
}
.unlock-page-label { display: inline-block; padding: 3px 8px; margin-bottom: 12px; border: 1px solid #d6dbc8; color: #8a937a; font: 10px/1.5 ui-monospace,Consolas,monospace; transform: rotate(-3deg); }
.notebook-unlock > p { color: #8a8a78; font-size: 12px; }
.notebook-unlock h2 { font-size: 25px; color: #414e3b; }
label { display: block; font-size: 12px; color: #777f69; margin: 18px 0 7px; }
input, textarea {
  width: 100%; border: 1px solid #d4d7c6; border-radius: 4px;
  color: var(--ink); background: rgba(255,254,247,.92); padding: 11px 13px;
}
input:focus, textarea:focus { border-color: #859977; }
input[type=password] { letter-spacing: .22em; }
button {
  cursor: pointer; min-height: 43px; border: 1px solid #cbd2bf; border-radius: 4px;
  background: #f8f8ef; color: #57644e; padding: 9px 17px;
  transition: background .18s, transform .18s, box-shadow .18s;
}
button:hover { background: #ecf0e3; }
button:disabled { opacity: .6; cursor: wait; }
.primary { color: #fffcf1; border-color: var(--accent); background: var(--accent); box-shadow: 0 3px 5px #344c3215; }
.primary:hover { background: #40563d; box-shadow: 0 4px 8px #344c3222; }
.unlock-submit { width: 100%; margin-top: 18px; }
.error { min-height: 22px; margin-top: 10px; color: #a65443; font-size: 12px; }
.owner-login { margin-top: 12px; color: #878b78; font-size: 11px; }
.owner-login a { border-bottom: 1px dashed #b9c1aa; padding-bottom: 2px; }
.diary-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.diary-layout.has-timeline { grid-template-columns: 138px minmax(0, 1fr); gap: 32px; }
.diary-timeline { position: sticky; top: 28px; min-width: 0; align-self: start; padding: 7px 0; }
.diary-timeline h2 { margin: 0 0 4px; font: 600 15px/1.6 var(--serif); color: #52634a; letter-spacing: .06em; }
.timeline-hint { color: #828b75; font-size: 10px; margin: 0 0 21px; }
.timeline-groups { max-height: calc(100dvh - 130px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #bac5ad transparent; padding: 0 7px 6px 0; }
.timeline-month + .timeline-month { margin-top: 20px; }
.timeline-month h3 { margin: 0 0 10px 18px; font: 600 11px/1.5 ui-monospace,Consolas,monospace; letter-spacing: .06em; color: #758467; }
.timeline-month ol { position: relative; list-style: none; padding: 0; margin: 0; }
.timeline-month ol::before { content: ''; position: absolute; top: 19px; bottom: 19px; left: 3px; width: 1px; background: #c1cbb4; }
.timeline-month li { margin: 0 0 4px; }
.timeline-link { position: relative; display: block; min-width: 0; padding: 10px 7px 10px 18px; border-radius: 4px; color: #818b74; transition: color .18s, background .18s; }
.timeline-link::before { content: ''; position: absolute; left: 0; top: 16px; width: 7px; height: 7px; border: 1px solid #b2bea4; border-radius: 50%; background: #e9ede1; box-shadow: 0 0 0 3px var(--bg); }
.timeline-link:hover { color: #4d6345; background: #dfe5d6; }
.timeline-link[aria-current] { color: #3f5b37; background: #dbe3d0; }
.timeline-link[aria-current]::before { background: #617d52; border-color: #617d52; box-shadow: 0 0 0 3px #e3e9da; }
.timeline-date { display: block; font: 600 12px/1.6 ui-monospace,Consolas,monospace; letter-spacing: .025em; }
#notebook { position: relative; min-width: 0; padding: 28px 46px 38px 64px; border: 1px solid #d7dacb; border-radius: 4px 10px 10px 4px; background: var(--paper); box-shadow: 0 3px 0 #eeecdf, 0 5px 0 #c5cbb6, 0 20px 45px -28px #4e5e4355; }
#notebook::before { content: ''; position: absolute; top: 0; bottom: 0; left: 35px; width: 1px; background: rgba(185,111,91,.25); }
#notebook::after { content: ''; position: absolute; top: 22px; bottom: 22px; left: -8px; width: 16px; background: radial-gradient(ellipse at center,#e9eae1 0 4px,#a6ae98 4.5px 5.5px,transparent 6px) center top/16px 52px repeat-y; pointer-events: none; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid #dedfcf; margin-bottom: 12px; }
.toolbar > span { font: 12px var(--serif); color: #81866f; letter-spacing: .06em; }
.tools { display: flex; gap: 9px; }
.tools button { font-size: 12px; }
article { position: relative; padding: 29px 0 36px; border-bottom: 1px dashed #d2d6c4; animation: page-in .3s ease; scroll-margin-top: 24px; }
article time { display: inline-block; padding: 3px 10px; margin-bottom: 10px; background: #edf0e2; color: #79866b; font: 11px/1.5 ui-monospace,Consolas,monospace; border-radius: 2px; }
article h2 { font-weight: 500; letter-spacing: .025em; color: #414c38; }
.entry-body { white-space: pre-wrap; overflow-wrap: anywhere; font: 17px/34px var(--serif); color: #535748; background: repeating-linear-gradient(transparent 0 33px,rgba(134,151,120,.18) 33px 34px); }
.entry-actions { display: flex; gap: 8px; margin-top: 20px; }
.entry-actions button { min-height: 35px; padding: 5px 12px; font-size: 11px; }
.empty { padding: 50px 12px 65px; text-align: center; color: #9b9b85; font: 15px/2 var(--serif); }
.empty svg { display: block; width: 106px; height: 85px; margin: 0 auto 24px; color: #a2ad92; }
.empty p { margin: 0; }
.editor { margin: 25px 0; padding: 24px; background: #f5f4e9; border: 1px solid #dfe1d0; border-radius: 4px; }
.editor h2 { font-size: 23px; font-weight: 500; }
textarea { min-height: 320px; padding: 10px 13px; resize: vertical; font: 17px/32px var(--serif); background: repeating-linear-gradient(#fffdf6 0 31px,#dfe4d4 31px 32px); background-origin: content-box; }
.editor-buttons { display: flex; gap: 10px; margin-top: 20px; }
.footer-note { margin: 36px 0 12px; text-align: center; color: #9b9e8d; font: 11px/1.8 var(--serif); letter-spacing: .16em; }
[hidden] { display: none !important; }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
  header { margin: 0 18px; padding: 18px 0; }
  header nav { gap: 20px; }
  main { padding: 0 22px; margin-top: 30px; }
  .journal-heading { margin-bottom: 25px; align-items: start; }
  .journal-date { font-size: 10px; max-width: 118px; padding-top: 5px; }
  .lock-card { min-height: auto; grid-template-columns: 1fr; }
  .lock-card::before { display: none; }
  .lock-card::after { height: 55px; right: 24px; }
  .notebook-cover { min-height: auto; padding: 28px 30px; border-radius: 5px 12px 0 0; border-bottom: 1px solid #dedfcd; }
  .cover-label { margin-bottom: 10px; }
  .cover-illustration { position: absolute; right: 25px; top: 45px; width: 70px; height: 68px; opacity: .7; }
  .cover-title { font-size: 28px; }
  .cover-note { margin: 6px 0 0; font-size: 13px; }
  .cover-owner { display: none; }
  .notebook-unlock { padding: 30px; border-radius: 0 0 12px 5px; }
  .diary-layout.has-timeline { display: block; }
  .diary-timeline { position: sticky; top: 0; z-index: 5; margin: 0 -8px 20px; padding: 11px 8px 9px; background: #e8ebe4f5; border-bottom: 1px solid #cfd7c3; backdrop-filter: blur(8px); }
  .diary-timeline h2 { margin: 0 0 7px; font-size: 12px; }
  .timeline-hint { display: none; }
  .timeline-groups { display: flex; gap: 10px; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 2px 0 5px; }
  .timeline-month { flex: 0 0 auto; }
  .timeline-month + .timeline-month { margin-top: 0; }
  .timeline-month h3 { display: none; }
  .timeline-month ol { display: flex; gap: 7px; }
  .timeline-month ol::before { display: none; }
  .timeline-month li { margin: 0; }
  .timeline-link { padding: 10px 12px; border: 1px solid #cdd6c0; background: #eef1e7; min-height: 42px; }
  .timeline-link::before { display: none; }
  .timeline-link[aria-current] { background: #52684f; border-color: #52684f; color: #fffdf1; }
  .timeline-date { font-size: 11px; }
  article { scroll-margin-top: 114px; }
  #notebook { padding: 22px 20px 30px 36px; }
  #notebook::before { left: 21px; }
  #notebook::after { left: -7px; width: 14px; }
  .toolbar { align-items: start; flex-wrap: wrap; }
  .editor { padding: 17px; }
  .entry-body { font-size: 16px; line-height: 32px; background-size: 100% 32px; }
}
@media (max-width: 390px) {
  .journal-date { display: none; }
  header nav { gap: 14px; }
  .notebook-unlock { padding: 27px 24px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
