/* ============================================================
   页间 · 阅读日志
   纸张、油墨、一点朱砂。所有视觉都从这三个词长出来。
   ============================================================ */

:root {
  --paper: #f5f0e6;
  --paper-2: #faf6ee;
  --card: #fffdf8;
  --ink: #231e18;
  --ink-2: #4d443a;
  --muted: #8b8073;
  --line: #e0d6c6;
  --line-2: #ece4d6;
  --accent: #a34e2c;
  --accent-ink: #843c20;
  --accent-soft: #f1e0d3;
  --shadow-sm: 0 1px 2px rgba(60, 45, 25, .05);
  --shadow: 0 10px 24px -12px rgba(60, 45, 25, .28), 0 2px 6px rgba(60, 45, 25, .04);
  --shadow-lg: 0 26px 50px -24px rgba(60, 45, 25, .4), 0 4px 12px rgba(60, 45, 25, .05);
  --r: 12px;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  --kai: "KaiTi", "STKaiti", "Kaiti SC", "Songti SC", serif;
  --num: Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --paper: #14120f;
  --paper-2: #1a1713;
  --card: #201c17;
  --ink: #ece2d2;
  --ink-2: #c9bdac;
  --muted: #8d8173;
  --line: #302a22;
  --line-2: #262119;
  --accent: #d08a62;
  --accent-ink: #e3a37c;
  --accent-soft: #36261d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 12px 26px -14px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, .8), 0 4px 14px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
}

/* 纸张的呼吸：一层极淡的光斑 + 一层极淡的颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(255, 250, 238, .9), transparent 60%),
    radial-gradient(900px 600px at 6% 4%, rgba(238, 226, 205, .55), transparent 55%);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(1100px 650px at 80% -10%, rgba(90, 66, 44, .22), transparent 62%),
    radial-gradient(900px 600px at 4% 6%, rgba(52, 40, 28, .3), transparent 58%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent-soft); color: var(--ink); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, dl, dd, blockquote, figure { margin: 0; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------- 骨架 */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 34px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  border-right: 1px solid var(--line-2);
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-2) 72%, transparent), transparent 70%);
  backdrop-filter: blur(6px);
}

.main {
  min-width: 0;
  padding: 58px clamp(22px, 4.6vw, 76px) 40px;
}

.view {
  max-width: 1060px;
  animation: viewIn .55s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------- 侧栏 */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.brand-mark { color: var(--ink); display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .14em;
}
.brand-text small {
  font-size: 9px;
  letter-spacing: .28em;
  color: var(--muted);
  margin-top: 4px;
}

.nav { display: flex; flex-direction: column; }
.nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid transparent;
  color: var(--ink-2);
  transition: color .2s ease, padding-left .25s ease;
}
.nav a span { font-family: var(--serif); font-size: 17px; letter-spacing: .1em; }
.nav a em {
  font-family: var(--num);
  font-style: normal;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
  opacity: .7;
}
.nav a:hover { color: var(--ink); padding-left: 5px; }
.nav a.is-active { color: var(--accent-ink); }
.nav a.is-active span { position: relative; }
.nav a.is-active span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--accent);
}
.nav a.is-active em { color: var(--accent); opacity: 1; }

.rail-reading { display: flex; flex-direction: column; gap: 12px; }
.rail-reading:empty { display: none; }
.rail-label {
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--muted);
  text-transform: uppercase;
}
.rail-book {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 2px 0;
  border-radius: 6px;
  transition: transform .2s ease;
}
.rail-book:hover { transform: translateX(3px); }
.rail-book .mini-cover {
  width: 24px;
  height: 34px;
  border-radius: 2px 4px 4px 2px;
  flex: none;
  box-shadow: 0 2px 5px rgba(40, 30, 15, .25);
  background: var(--c1, #555);
}
.rail-book .mini-meta { min-width: 0; }
.rail-book .mini-title {
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-book .mini-line { display: block; height: 2px; background: var(--line); margin-top: 6px; border-radius: 2px; overflow: hidden; }
.rail-book .mini-line i { display: block; height: 100%; background: var(--accent); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.rail-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: color .2s ease;
}
.rail-btn:hover { color: var(--ink); }
.rail-btn svg { flex: none; opacity: .8; }
.ico-moon { display: none; }
[data-theme="dark"] .ico-moon { display: block; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .cover { filter: brightness(.78) saturate(.9); }
[data-theme="dark"] .cover-badge { background: rgba(0, 0, 0, .45); }

/* ---------------------------------------------------------- 页头 */

.eyebrow {
  font-family: var(--num);
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  max-width: 120px;
}

.page-title {
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: .015em;
}
.page-title .thin { color: var(--muted); }

.lede {
  margin-top: 14px;
  max-width: 46em;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.85;
}
.lede em { font-style: normal; color: var(--accent-ink); }

/* ---------------------------------------------------------- 数字条 */

.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 40px 0 44px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.figure {
  padding: 20px 18px 18px;
  border-left: 1px solid var(--line-2);
}
.figure:first-child { border-left: 0; padding-left: 0; }
.figure dt {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  margin-bottom: 6px;
}
.figure dd {
  font-family: var(--num);
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1;
  letter-spacing: -.01em;
}
.figure dd small {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
  margin-left: 5px;
  letter-spacing: 0;
}

/* ---------------------------------------------------------- 工具条 */

.tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.search {
  position: relative;
  flex: 1 1 200px;
  max-width: 300px;
}
.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  transition: border-color .2s ease, background .2s ease;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none;
  border-color: var(--ink-2);
  background: var(--card);
}

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  border: 0;
  background: none;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.chip:hover { color: var(--ink); }
.chip.is-on { background: var(--ink); color: var(--paper); }
.chip .n { font-family: var(--num); font-size: 10.5px; opacity: .6; margin-left: 5px; }

.spacer { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line); }
.btn-danger { color: #a33; border-color: color-mix(in srgb, #a33 30%, var(--line)); }
.btn-danger:hover { border-color: #a33; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn svg { flex: none; }

/* ---------------------------------------------------------- 书架 */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  gap: 38px 26px;
}

.book-card {
  display: block;
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  animation: cardIn .5s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 3px 8px 8px 3px;
  padding: 17px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f8f1e3;
  overflow: hidden;
  background: linear-gradient(150deg, var(--c1, #4a4038), var(--c2, #2c2620));
  box-shadow: 0 12px 20px -14px rgba(45, 32, 16, .55), 0 2px 4px rgba(45, 32, 16, .12);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
  isolation: isolate;
}
.book-card:hover .cover {
  transform: translateY(-6px) rotate(-.5deg);
  box-shadow: 0 26px 34px -20px rgba(45, 32, 16, .6), 0 4px 8px rgba(45, 32, 16, .14);
}
/* 书脊的弧度 */
.cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 11px;
  z-index: 2;
  background: linear-gradient(90deg, rgba(0, 0, 0, .34), rgba(255, 255, 255, .14) 55%, rgba(0, 0, 0, .1));
}
/* 纸面反光 */
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 42%),
              radial-gradient(120% 80% at 100% 100%, rgba(0, 0, 0, .26), transparent 60%);
}
.cover-frame {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 2px;
  pointer-events: none;
  z-index: 3;
}
.cover-title {
  position: relative;
  z-index: 4;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: .04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-author {
  position: relative;
  z-index: 4;
  font-size: 10.5px;
  letter-spacing: .1em;
  opacity: .78;
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.cover.has-img { padding: 0; }
.cover.has-img .cover-frame { border-color: rgba(0, 0, 0, .1); }
.cover.has-badge .cover-title { padding-right: 38px; }
.cover-badge {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  font-size: 9.5px;
  letter-spacing: .12em;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .32);
  backdrop-filter: blur(4px);
  color: #f6eddd;
}

.book-info { padding-top: 14px; }
.book-info h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .01em;
  min-height: 2.9em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-info .by {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-line {
  margin-top: 11px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.book-line i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.book-meta {
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.book-meta .num { font-family: var(--num); }

.add-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  aspect-ratio: 2 / 3;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.add-tile:hover { border-color: var(--ink-2); color: var(--ink); background: color-mix(in srgb, var(--card) 50%, transparent); }
.add-tile .plus { font-family: var(--num); font-size: 30px; line-height: 1; font-weight: 300; }
.add-tile span.txt { font-size: 12px; letter-spacing: .14em; }

/* ---------------------------------------------------------- 空状态 */

.empty {
  padding: 30px 0 8px;
  display: grid;
  gap: 20px;
  max-width: 620px;
}
.empty h2 { font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.5; }
.empty p { color: var(--ink-2); font-size: 14px; line-height: 1.9; }
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------- 单本书 */

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 34px;
  transition: color .2s ease, gap .2s ease;
}
.backlink:hover { color: var(--ink); gap: 10px; }

.book-hero {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}
.book-hero .cover { width: 208px; }

.book-hero-body { min-width: 0; }
.book-hero-body .eyebrow { margin-bottom: 12px; }
.book-hero-body h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.1vw, 38px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: .01em;
}
.book-hero-body .author {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: .04em;
}

.progress-block { margin-top: 26px; }
.progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.progress-top .pct { font-family: var(--num); font-size: 22px; line-height: 1; }
.progress-top .pages { font-size: 11.5px; color: var(--muted); font-family: var(--num); }
.progress-track { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  border-radius: 3px;
  transition: width .6s cubic-bezier(.2, .7, .2, 1);
}

.book-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
}
.book-facts div { display: flex; flex-direction: column; gap: 3px; }
.book-facts dt { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); }
.book-facts dd { font-size: 13.5px; }
.book-facts dd .num { font-family: var(--num); font-size: 16px; }

.hero-actions { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }

/* ---------------------------------------------------------- 记录表单 */

.composer {
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--paper-2) 60%, transparent);
}
.composer-head h2 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .06em;
}
.composer-head .hint { font-size: 11.5px; color: var(--muted); }

.composer form { padding: 22px 24px 20px; display: grid; gap: 18px; }

.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
}
.field > label .opt { opacity: .55; letter-spacing: 0; }
.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 78px; line-height: 1.8; }
.field textarea.kai { font-family: var(--kai); font-size: 15.5px; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: .75; }

.composer-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.composer-foot .note { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------- 时间线 */

.timeline-section { margin-top: 58px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .08em;
}
.section-head .count { font-size: 11.5px; color: var(--muted); letter-spacing: .1em; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 26px; }
.entry {
  position: relative;
  padding-left: 30px;
  animation: entryIn .45s ease both;
}
@keyframes entryIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.entry::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  bottom: -26px;
  width: 1px;
  background: var(--line-2);
}
.entry:last-child::before { display: none; }
.entry::after {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--accent);
}
.entry-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.entry-date {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .04em;
}
.entry-date span { font-size: 11px; color: var(--muted); margin-left: 7px; letter-spacing: .1em; }
.pill {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-family: var(--num);
  letter-spacing: .02em;
  white-space: nowrap;
}
.pill.accent { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 25%, var(--line-2)); background: var(--accent-soft); }
.entry-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .2s ease;
}
.entry:hover .entry-actions, .entry:focus-within .entry-actions { opacity: 1; }
.icon-btn {
  border: 0;
  background: none;
  padding: 4px 7px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 5px;
  transition: color .2s ease, background .2s ease;
}
.icon-btn:hover { color: var(--ink); background: var(--paper-2); }
.icon-btn.danger:hover { color: #b0392b; }

.entry-quote {
  font-family: var(--kai);
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink);
  padding: 12px 18px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 34%, transparent);
  border-radius: 0 6px 6px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.entry-note {
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-2);
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.entry-quote + .entry-note { margin-top: 12px; }
.entry-empty { font-size: 13px; color: var(--muted); font-style: normal; }

/* ---------------------------------------------------------- 日志页 */

.log-groups { display: flex; flex-direction: column; gap: 46px; }
.log-group { animation: entryIn .4s ease both; }
.log-date {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.log-date h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .04em;
}
.log-date .wk { font-size: 11.5px; color: var(--muted); letter-spacing: .12em; }
.log-date .sum { margin-left: auto; font-size: 11.5px; color: var(--muted); font-family: var(--num); }

.log-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 12px 14px 0;
  border-radius: 8px;
  transition: background .2s ease;
}
.log-item:hover { background: color-mix(in srgb, var(--card) 60%, transparent); }
.log-item .mini-cover {
  width: 34px;
  height: 48px;
  border-radius: 2px 5px 5px 2px;
  background: linear-gradient(150deg, var(--c1, #4a4038), var(--c2, #2c2620));
  box-shadow: 0 3px 7px rgba(45, 32, 16, .25);
  margin-top: 2px;
  overflow: hidden;
}
.log-item .mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.log-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.log-title strong { font-family: var(--serif); font-weight: 500; font-size: 15.5px; }
.log-title a:hover { color: var(--accent-ink); }
.log-body { margin-top: 7px; display: flex; flex-direction: column; gap: 7px; }
.log-quote {
  font-family: var(--kai);
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.log-note {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------- 随记 */

.form-row.two { grid-template-columns: 1fr 1fr; }

.note-month {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 40px 0 2px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
#noteList > section:first-child .note-month { margin-top: 6px; }
.note-month span { font-family: var(--serif); font-size: 15px; letter-spacing: .1em; }
.note-month em {
  font-style: normal;
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--muted);
}

.note-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-2);
  animation: entryIn .4s ease both;
}
.note-item:last-child { border-bottom: 0; }
.note-date { display: flex; flex-direction: column; gap: 3px; padding-top: 1px; }
.note-date strong {
  font-family: var(--num);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
}
.note-date span { font-size: 10.5px; letter-spacing: .08em; color: var(--muted); }
.note-text {
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.note-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.note-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .2s ease;
}
.note-item:hover .note-actions,
.note-item:focus-within .note-actions { opacity: 1; }
.note-mark {
  width: 34px;
  height: 34px;
  margin-top: 3px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0;
  flex: none;
}
.count-hint { font-size: 11.5px; letter-spacing: .1em; color: var(--muted); }

/* 书架上的一小段随记 */
.recent-notes { margin-top: 66px; }
.recent-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-2);
  transition: background .2s ease;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row .d {
  font-family: var(--num);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .03em;
  padding-top: 2px;
  white-space: nowrap;
}
.recent-row p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s ease;
}
.recent-row:hover p { color: var(--ink); }
.section-head .more {
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted);
  transition: color .2s ease;
}
.section-head .more:hover { color: var(--accent-ink); }

/* ---------------------------------------------------------- 统计页 */

.heat-wrap { margin: 44px 0 10px; }
.heat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.heat-head h2 { font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .06em; }
.heat-head .legend { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
.heat-scroll { overflow-x: auto; padding-bottom: 6px; }
.heat-months { display: flex; gap: 4px; margin-bottom: 5px; }
.heat-months .hm {
  width: 13px;
  flex: none;
  font-size: 9.5px;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
}
.heat-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 13px);
  grid-auto-columns: 13px;
  justify-content: start;
  gap: 4px;
}
.heat-cell {
  width: 13px;
  height: 13px;
  border-radius: 2.5px;
  background: color-mix(in srgb, var(--line) 78%, transparent);
}
.heat-cell.is-blank { background: transparent; }
.heat-cell[data-l="1"] { background: color-mix(in srgb, var(--accent) 28%, var(--paper)); }
.heat-cell[data-l="2"] { background: color-mix(in srgb, var(--accent) 58%, var(--paper)); }
.heat-cell[data-l="3"] { background: var(--accent); }
.heat-cell.is-today { box-shadow: 0 0 0 1px var(--ink); }
.heat-legend-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.rank { margin-top: 52px; }
.rank h2 { font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .06em; margin-bottom: 18px; }
.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.rank-row .name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .track { height: 4px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.rank-row .track i { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }
.rank-row .val { font-family: var(--num); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------- 页脚 */

.site-foot {
  margin-top: 90px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
}

/* ---------------------------------------------------------- 同步状态 / 本地模式 */

.sync-row { margin-bottom: 1px; }
.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 14%, transparent);
  transition: background .3s ease;
}
.sync-row[data-state="ok"] .sync-dot { background: #5b8560; box-shadow: 0 0 0 3px rgba(91, 133, 96, .16); }
.sync-row[data-state="busy"] .sync-dot { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.sync-row[data-state="off"] .sync-dot { background: #b8802f; box-shadow: 0 0 0 3px rgba(184, 128, 47, .16); }
@keyframes pulse { 50% { opacity: .3; } }

.mode-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -16px 0 30px;
  padding: 9px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 42%, transparent);
  border-radius: 9px;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--ink-2);
}
.mode-banner[hidden] { display: none; }
.mode-banner button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--accent-ink);
  cursor: pointer;
}
.mode-banner button:hover { text-decoration: underline; }

/* ---------------------------------------------------------- 打卡 */

.habit-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.habit-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line-2);
  transition: background .2s ease;
}
.habit-row:hover { background: color-mix(in srgb, var(--card) 55%, transparent); }
.habit-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--hc, var(--accent)) 45%, var(--line));
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  transition: transform .18s ease, background .2s ease, border-color .2s ease;
}
.habit-toggle:hover { border-color: var(--hc, var(--accent)); transform: scale(1.07); }
.habit-row.is-done .habit-toggle {
  background: var(--hc, var(--accent));
  border-color: var(--hc, var(--accent));
}
.habit-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.habit-name {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .02em;
  line-height: 1.4;
}
.habit-meta {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.habit-week { display: flex; gap: 4px; }
.habit-week i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  display: block;
}
.habit-week i.on { background: var(--hc, var(--accent)); }
.habit-actions { margin-top: 20px; }

.habit-month { margin-top: 54px; }
.cal { max-width: 420px; }
.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 7px;
}
.cal-head span {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  letter-spacing: .06em;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  background: color-mix(in srgb, var(--line) 50%, transparent);
  display: grid;
  place-items: center;
  font-family: var(--num);
  font-size: 11px;
  color: var(--muted);
  transition: background .2s ease;
}
.cal-cell.is-blank { background: transparent; }
.cal-cell.is-future { opacity: .4; }
.cal-cell[data-l="1"] { background: color-mix(in srgb, var(--accent) 20%, var(--paper)); color: var(--ink-2); }
.cal-cell[data-l="2"] { background: color-mix(in srgb, var(--accent) 38%, var(--paper)); color: var(--ink-2); }
.cal-cell[data-l="3"] { background: color-mix(in srgb, var(--accent) 62%, var(--paper)); color: #fff; }
.cal-cell[data-l="4"] { background: var(--accent); color: #fff; }
.cal-cell.is-today { box-shadow: 0 0 0 1.5px var(--ink); }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preset-row .chip { border: 1px dashed var(--line); }

/* ---------------------------------------------------------- 登录 / 首次设置 */

body.auth-mode .rail,
body.auth-mode .site-foot,
body.auth-mode .mode-banner { display: none; }
body.auth-mode .app { grid-template-columns: minmax(0, 1fr); }
body.auth-mode .main {
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: 48px 24px;
}
body.auth-mode .view { max-width: 430px; width: 100%; margin: 0 auto; }

.auth { display: grid; gap: 16px; }
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--num);
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
}
.auth-brand svg { color: var(--ink); }
.auth h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .02em;
}
.auth .lede { margin-top: 0; }
.auth-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 15px;
}
.auth-card form { display: grid; gap: 15px; }
.auth-msg {
  min-height: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #b0392b;
}
.auth-msg:empty { display: none; }
.auth-note {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}
.auth .field > label { letter-spacing: .14em; }

/* ---------------------------------------------------------- 弹窗 */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 22, 14, .42);
  backdrop-filter: blur(5px);
  animation: fadeIn .25s ease both;
}
.modal-root[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .32s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.modal-lg { max-width: 620px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 500; letter-spacing: .06em; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.modal-close {
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.modal-close:hover { color: var(--ink); background: var(--paper-2); }
.modal-body { padding: 22px 26px 26px; display: grid; gap: 16px; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 26px 24px;
  flex-wrap: wrap;
}
.modal-foot .left { margin-right: auto; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span2 { grid-column: 1 / -1; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  box-shadow: 0 2px 5px rgba(40, 30, 15, .2);
  transition: transform .18s ease, border-color .18s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-on { border-color: var(--ink); }

.cover-pick { display: flex; gap: 16px; align-items: flex-start; }
.cover-preview {
  width: 76px;
  aspect-ratio: 2 / 3;
  border-radius: 2px 5px 5px 2px;
  background: linear-gradient(150deg, var(--c1, #4a4038), var(--c2, #2c2620));
  box-shadow: 0 6px 12px -6px rgba(45, 32, 16, .5);
  flex: none;
  overflow: hidden;
  position: relative;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-pick .side { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }

.danger-zone {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.danger-zone .note { font-size: 11.5px; color: var(--muted); flex: 1 1 100%; line-height: 1.7; }

.confirm-body { padding: 4px 26px 8px; color: var(--ink-2); font-size: 14px; line-height: 1.85; }
.confirm-body strong { color: var(--ink); font-weight: 500; }

/* ---------------------------------------------------------- 提示条 */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  letter-spacing: .06em;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: toastIn .3s cubic-bezier(.2, .7, .2, 1) both;
}
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------- 响应式 */

@media (max-width: 1000px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  .main { padding: 44px 32px 30px; }
  .book-hero { grid-template-columns: 168px minmax(0, 1fr); }
  .book-hero .cover { width: 168px; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 12px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line-2);
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(12px);
  }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 19px; }
  .nav { flex-direction: row; gap: 4px; margin-left: auto; }
  .nav a { padding: 4px 10px; border: 0; border-radius: 999px; }
  .nav a span { font-size: 15px; letter-spacing: .06em; }
  .nav a em { display: none; }
  .nav a:hover { padding-left: 10px; }
  .nav a.is-active { background: var(--ink); }
  .nav a.is-active span { color: var(--paper); }
  .nav a.is-active span::after { display: none; }
  .rail-reading { display: none; }
  .rail-foot { margin: 0 0 0 4px; flex-direction: row; gap: 2px; }
  .rail-btn { padding: 6px; }
  .rail-btn span { display: none; }
  .main { padding: 34px 20px 24px; }

  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 30px 0 34px; }
  .figure { padding: 16px 14px; }
  .figure:nth-child(odd) { border-left: 0; padding-left: 0; }
  .figure:nth-child(n + 3) { border-top: 1px solid var(--line-2); }

  .book-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 30px 18px; }
  .book-hero { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .book-hero .cover { width: 128px; }
  .hero-actions { margin-top: 22px; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .composer form, .composer-head { padding-left: 18px; padding-right: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-head, .modal-body, .modal-foot { padding-left: 20px; padding-right: 20px; }
  .entry { padding-left: 24px; }
  .entry-actions { opacity: 1; }
  .note-item { grid-template-columns: 54px minmax(0, 1fr); gap: 16px; }
  .note-actions { opacity: 1; }
  .rank-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rank-row .track { display: none; }
  .site-foot { margin-top: 60px; }
}

@media (max-width: 520px) {
  .page-title { font-size: 28px; }
  .figures { grid-template-columns: 1fr 1fr; }
  .tools { gap: 10px; }
  .search { max-width: none; flex-basis: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 26px 16px; }
  .cover { padding: 13px 11px; }
  .cover-title { font-size: 14.5px; }
  .log-item { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
  .log-item .mini-cover { width: 28px; height: 40px; }
  .brand-text { display: none; }
  .rail { gap: 8px; padding: 10px 12px; }
  .nav a { padding: 4px 6px; white-space: nowrap; }
  .nav a span { font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
  .rail-btn { padding: 4px; }
  .note-item { grid-template-columns: 44px minmax(0, 1fr); gap: 13px; }
  .note-date strong { font-size: 23px; }
  .note-mark { width: 28px; height: 28px; font-size: 12px; }
  .recent-row { grid-template-columns: 66px minmax(0, 1fr); gap: 12px; }
  .form-row.two { grid-template-columns: 1fr; }
  .habit-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; padding: 14px 2px; }
  .habit-week { display: none; }
  .habit-toggle { width: 30px; height: 30px; font-size: 13px; }
  .habit-name { font-size: 16px; }
  .cal { max-width: none; }
}

