:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #e2e7ee;
  --line-strong: #c8d3df;
  --text: #111827;
  --muted: #64748b;
  --subtle: #94a3b8;
  --accent: #0f766e;
  --accent-2: #3b82f6;
  --accent-3: #f97316;
  --accent-weak: #e7f7f3;
  --blue-weak: #eaf2ff;
  --orange-weak: #fff1e7;
  --danger: #a52626;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 247, 249, 0.96)),
    linear-gradient(90deg, rgba(15, 118, 110, 0.05), rgba(59, 130, 246, 0.06), rgba(249, 115, 22, 0.04));
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon {
  display: block;
  stroke-width: 2;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(226, 232, 240, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 2px 4px 10px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.18);
}

.brand h1 {
  min-width: 0;
  font-size: 20px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: #475569;
  background: transparent;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: var(--text);
}

.nav button.active .icon {
  color: var(--accent);
}

.sidebar-stat {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 58%),
    #ffffff;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
}

.sidebar-stat span,
.sidebar-stat small {
  color: var(--muted);
  font-size: 13px;
}

.sidebar-stat strong {
  font-size: 34px;
  line-height: 1;
}

.sync {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 5px;
}

.sync strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.main {
  min-width: 0;
  padding: 24px 28px 34px;
}

.topbar {
  min-height: 86px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.055);
  backdrop-filter: blur(18px);
}

.eyebrow,
.subtitle {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.2;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.icon-button,
.text-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.text-button {
  height: 36px;
  gap: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.icon-button:hover,
.text-button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.error {
  padding: 12px 14px;
  border: 1px solid #efb4b4;
  background: #fff4f4;
  color: var(--danger);
  border-radius: 8px;
}

.page {
  animation: page-in 0.18s ease-out;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.14s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric,
.panel,
.note,
.section-head {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.metric {
  min-height: 136px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 8px;
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #111827;
}

.metric:nth-child(2) .metric-icon {
  background: var(--accent);
}

.metric:nth-child(3) .metric-icon {
  background: var(--accent-2);
}

.metric:nth-child(4) .metric-icon {
  background: var(--accent-3);
}

.metric:nth-child(5) .metric-icon {
  background: #7c3aed;
}

.metric span,
.metric small,
.panel-title p,
.stats-list dt,
.note span,
.note small,
.section-head p,
.panel-count,
.empty,
.empty-state {
  color: var(--muted);
}

.metric span {
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  min-width: 0;
  font-size: 28px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric small {
  align-self: end;
  font-size: 12px;
}

.dashboard-grid,
.visual-grid,
.category-page-grid {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: minmax(330px, 0.85fr) minmax(0, 1.15fr);
}

.visual-grid {
  grid-template-columns: minmax(430px, 1.1fr) minmax(320px, 0.9fr);
}

.category-page-grid {
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  align-items: stretch;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.panel-title {
  min-height: 38px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel h3 {
  font-size: 18px;
}

.panel-title p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.panel-count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
}

.stat-panel {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 54%),
    rgba(255, 255, 255, 0.92);
}

.stats-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.stats-list div {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.stats-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.stats-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.reading-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.reading-item {
  min-height: 216px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: center;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  justify-items: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.reading-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.09);
  transform: translateY(-2px);
}

.reading-item img {
  width: 72px;
  height: 98px;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.12);
}

.reading-item div {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}

.reading-item strong,
.reading-item span,
.reading-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reading-item strong {
  font-size: 14px;
}

.reading-item span,
.reading-item small {
  color: var(--muted);
}

.reading-item small {
  font-size: 12px;
}

.mini-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebef;
}

.mini-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.heatmap-selected {
  height: 72px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 246, 255, 0.88)),
    #f8fafc;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.heatmap-selected strong,
.heatmap-selected span {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  height: 100%;
  padding: 0 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  line-height: 1;
}

.heatmap-selected strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  border-color: rgba(15, 118, 110, 0.16);
  background: rgba(231, 247, 243, 0.92);
}

.heatmap-selected span:nth-child(2) {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.18);
  background: rgba(234, 242, 255, 0.96);
  font-weight: 800;
}

.heatmap-selected span:nth-child(3) {
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.18);
  background: rgba(245, 243, 255, 0.94);
  font-weight: 800;
}

.heatmap-selected span:nth-child(4) {
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.18);
  background: rgba(255, 241, 231, 0.92);
  font-weight: 800;
}

.year-heatmap {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 14px 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 252, 0.88)),
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 42%);
  display: grid;
  align-items: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.year-heatmap-grid {
  position: relative;
  display: grid;
  grid-template-rows: repeat(7, auto);
  grid-auto-flow: column;
  gap: 1px;
  width: 100%;
  height: auto;
  align-content: center;
}

.heat-cell {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 2.5px;
  background: #e8edf2;
  border: 0;
  display: block;
  transition: transform 0.12s ease, box-shadow 0.12s ease, outline-color 0.12s ease;
}

.heat-cell.blank {
  opacity: 0;
  pointer-events: none;
}

.heat-cell:not(.blank) {
  cursor: pointer;
}

.heat-cell:not(.blank):hover,
.heat-cell.selected {
  outline: 2px solid rgba(17, 24, 39, 0.86);
  outline-offset: 1px;
  transform: scale(1.18);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.16);
  z-index: 1;
}

.heat-cell[data-level="1"] {
  background: #cdeafe;
}

.heat-cell[data-level="2"] {
  background: #7dd3fc;
}

.heat-cell[data-level="3"] {
  background: #2563eb;
}

.heat-cell[data-level="4"] {
  background: #0f766e;
}

.heatmap-empty {
  grid-row: 1 / -1;
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px 0;
  text-align: center;
}

.weekly-bars {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 252, 0.9)),
    #f8fafc;
  height: 172px;
  display: grid;
  grid-template-rows: 22px minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.weekly-bars-title {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  overflow: hidden;
}

.weekly-bars-title strong {
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-bars-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-bar-grid {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  overflow: hidden;
}

.weekly-bar-item {
  min-width: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 13px 13px 18px;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
}

.weekly-bar-track {
  width: 100%;
  max-width: 32px;
  height: 100%;
  min-height: 0;
  padding: 3px;
  border-radius: 8px;
  background: linear-gradient(180deg, #edf3f8, #e2e8f0);
  display: flex;
  align-items: flex-end;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.weekly-bar-track i {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 6px;
  background: linear-gradient(180deg, #38bdf8, #0f766e);
  box-shadow: 0 6px 12px rgba(15, 118, 110, 0.18);
}

.weekly-bar-item.active .weekly-bar-track {
  background: #e0f2fe;
  outline: 2px solid rgba(17, 24, 39, 0.88);
  outline-offset: 2px;
}

.weekly-bar-item.outside {
  opacity: 0.38;
}

.weekly-bar-item strong {
  width: 100%;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-bar-item span,
.weekly-bar-item small {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 13px;
}

.weekly-bar-item small {
  color: #0f766e;
  font-weight: 800;
  line-height: 18px;
}

.category-dashboard-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 42%),
    linear-gradient(235deg, rgba(249, 115, 22, 0.07), transparent 46%),
    rgba(255, 255, 255, 0.92);
}

.category-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.category-gauge-wrap {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.category-gauge {
  width: 172px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.08),
    0 16px 36px rgba(15, 23, 42, 0.10);
}

.category-gauge::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.5);
}

.category-gauge-core {
  position: relative;
  width: 96px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  text-align: center;
}

.category-gauge-core span,
.category-gauge-core small,
.category-top-card span,
.category-top-card small {
  color: var(--muted);
  font-size: 11px;
}

.category-gauge-core strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.category-top-card {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  gap: 5px;
}

.category-top-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-rank {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.category-rank-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 5px 10px;
  align-items: center;
}

.category-rank-head {
  min-width: 0;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.category-rank-head span {
  min-width: 0;
  color: var(--text);
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-rank-head span i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 3px;
  background: #cbd5e1;
}

.category-rank-head strong {
  flex: 0 0 auto;
  font-size: 12px;
}

.category-rank-bar {
  height: 9px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}

.category-rank-bar i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: #94a3b8;
}

.category-rank-item small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.category-rank-item.muted {
  opacity: 0.82;
}

.section-head {
  min-height: 104px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), transparent 40%),
    linear-gradient(240deg, rgba(249, 115, 22, 0.08), transparent 46%),
    rgba(255, 255, 255, 0.9);
}

.section-head h3 {
  font-size: 24px;
}

.section-head p {
  margin: 8px 0 0;
  line-height: 1.7;
}

.section-head strong {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 34px;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.category-row {
  width: 100%;
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
}

.category-row img {
  width: 100%;
  max-width: 110px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.12);
}

.category-row-text {
  min-width: 0;
  display: grid;
  gap: 3px;
  justify-items: center;
}

.category-row-text span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
}

.category-row-text small {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.notes-view {
  display: grid;
  gap: 16px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.note {
  min-height: 300px;
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.045), transparent 36%),
    var(--surface);
  position: relative;
}

.note::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
}

.note-topline,
.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note-topline span,
.note-meta i {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-weak);
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1;
  font-style: normal;
  font-weight: 800;
}

.note-topline time {
  color: var(--muted);
  font-size: 12px;
}

.note-book {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.note-book img {
  width: 64px;
  height: 88px;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.1);
}

.note-book div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.note-book h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-book strong,
.note-book span,
.note-book small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-book strong {
  font-size: 13px;
  color: #344252;
}

.note-book span,
.note-book small {
  color: var(--muted);
  font-size: 12px;
}

.note p {
  margin: 0;
  color: #2d3945;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note p.thought-text {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8faf9;
  border-radius: 6px;
  color: #374454;
}

.note-meta {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.note-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.28);
}

.detail {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(400px, 90vw);
  width: min(420px, 92vw);
  padding: 20px 22px;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 44px rgba(15, 23, 42, 0.18);
  overflow-y: auto;
}

.close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.detail-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  margin-right: 42px;
}

.detail-head img {
  width: 88px;
  height: 122px;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: 0 12px 26px rgba(23, 33, 43, 0.12);
}

.detail-head h2 {
  font-size: 20px;
  line-height: 1.3;
}

.detail-head p.detail-author {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
}

.heatmap-panel {
  height: 520px;
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 72px minmax(0, 1fr) 172px;
  row-gap: 12px;
  align-content: stretch;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.94);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 36%),
    linear-gradient(225deg, rgba(59, 130, 246, 0.09), transparent 42%),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.heatmap-panel .panel-title {
  min-width: 0;
  min-height: 0;
  margin-bottom: 0;
}

.heatmap-panel .panel-title > div {
  min-width: 0;
}

.heatmap-panel .panel-title h3,
.heatmap-panel .panel-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-panel .panel-title h3 {
  margin: 0;
  line-height: 1.2;
}

.heatmap-panel .panel-title p {
  margin-top: 5px;
}

.heatmap-panel .heatmap-selected,
.heatmap-panel .weekly-bars {
  margin-bottom: 0;
  margin-top: 0;
}



.detail-progress {
  margin: 18px 0;
}

.detail-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 12px;
}

.detail-progress-head span { color: var(--muted); }
.detail-progress-head strong { color: var(--text); font-weight: 700; }

.detail-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.detail-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #60a5fa);
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin-bottom: 14px;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12px;
  color: var(--text);
}

.detail-meta-item .icon { color: var(--muted); flex-shrink: 0; }
.detail-meta-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 10px;
  background: linear-gradient(135deg, rgba(15,118,110,0.1), rgba(15,118,110,0.04));
  border: 1px solid rgba(15,118,110,0.18);
  border-radius: 999px;
  color: var(--accent);
}

.detail-rating-badge .icon { color: var(--accent); }
.detail-rating-badge strong { font-size: 14px; font-weight: 800; }
.detail-rating-badge span { font-size: 13px; color: var(--muted); font-weight: 500; }

.detail-rating-dist { margin-bottom: 12px; }

.dist-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 12px;
}

.dist-header span { color: var(--muted); }
.dist-header strong { color: var(--text); font-weight: 700; font-size: 12px; }

.dist-bar {
  height: 8px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
  display: flex;
}

.dist-bar i { height: 100%; }
.dist-bar i.good { background: #0f766e; }
.dist-bar i.fair { background: #f59e0b; }
.dist-bar i.poor { background: #d1d5db; }

.dist-labels {
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.dist-labels span { display: inline-flex; align-items: center; gap: 4px; }
.dist-labels .dot {
  width: 7px; height: 7px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

.dist-labels .good-dot { background: #0f766e; }
.dist-labels .fair-dot { background: #f59e0b; }
.dist-labels .poor-dot { background: #d1d5db; }

.detail-section { margin-top: 14px; }

.detail-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--text);
}

.detail-section h3 .icon { color: var(--muted); }




.stats-category-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 8px 16px;
  align-items: start;
}

.stats-category-row dt {
  padding-top: 3px;
  font-size: 12px;
  text-align: right;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 0;
  list-style: none;
  max-height: 48px;
  overflow: hidden;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  line-height: 1.4;
}

.category-tag em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  margin-left: 1px;
}

.category-tag.muted {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}

.category-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-content: flex-start;
}




.sidebar-profile {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(248,250,251,0.6));
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: auto;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

.sidebar-avatar-wrapper {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.sidebar-avatar-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  background: var(--surface-soft);
}

.sidebar-avatar-fallback {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 2px solid rgba(255,255,255,0.2);
}

.sidebar-avatar-fallback span {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.sidebar-profile-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sidebar-profile-info strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile-info small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}



.detail-head p.detail-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 2px 0 0;
}

.detail-info-table {
  margin: 14px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.detail-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
}

.detail-info-row span {
  color: var(--muted);
  flex-shrink: 0;
}

.detail-info-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.detail-rating-dist {
  margin-bottom: 10px;
}

.rating-dist-bar {
  height: 8px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
  display: flex;
}

.rating-dist-bar i {
  height: 100%;
}

.rating-dist-bar i.good { background: #0f766e; }
.rating-dist-bar i.fair { background: #f59e0b; }
.rating-dist-bar i.poor { background: #e2e8f0; }

.rating-dist-labels {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.progress {
  margin: 14px 0;
  height: 28px;
  border-radius: 8px;
  background: #e8eef6;
  overflow: hidden;
  position: relative;
}

.progress span {
  font-size: 13px;
}

.progress span {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #203445;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #60a5fa);
}

.intro {
  color: #374454;
  line-height: 1.6;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.intro.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.intro-block {
  margin: 12px 0;
}

.intro-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.intro-toggle {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

blockquote {
  margin: 6px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: #f8faf9;
  color: #2d3945;
  line-height: 1.5;
  font-size: 13px;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1240px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .visual-grid,
  .category-page-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav button {
    justify-content: center;
  }

  .main {
    padding: 20px;
  }

  .topbar {
    align-items: flex-start;
  }

  .reading-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-dashboard {
  }

  .category-rank {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    background: #f8fafb;
  }

  .sidebar {
    padding: 14px 16px;
    gap: 12px;
  }

  .brand {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.14);
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    margin-top: 3px;
    font-size: 12px;
  }

  .nav {
    gap: 6px;
  }

  .nav button {
    height: 38px;
    padding: 0 8px;
    gap: 6px;
    font-size: 13px;
  }

  .sidebar-profile {
    margin-top: 0;
    padding: 10px;
    gap: 10px;
    border-radius: 8px;
  }

  .sidebar-avatar-wrapper,
  .sidebar-avatar-img,
  .sidebar-avatar-fallback {
    width: 46px;
    height: 46px;
  }

  .sidebar-avatar-fallback span {
    font-size: 20px;
  }

  .sidebar-profile-info strong {
    font-size: 15px;
  }

  .sidebar-profile-info small {
    font-size: 12px;
  }

  .sync {
    margin-top: 0;
    padding-top: 10px;
    gap: 2px;
  }

  .main {
    padding: 14px 14px 24px;
  }

  .metric-grid,
  .reading-list,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .dashboard-grid,
  .visual-grid,
  .category-page-grid {
    gap: 10px;
  }

  .dashboard-grid,
  .visual-grid,
  .category-page-grid {
    margin-top: 10px;
  }

  .topbar {
    min-height: 0;
    margin-bottom: 10px;
    padding: 14px;
    gap: 10px;
  }

  .topbar h2 {
    font-size: 23px;
    line-height: 1.15;
  }

  .topbar p {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.65;
  }

  .topbar .eyebrow {
    font-size: 11px;
  }

  .text-button {
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .metric {
    min-height: 92px;
    padding: 12px;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 4px 10px;
    align-items: center;
  }

  .metric-icon {
    grid-row: 1 / -1;
    width: 32px;
    height: 32px;
  }

  .metric span {
    font-size: 12px;
  }

  .metric strong {
    font-size: 24px;
  }

  .metric small {
    align-self: start;
    font-size: 11px;
  }

  .panel {
    padding: 14px;
  }

  .panel-title {
    min-height: 0;
    margin-bottom: 10px;
    gap: 8px;
  }

  .panel h3 {
    font-size: 16px;
  }

  .panel-title p {
    font-size: 12px;
    line-height: 1.45;
  }

  .stats-list {
    gap: 7px;
  }

  .stats-list div {
    min-height: 34px;
    padding-bottom: 7px;
  }

  .stat-panel {
    min-height: 0;
  }

  .reading-list {
    gap: 8px;
  }

  .reading-item {
    min-height: 118px;
    padding: 10px;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 10px;
    text-align: left;
    justify-items: stretch;
    align-items: center;
  }

  .reading-item img {
    width: 48px;
    height: 66px;
  }

  .reading-item strong {
    font-size: 13px;
  }

  .reading-item span,
  .reading-item small {
    font-size: 11px;
  }

  .mini-progress {
    height: 5px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 14px;
    gap: 8px;
  }

  .section-head h3 {
    font-size: 21px;
  }

  .section-head p {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.55;
  }

  .section-head strong {
    font-size: 24px;
  }

  .heatmap-panel {
    height: 390px;
    min-height: 390px;
    grid-template-rows: auto 64px minmax(0, 1fr) 132px;
    row-gap: 9px;
  }

  .heatmap-selected {
    height: 64px;
    padding: 6px;
    gap: 6px;
  }

  .heatmap-selected strong,
  .heatmap-selected span {
    padding: 0 7px;
    font-size: 10px;
  }

  .heatmap-selected strong {
    font-size: 11px;
  }

  .year-heatmap {
    padding: 10px 8px;
  }

  .year-heatmap-grid {
    gap: 1px;
  }

  .weekly-bars {
    height: 132px;
    padding: 9px;
    grid-template-rows: 18px minmax(0, 1fr);
    gap: 7px;
  }

  .weekly-bars-title strong,
  .weekly-bars-title span {
    font-size: 11px;
  }

  .weekly-bar-grid {
    gap: 6px;
  }

  .weekly-bar-item {
    grid-template-rows: minmax(0, 1fr) 12px 12px 15px;
    gap: 3px;
  }

  .weekly-bar-track {
    max-width: 24px;
    border-radius: 7px;
  }

  .weekly-bar-item strong {
    font-size: 11px;
    line-height: 12px;
  }

  .weekly-bar-item span,
  .weekly-bar-item small {
    font-size: 9px;
    line-height: 12px;
  }

  .weekly-bar-item small {
    line-height: 15px;
  }

  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .category-row {
    padding: 8px 6px;
    gap: 6px;
  }

  .category-row img {
    max-width: 80px;
  }

  .category-row-text span {
    font-size: 12px;
  }

  .category-row-text small {
    font-size: 10px;
  }

  .detail {
    padding: 16px;
  }

  .detail-head {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .detail-head img {
    width: 72px;
    height: 100px;
  }

  .dashboard-pie-panel {
    min-height: 0;
  }

  .dashboard-pie {
    width: 180px;
  }

  .pie-ring {
    width: 168px;
  }

  .notes-view,
  .notes-grid,
  .note {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .notes-grid {
    gap: 12px;
  }

  .note {
    min-height: 0;
    padding: 13px;
    grid-template-rows: auto auto auto auto;
  }

  .note-topline,
  .note-meta {
    min-width: 0;
    gap: 8px;
  }

  .note-topline time {
    flex: 0 0 auto;
  }

  .note-book {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
  }

  .note-book img {
    width: 52px;
    height: 72px;
  }

  .note-book h3 {
    font-size: 15px;
  }

  .note p,
  .note blockquote {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .note p {
    -webkit-line-clamp: 5;
    font-size: 13px;
    line-height: 1.7;
  }

  .note-meta span {
    white-space: nowrap;
  }
}
.note-topline span.type-bookmark {
  background: var(--orange-weak);
  color: #c2410c;
}
.note blockquote,
.note p:not(.thought-text) {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: rgba(15, 118, 110, 0.35);
  text-underline-offset: 4px;
}
.category-row.button,
button.category-row {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button.category-row:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}
.detail section h3 {
  font-size: 14px;
  margin: 10px 0 6px;
}

.detail section .empty {
  font-size: 13px;
}
.dashboard-pie-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.06), transparent 42%),
    linear-gradient(235deg, rgba(59, 130, 246, 0.05), transparent 46%),
    rgba(255, 255, 255, 0.92);
}

.dashboard-pie {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 16px;
}

.dashboard-pie-gauge {
  position: relative;
  width: 160px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.06),
    0 14px 34px rgba(15, 23, 42, 0.10);
  transition: transform 0.3s ease;
}

.dashboard-pie-gauge:hover {
  transform: scale(1.03);
}

.dashboard-pie-core {
  position: relative;
  width: 100px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  text-align: center;
}

.dashboard-pie-core span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.dashboard-pie-core strong {
  color: var(--text);
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
}

.dashboard-pie-core small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.dashboard-pie-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 380px;
}

.pie-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: var(--text);
  line-height: 1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pie-tag:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.pie-tag i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 3px;
}

.pie-tag em {
  font-style: normal;
  font-weight: 800;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 640px) {
  .dashboard-pie {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
  }

  .dashboard-pie-gauge {
    width: 136px;
  }

  .dashboard-pie-core {
    width: 86px;
  }

  .dashboard-pie-core strong {
    font-size: 26px;
  }

  .dashboard-pie-tags {
    gap: 6px;
  }

  .pie-tag {
    padding: 3px 8px;
    font-size: 11px;
  }

  .dashboard-pie-legend {
    width: 100%;
  }
}
.popular-section h3 .popular-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #e11d48);
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 4px;
}

.popular-section blockquote small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}
.detail-empty {
  padding: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.detail-rating-card {
  margin: 14px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fefce8, #fffbeb);
  border: 1px solid #fde68a;
  border-radius: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 6px 14px;
  align-items: center;
}

.rating-card-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  grid-row: 1 / 3;
}

.rating-card-score .icon { color: #eab308; margin-right: 2px; }
.rating-card-score strong {
  font-size: 28px;
  font-weight: 800;
  color: #92400e;
  line-height: 1;
}
.rating-card-score span {
  font-size: 13px;
  color: #a16207;
  font-weight: 600;
}

.rating-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
}

.rating-card-count {
  font-size: 12px;
  color: #a16207;
  margin-left: 8px;
}

.rc-bar {
  height: 8px;
  border-radius: 999px;
  background: #fef3c7;
  overflow: hidden;
  display: flex;
  margin-top: 4px;
}

.rc-bar i { height: 100%; }
.rc-bar i.good { background: #22c55e; }
.rc-bar i.fair { background: #f59e0b; }
.rc-bar i.poor { background: #fecaca; }

.rc-labels {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #a16207;
}

.rc-labels span { display: inline-flex; align-items: center; gap: 3px; }
.rc-dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.rc-dot.good-dot { background: #22c55e; }
.rc-dot.fair-dot { background: #f59e0b; }
.rc-dot.poor-dot { background: #fecaca; }
.category-gauge-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.category-rank-head span em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  flex-shrink: 0;
}
.category-top-book {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble-map {
  padding: 30px 20px 20px;
  margin-bottom: 16px;
  background: radial-gradient(ellipse at 50% 30%, rgba(15,118,110,0.06), transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(59,130,246,0.05), transparent 50%),
              rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  overflow: hidden;
}

.bubble-map-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.bubble-map-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.bubble-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 20px;
  padding: 10px 0;
  perspective: 800px;
}

.bubble {
  position: relative;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.bubble-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  animation: bubble-appear 0.55s ease-out both;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.skeleton-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.skeleton-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--line);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  box-shadow: none !important;
}



.bubble:hover {
  transform: scale(1.12) !important;
  filter: brightness(1.05);
  z-index: 2;
}

.bubble-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 8px 24px rgba(15,23,42,0.12),
    inset 0 -4px 8px rgba(0,0,0,0.08),
    inset 0 4px 8px rgba(255,255,255,0.3);
  background: var(--surface);
}

.bubble-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 30% 25%, rgba(255,255,255,0.35), transparent 55%);
  pointer-events: none;
}

.bubble-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  word-break: break-word;
}

.bubble-author {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 640px) {
  .bubble-map {
    min-height: 210px;
    padding: 24px 14px 20px;
  }

  .bubble-cloud {
    gap: 8px 10px;
  }

  .bubble-item {
    transform: scale(0.88);
  }
}

.skeleton-loading-text {
  flex: 0 0 100%;
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@media (max-width: 640px) {
  .dashboard-pie-panel {
    display: grid;
    justify-items: stretch;
  }

  .dashboard-pie {
    width: 100%;
    max-width: 100%;
    place-items: center;
    justify-content: center;
    gap: 8px;
  }

  .dashboard-pie-gauge {
    width: 132px;
    margin-inline: auto;
  }

  .dashboard-pie-core {
    width: 82px;
  }

  .dashboard-pie-core strong {
    font-size: 24px;
  }

  .dashboard-pie-tags {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    gap: 5px;
  }

  .pie-tag {
    padding: 3px 7px;
    font-size: 10px;
  }

  .categories-view {
    gap: 10px;
  }

  .category-dashboard-panel {
    padding: 12px;
  }

  .category-dashboard,
  .category-gauge-wrap,
  .category-rank {
    gap: 8px;
  }

  .category-dashboard {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .category-gauge-wrap {
    justify-items: center;
    min-width: 0;
  }

  .category-gauge {
    width: 108px;
    margin-inline: auto;
  }

  .category-gauge::before {
    inset: 8px;
  }

  .category-gauge-core {
    width: 64px;
  }

  .category-gauge-core span,
  .category-gauge-core small,
  .category-top-card span,
  .category-top-card small {
    font-size: 10px;
  }

  .category-gauge-core strong {
    font-size: 17px;
  }

  .category-tags-list {
    max-height: 64px;
    overflow: hidden;
    justify-content: center;
    gap: 3px;
  }

  .category-tag {
    padding: 3px 5px;
    font-size: 9px;
  }

  .category-top-card {
    min-height: 70px;
    padding: 9px;
    gap: 3px;
  }

  .category-top-card strong {
    font-size: 13px;
  }

  .category-rank-item {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 3px 7px;
  }

  .category-rank-head {
    gap: 7px;
  }

  .category-rank-head span,
  .category-rank-head strong {
    font-size: 11px;
  }

  .category-rank-head span i {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
  }

  .category-rank-bar {
    height: 5px;
  }

  .category-rank-item small {
    font-size: 10px;
  }

  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .category-row {
    padding: 6px 5px;
    gap: 4px;
  }

  .category-row img {
    max-width: 56px;
  }

  .category-row-text span {
    font-size: 11px;
  }

  .category-row-text small {
    font-size: 9px;
  }

  .bubble-map {
    min-height: 0;
    margin-bottom: 10px;
    padding: 14px 10px 12px;
  }

  .bubble-map-title {
    font-size: 17px;
    margin-bottom: 2px;
  }

  .bubble-map-sub {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .bubble-cloud {
    gap: 4px 6px;
    padding: 2px 0;
  }

  .bubble,
  .bubble-item {
    width: 58px !important;
  }

  .bubble {
    height: 58px !important;
  }

  .bubble-item {
    transform: scale(0.76);
    transform-origin: center;
    margin: -6px -4px;
  }

  .bubble-label {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.15;
    max-height: 23px;
    overflow: hidden;
  }

  .bubble-author {
    font-size: 8px;
  }

  .notes-view,
  .notes-grid {
    gap: 8px;
  }

  .note {
    min-height: 0;
    padding: 8px;
    gap: 4px;
  }

  .note::before {
    left: 12px;
    right: 12px;
    height: 2px;
  }

  .note-topline,
  .note-meta {
    gap: 5px;
  }

  .note-topline span,
  .note-meta i {
    padding: 3px 7px;
    font-size: 10px;
  }

  .note-topline time,
  .note-meta {
    font-size: 10px;
  }

  .note-book {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 7px;
  }

  .note-book img {
    width: 36px;
    height: 50px;
    border-radius: 6px;
  }

  .note-book div {
    gap: 3px;
  }

  .note-book h3 {
    font-size: 12px;
    line-height: 1.25;
  }

  .note-book strong,
  .note-book span,
  .note-book small {
    font-size: 9px;
  }

  .note .mini-progress {
    height: 3px;
  }

  .note p {
    -webkit-line-clamp: 3;
    font-size: 11px;
    line-height: 1.45;
  }

  .note p.thought-text {
    margin-top: 2px;
    padding: 7px 8px;
  }

  .note-meta {
    padding-top: 4px;
    line-height: 1.2;
  }
}

.bubble.popping {
  animation: bubble-pop 0.4s ease-out forwards !important;
  pointer-events: none;
}

@keyframes bubble-pop {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.2); opacity: 0; }
}

@keyframes bubble-slide-in {
  0% { transform: translateX(60px) scale(0.3); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}


@keyframes bubble-appear {
  0% { opacity: 0; transform: scale(0.75) translateY(12px); }
  60% { opacity: 1; transform: scale(1.03) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.bubble-item:nth-child(odd) { margin-top: -4px; }
.bubble-item:nth-child(3n) { margin-top: 6px; }
.bubble-item:nth-child(5n+2) { margin-top: -8px; }

.bubble-map {
  padding: 40px 20px 30px;
  min-height: 280px;
}

.bubble-cloud {
  gap: 16px 20px;
}

.bubble {
  border-radius: 0;
}

.bubble-inner {
  border-radius: 50%;
}

.bubble-map {
  min-height: 320px;
}

.bubble-cloud {
  gap: 18px 22px;
  padding: 18px 0 24px;
  row-gap: 38px;
}

.bubble {
    overflow: visible;
}

.bubble:hover {
  transform: scale(1.08) !important;
}

.bubble-map {
  padding: 20px 16px 16px;
}

@media (max-width: 640px) {
  .sync {
    padding-top: 6px;
    gap: 0;
  }

  .sync span {
    font-size: 10px;
    line-height: 14px;
  }

  .sync strong {
    font-size: 11px;
    line-height: 16px;
  }

  .topbar {
    margin-bottom: 8px;
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar .eyebrow {
    font-size: 9px;
    line-height: 12px;
  }

  .topbar h2 {
    margin-top: 3px;
    font-size: 18px;
    line-height: 1.15;
  }

  .topbar .subtitle {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.45;
  }

  .topbar .icon-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 7px;
  }

  .topbar .icon-button .icon {
    width: 16px !important;
    height: 16px !important;
  }

  .metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .metric {
    min-height: 76px;
    padding: 8px 4px;
    grid-template-columns: 1fr;
    grid-template-rows: 22px 14px 22px;
    justify-items: center;
    align-items: center;
    gap: 3px;
    text-align: center;
    overflow: hidden;
  }

  .metric-icon {
    grid-row: auto;
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }

  .metric-icon .icon {
    width: 13px !important;
    height: 13px !important;
  }

  .metric span,
  .metric strong,
  .metric small {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric span {
    font-size: 10px;
    line-height: 14px;
  }

  .metric strong {
    font-size: 13px;
    line-height: 22px;
  }

  .metric small {
    display: none;
  }

  .bubble-map {
    min-height: 0;
    margin-bottom: 10px;
    padding: 14px 10px 12px;
  }

  .bubble-cloud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: center;
    align-items: start;
    gap: 10px 8px;
    padding: 2px 0;
  }

  .bubble,
  .bubble-item {
    width: 58px !important;
  }

  .bubble {
    height: 58px !important;
  }

  .skeleton-circle {
    width: 58px;
    height: 58px;
  }

  .bubble-cloud .skeleton-loading-text {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    margin: 2px 0 0;
    text-align: center;
    font-size: 11px;
    line-height: 16px;
  }

  .bubble-item,
  .bubble-item:nth-child(odd),
  .bubble-item:nth-child(3n),
  .bubble-item:nth-child(5n+2) {
    margin: 0;
    transform: none;
    transform-origin: center;
  }
}
