/* ==========================================================================
   有明书屋 (www.mingsec.com) · 素瓷雅集 Pro Design System
   Aesthetic: Apple Cupertino Craft × Song Dynasty Ding Ware Porcelain (定窑白瓷)
   ========================================================================== */

:root {
  /* Porcelain Day Palette (定窑素瓷) */
  --bg: #F5F4F0;
  --bg-elevated: #FAF9F6;
  --surface: #FFFFFF;
  --surface-subtle: #F8F6F1;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --nav-glass: rgba(245, 244, 240, 0.78);

  --ink: #1D1D1F;
  --ink-secondary: #49494D;
  --ink-muted: #7E7E84;
  --ink-faint: #AEAEB4;

  /* Traditional Chinese Accents */
  --seal: #B5382A;
  --seal-hover: #9B2D20;
  --seal-soft: rgba(181, 56, 42, 0.085);
  --seal-border: rgba(181, 56, 42, 0.22);

  --gold: #8C7355;
  --gold-soft: rgba(140, 115, 85, 0.11);
  --celadon: #4A6F63;
  --celadon-soft: rgba(74, 111, 99, 0.1);

  /* Borders & Specular Highlights */
  --border: rgba(29, 29, 31, 0.075);
  --border-strong: rgba(29, 29, 31, 0.13);
  --inner-rim: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* Silky Multi-Layer Shadows */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.025);
  --shadow-sm: 0 4px 14px rgba(20, 20, 22, 0.038), 0 1px 3px rgba(20, 20, 22, 0.03);
  --shadow-md: 0 14px 36px rgba(20, 20, 22, 0.065), 0 3px 10px rgba(20, 20, 22, 0.03);
  --shadow-lg: 0 24px 56px rgba(20, 20, 22, 0.095), 0 6px 16px rgba(20, 20, 22, 0.04);
  --shadow-modal: 0 32px 80px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Radii & Typography */
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 980px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", Georgia, serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --reader-font-size: 17.5px;
  --reader-font-family: var(--font-serif);
}

/* Warm Night Lamp Mode (澄心夜釉) */
html[data-theme="dark"] {
  --bg: #111214;
  --bg-elevated: #17181C;
  --surface: #191B20;
  --surface-subtle: #20232A;
  --surface-glass: rgba(25, 27, 32, 0.82);
  --nav-glass: rgba(17, 18, 20, 0.78);

  --ink: #EFECE4;
  --ink-secondary: #B5B1A7;
  --ink-muted: #807E78;
  --ink-faint: #525257;

  --seal: #D14D3E;
  --seal-hover: #E05A4B;
  --seal-soft: rgba(209, 77, 62, 0.15);
  --seal-border: rgba(209, 77, 62, 0.34);

  --gold: #C8AD82;
  --gold-soft: rgba(200, 173, 130, 0.14);
  --celadon: #74A192;
  --celadon-soft: rgba(116, 161, 146, 0.14);

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --inner-rim: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.44);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.56);
}

/* Paper Tint Variants for Reader */
body[data-paper="xuan"] {
  --surface: #FBF6EA;
  --surface-subtle: #F4ECDC;
}
html[data-theme="dark"] body[data-paper="xuan"] {
  --surface: #1D1B17;
  --surface-subtle: #26231D;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -15%, rgba(140, 115, 85, 0.07), transparent),
    radial-gradient(ellipse 50% 40% at 90% 10%, rgba(181, 56, 42, 0.035), transparent);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.65;
  transition: background-color 0.35s ease, color 0.35s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font-family: inherit;
}

/* ==========================================================================
   Sticky Apple Translucent Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: 60px;
  background: var(--nav-glass);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-seal {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 3px 10px rgba(181, 56, 42, 0.28);
  transition: transform 0.3s var(--ease-spring);
}

.brand-link:hover .brand-seal {
  transform: rotate(-4deg) scale(1.06);
}

.brand-text {
  font-family: var(--font-serif);
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-domain {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(128, 128, 128, 0.08);
  border: 1px solid var(--border);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(128, 128, 128, 0.055);
  border: 1px solid var(--border);
}

.nav-item {
  padding: 5px 15px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: all 0.22s var(--ease-out);
}

.nav-item:hover {
  color: var(--ink);
}

.nav-item.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

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

.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.22s var(--ease-out);
}

.cmdk-trigger:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.cmdk-kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink-muted);
}

.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.22s var(--ease-out);
}

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

.mobile-menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-drawer {
  display: none;
  padding: 12px 24px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-drawer.open {
  display: flex;
}

/* ==========================================================================
   Main Container & Porcelain Card Primitives
   ========================================================================== */
.main-wrap {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 80px;
  flex: 1;
}

.porcelain-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--inner-rim), var(--shadow-sm);
  position: relative;
  transition: transform 0.36s var(--ease-out), box-shadow 0.36s var(--ease-out), border-color 0.25s ease, background-color 0.3s ease;
}

.porcelain-card.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--inner-rim), var(--shadow-lg);
  border-color: var(--border-strong);
}

/* Subtle Traditional Corner Hairlines (宋式折角纹) */
.corner-ornament::before,
.corner-ornament::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  opacity: 0.38;
}
.corner-ornament::before {
  top: 12px;
  left: 12px;
  border-top: 1.5px solid var(--gold);
  border-left: 1.5px solid var(--gold);
  border-top-left-radius: 4px;
}
.corner-ornament::after {
  bottom: 12px;
  right: 12px;
  border-bottom: 1.5px solid var(--gold);
  border-right: 1.5px solid var(--gold);
  border-bottom-right-radius: 4px;
}

/* Pills & Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3.5px 11px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill-seal {
  background: var(--seal-soft);
  color: var(--seal);
}

.pill-gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.pill-celadon {
  background: var(--celadon-soft);
  color: var(--celadon);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.tag-chip:hover,
.tag-chip.active {
  background: var(--seal-soft);
  color: var(--seal);
  border-color: var(--seal-border);
}

/* Buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.22s ease, color 0.22s ease;
}

.btn-ink {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 8px 20px rgba(29, 29, 31, 0.16);
}

.btn-ink:hover {
  background: var(--seal);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(181, 56, 42, 0.28);
}

.btn-porcelain {
  background: var(--surface-glass);
  color: var(--ink);
  border-color: var(--border-strong);
  backdrop-filter: blur(12px);
}

.btn-porcelain:hover {
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Hero Panorama Stage (Index)
   ========================================================================== */
.hero-panorama {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-subtle) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--inner-rim), var(--shadow-md);
  min-height: 390px;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.hero-artwork {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-artwork svg {
  width: 100%;
  height: 100%;
  display: block;
}

html[data-theme="dark"] .hero-artwork {
  opacity: 0.36;
  filter: invert(0.86) hue-rotate(175deg);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 52px 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}

.hero-main {
  max-width: 620px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 18px;
}

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

.hero-heading {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.12;
}

.hero-subtitle {
  margin: 0 0 28px;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Traditional Vertical Epigraph Card (竖排题签) */
.hero-epigraph {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 18px;
  border-radius: 20px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.epigraph-col {
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.24em;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.epigraph-rule {
  width: 1px;
  height: 112px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  opacity: 0.45;
}

.epigraph-stamp {
  writing-mode: horizontal-tb;
  margin-top: 8px;
  display: inline-block;
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid var(--seal);
  color: var(--seal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   12-Column Asymmetric Apple Bento Grid
   ========================================================================== */
.bento-matrix {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 52px;
}

/* Card 1: Featured Essay (7 cols) */
.bento-spotlight {
  grid-column: span 7;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.spotlight-visual {
  position: relative;
  height: 215px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.spotlight-visual svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.6s var(--ease-out);
}

.bento-spotlight:hover .spotlight-visual svg {
  transform: scale(1.025);
}

.spotlight-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.82);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.spotlight-content {
  padding: 26px 30px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.meta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.spotlight-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.38;
  font-weight: 700;
}

.spotlight-title a:hover {
  color: var(--seal);
}

.spotlight-desc {
  margin: 0 0 20px;
  font-size: 14.5px;
  color: var(--ink-secondary);
  line-height: 1.76;
  flex: 1;
}

.card-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.action-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--seal);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.action-link:hover {
  gap: 7px;
}

/* Right Stack beside Spotlight (5 cols) */
.bento-right-col {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Solar Term Interactive Card */
.bento-solar {
  padding: 24px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.bento-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.micro-btn {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.micro-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.solar-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.solar-term-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.solar-lunar {
  font-size: 12.5px;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 10px;
}

.solar-verse {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.solar-dial {
  flex-shrink: 0;
}

/* Quick Reading Card inside Right Stack */
.bento-reading-mini {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.book-mini-flex {
  display: flex;
  align-items: center;
  gap: 16px;
}

.book-3d-mini {
  width: 54px;
  height: 76px;
  border-radius: 6px 10px 10px 6px;
  background: linear-gradient(145deg, #2C3338 0%, #181C1F 100%);
  color: #F3EDE0;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.14em;
  border-left: 4px solid var(--gold);
  box-shadow: 6px 8px 18px rgba(0, 0, 0, 0.16);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-out);
}

.bento-reading-mini:hover .book-3d-mini {
  transform: perspective(400px) rotateY(-12deg) translateY(-2px);
}

.book-mini-meta {
  flex: 1;
  min-width: 0;
}

.book-mini-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 3px;
}

.book-mini-sub {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-bar > i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold), var(--seal));
}

.progress-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-secondary);
}

/* Bottom 3 Bento Cards (4 + 4 + 4 cols) */
.bento-col-4 {
  grid-column: span 4;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.series-preview-title {
  font-family: var(--font-serif);
  font-size: 17.5px;
  font-weight: 700;
  margin: 4px 0 6px;
}

.series-preview-desc {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.stats-trio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.stat-cell {
  text-align: center;
  flex: 1;
}

.stat-val {
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

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

.stat-sep {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* Interactive Seal Greeting Card */
.stamp-greet-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
}

.stamp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--seal-border);
  background: var(--seal-soft);
  color: var(--seal);
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), background 0.2s ease;
}

.stamp-btn:hover {
  transform: scale(1.04);
  background: var(--seal);
  color: #FFFFFF;
}

.stamp-btn.stamped {
  background: var(--seal);
  color: #FFFFFF;
}

.stamp-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

/* ==========================================================================
   Section Headers, Segmented Controls & Essay Feed
   ========================================================================== */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-subtitle {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.segmented-bar {
  display: inline-flex;
  flex-shrink: 0;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(128, 128, 128, 0.08);
  border: 1px solid var(--border);
  gap: 2px;
}

.seg-tab {
  border: none;
  background: transparent;
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
}

.seg-tab:hover {
  color: var(--ink);
}

.seg-tab.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

/* Essays Grid & Compact List Modes */
.essays-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}

.essays-grid.list-view {
  grid-template-columns: 1fr;
  gap: 12px;
}

.essay-card {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.essay-card-top {
  margin-bottom: 16px;
}

.essay-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 20.5px;
  font-weight: 700;
  line-height: 1.42;
}

.essay-title a:hover {
  color: var(--seal);
}

.essay-excerpt {
  margin: 0;
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.74;
}

.essays-grid.list-view .essay-card {
  padding: 18px 24px;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}

.essays-grid.list-view .essay-excerpt {
  display: none;
}

.essays-grid.list-view .essay-card-top {
  margin-bottom: 0;
}

.essays-grid.list-view .card-footer-bar {
  border-top: none;
  padding-top: 0;
  flex-shrink: 0;
}

/* ==========================================================================
   Page Banner (Subpages: Columns, Bookshelf, Archive, About)
   ========================================================================== */
.page-hero {
  padding: 38px 44px;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
}

.page-hero-title {
  margin: 8px 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700;
}

.page-hero-desc {
  margin: 0;
  max-width: 620px;
  font-size: 15.5px;
  color: var(--ink-secondary);
  line-height: 1.75;
}

/* ==========================================================================
   Columns Page (专题专栏)
   ========================================================================== */
.columns-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.column-showcase {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  overflow: hidden;
}

.column-art {
  position: relative;
  min-height: 260px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  background: linear-gradient(145deg, var(--surface-subtle), var(--bg));
}

.column-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--border);
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.chapter-item:hover {
  background: var(--surface-subtle);
  padding-left: 14px;
  color: var(--seal);
}

.chapter-idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  margin-right: 10px;
}

/* ==========================================================================
   Bookshelf Page (案头书单 · Apple Books 3D Shelf)
   ========================================================================== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.book-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  cursor: pointer;
}

.book-stage {
  display: flex;
  align-items: center;
  gap: 20px;
}

.book-cover-3d {
  width: 86px;
  height: 122px;
  border-radius: 6px 12px 12px 6px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #FAF6EE;
  box-shadow:
    inset 4px 0 8px rgba(255, 255, 255, 0.14),
    inset -1px 0 2px rgba(0, 0, 0, 0.25),
    8px 12px 24px rgba(20, 20, 22, 0.18);
  position: relative;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.book-cover-3d::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8px;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.22);
}

.book-card:hover .book-cover-3d {
  transform: perspective(600px) rotateY(-14deg) translateY(-4px);
  box-shadow: 14px 18px 30px rgba(20, 20, 22, 0.24);
}

.book-cover-label {
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 11.5px;
  line-height: 1.25;
  letter-spacing: 0.14em;
  background: rgba(255, 253, 248, 0.92);
  color: #1D1D1F;
  padding: 6px 3px;
  border-radius: 2px;
  align-self: flex-end;
  max-height: 102px;
  overflow: hidden;
}

.book-meta {
  flex: 1;
  min-width: 0;
}

.book-name {
  margin: 6px 0 4px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.book-writer {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.book-note-snippet {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.7;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Archive Page (岁时归档 & 二十四节气热力图)
   ========================================================================== */
.heatmap-card {
  padding: 26px 30px;
  margin-bottom: 26px;
}

.solar-heatmap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.solar-cell {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  text-align: center;
  transition: transform 0.2s ease;
}

.solar-cell:hover {
  transform: translateY(-2px);
}

.solar-cell[data-level="1"] { background: rgba(140, 115, 85, 0.14); border-color: rgba(140, 115, 85, 0.28); }
.solar-cell[data-level="2"] { background: rgba(181, 56, 42, 0.14); border-color: rgba(181, 56, 42, 0.28); }
.solar-cell[data-level="3"] { background: var(--seal); color: #FFFFFF; border-color: var(--seal); }

.solar-cell-name {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
}

.solar-cell-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.78;
  margin-top: 2px;
}

.timeline-card {
  padding: 28px 34px;
}

.timeline-year {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  margin: 22px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-year:first-child {
  margin-top: 0;
}

.timeline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.timeline-row:hover {
  background: var(--surface-subtle);
}

.timeline-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.timeline-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   About Page (关于书屋 Bento)
   ========================================================================== */
.about-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.about-bio { grid-column: span 7; padding: 32px 36px; }
.about-card-5 { grid-column: span 5; padding: 28px 30px; }
.about-card-6 { grid-column: span 6; padding: 28px 30px; }

.about-bio p {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-secondary);
  margin: 0 0 16px;
}

.desk-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.desk-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.desk-item strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.desk-item span {
  font-size: 12px;
  color: var(--ink-muted);
}

.copy-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 10px;
}

/* ==========================================================================
   Article Reader Page (沉浸式阅读器)
   ========================================================================== */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--seal));
  z-index: 200;
  transition: width 0.08s linear;
}

.article-masthead {
  padding: 40px 46px;
  margin-bottom: 22px;
}

.article-h1 {
  margin: 12px 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.8vw, 42px);
  line-height: 1.26;
  font-weight: 700;
}

.article-lead {
  margin: 0 0 20px;
  font-size: 16.5px;
  color: var(--ink-secondary);
  line-height: 1.78;
}

/* Reader Floating Toolbar */
.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  margin-bottom: 22px;
  border-radius: 18px;
}

.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.tool-chip {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-chip.active,
.tool-chip:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.reader-columns {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.toc-sticky {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toc-box {
  padding: 20px 22px;
}

.toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14.5px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.toc-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-links a {
  display: block;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--ink-secondary);
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.toc-links a:hover,
.toc-links a.active {
  background: var(--seal-soft);
  color: var(--seal);
  border-left-color: var(--seal);
  font-weight: 600;
}

.prose-surface {
  padding: 44px 52px;
  font-family: var(--reader-font-family);
  font-size: var(--reader-font-size);
  line-height: 1.95;
}

.prose-surface h2 {
  font-family: var(--font-serif);
  font-size: 1.35em;
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 84px;
}

.prose-surface h2:first-child {
  margin-top: 0;
}

.prose-surface p {
  margin: 0 0 20px;
}

.prose-surface blockquote {
  margin: 24px 0;
  padding: 18px 24px;
  border-radius: 16px;
  background: var(--surface-subtle);
  border-left: 3.5px solid var(--seal);
  color: var(--ink-secondary);
}

.prose-surface ul {
  margin: 0 0 22px;
  padding-left: 22px;
}

.prose-surface li {
  margin-bottom: 8px;
}

.prose-surface code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(128, 128, 128, 0.11);
}

/* macOS Code Window */
.code-frame {
  margin: 26px 0;
  border-radius: 18px;
  overflow: hidden;
  background: #1B1D21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-md);
  font-family: var(--font-sans);
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #24272D;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mac-dots {
  display: flex;
  gap: 7px;
}

.mac-dots i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.mac-dots .r { background: #FF5F56; }
.mac-dots .y { background: #FFBD2E; }
.mac-dots .g { background: #27C93F; }

.code-lang {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #A2A6B0;
}

.code-copy {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #ECEFF4;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  cursor: pointer;
}

.code-frame pre {
  margin: 0;
  padding: 18px 22px;
  overflow-x: auto;
  line-height: 1.62;
}

.code-frame pre code {
  background: transparent;
  padding: 0;
  color: #ECEFF4;
  font-size: 13px;
}

/* Red Ink Seal Applause Section */
.applause-box {
  margin-top: 38px;
  padding: 26px;
  border-radius: 20px;
  background: var(--surface-subtle);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.seal-impression {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 2.5px solid var(--seal);
  border-radius: 10px;
  color: var(--seal);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  transform: rotate(-6deg) scale(0.92);
  opacity: 0.35;
  transition: transform 0.35s var(--ease-spring), opacity 0.3s ease, background 0.3s ease;
}

.seal-impression.active {
  opacity: 1;
  transform: rotate(-4deg) scale(1.04);
  background: rgba(181, 56, 42, 0.08);
}

.prev-next-row {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pn-item {
  padding: 22px 26px;
}

/* ==========================================================================
   Spotlight Command Palette (⌘K) & Book Modal Drawer
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 16, 18, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 20px 20px;
}

.modal-backdrop.open {
  display: flex;
}

.cmdk-dialog,
.book-dialog {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: modalPop 0.24s var(--ease-out);
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.cmdk-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
}

.cmdk-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
}

.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cmdk-item:hover,
.cmdk-item.focused {
  background: var(--seal-soft);
}

.cmdk-item-title {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 600;
}

.cmdk-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.book-dialog-body {
  padding: 30px 34px;
}

/* ==========================================================================
   Site Colophon Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  padding: 38px 24px;
}

.footer-wrap {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.footer-seal {
  background: var(--seal);
  color: #FFFDF9;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
}

.footer-colophon {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.footer-nav a:hover {
  color: var(--seal);
}

.footer-legal {
  max-width: 1180px;
  margin: 20px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  font-size: 12px;
  color: var(--ink-muted);
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease;
}

.footer-legal a:hover {
  color: var(--ink);
}

.footer-legal-sep {
  opacity: 0.45;
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .bento-spotlight,
  .bento-right-col,
  .bento-col-4,
  .about-bio,
  .about-card-5,
  .about-card-6 {
    grid-column: span 12;
  }
  .column-showcase,
  .reader-columns {
    grid-template-columns: 1fr;
  }
  .column-art {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 180px;
  }
  .toc-sticky {
    position: static;
  }
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .solar-heatmap {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .hero-epigraph {
    display: none;
  }
  .hero-inner {
    padding: 38px 30px;
  }
}

@media (max-width: 720px) {
  .primary-nav,
  .brand-domain,
  .cmdk-kbd {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .essays-grid,
  .books-grid,
  .prev-next-row,
  .desk-list {
    grid-template-columns: 1fr;
  }
  .solar-heatmap {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .article-masthead,
  .prose-surface,
  .page-hero {
    padding: 26px 20px;
  }
  .timeline-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
