:root {
  --paper: #faf5eb;
  --paper-dot: rgba(154, 134, 110, 0.22);
  --surface: #fffdf8;
  --surface-alt: #f5ede0;
  --ink: #2f2923;
  --ink-soft: #6f6458;
  --ink-faint: #9a8d7e;
  --border: rgba(124, 102, 79, 0.16);
  --border-strong: rgba(124, 102, 79, 0.28);

  --accent: #c86d51;
  --accent-deep: #a9533a;
  --accent-soft: rgba(200, 109, 81, 0.12);
  --sage: #67836c;
  --sage-soft: rgba(103, 131, 108, 0.14);
  --ochre: #cc9442;

  /* 便签柔和纸色 */
  --note-0: #fffdf8;
  --note-1: #fff7dc;
  --note-2: #fceee9;
  --note-3: #edf4ee;
  --note-4: #f4eff9;

  --shadow-sm: 0 4px 14px rgba(72, 54, 34, 0.06);
  --shadow-md: 0 12px 28px rgba(72, 54, 34, 0.09);
  --shadow-lg: 0 20px 50px rgba(45, 32, 18, 0.16);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --font-serif: "LXGW WenKai", "PingFang SC", "Hiragino Sans GB", "Noto Serif CJK SC", "Songti SC", "Microsoft YaHei", Georgia, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

/* 深夜台灯模式 */
[data-theme="dark"] {
  --paper: #1b1815;
  --paper-dot: rgba(236, 214, 185, 0.08);
  --surface: #25211d;
  --surface-alt: #2e2923;
  --ink: #efe6da;
  --ink-soft: #b8aa99;
  --ink-faint: #847768;
  --border: rgba(239, 224, 202, 0.11);
  --border-strong: rgba(239, 224, 202, 0.22);

  --accent: #e08669;
  --accent-deep: #ec9a7f;
  --accent-soft: rgba(224, 134, 105, 0.16);
  --sage: #8eb093;
  --sage-soft: rgba(142, 176, 147, 0.16);

  --note-0: #25211d;
  --note-1: #2c271e;
  --note-2: #2d2320;
  --note-3: #222923;
  --note-4: #27232c;

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.26);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* 梦幻虚化奶娃泡泡湖面背景 + 细腻点阵手账纸薄纱 */
.paper-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.paper-backdrop::before {
  content: "";
  position: absolute;
  inset: -24px;
  background: url("./bg.jpg") center 42% / cover no-repeat;
  filter: blur(8px) saturate(1.12) brightness(1.02);
  transform: scale(1.04);
  transition: filter 0.3s ease;
}

.paper-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(var(--paper-dot) 1.2px, transparent 1.2px),
    linear-gradient(
      180deg,
      rgba(252, 246, 238, 0.46) 0%,
      rgba(250, 243, 233, 0.36) 48%,
      rgba(247, 239, 228, 0.54) 100%
    );
  background-size: 24px 24px, 100% 100%;
  transition: background 0.3s ease;
}

[data-theme="dark"] .paper-backdrop::before {
  filter: blur(13px) saturate(0.96) brightness(0.42);
}

[data-theme="dark"] .paper-backdrop::after {
  background-image:
    radial-gradient(var(--paper-dot) 1.2px, transparent 1.2px),
    linear-gradient(
      180deg,
      rgba(26, 22, 19, 0.64) 0%,
      rgba(26, 22, 19, 0.54) 50%,
      rgba(24, 20, 17, 0.72) 100%
    );
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px dashed var(--border-strong);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none !important;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  font-size: 20px;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-text small {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-stamp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: var(--surface);
}

/* 按钮体系 */
.btn-primary,
.btn-ghost,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--accent);
  color: #fffdf9;
  border: 1px solid transparent;
  padding: 8px 16px;
  box-shadow: 0 6px 16px rgba(200, 109, 81, 0.26);
}

.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(200, 109, 81, 0.32);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 8px 15px;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-sm {
  font-size: 13px;
  padding: 6px 12px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* 主容器 */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* 通用手账卡片与和纸胶带（带轻磨砂玻璃通透感，隐约透出虚化泡泡光泽） */
.card {
  position: relative;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.washi-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 92px;
  height: 22px;
  border-radius: 3px;
  opacity: 0.72;
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.tape-terracotta {
  background: repeating-linear-gradient(
    -45deg,
    rgba(200, 109, 81, 0.48),
    rgba(200, 109, 81, 0.48) 7px,
    rgba(235, 168, 138, 0.48) 7px,
    rgba(235, 168, 138, 0.48) 14px
  );
}

.tape-sage {
  transform: translateX(-50%) rotate(2.4deg);
  background: repeating-linear-gradient(
    45deg,
    rgba(103, 131, 108, 0.44),
    rgba(103, 131, 108, 0.44) 7px,
    rgba(164, 192, 166, 0.44) 7px,
    rgba(164, 192, 166, 0.44) 14px
  );
}

/* Hero 布局 */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 48px;
}

.hero-card {
  padding: 32px 30px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.hero-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar-frame {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--note-1), var(--note-2));
  border: 3px solid var(--surface);
  box-shadow: 0 10px 24px rgba(90, 62, 34, 0.16), 0 0 0 1px var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 38px;
  overflow: hidden;
  transform: rotate(-2.5deg);
  transition: transform 0.22s ease;
}

.avatar-frame:hover {
  transform: rotate(0deg) scale(1.04);
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
  margin-bottom: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-soft);
}

.hero-identity h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.hero-location {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}

.hero-tagline {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.85;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-chip {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}

.hero-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

/* 右侧边栏：Now 便签 + 数据卡片 */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sticky-note {
  padding: 26px 24px 22px;
  flex: 1;
}

.sticky-butter {
  background: color-mix(in srgb, var(--note-1) 86%, transparent);
}

.card-kicker,
.section-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.sticky-note h2 {
  margin: 6px 0 12px;
  font-family: var(--font-serif);
  font-size: 20px;
}

.now-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.now-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  color: var(--ink-soft);
}

.now-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
}

.stats-card {
  padding: 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.stat-label {
  font-size: 12px;
  color: var(--ink-faint);
}

.stat-divider {
  width: 1px;
  height: 30px;
  background: var(--border-strong);
}

/* 碎碎念区域 */
.notes-section {
  margin-bottom: 56px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.25;
}

.controls-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.7;
}

.search-wrap input {
  width: 220px;
  padding: 9px 14px 9px 36px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, width 0.2s ease;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.view-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.view-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 标签栏 */
.tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffdf9;
}

.feed-notice {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  color: var(--ink);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* 便签瀑布流视图 */
.notes-grid {
  column-count: 3;
  column-gap: 20px;
}

.notes-grid.timeline-mode {
  column-count: 1;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  padding-left: 26px;
  border-left: 2px dashed var(--border-strong);
}

.note-card {
  break-inside: avoid;
  margin-bottom: 20px;
  padding: 20px 20px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--note-0) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.note-card[data-tint="1"] { background: color-mix(in srgb, var(--note-1) 88%, transparent); }
.note-card[data-tint="2"] { background: color-mix(in srgb, var(--note-2) 88%, transparent); }
.note-card[data-tint="3"] { background: color-mix(in srgb, var(--note-3) 88%, transparent); }
.note-card[data-tint="4"] { background: color-mix(in srgb, var(--note-4) 88%, transparent); }

.notes-grid:not(.timeline-mode) .note-card:nth-child(odd) {
  transform: rotate(-0.45deg);
}

.notes-grid:not(.timeline-mode) .note-card:nth-child(even) {
  transform: rotate(0.45deg);
}

.note-card:hover {
  transform: translateY(-3px) rotate(0deg) !important;
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.notes-grid.timeline-mode .note-card::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--ink-faint);
}

.note-time {
  font-family: var(--font-mono);
}

.pin-badge,
.sample-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.pin-badge {
  background: var(--accent-soft);
  color: var(--accent);
}

.sample-badge {
  background: var(--sage-soft);
  color: var(--sage);
}

/* Markdown 内容排版 */
.markdown-body {
  font-size: 15px;
  color: var(--ink);
  word-break: break-word;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p {
  margin: 0 0 10px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-family: var(--font-serif);
  margin: 12px 0 8px;
  line-height: 1.35;
}

.markdown-body h1 { font-size: 19px; }
.markdown-body h2 { font-size: 17px; }
.markdown-body h3 { font-size: 15.5px; }

.markdown-body blockquote {
  margin: 10px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--accent);
  background: rgba(128, 100, 72, 0.06);
  border-radius: 0 8px 8px 0;
  color: var(--ink-soft);
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(128, 100, 72, 0.11);
  padding: 2px 5px;
  border-radius: 5px;
}

.markdown-body pre {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #231f1b;
  color: #f3e9dc;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.markdown-body ul,
.markdown-body ol {
  margin: 8px 0;
  padding-left: 20px;
}

.markdown-body .inline-tag {
  display: inline-block;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.9em;
  margin-right: 3px;
  cursor: pointer;
}

.markdown-body .task-item {
  list-style: none;
  margin-left: -18px;
}

.note-card .markdown-body.is-clamped {
  max-height: 290px;
  overflow: hidden;
  position: relative;
}

.note-card .markdown-body.is-clamped::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}

/* 拍立得风格附件图 */
.note-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.polaroid-img {
  background: #ffffff;
  padding: 6px 6px 14px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.16s ease;
}

[data-theme="dark"] .polaroid-img {
  background: #332d27;
}

.polaroid-img:hover {
  transform: scale(1.02);
}

.polaroid-img img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  border-radius: 3px;
}

.note-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.file-chip {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.note-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-faint);
}

.note-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-tag {
  color: var(--accent);
  font-size: 12px;
}

.loading-card,
.empty-card {
  column-span: all;
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  color: var(--ink-soft);
}

/* 书桌角落卡片 */
.links-section {
  margin-bottom: 24px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  text-align: left;
  font-family: inherit;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.link-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.link-card h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 16px;
}

.link-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* 页脚 */
.site-footer {
  border-top: 1px dashed var(--border-strong);
  padding: 26px 20px 36px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

.site-footer p {
  margin: 4px 0;
}

.footer-meta code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--ink-soft);
}

/* 阅读弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(25, 20, 15, 0.56);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-overlay[hidden],
.lightbox-overlay[hidden] {
  display: none !important;
}

.modal-sheet {
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px 26px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border-strong);
  margin-bottom: 18px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.modal-body {
  font-size: 15.5px;
  line-height: 1.85;
}

.modal-attachments {
  margin-top: 16px;
}

.modal-attachments .polaroid-img img {
  height: auto;
  max-height: 420px;
  object-fit: contain;
  background: var(--surface-alt);
}

.modal-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* 灯箱 */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16, 13, 10, 0.88);
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox-overlay img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* 响应式 */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .notes-grid {
    column-count: 2;
  }
  .links-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 10px 14px;
  }
  .date-stamp,
  .brand-text small {
    display: none;
  }
  .container {
    padding: 22px 14px 48px;
  }
  .hero-card {
    padding: 24px 20px 22px;
  }
  .hero-identity h1 {
    font-size: 24px;
  }
  .notes-grid {
    column-count: 1;
  }
  .search-wrap input {
    width: 100%;
  }
  .controls-bar {
    width: 100%;
  }
  .search-wrap {
    flex: 1;
  }
}
