:root {
  --ink: #202622;
  --muted: #737a75;
  --line: #e1e5e1;
  --paper: #fbfcfa;
  --accent: #346b60;
  --accent-soft: #e6f0eb;
  --warm: #b86f48;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

.page-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1440px; min-height: 100vh; margin: auto; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 38px 34px 28px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 500 12px/1 "SFMono-Regular", Menlo, monospace; letter-spacing: .13em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--ink); border-radius: 50%; }
.brand-mark img { width: 13px; height: 13px; }
.profile { margin-top: 130px; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 600 16px/1 "Songti SC", SimSun, serif; }
.profile-name { margin: 16px 0 5px; font-weight: 600; }
.profile-copy { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.side-nav { display: grid; gap: 15px; margin-top: 74px; }
.nav-link { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 13px; text-decoration: none; }
.nav-link img { width: 15px; height: 15px; opacity: .58; }
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link:hover img, .nav-link.active img { opacity: 1; }
.nav-link.active::after { content: ""; width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--warm); }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; color: var(--muted); font: 400 10px "SFMono-Regular", Menlo, monospace; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #6aaf89; box-shadow: 0 0 0 3px #e6f3eb; }
.foot-year { margin-left: auto; color: #b7bcb7; }

.content { max-width: 1160px; padding: 0 8.8vw 0 7.6vw; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 90px; border-bottom: 1px solid var(--line); color: var(--muted); font: 400 10px "SFMono-Regular", Menlo, monospace; letter-spacing: .08em; }
.intro { max-width: 720px; padding: 78px 0 84px; }
.eyebrow { margin: 0 0 20px; color: var(--accent); font: 500 10px "SFMono-Regular", Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
.intro h1 { margin: 0; font: 600 44px/1.25 "Songti SC", SimSun, serif; }
.intro-copy { max-width: 560px; margin: 24px 0 0; color: var(--muted); font-size: 14px; }

.search-section { padding: 0 0 62px; }
.search-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.search-heading .eyebrow { margin-bottom: 6px; }
.search-heading h2 { margin: 0; font: 600 21px/1.35 "Songti SC", SimSun, serif; }
.search-heading > span { color: var(--muted); font: 400 10px "SFMono-Regular", Menlo, monospace; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) 170px 170px 44px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.search-control { display: flex; align-items: center; min-width: 0; height: 48px; }
.search-control input { min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 12px inherit; }
.search-control input::placeholder { color: #9ba29c; }
.search-keyword { gap: 10px; padding: 0 14px 0 2px; }
.search-keyword > img { width: 16px; height: 16px; opacity: .62; }
.search-keyword input { flex: 1; }
.search-date { gap: 12px; padding: 0 13px; border-left: 1px solid var(--line); }
.search-date label { color: var(--muted); font: 500 10px "SFMono-Regular", Menlo, monospace; }
.search-date input { flex: 1; }
.search-clear { display: grid; place-items: center; width: 44px; height: 48px; padding: 0; border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; }
.search-clear img { width: 16px; height: 16px; }
.search-clear:disabled { opacity: .25; cursor: default; }
.search-empty { margin: 18px 0 0; color: var(--warm); font-size: 12px; }

.daily-entry { padding: 24px 0 0; border-top: 1px solid var(--ink); }
.entry-meta { display: flex; align-items: center; gap: 15px; color: var(--muted); font: 400 10px "SFMono-Regular", Menlo, monospace; }
.entry-number { color: var(--ink); }
.entry-rule { width: 50px; height: 1px; background: var(--line); }
.entry-state { padding: 4px 8px; background: var(--accent-soft); color: var(--accent); font-size: 9px; }
.entry-grid { display: grid; grid-template-columns: 27% 1fr; gap: 6vw; padding: 48px 0 62px; }
.entry-heading h2 { margin: 0 0 13px; font: 600 23px/1.4 "Songti SC", SimSun, serif; }
.entry-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.entry-content { min-width: 0; border-top: 1px solid var(--line); }
.task-block + .task-block { border-top: 1px solid var(--line); }
.markdown-content h2 { margin: 0; padding: 21px 0 5px; font-size: 14px; line-height: 1.45; }
.markdown-content h3 { margin: 18px 0 8px; font-size: 13px; }
.markdown-content p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.markdown-content strong { color: var(--warm); font-weight: 500; }
.markdown-content ol, .markdown-content ul { margin: 13px 0 18px; padding: 15px 18px 15px 38px; background: #f2f4f1; border-left: 2px solid var(--accent); color: #465049; font-size: 12px; }
.markdown-content li + li { margin-top: 7px; }
.markdown-content code { padding: 1px 4px; color: #344a43; font: 400 11px/1.7 "SFMono-Regular", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.entry-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; }
.entry-count { color: var(--muted); font: 400 10px "SFMono-Regular", Menlo, monospace; }
.unlock-button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.unlock-button img { width: 15px; height: 15px; }
.unlock-button:hover { color: var(--accent); }
.private-view .unlock-button { color: var(--warm); }
.private-view .unlock-button:hover { color: #8f4f30; }

.archive-section { padding: 96px 0 111px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.archive-row { display: grid; grid-template-columns: 130px 1fr 80px 30px; gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; text-decoration: none; }
.archive-date, .archive-count { color: var(--muted); font: 400 10px "SFMono-Regular", Menlo, monospace; }
.archive-count { text-align: right; }
.archive-arrow { width: 17px; height: 17px; justify-self: end; opacity: .65; }
.about-section { display: grid; grid-template-columns: 1fr 1fr; gap: 7vw; margin: 0 -8.8vw 0 -7.6vw; padding: 92px 8.8vw 104px 7.6vw; background: #eef3ef; }
.about-section h2 { margin: 0; font: 600 34px/1.42 "Songti SC", SimSun, serif; }
.about-copy { max-width: 390px; padding-top: 40px; color: #5e6962; font-size: 13px; }
.about-copy p { margin: 0 0 22px; }
.about-copy strong { color: var(--ink); font-weight: 600; }
.signature { display: block; margin-top: 36px; color: var(--accent); font: 400 11px "SFMono-Regular", Menlo, monospace; }
.footer { display: flex; justify-content: space-between; padding: 26px 0; color: #9da49e; font: 400 9px "SFMono-Regular", Menlo, monospace; letter-spacing: .08em; }

.unlock-dialog { width: min(440px, calc(100% - 36px)); padding: 0; border: 0; background: #fff; color: var(--ink); box-shadow: 0 22px 70px #1d2a2122; }
.unlock-dialog::backdrop { background: #17241e66; backdrop-filter: blur(3px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--line); color: var(--accent); font: 500 10px "SFMono-Regular", Menlo, monospace; letter-spacing: .12em; }
.dialog-top button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.dialog-top button img { width: 18px; height: 18px; }
.unlock-dialog h2 { margin: 30px 26px 7px; font: 600 25px "Songti SC", SimSun, serif; }
.unlock-dialog > p { margin: 0 26px 25px; color: var(--muted); font-size: 12px; }
.unlock-dialog form { padding: 0 26px; }
.unlock-dialog label { display: block; margin-bottom: 8px; color: var(--muted); font: 500 10px "SFMono-Regular", Menlo, monospace; }
.input-wrap { display: flex; border: 1px solid #cfd6d0; }
.input-wrap:focus-within { border-color: var(--accent); }
.input-wrap input { width: 100%; padding: 12px; border: 0; outline: 0; background: transparent; font: 400 13px inherit; }
.input-wrap button { padding: 0 12px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.input-wrap button img { width: 17px; height: 17px; opacity: .68; }
.submit-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 15px; padding: 13px; border: 0; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.submit-button img { width: 16px; height: 16px; filter: invert(1); }
.error-message { min-height: 20px; margin: 10px 0 0 !important; color: #b75a46 !important; font-size: 11px !important; }
.dialog-note { margin-top: 21px; padding: 17px 26px; border-top: 1px solid var(--line); color: #9aa39b; font: 400 9px "SFMono-Regular", Menlo, monospace; }
.toast { position: fixed; bottom: 25px; left: 50%; padding: 9px 15px; background: var(--ink); color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.private-view .entry-content { border-top-color: var(--accent); }

@media (max-width: 850px) {
  .page-shell { display: block; }
  .sidebar { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; height: auto; padding: 24px; border-right: 0; }
  .profile, .side-nav { display: none; }
  .sidebar-foot { grid-column: 2; grid-row: 1; margin: 0; }
  .content { padding: 0 24px; }
  .topbar { height: 62px; }
  .intro { padding: 58px 0 64px; }
  .intro h1 { font-size: 34px; }
  .search-section { padding-bottom: 52px; }
  .search-form { grid-template-columns: minmax(0, 1fr) 44px; }
  .search-date { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
  .search-date-start { grid-row: 2; }
  .search-date-end { grid-row: 3; }
  .search-clear { grid-column: 2; grid-row: 1; }
  .entry-grid { display: block; padding-top: 36px; }
  .entry-heading { margin-bottom: 34px; }
  .archive-section { padding: 72px 0 80px; }
  .about-section { display: block; margin: 0 -24px; padding: 72px 24px 78px; }
  .about-copy { padding-top: 30px; }
  .archive-row { grid-template-columns: 100px 1fr 45px 20px; gap: 10px; }
  .section-heading span { display: none; }
}
