/* Weread Stats v2 — top-nav layout, wider content, polished */

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--green-soft); }

/* ============ TOP NAV ============ */
.topbar {
  position: sticky; top: 0; z-index: 50; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; gap: 20px;
  background: oklch(0.965 0.012 86 / 0.82); backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid oklch(0 0 0 / 0.05);
  transition: box-shadow .3s var(--ease);
}
.topbar.scrolled { box-shadow: 0 2px 20px oklch(0.4 0.02 70 / 0.06); }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(145deg, var(--green), var(--green-deep));
  display: grid; place-items: center; color: #fff; font-family: var(--serif); font-weight: 700; font-size: 16px;
  box-shadow: 0 2px 8px oklch(0.5 0.08 158 / 0.28);
}
.brand .name { font-family: var(--serif); font-weight: 600; font-size: 16px; white-space: nowrap; }

.nav-pills { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface-2); }
.nav-pill {
  display: flex; align-items: center; gap: 7px; padding: 8px 18px; border-radius: 99px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: all .2s var(--ease);
  white-space: nowrap;
}
.nav-pill .gi { width: 17px; height: 17px; opacity: .7; }
.nav-pill:hover { color: var(--ink); background: oklch(1 0 0 / 0.5); }
.nav-pill.active { background: var(--surface); color: var(--green-deep); font-weight: 600; box-shadow: 0 1px 6px oklch(0.4 0.02 70 / 0.08); }
.nav-pill.active .gi { opacity: 1; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.synced { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); padding: 7px 14px; border-radius: 99px; border: 1px solid var(--hairline); background: var(--surface); transition: all .15s; }
.synced:hover { border-color: var(--green); }
.synced .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; color: #fff;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 14px;
  background: linear-gradient(145deg, var(--green), var(--green-deep));
  box-shadow: 0 2px 6px oklch(0.5 0.08 158 / 0.24); cursor: pointer; transition: transform .15s;
}
.avatar:hover { transform: scale(1.08); }

/* ============ MAIN CONTENT ============ */
.content { max-width: 1200px; margin: 0 auto; padding: 36px 40px 100px; }

/* page header */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.pagehead h1 { font-family: var(--serif); font-weight: 600; font-size: 32px; margin: 0; letter-spacing: .01em; }
.pagehead .greet { color: var(--ink-3); font-size: 14px; margin-bottom: 6px; }

/* ============ CARDS (enhanced hover) ============ */
.card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.card-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-pad { padding: 24px 26px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-h h3 { font-family: var(--serif); font-weight: 600; font-size: 17px; margin: 0; }
.card-h .more { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; transition: color .15s; }
.card-h .more:hover { color: var(--green-deep); }

/* ============ DASHBOARD GRID (wider, richer) ============ */
.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; } .col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; }

/* entrance */
.rise { opacity: 1; transform: none; }
.motion-on .rise { opacity: 0; transform: translateY(16px); animation: rise .65s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .motion-on .rise { opacity: 1; transform: none; animation: none; } }
.reveal-all .rise { opacity: 1 !important; transform: none !important; }

/* ============ STAT VALUES ============ */
.stat-num { font-family: var(--serif); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: .42em; color: var(--ink-3); font-family: var(--sans); margin-left: 4px; font-weight: 500; }
.stat-lab { font-size: 13px; color: var(--ink-2); }

/* hero */
.heroc { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; }
.heroc .big {
  grid-row: span 1; background: linear-gradient(155deg, var(--green-deep), var(--green));
  border-radius: var(--r-lg); padding: 28px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 174px; position: relative; overflow: hidden;
}
.heroc .big::after { content: ""; position: absolute; right: -40px; bottom: -50px; width: 160px; height: 160px; border-radius: 50%; background: oklch(1 0 0 / 0.07); }
.heroc .big .stat-num { color: #fff; font-size: 56px; }
.heroc .big .stat-lab { color: oklch(0.93 0.03 158); }
.heroc .big .sub2 { color: oklch(0.9 0.03 158); font-size: 12.5px; }
.mini { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 10px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.mini:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mini .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.mini .ic .gi { width: 17px; height: 17px; }
.mini .stat-num { font-size: 34px; }
.mini .stat-lab { font-size: 12.5px; }
.quad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.statstrip { display: flex; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.statstrip .seg { flex: 1; padding: 22px 24px; border-right: 1px solid var(--hairline); }
.statstrip .seg:last-child { border: none; }
.statstrip .seg .stat-num { font-size: 32px; }

/* ============ HEATMAP ============ */
.hm-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.hm-sum { font-size: 13px; color: var(--ink-2); } .hm-sum b { color: var(--ink); font-weight: 600; }
.hmx { overflow-x: auto; padding-bottom: 6px; }
.hmx::-webkit-scrollbar { height: 5px; } .hmx::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }
.hm-wrap { display: flex; gap: 8px; min-width: max-content; }
.hm-rowlabels { display: grid; grid-template-rows: repeat(7, 14px); font-size: 10px; color: var(--ink-3); gap: 4px; padding-top: 17px; }
.hm-grid { display: flex; flex-direction: column; gap: 5px; }
.hm-months { display: flex; gap: 4px; font-size: 10px; color: var(--ink-3); height: 13px; }
.hm-weeks { display: flex; gap: 4px; }
.hm-week { display: grid; grid-template-rows: repeat(7, 14px); gap: 4px; }
.hm-sq { width: 14px; height: 14px; border-radius: 3.5px; transition: transform .12s var(--ease), outline .12s; }
.hm-sq[data-lvl]:hover { transform: scale(1.3); outline: 2px solid var(--surface); z-index: 1; position: relative; }
.hm-l0 { background: var(--hm-0); } .hm-l1 { background: var(--hm-1); } .hm-l2 { background: var(--hm-2); } .hm-l3 { background: var(--hm-3); } .hm-l4 { background: var(--hm-4); }
.hm-empty { background: transparent; }
.hm-dotcell { width: 14px; height: 14px; display: grid; place-items: center; }
.hm-dot { border-radius: 50%; background: var(--green); }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: var(--o); } 50% { transform: scale(1.4); opacity: 1; } }
.motion-on .hm-dot.breathe { animation: breathe 3.6s var(--ease) infinite; animation-delay: var(--d); }
.motion-strong .hm-dot.breathe { animation-duration: 2.6s; }
.rb { display: flex; flex-direction: column; gap: 8px; }
.rb-row { display: flex; align-items: center; gap: 12px; }
.rb-mon { width: 30px; font-size: 12px; color: var(--ink-2); text-align: right; }
.rb-cells { display: flex; gap: 3px; }
.rb-cell { width: 11px; height: 19px; border-radius: 3px; }
.rb-tot { font-size: 11px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.hm-legend { display: flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 11px; color: var(--ink-3); }
.hm-legend .hm-sq { width: 12px; height: 12px; }
.hm-legend .hm-sq:hover { transform: none; outline: none; }

/* ============ DONUT CHART ============ */
.donut-wrap { display: flex; align-items: center; gap: 28px; }
.donut-labels { display: flex; flex-direction: column; gap: 10px; }
.donut-label { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.donut-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-label .pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }

/* ============ RADIAL HOURS ============ */
.radial-wrap { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.radial-labels { font-size: 9px; color: var(--ink-3); }
.radial-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.radial-center .val { font-family: var(--serif); font-weight: 600; font-size: 22px; }
.radial-center .lab { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* ============ TREND ============ */
.trend { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.trend .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.trend .bar { width: 100%; max-width: 24px; border-radius: 7px 7px 3px 3px; background: var(--green-soft); position: relative; min-height: 4px; transition: background .18s; }
.trend .bar .fill { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, var(--green), var(--green-deep)); transform-origin: bottom; transform: scaleY(0); }
.motion-on .trend .bar .fill { transition: transform .8s var(--ease); }
.trend .ml { font-size: 11px; color: var(--ink-3); }
.trend .bv { font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .15s; }
.trend .bar-col:hover .bv { opacity: 1; }
.trend .bar-col:hover .bar { filter: brightness(1.05); }

/* ============ CURRENTLY READING ============ */
.read-list { display: flex; flex-direction: column; gap: 20px; }
.read-row { display: flex; gap: 16px; align-items: center; padding: 12px; margin: -12px; border-radius: var(--r-md); transition: background .15s; cursor: pointer; }
.read-row:hover { background: oklch(0.5 0.02 80 / 0.04); }
.read-row .meta { flex: 1; min-width: 0; }
.read-row .bt { font-family: var(--serif); font-weight: 600; font-size: 15px; }
.read-row .ba { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.prog { height: 7px; border-radius: 99px; background: var(--paper-2); margin-top: 11px; overflow: hidden; }
.prog > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--green-deep)); }
.motion-on .prog > span { transition: width 1.1s var(--ease) .2s; }
.prog-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 7px; }

/* covers */
.cover { border-radius: 8px; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; position: relative; overflow: hidden;
  box-shadow: 0 4px 14px oklch(0.3 0.02 70 / 0.18); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: oklch(1 0 0 / 0.22); }
.cover .ct { font-family: var(--serif); font-weight: 600; line-height: 1.16; letter-spacing: .02em; }
.cover .ca { margin-top: auto; opacity: .8; }

/* recent finished */
.cover-row { display: flex; gap: 22px; overflow-x: auto; padding-bottom: 10px; }
.cover-row::-webkit-scrollbar { height: 5px; } .cover-row::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }
.fin-item { width: 100px; flex-shrink: 0; cursor: pointer; }
.fin-item .ft { font-size: 12.5px; font-weight: 500; margin-top: 10px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fin-item .fd { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.fin-item:hover .cover { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 10px 28px oklch(0.3 0.02 70 / 0.22); }

/* ============ REPORT BANNER ============ */
.report-banner { grid-column: span 12; border-radius: var(--r-xl); padding: 32px 36px; position: relative; overflow: hidden;
  background: radial-gradient(130% 130% at 0% 0%, var(--green) 0%, var(--green-deep) 60%, oklch(0.3 0.06 162) 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; cursor: pointer;
  box-shadow: var(--shadow-md); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.report-banner:hover { transform: translateY(-2px); box-shadow: 0 8px 32px oklch(0.4 0.06 160 / 0.18); }
.report-banner h3 { font-family: var(--serif); font-weight: 700; font-size: 26px; margin: 0 0 8px; }
.report-banner p { margin: 0; font-size: 14px; opacity: .9; max-width: 440px; line-height: 1.6; }
.report-banner .go { background: #fff; color: var(--green-deep); padding: 13px 26px; border-radius: 99px; font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: transform .15s; }
.report-banner:hover .go { transform: translateX(3px); }
.report-banner .yr { position: absolute; right: 28px; top: -20px; font-family: var(--serif); font-weight: 700; font-size: 130px; opacity: .1; line-height: 1; }

/* ============ LIBRARY ============ */
.filters { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 99px; font-size: 13px; color: var(--ink-2); border: 1px solid var(--hairline); background: var(--surface); transition: all .15s var(--ease); }
.chip:hover { border-color: var(--green); color: var(--green-deep); }
.chip.on { background: var(--green-deep); color: #fff; border-color: var(--green-deep); }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 28px 22px; }
.shelf-item { display: flex; flex-direction: column; cursor: pointer; }
.shelf-item .cover { width: 100%; aspect-ratio: 1/1.42; height: auto; }
.shelf-item .st { font-family: var(--serif); font-weight: 600; font-size: 14.5px; margin-top: 12px; line-height: 1.3; }
.shelf-item .sa { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.shelf-item .sm { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; display: flex; gap: 12px; }
.shelf-item .badge { position: absolute; top: 8px; right: 8px; font-size: 10px; padding: 3px 8px; border-radius: 99px; background: oklch(1 0 0 / 0.22); color: #fff; backdrop-filter: blur(4px); }
.shelf-item:hover .cover { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 10px 28px oklch(0.3 0.02 70 / 0.22); }

/* ============ BOOK DETAIL MODAL ============ */
.bd-overlay { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-end;
  background: oklch(0.2 0.02 70 / 0.4); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .25s var(--ease); pointer-events: none; }
.bd-overlay.open { opacity: 1; pointer-events: all; }
.bd-panel { width: 100%; max-width: 640px; max-height: 88vh; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 36px 36px 44px; overflow-y: auto; transform: translateY(100%); transition: transform .35s var(--ease-soft); }
.bd-overlay.open .bd-panel { transform: translateY(0); }
.bd-head { display: flex; gap: 24px; margin-bottom: 28px; }
.bd-info { flex: 1; min-width: 0; }
.bd-title { font-family: var(--serif); font-weight: 700; font-size: 24px; margin: 0 0 6px; }
.bd-author { font-size: 14px; color: var(--ink-2); }
.bd-cat { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 99px; font-size: 12px; background: var(--green-soft); color: var(--green-deep); }
.bd-stars { display: flex; gap: 3px; margin-top: 14px; }
.bd-stars .star { width: 18px; height: 18px; }
.bd-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--paper-2);
  display: grid; place-items: center; transition: background .15s; }
.bd-close:hover { background: var(--hairline); }
.bd-close svg { width: 16px; height: 16px; }
.bd-section { margin-top: 26px; }
.bd-section h4 { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; margin: 0 0 14px; }
.bd-stat-row { display: flex; gap: 20px; flex-wrap: wrap; }
.bd-stat { text-align: center; flex: 1; min-width: 80px; padding: 14px; background: var(--paper-2); border-radius: var(--r-md); }
.bd-stat .stat-num { font-size: 26px; }
.bd-stat .stat-lab { font-size: 11px; margin-top: 4px; }
.bd-note { padding: 16px; background: var(--paper); border-radius: var(--r-md); margin-bottom: 12px; }
.bd-note .quote { font-family: var(--serif); font-size: 14.5px; line-height: 1.7; padding-left: 14px; border-left: 2.5px solid var(--green); }
.bd-note .my { font-size: 13px; color: var(--ink-2); margin-top: 10px; }

/* ============ NOTES ============ */
.notes-tl { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.note-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 24px 26px;
  box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.note-card .quote { font-family: var(--serif); font-size: 17px; line-height: 1.7; color: var(--ink); padding-left: 18px; border-left: 3px solid var(--green); }
.note-card .my { font-size: 14px; color: var(--ink-2); line-height: 1.65; margin-top: 14px; }
.note-card .nfoot { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 12.5px; color: var(--ink-3); }
.note-card .nfoot .bk { color: var(--green-deep); font-weight: 500; }
.note-card .nlike { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }

/* ============ SETTINGS ============ */
.settings { max-width: 640px; display: flex; flex-direction: column; gap: 20px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; }
.set-row + .set-row { border-top: 1px solid var(--hairline); }
.set-row .sl { font-weight: 500; font-size: 14.5px; }
.set-row .sd { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.theme-dots { display: flex; gap: 10px; }
.theme-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .15s, border-color .15s; }
.theme-dot:hover { transform: scale(1.1); }
.theme-dot.on { border-color: var(--ink); }
.input { padding: 11px 14px; border-radius: var(--r-md); border: 1px solid var(--hairline); background: var(--paper); font-size: 13px; font-family: var(--sans); color: var(--ink); width: 220px; transition: border-color .15s; }
.input:focus { outline: 2px solid var(--green-soft); border-color: var(--green); }
.btn-primary { background: var(--green-deep); color: #fff; padding: 11px 20px; border-radius: var(--r-md); font-size: 14px; font-weight: 500; transition: filter .15s, transform .15s; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* highlight grid on dashboard */
.hl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hl-item { padding: 16px 18px; border-left: 3px solid var(--green); border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--paper); transition: background .15s; cursor: pointer; }
.hl-item:hover { background: var(--green-soft); }
.hl-item .q { font-family: var(--serif); font-size: 15px; line-height: 1.7; }
.hl-item .src { font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* ============ TOGGLE SWITCH ============ */
.toggle {
  width: 46px; height: 26px; border-radius: 99px;
  background: var(--hairline); border: none; cursor: pointer;
  position: relative; transition: background .2s var(--ease);
  padding: 0; flex-shrink: 0;
}
.toggle .toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px oklch(0 0 0 / 0.15);
  transition: transform .2s var(--ease);
}
.toggle.on { background: var(--green-deep); }
.toggle.on .toggle-knob { transform: translateX(20px); }

/* ============ MOBILE BOTTOM TAB ============ */
.tabbar { display: none; }
@media (max-width: 860px) {
  .topbar { padding: 0 16px; }
  .nav-pills { display: none; }
  .synced { display: none; }
  .content { padding: 24px 18px 100px; }
  .pagehead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pagehead h1 { font-size: 26px; }
  .dash { gap: 16px; }
  .col-7, .col-5, .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }
  .heroc { grid-template-columns: 1fr 1fr; }
  .heroc .big { grid-column: span 2; min-height: 140px; }
  .heroc .big .stat-num { font-size: 46px; }
  .donut-wrap { flex-direction: column; }
  .hl-grid { grid-template-columns: 1fr; }
  .report-banner { flex-direction: column; align-items: flex-start; }
  .report-banner .yr { font-size: 80px; right: 12px; }
  .bd-panel { max-width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 28px 22px 36px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: oklch(0.99 0.006 86 / 0.92); backdrop-filter: blur(16px); border-top: 1px solid var(--hairline);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 12px; font-size: 10px; color: var(--ink-3); flex: 1; transition: color .15s; }
  .tab .gi { width: 22px; height: 22px; }
  .tab.active { color: var(--green-deep); }
}
@media (max-width: 480px) {
  .heroc { grid-template-columns: 1fr; } .heroc .big { grid-column: span 1; }
}

/* ============ SEARCH INPUT ============ */
.search-wrap { position: relative; }
.search-wrap::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat;
}
.search-wrap .input { padding-left: 36px; width: 240px; }
@media (max-width: 640px) { .search-wrap .input { width: 100%; } }

/* ============ ANNUAL REPORT (WRAPPED) ============ */
.wrapped {
  position: fixed; inset: 0; z-index: 70;
  overflow-y: auto; scroll-snap-type: y mandatory;
  background: var(--paper);
}
.wr-slide {
  height: 100vh; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px; box-sizing: border-box;
  position: relative;
}
.wr-inner { width: 100%; max-width: 640px; text-align: center; }

/* 导航 */
.wr-close {
  position: fixed; top: 20px; right: 24px; z-index: 72;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); display: grid; place-items: center;
  color: var(--ink-2); transition: background .15s, color .15s; cursor: pointer;
  border: 1px solid var(--hairline);
}
.wr-close:hover { background: var(--hairline); color: var(--ink); }
.wr-dots {
  position: fixed; right: 24px; top: 50%; transform: translateY(-50%);
  z-index: 72; display: flex; flex-direction: column; gap: 8px;
}
.wr-dots .d { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline); cursor: pointer; transition: background .2s, transform .2s; }
.wr-dots .d.on { background: var(--green-deep); transform: scale(1.3); }
.wr-dots .d:hover { background: var(--green); }

/* 动画元素 */
.wr-anim { opacity: 1; transform: none; }
.motion-on .wr-anim { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.wr-slide.in .wr-anim,
.wr-slide .wr-anim { opacity: 1; transform: none; }
.motion-on .wr-slide.in .wr-anim.d1,
.motion-on .wr-slide .wr-anim.d1 { transition-delay: .15s; }
.motion-on .wr-slide.in .wr-anim.d2,
.motion-on .wr-slide .wr-anim.d2 { transition-delay: .35s; }
.motion-on .wr-slide.in .wr-anim.d3,
.motion-on .wr-slide .wr-anim.d3 { transition-delay: .55s; }

/* 幻灯片变体 */
.wr-cover { background: radial-gradient(130% 130% at 0% 0%, var(--green) 0%, var(--green-deep) 60%, oklch(0.3 0.06 162) 100%); color: #fff; }
.wr-cover .wr-tag { display: inline-block; padding: 6px 16px; border-radius: 99px; background: oklch(1 0 0 / 0.14); font-size: 13px; margin-bottom: 20px; backdrop-filter: blur(4px); }
.wr-cover .wr-h1 { font-family: var(--serif); font-size: 42px; font-weight: 700; line-height: 1.25; margin: 0 0 16px; }
.wr-cover .wr-lead { font-size: 16px; opacity: .85; margin: 0 0 32px; }
.wr-cover .wr-hint { font-size: 13px; opacity: .6; animation: bounce 2s ease infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.wr-open .wr-eyebrow, .wr-numbers .wr-eyebrow, .wr-foot .wr-eyebrow,
.wr-cats .wr-eyebrow, .wr-night .wr-eyebrow, .wr-authors .wr-eyebrow,
.wr-monthly .wr-eyebrow, .wr-book .wr-eyebrow, .wr-quote .wr-eyebrow,
.wr-keyword .wr-eyebrow, .wr-finale .wr-eyebrow {
  font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px;
}

.wr-open b, .wr-numbers b, .wr-finale b { color: var(--green-deep); }

/* 数字总览 */
.wr-numgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 28px; }
.wr-big-num { font-family: var(--serif); font-size: 56px; font-weight: 700; color: var(--ink); line-height: 1; display: block; }
.wr-num-unit { font-size: 14px; color: var(--ink-2); display: block; margin-top: 8px; }
.wr-statline { margin-top: 28px; font-size: 14px; color: var(--ink-2); }

/* 阅读足迹热力图 */
.wr-fpgrid { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.wr-week { display: grid; grid-template-rows: repeat(7, 10px); gap: 3px; }
.wr-cell { width: 10px; height: 10px; border-radius: 2px; }
.wr-empty { background: transparent; }

/* 分类标签 */
.wr-cat-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.wr-cat-pill { padding: 8px 18px; border-radius: 99px; font-size: 13px; color: #fff; font-weight: 500; }

/* 深夜时间大字 */
.wr-time { font-family: var(--serif); font-size: 80px; font-weight: 700; color: var(--ink); line-height: 1; margin: 16px 0; }
.wr-night .wr-lead { font-size: 16px; color: var(--ink-2); line-height: 1.7; }

/* 作者排行 */
.wr-rank { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; max-width: 480px; margin-left: auto; margin-right: auto; }
.wr-rankrow { display: grid; grid-template-columns: 24px 1fr 120px 40px; align-items: center; gap: 10px; text-align: left; }
.wr-ranknum { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wr-rankname { font-size: 14px; font-weight: 500; }
.wr-rankbar { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.wr-rankfill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--green-deep)); transition: width 1s var(--ease) .3s; }
.wr-rankval { font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

/* 月度之书 */
.wr-mon-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; max-width: 400px; margin-left: auto; margin-right: auto; }
.wr-mon-row { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 16px; background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--hairline); }
.wr-mon-label { font-size: 12px; color: var(--ink-3); width: 32px; flex-shrink: 0; }
.wr-mon-book { font-weight: 500; font-size: 14px; flex: 1; }
.wr-mon-auth { font-size: 12px; color: var(--ink-3); }

/* 年度之书 */
.wr-book .cover { margin: 0 auto; }

/* 关键词 */
.wr-keyword .wr-time { color: var(--green-deep); }

/* 结尾 */
.wr-finale .wr-tag { display: inline-block; padding: 6px 16px; border-radius: 99px; background: var(--green-soft); color: var(--green-deep); font-size: 13px; margin-bottom: 20px; }
.wr-finale .wr-h1 { font-family: var(--serif); font-size: 32px; font-weight: 700; line-height: 1.3; margin: 0; color: var(--ink); }
.wr-finale .wr-lead { font-size: 15px; color: var(--ink-2); line-height: 1.7; margin-top: 12px; }
.wr-actions { display: flex; gap: 12px; justify-content: center; margin-top: 32px; }
.wr-btn {
  padding: 12px 28px; border-radius: 99px; font-size: 14px; font-weight: 600;
  background: var(--green-deep); color: #fff; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: filter .15s, transform .15s;
}
.wr-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.wr-btn.outline { background: transparent; color: var(--ink); border: 1.5px solid var(--hairline); }
.wr-btn.outline:hover { border-color: var(--green); color: var(--green-deep); }

/* 年度报告响应式 */
@media (max-width: 640px) {
  .wr-slide { padding: 24px 20px; }
  .wr-cover .wr-h1 { font-size: 30px; }
  .wr-big-num { font-size: 40px; }
  .wr-numgrid { grid-template-columns: 1fr; gap: 16px; }
  .wr-dots { right: 12px; }
  .wr-close { top: 12px; right: 12px; }
  .wr-rankrow { grid-template-columns: 20px 1fr 80px 36px; }
  .wr-time { font-size: 56px; }
  .wr-finale .wr-h1 { font-size: 24px; }
}

