:root {
  --bg: #F7F3EB;
  --surface: #FFFDFA;
  --surface-soft: #EFEAE0;
  --surface-glass: rgba(247, 243, 235, 0.88);
  --text: #382F23;
  --text-secondary: #6E6251;
  --text-muted: #998C7A;
  --border: rgba(84, 70, 32, 0.085);
  --border-strong: rgba(84, 70, 32, 0.16);
  --accent: #9E683F;
  --accent-soft: #F3E7D6;
  --shadow-sm: 0 1px 6px rgba(84, 70, 32, 0.035);
  --shadow-md: 0 6px 20px rgba(84, 70, 32, 0.06);
  --shadow-lg: 0 18px 46px rgba(42, 32, 18, 0.14);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif CN", Georgia, serif;
  --reader-font: var(--font-sans);
  --reader-size: 16px;
  --reader-lh: 1.54;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html[data-theme="white"] {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-soft: #F4F1EC;
  --surface-glass: rgba(255, 255, 255, 0.9);
  --text: #382F23;
  --text-secondary: #6E6251;
  --text-muted: #998C7A;
  --border: rgba(84, 70, 32, 0.08);
  --border-strong: rgba(84, 70, 32, 0.15);
  --shadow-sm: 0 1px 6px rgba(84, 70, 32, 0.04);
  --shadow-md: 0 6px 20px rgba(84, 70, 32, 0.065);
}

html[data-theme="dark"] {
  --bg: #171614;
  --surface: #22201D;
  --surface-soft: #2B2824;
  --surface-glass: rgba(23, 22, 20, 0.88);
  --text: #E2DDD4;
  --text-secondary: #A69E92;
  --text-muted: #787167;
  --border: rgba(255, 244, 228, 0.085);
  --border-strong: rgba(255, 244, 228, 0.16);
  --accent: #E89B54;
  --accent-soft: #31251A;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

html[data-font="serif"] { --reader-font: var(--font-serif); }
html[data-font="sans"] { --reader-font: var(--font-sans); }

html[data-size="sm"] { --reader-size: 15px; --reader-lh: 1.54; }
html[data-size="md"] { --reader-size: 16px; --reader-lh: 1.54; }
html[data-size="lg"] { --reader-size: 17.5px; --reader-lh: 1.58; }
html[data-size="xl"] { --reader-size: 19px; --reader-lh: 1.62; }

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-width: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

img { display: block; max-width: 100%; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }

/* Top reading progress */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, #E89E52, #D4782B);
  z-index: 200;
  opacity: 0;
  transition: width 80ms linear, opacity 180ms ease;
  pointer-events: none;
}
.read-progress.active { opacity: 1; }

/* Container */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px;
}

.page-pad-bottom {
  padding-bottom: calc(96px + var(--safe-bottom));
}

/* Sticky top header */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 54px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.top-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  box-shadow: none;
  transition: opacity 0.14s ease;
}
.top-text-btn:active { opacity: 0.55; }
.top-text-btn.member-on {
  color: var(--accent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  min-width: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  box-shadow: none;
  transition: transform 0.14s ease, background-color 0.15s ease;
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn.icon-only { width: 32px; padding: 0; }
.icon-btn.member-on {
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-btn.fav-on {
  color: #D98236;
  background: var(--accent-soft);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  min-width: 68px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 14px 6px 4px;
  margin-left: -4px;
  border-radius: 10px;
  touch-action: manipulation;
  flex-shrink: 0;
}
.back-btn:active { background: var(--surface-soft); }

/* Hero Welcome section */
.hero-wrap {
  padding-top: 14px;
  margin-bottom: 18px;
}

.hero-banner {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  background: var(--surface-soft);
}

.hero-banner img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 0 2px;
}

.hero-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  box-shadow: none;
  transition: transform 0.14s ease, opacity 0.15s ease;
}
.pill-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.pill-btn:active { transform: scale(0.96); }
.pill-btn.preface {
  background: #EFE2CD;
  color: #6B4925;
}
.pill-btn.guide {
  background: #E4E6D2;
  color: #4D5428;
}
html[data-theme="dark"] .pill-btn.preface {
  background: #33271C;
  color: #E5B98A;
}
html[data-theme="dark"] .pill-btn.guide {
  background: #282B1E;
  color: #C4CC96;
}

/* Resume Reading Card */
.resume-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 14px 0 6px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.15s ease;
}
.resume-card:active { transform: scale(0.985); }
.resume-thumb {
  width: 72px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.resume-meta {
  flex: 1;
  min-width: 0;
}
.resume-kicker {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 2px;
}
.resume-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resume-go {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

/* Module Shelf */
.shelf {
  margin-top: 26px;
}
.shelf.shelf-sub {
  margin-top: 18px;
}

.shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.shelf-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shelf-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.shelf-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.shelf-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.shelf-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: none;
  box-shadow: none;
  flex-shrink: 0;
  transition: transform 0.14s ease, color 0.14s ease;
}
.shelf-more:hover { color: var(--text); }
.shelf-more:active { transform: scale(0.96); }

.shelf-banner {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  background: var(--surface-soft);
}
.shelf-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* 03 Philosophy Map Flat Capsule Pills */
.map-seg-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 11px;
}
.map-seg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.map-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  border: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.14s ease;
}
.map-seg-btn:active { transform: scale(0.96); }
.map-seg-btn.active {
  background: #DCEEFF;
  color: #2D6296;
  font-weight: 700;
}
[data-theme="dark"] .map-seg-btn.active {
  background: #1C2E40;
  color: #9AC7F2;
}

/* Horizontal Snap Carousel */
.carousel-shell {
  position: relative;
}

.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.carousel-arrow {
  display: none;
}

@media (min-width: 820px) {
  .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-54%);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.14s ease;
  }
  .carousel-shell:hover .carousel-arrow { opacity: 0.94; }
  .carousel-arrow:hover { transform: translateY(-54%) scale(1.06); }
  .carousel-arrow.prev { left: -14px; }
  .carousel-arrow.next { right: -14px; }
}

/* Pure Cover Card */
.cover-card {
  position: relative;
  flex: 0 0 56vw;
  max-width: 218px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
@media (min-width: 640px) {
  .cover-card { flex: 0 0 202px; max-width: 202px; }
}
.cover-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.cover-card:active { transform: scale(0.975); }

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

.card-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.card-badge.free {
  background: rgba(255, 246, 232, 0.92);
  color: #B45D14;
  border: 1px solid rgba(217, 130, 54, 0.25);
}
.card-badge.locked {
  padding: 3px 6px;
  background: rgba(28, 25, 22, 0.46);
  color: #FFFDF8;
  font-size: 11px;
}
.card-badge.done {
  background: rgba(232, 245, 235, 0.94);
  color: #2E6F45;
  border: 1px solid rgba(79, 138, 101, 0.25);
}

/* Grid & List in Module View */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-soft);
  border: none;
  box-shadow: none;
  color: var(--text-muted);
  transition: background-color 0.14s ease, color 0.14s ease;
}
.chip.active {
  background: #FFE5A3;
  color: #6B4408;
  font-weight: 700;
}
[data-theme="dark"] .chip.active {
  background: #2D2A1E;
  color: #DDD4A8;
}

.mod-chapter-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 2px 2px 10px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}
@media (min-width: 760px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

.card-grid .cover-card {
  flex: none;
  width: 100%;
  max-width: none;
}

/* Morandi Capsule Directory */
.list-group {
  margin-top: 18px;
}
.list-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.list-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.list-group-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.list-group-title .ch-em,
.list-group-title .ch-rest {
  font-size: inherit;
  font-weight: inherit;
  color: var(--text-secondary) !important;
}
.list-group-title .ch-sep {
  opacity: 0.5;
}
.capsule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
@media (min-width: 640px) {
  .capsule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}
@media (min-width: 980px) {
  .capsule-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
  }
}

.capsule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  border: none;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.15s ease;
  min-width: 0;
}
.capsule-row:hover {
  filter: brightness(0.975);
}
.capsule-row:active { transform: scale(0.985); }

.capsule-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 40px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
html[data-theme="dark"] .capsule-code {
  background: rgba(0, 0, 0, 0.28);
}

.capsule-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.capsule-right {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.capsule-tag-free {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #B45D14;
  font-size: 11px;
  font-weight: 700;
}
html[data-theme="dark"] .capsule-tag-free {
  background: rgba(0, 0, 0, 0.3);
  color: #F0B67D;
}
.capsule-tag-done {
  color: #3E7D54;
  font-size: 13px;
  font-weight: 700;
}
.capsule-tag-lock {
  opacity: 0.55;
  font-size: 12px;
}

/* Keep .list-card for simple settings box in Me tab */
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Article Immersive Academic Reader */
.reader-top-bar {
  border-bottom: 1px solid var(--border);
}
.reader-top-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.reader-top-title.visible {
  opacity: 1;
  transform: translateY(0);
}

.reader-container {
  --r-title: #1F1D19;
  --r-ink: #37352F;
  --r-muted: #78746C;
  --r-surface: #FCF6E8;
  --r-border: rgba(55, 53, 47, 0.085);
  --art-accent: #5A5751;
  --art-tint: #FAF3E3;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 26px calc(76px + var(--safe-bottom));
  position: relative;
}

.reader-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.032;
  background-repeat: repeat;
  background-size: 260px 180px;
}

.art-header {
  padding-bottom: 14px;
}
.art-kicker-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-bottom: 13px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--r-border);
}
.art-kicker {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.art-chap-name {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  background: #F4F2ED;
  font-size: 12px;
  font-weight: 500;
  color: #6B6358;
  line-height: 1;
}

.art-h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.36;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--r-title);
}
@media (min-width: 640px) {
  .art-h1 { font-size: 28px; }
}

.art-subtitle {
  margin: 7px 0 0;
  font-size: 14.5px;
  color: var(--r-muted);
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.art-sub-card {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.art-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.art-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.art-divider {
  height: 1px;
  background: var(--r-border);
  margin: 0 0 20px;
}

/* Reader Body Typography (Calibrated to Notion iOS mobile reading comfort) */
.art-body {
  font-size: var(--reader-size);
  line-height: var(--reader-lh);
  color: var(--r-ink);
  font-weight: 400;
  letter-spacing: 0.015em;
  text-spacing-trim: trim-start;
  hanging-punctuation: none;
  word-break: normal;
  overflow-wrap: break-word;
  line-break: auto;
  position: relative;
  z-index: 3;
}

.art-body h2 {
  font-size: 1.24em;
  line-height: 1.38;
  font-weight: 700;
  margin: 1.85em 0 0.25em;
  letter-spacing: -0.01em;
  color: var(--r-title);
}
.art-body > h2:first-child {
  margin-top: 0.2em;
}
.art-body h2 + .art-figure {
  margin-top: 0.75em;
}

.art-body h3 {
  font-size: 1.08em;
  line-height: 1.4;
  font-weight: 700;
  margin: 1.35em 0 0.2em;
  letter-spacing: 0;
  color: var(--r-title);
}
.art-body h4 {
  font-size: 1em;
  font-weight: 700;
  margin: 1.05em 0 0.18em;
  letter-spacing: 0.01em;
  color: var(--r-muted);
}
.art-body p {
  margin: 0 0 1.05em;
  text-align: justify;
  text-justify: inter-ideograph;
}
.art-body strong {
  font-weight: 600;
  color: var(--r-title);
}

/* Minimal Circular List Markers */
.art-body ul {
  margin: 0.4em 0 1.05em;
  padding-left: 0;
  list-style: none;
}
.art-body ul li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 0.48em;
  text-align: justify;
  text-justify: inter-ideograph;
}
.art-body ul li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.58em;
  width: 4.5px;
  height: 4.5px;
  border-radius: 999px;
  background: #9B968E;
}
.art-body ul li.li-lead {
  padding-left: 0;
  margin-bottom: 0.6em;
}
.art-body ul li.li-lead::before {
  display: none;
}
.art-body ul li.li-lead > strong:first-child {
  font-weight: 700;
}

.art-body ol {
  margin: 0.45em 0 1.08em;
  padding-left: 0;
  list-style: none;
  counter-reset: ol-counter;
}
.art-body ol li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 0.62em;
  counter-increment: ol-counter;
  text-align: justify;
  text-justify: inter-ideograph;
  hanging-punctuation: none;
}
.art-body ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(142, 127, 105, 0.14);
  color: #5C4E3C;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

/* Bright Warm Cream Quotation Block */
.art-body blockquote {
  margin: 1.15em 0 1.25em;
  padding: 15px 17px;
  background: var(--r-surface);
  border-radius: 13px;
  border: none;
  box-shadow: none;
}
.art-body blockquote p {
  margin: 0;
  font-size: 0.95em;
  font-weight: 500;
  line-height: 1.58;
  letter-spacing: 0.015em;
  color: #363026;
  text-align: justify;
  text-justify: inter-ideograph;
}
.art-body blockquote .quote-src {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: #8E7F69;
}

/* Unified 100% Width Illustrations */
.art-figure {
  margin: 1.15em 0 1.3em;
  max-width: 100%;
  text-align: center;
}
.art-body > .art-figure:first-child {
  margin: 0 0 1.35em;
}
.art-body > .art-figure:first-child + h2 {
  margin-top: 0;
}
.art-figure.art-lvl-a,
.art-figure.art-lvl-b,
.art-figure.art-lvl-c { max-width: 100%; }
.art-figure img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  cursor: zoom-in;
  transition: transform 0.16s ease;
}
.art-figure img:active { transform: scale(0.99); }

/* Clean Quiet Calm Table */
.table-block {
  margin: 1.2em 0 1.35em;
}
.table-cap {
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--r-muted);
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--r-border);
  box-shadow: none;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.54;
  letter-spacing: 0;
}
.table-wrap thead tr {
  background: #FAF3E3;
}
.table-wrap th {
  text-align: left;
  padding: 9px 10px;
  background: transparent;
  font-weight: 600;
  color: var(--r-title);
  border-bottom: 1px solid var(--r-border);
  white-space: nowrap;
}
.table-wrap td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(55, 53, 47, 0.055);
  vertical-align: top;
  color: var(--r-ink);
}
.table-wrap tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}
.table-wrap tr:last-child td { border-bottom: none; }

/* Responsive Stacked Cards for 3+ Column Tables on Mobile (compact & scannable) */
@media (max-width: 540px) {
  .table-wrap-multi {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }
  .tbl-multi,
  .tbl-multi tbody {
    display: block;
    width: 100%;
  }
  .tbl-multi thead {
    display: none;
  }
  .tbl-multi tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .tbl-multi tbody tr,
  .tbl-multi tbody tr:nth-child(even) {
    display: block;
    background: var(--surface);
    border: 1px solid rgba(55, 53, 47, 0.085);
    border-radius: 12px;
    overflow: hidden;
  }
  .tbl-multi tbody td {
    display: block;
    padding: 7px 12px;
    font-size: 13.5px;
    line-height: 1.5;
    letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(55, 53, 47, 0.055);
    text-align: justify;
    text-justify: inter-ideograph;
  }
  .tbl-multi tbody td:last-child {
    border-bottom: none;
    padding-bottom: 9px;
  }
  .tbl-multi tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #8E7F69;
    letter-spacing: 0.01em;
    text-align: left;
  }
  .tbl-multi tbody td.td-key {
    font-weight: 600;
    color: var(--r-title);
  }
  .tbl-multi tbody td:first-child {
    background: #FAF3E3;
    border-bottom: 1px solid rgba(55, 53, 47, 0.065);
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--r-title);
    text-align: left;
  }
  .tbl-h0-inline tbody td:first-child {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }
  .tbl-h0-inline tbody td:first-child::before {
    display: inline-block;
    margin-bottom: 0;
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: #8C7A60;
  }
  /* Ultra-compact 2-column key-value grid when all column labels <= 6 chars */
  .tbl-compact tbody td:not(:first-child) {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: baseline;
    column-gap: 8px;
    padding: 6.5px 12px;
    text-align: left;
  }
  .tbl-compact tbody td:not(:first-child)::before {
    margin-bottom: 0;
    font-size: 12px;
    font-weight: 600;
    color: #8E7F69;
    line-height: 1.5;
  }
  .tbl-compact tbody td:last-child {
    padding-bottom: 8px;
  }
}
.chk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #ECEBE6;
  color: #3A3833;
  font-size: 10.5px;
  font-weight: 800;
  margin-right: 3px;
  vertical-align: -2px;
}

.article-callout {
  margin: 1.15em 0 1.35em;
  padding: 15px 17px;
  border-radius: 14px;
  background: var(--r-surface);
  border: none;
  box-shadow: none;
}
.article-callout p:last-child,
.article-callout ul:last-child,
.article-callout ol:last-child { margin-bottom: 0; }

/* Ceremonial Epilogue Section (结语 / 尾声 / 写在最后) */
.art-epilogue {
  margin: 2.2em -8px 1.6em;
  padding: 22px 18px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #F8F6F1 0%, #F3EFE6 100%);
  border: none;
  box-shadow: none;
}
.epilogue-head {
  margin-bottom: 14px;
}
.epilogue-head::after {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 99px;
  background: rgba(139, 118, 88, 0.34);
  margin-top: 9px;
}
.epilogue-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #8B7658;
}
.art-body .epilogue-title {
  margin: 6px 0 0 !important;
  font-size: 1.2em;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--r-title);
}
.art-epilogue .art-figure {
  margin: 12px 0 16px;
}
.art-epilogue p {
  line-height: 1.6;
  color: #33302A;
}
.art-epilogue p:last-of-type,
.art-epilogue ol:last-of-type,
.art-epilogue ul:last-of-type {
  margin-bottom: 0;
}
.art-epilogue blockquote {
  background: rgba(255, 255, 255, 0.72);
}
.epilogue-end {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: rgba(139, 118, 88, 0.48);
  user-select: none;
}

.takeaway-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 1.35em 0;
  padding: 15px 17px;
  border-radius: 14px;
  background: var(--r-surface);
  border: none;
  box-shadow: none;
}
.note-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--r-title);
  font-size: 11.5px;
  font-weight: 700;
}
.takeaway-txt {
  font-size: 0.95em;
  line-height: 1.48;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--r-ink);
}

.inline-ref {
  color: var(--r-title);
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
  font-weight: 500;
}

.citation-fold {
  margin: 2em 0 1.3em;
  padding: 12px 16px;
  border-radius: 14px;
  background: #F6F5F1;
  border: none;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.52;
  letter-spacing: -0.01em;
}
.citation-fold summary {
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.citation-fold summary::-webkit-details-marker { display: none; }
.citation-fold summary::after {
  content: "展开 ▾";
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.citation-fold[open] summary::after { content: "收起 ▴"; }
.citation-inner {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}
.citation-inner h3 {
  font-size: 13px;
  margin: 10px 0 6px;
  color: var(--text);
}
.citation-inner h3::before { display: none; }
.citation-inner p { margin: 0 0 8px; }

/* Paywall Gate */
.paywall-wrap {
  position: relative;
  margin-top: -110px;
  padding-top: 110px;
  z-index: 6;
}
.paywall-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(250, 247, 242, 0) 0%, var(--bg) 92%);
  pointer-events: none;
}
html[data-theme="white"] .paywall-fade {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 92%);
}
html[data-theme="dark"] .paywall-fade {
  background: linear-gradient(180deg, rgba(23, 22, 20, 0) 0%, #171614 92%);
}

.paywall-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px 20px 22px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.paywall-cat {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  object-fit: contain;
}
.paywall-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.paywall-desc {
  margin: 6px 0 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.paywall-btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.primary-btn {
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  background: #26231F;
  color: #FAF7F2;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.14s ease, opacity 0.15s ease;
}
html[data-theme="dark"] .primary-btn {
  background: #E89B54;
  color: #1A1612;
}
.primary-btn:active { transform: scale(0.98); }
.secondary-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
}

/* Related Reading Section */
.related-sec {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.related-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.related-strip {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.related-strip::-webkit-scrollbar { display: none; }
.related-card {
  flex: 0 0 176px;
  background: var(--surface-soft);
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.related-card:active { transform: scale(0.97); }
.related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.related-card-info {
  padding: 8px 10px 10px;
}
.related-card-mod {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.related-card-name {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prev / Next Bar */
.art-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}
.art-nav-btn {
  padding: 12px 14px;
  border-radius: 14px;
  border: none;
  box-shadow: none;
  text-align: left;
  transition: transform 0.14s ease, filter 0.14s ease;
}
.art-nav-btn.is-next {
  background: #EFECE6;
}
.art-nav-btn.is-next .art-nav-dir {
  color: var(--r-title);
}
.art-nav-btn.is-prev {
  background: #F7F6F3;
  text-align: right;
}
.art-nav-btn:active { transform: scale(0.98); }
.art-nav-dir {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--r-muted);
  margin-bottom: 3px;
}
.art-nav-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom Tab Bar */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.tab-bar-inner {
  max-width: 560px;
  margin: 0 auto;
  height: 66px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}
.tab-item svg { width: 21px; height: 21px; }
.tab-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab-icon {
  width: 31px;
  height: 31px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.6;
  filter: saturate(0.72);
  transform: scale(0.92);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, filter 0.18s ease;
}
.tab-item.active {
  color: #2B241B;
  font-weight: 700;
}
.tab-item.active .tab-icon-wrap::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #E34C3E;
  border: 1.5px solid #FFFFFF;
}
.tab-item.active .tab-icon {
  opacity: 1;
  filter: saturate(1.06) drop-shadow(0 2px 5px rgba(180, 110, 40, 0.22));
  transform: scale(1.08);
}
.tab-item:active .tab-icon {
  transform: scale(0.96);
}

/* Modals & Bottom Sheets */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(20, 16, 12, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.16s ease;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border-radius: 22px 22px 0 0;
  padding: 18px 20px calc(34px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.sheet.sheet-editorial {
  background: var(--bg);
  padding: 0 0 calc(34px + var(--safe-bottom));
  overflow-x: hidden;
}
.sheet.sheet-editorial .sheet-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 3;
  background: rgba(84, 70, 32, 0.2);
}
@media (min-width: 640px) {
  .sheet { border-radius: 20px; padding: 22px 24px 26px; }
  .sheet.sheet-editorial { padding: 0 0 28px; }
}
.sheet-close-float {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.72);
}
[data-theme="dark"] .sheet-close-float {
  background: rgba(255, 255, 255, 0.12);
}
.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: var(--border-strong);
  margin: 0 auto 14px;
}
@media (min-width: 640px) { .sheet-handle { display: none; } }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sheet-title { font-size: 17px; font-weight: 700; margin: 0; }
.sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Editorial Frontispiece Modals (Preface & Guide) */
.ed-sheet {
  text-align: left;
}
.ed-hero-band {
  padding: 28px 22px 18px;
}
.ed-hero-band.preface {
  background: #F4EAD9;
}
.ed-hero-band.guide {
  background: #E9ECE0;
}
[data-theme="dark"] .ed-hero-band.preface {
  background: #2C231A;
}
[data-theme="dark"] .ed-hero-band.guide {
  background: #22261C;
}
.ed-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 26px;
}
.ed-hero-text {
  min-width: 0;
}
.ed-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}
.ed-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.ed-stat-line {
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #535E31;
  line-height: 1.45;
}
[data-theme="dark"] .ed-stat-line {
  color: #B9C48E;
}
.ed-hero-art {
  width: 88px;
  height: 88px;
  object-fit: contain;
  flex-shrink: 0;
}
.ed-body {
  padding: 22px 24px 0;
}
.ed-content-pad {
  padding: 18px 22px 0;
}
.ed-body p {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.88;
  color: var(--text);
  text-align: left;
}
.ed-emphasis {
  font-weight: 700;
}
.ed-sign {
  margin: 18px 0 0 !important;
  font-size: 12.5px !important;
  color: var(--text-muted) !important;
  letter-spacing: 0.02em;
}
.ed-kicker {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 6px;
}
.ed-index {
  display: flex;
  flex-direction: column;
}
.ed-index-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: start;
  gap: 11px;
  width: 100%;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.ed-index-row:last-child { border-bottom: none; }
.ed-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  margin-top: 1px;
  border-radius: 999px;
  background: #ECEEE4;
  color: #555E34;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .ed-num {
  background: #252A1E;
  color: #B6C28C;
}
.ed-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ed-row-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.ed-row-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.ed-row-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  white-space: nowrap;
}
.ed-tips-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-soft);
}
.ed-tips-head {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.ed-tip-item + .ed-tip-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ed-tip-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.ed-tip-desc {
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--text-secondary);
}

/* Typography Drawer */
.setting-group {
  margin-bottom: 16px;
}
.setting-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.seg-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.seg-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.seg-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.seg-btn {
  padding: 9px 10px;
  border-radius: 999px;
  border: none;
  background: var(--surface-soft);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.seg-btn.active {
  background: #F4EAD3;
  color: #8B6D4C;
  font-weight: 700;
}
.theme-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 5px;
  vertical-align: -1px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* Search Modal */
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.search-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 15px;
  color: var(--text);
}
.mood-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.mood-tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}

/* Auth Modal */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.auth-tab {
  padding: 8px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.field-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  margin-bottom: 10px;
}
.field-input:focus { border-color: var(--accent); }
.field-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.field-row .field-input { margin-bottom: 0; }
.code-btn {
  flex-shrink: 0;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
}
.demo-hint {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
}
.demo-code-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid rgba(217, 130, 54, 0.3);
  cursor: pointer;
}

/* My Study Tab */
.me-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-top: 14px;
}
.me-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.me-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  padding: 6px;
  object-fit: contain;
}
.me-name { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.me-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.me-stat-num { font-size: 19px; font-weight: 700; }
.me-stat-lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.me-progress-bar {
  margin-top: 12px;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-soft);
  overflow: hidden;
}
.me-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #E89E52, #D4782B);
  border-radius: 99px;
}

.me-section {
  margin-top: 20px;
}
.me-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 8px 4px;
}
.empty-note {
  padding: 22px 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(16, 14, 12, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 16px;
}
.lightbox-cap {
  margin-top: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(34, 30, 26, 0.92);
  color: #FAF7F2;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(26px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
