/* ==========================================================================
   臺中市清水區西寧國小《西寧心橋》數位校刊 — 設計系統
   ========================================================================== */
:root {
  --bg-page: #faf8f4;
  --bg-paper: #ffffff;
  --bg-soft: #f2eee6;
  --bg-ocean-soft: #edf6f9;
  --ink-primary: #1c2430;
  --ink-secondary: #475569;
  --ink-muted: #64748b;
  --brand-ocean: #145374;
  --brand-ocean-hover: #0d3b54;
  --brand-sky: #0ea5e9;
  --brand-coral: #d95d39;
  --brand-gold: #c2851c;
  --brand-green: #2d7a4f;
  --border-light: #e6e0d4;
  --border-strong: #d4cbb8;
  --shadow-sm: 0 2px 8px rgba(28, 36, 48, 0.05);
  --shadow-md: 0 8px 24px rgba(28, 36, 48, 0.08);
  --shadow-lg: 0 18px 42px rgba(20, 83, 116, 0.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  --font-sans: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Noto Serif TC', 'Noto Sans TC', Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--ink-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 10px 0;
}

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

.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-light);
  background: #fff;
  flex-shrink: 0;
}

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

.brand-school {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ocean);
  letter-spacing: 0.04em;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link:hover, .nav-link.active {
  background: var(--bg-ocean-soft);
  color: var(--brand-ocean);
}

.header-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-paper);
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.header-search-btn:hover {
  border-color: var(--brand-ocean);
  color: var(--brand-ocean);
  box-shadow: var(--shadow-sm);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-paper);
  color: var(--ink-primary);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.mobile-menu-btn:hover {
  border-color: var(--brand-ocean);
  color: var(--brand-ocean);
}

.mobile-nav-drawer {
  border-top: 1px solid var(--border-light);
  background: rgba(250, 248, 244, 0.98);
  padding: 12px 0 16px;
}

.mobile-nav-drawer.hidden {
  display: none;
}

.mobile-nav-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mobile-nav-link {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-paper);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-align: center;
}

.mobile-nav-link.active,
.mobile-nav-link:hover {
  background: var(--bg-ocean-soft);
  border-color: var(--brand-ocean);
  color: var(--brand-ocean);
}

@media (max-width: 780px) {
  .header-inner {
    gap: 8px;
  }

  .nav-links {
    display: none;
  }

  .header-search-btn {
    margin-left: auto;
    padding: 7px 12px;
    font-size: 13px;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 400px) {
  .brand-name {
    font-size: 17px;
  }

  .header-search-btn {
    padding: 7px 10px;
    font-size: 12.5px;
  }
}

/* ==========================================================================
   Buttons & Interactive Pills
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand-ocean);
  color: #fff;
  box-shadow: 0 6px 16px rgba(20, 83, 116, 0.22);
}

.btn-primary:hover {
  background: var(--brand-ocean-hover);
  box-shadow: 0 8px 22px rgba(20, 83, 116, 0.3);
}

.btn-secondary {
  background: var(--bg-paper);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--brand-ocean);
  color: var(--brand-ocean);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-paper);
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.like-btn:hover {
  border-color: #e11d48;
  background: #fff1f2;
  color: #be123c;
}

.like-btn.liked {
  border-color: #fb7185;
  background: #ffe4e6;
  color: #be123c;
}

.like-btn .heart-icon {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.like-btn.pop .heart-icon {
  transform: scale(1.45);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 40px 0 32px;
  background: radial-gradient(circle at 85% 15%, rgba(14, 165, 233, 0.12), transparent 50%),
              radial-gradient(circle at 12% 85%, rgba(217, 93, 57, 0.08), transparent 45%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 36px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-ocean-soft);
  color: var(--brand-ocean);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.28;
  margin: 0 0 14px;
  color: var(--ink-primary);
}

.hero-desc {
  font-size: 16px;
  color: var(--ink-secondary);
  margin: 0 0 22px;
  max-width: 580px;
}

.hero-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-paper);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 18px;
  box-shadow: var(--shadow-md);
  max-width: 560px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease;
}

.hero-search-box:focus-within {
  border-color: var(--brand-ocean);
}

.hero-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: var(--ink-primary);
  min-width: 0;
}

.hero-search-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}

.hint-chip {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  color: var(--ink-secondary);
  font-size: 12px;
  transition: all 0.15s ease;
}

.hint-chip:hover {
  border-color: var(--brand-ocean);
  color: var(--brand-ocean);
}

.hero-featured-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: center;
}

.hero-cover-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 3 / 4.24;
  background: var(--bg-soft);
}

.hero-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-issue-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-coral);
  background: #fdf0ec;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.hero-issue-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
}

.hero-issue-summary {
  font-size: 14px;
  color: var(--ink-secondary);
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hero-featured-card {
    grid-template-columns: 1fr;
  }
  .hero-cover-wrap {
    max-width: 180px;
    margin: 0 auto;
  }
}

/* ==========================================================================
   Section Headers & Curated Themes
   ========================================================================== */
.section {
  padding: 36px 0;
}

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

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.8vw, 28px);
  margin: 0 0 4px;
}

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

.themes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.theme-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.theme-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--theme-accent, var(--brand-ocean));
}

.theme-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--theme-accent, var(--brand-ocean));
}

.theme-card-featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  background: linear-gradient(135deg, #fffdf7 0%, #fef7e6 55%, #fffaf0 100%);
  border-color: rgba(180, 83, 9, 0.25);
}

.theme-card-featured .theme-featured-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
}

.theme-card-featured .theme-icon {
  font-size: 36px;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(180, 83, 9, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-card-featured .theme-name {
  font-size: 19px;
  margin-bottom: 4px;
}

.theme-card-featured .theme-cta {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--theme-accent, #b45309);
  color: #fff;
  font-size: 13.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.theme-icon {
  font-size: 28px;
  line-height: 1;
}

.theme-name {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.theme-desc {
  font-size: 13.5px;
  color: var(--ink-secondary);
  margin: 0;
  flex: 1;
}

.theme-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-accent, var(--brand-ocean));
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 1024px) {
  .themes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .theme-card-featured {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .theme-card-featured .theme-featured-main {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .themes-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Filter Pills & Issues Shelf
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-pill {
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-paper);
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.filter-pill:hover {
  border-color: var(--brand-ocean);
  color: var(--brand-ocean);
}

.filter-pill.active {
  background: var(--brand-ocean);
  border-color: var(--brand-ocean);
  color: #fff;
}

.load-more-bar {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.load-more-status {
  font-size: 13.5px;
  color: var(--ink-secondary);
  font-weight: 600;
  margin-right: 4px;
}

.issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 20px;
}

.issue-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.issue-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.issue-card-cover {
  position: relative;
  aspect-ratio: 3 / 4.15;
  background: linear-gradient(145deg, #e7eef2 0%, #f4eee2 100%);
  overflow: hidden;
}

.issue-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.issue-card:hover .issue-card-cover img {
  transform: scale(1.03);
}

.issue-cover-placeholder {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(155deg, #145374 0%, #1e6f8c 55%, #d95d39 140%);
  color: #fff;
}

.placeholder-series {
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.88;
}

.placeholder-num {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.placeholder-badge {
  align-self: flex-start;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
}

.status-ribbon {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.status-ribbon.ready {
  background: rgba(16, 185, 129, 0.92);
  color: #fff;
}

.status-ribbon.pending {
  background: rgba(28, 36, 48, 0.72);
  color: #f8fafc;
}

.issue-card-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.issue-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-muted);
}

.issue-card-title {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0;
  color: var(--ink-primary);
}

.issue-card-desc {
  font-size: 13px;
  color: var(--ink-secondary);
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.issue-stats-mini {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* ==========================================================================
   Search Results & Article Cards
   ========================================================================== */
.search-panel {
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

.search-panel.hidden {
  display: none;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.article-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-ocean);
}

.article-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-theme {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-ocean-soft);
  color: var(--brand-ocean);
}

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

.article-card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

.article-card-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-coral);
}

.article-card-excerpt {
  font-size: 13.5px;
  color: var(--ink-secondary);
  margin: 0;
  flex: 1;
}

.article-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
}

mark {
  background: #fef08a;
  color: var(--ink-primary);
  padding: 0 2px;
  border-radius: 3px;
}

/* ==========================================================================
   Issue Overview & Flipbook Reader
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 18px 0 12px;
}

.breadcrumb a:hover {
  color: var(--brand-ocean);
  text-decoration: underline;
}

.issue-hero-bar {
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.issue-hero-bar h1 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 6px;
}

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

.reader-shell {
  background: #1d2633;
  border-radius: var(--radius-lg);
  padding: 16px;
  color: #f1f5f9;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 16px;
}

.reader-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reader-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.16s ease;
}

.reader-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}

.reader-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.reader-btn.active {
  background: var(--brand-sky);
  border-color: var(--brand-sky);
}

.reader-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 460px;
  position: relative;
  user-select: none;
}

.reader-spread {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
}

.reader-page-box {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-height: 78vh;
  cursor: zoom-in;
}

.reader-page-box img {
  max-height: 78vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.reader-spread.two-page .reader-page-box {
  max-width: 49%;
}

.reader-page-articles {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.page-article-chip {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.45);
  color: #e0f2fe;
  font-weight: 500;
  transition: background 0.15s ease;
}

.page-article-chip:hover {
  background: rgba(14, 165, 233, 0.4);
}

.reader-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.thumb-item {
  flex: 0 0 auto;
  width: 62px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #0f172a;
  padding: 0;
  position: relative;
  opacity: 0.72;
  transition: all 0.15s ease;
}

.thumb-item.active {
  border-color: var(--brand-sky);
  opacity: 1;
  transform: translateY(-2px);
}

.thumb-num {
  position: absolute;
  bottom: 2px;
  right: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Lightbox for zoomed original page */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(10, 14, 22, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 8px;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
}

/* ==========================================================================
   Mobile-Friendly Single-Column Article Reader
   ========================================================================== */
.article-reader-wrap {
  max-width: 740px;
  margin: 20px auto 56px;
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 44px);
  box-shadow: var(--shadow-md);
}

.article-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.article-original-preview {
  margin: -6px 0 22px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.article-original-preview.hidden {
  display: none;
}

.article-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.article-preview-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.article-preview-stage img {
  max-width: 100%;
  max-height: 560px;
  width: auto;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  background: #fff;
}

.font-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: var(--radius-pill);
}

.font-btn {
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.font-btn.active {
  background: var(--bg-paper);
  color: var(--brand-ocean);
  box-shadow: var(--shadow-sm);
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.35;
  margin: 12px 0;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-secondary);
  margin-bottom: 26px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
}

.article-body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.95;
  color: var(--ink-primary);
}

.article-body.font-sm { font-size: 16px; line-height: 1.85; }
.article-body.font-md { font-size: 18px; line-height: 1.95; }
.article-body.font-lg { font-size: 21px; line-height: 2.05; }

.article-body p {
  margin: 0 0 1.25em;
  text-align: justify;
}

.article-body p.poem-stanza {
  text-align: left;
  line-height: 2.05;
  margin-bottom: 1.35em;
}

.article-body p.article-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
}

.article-bullet-item .bullet-dot {
  color: var(--brand-ocean);
  font-weight: 700;
  flex-shrink: 0;
}

.article-work-block {
  padding: 20px 0 6px;
  border-top: 1px dashed var(--border-light);
}

.article-work-block:first-child {
  padding-top: 6px;
  border-top: none;
}

.article-subhead {
  font-family: var(--font-sans);
  font-size: 1.08em;
  font-weight: 700;
  line-height: 1.45;
  color: var(--brand-ocean);
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--brand-ocean);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-subhead-meta {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.article-work-content > :last-child {
  margin-bottom: 0;
}

.article-footer-box {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.article-nav-links {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.article-nav-card {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  font-size: 13.5px;
}

.article-nav-card:hover {
  border-color: var(--brand-ocean);
}

@media (max-width: 540px) {
  .article-nav-links {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Search Modal (Global Quick Search)
   ========================================================================== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 64px 16px 24px;
}

.search-modal.hidden {
  display: none;
}

.search-modal-card {
  width: 100%;
  max-width: 760px;
  max-height: 82vh;
  background: var(--bg-paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-modal-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.search-modal-top input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
}

.search-modal-body {
  padding: 18px;
  overflow-y: auto;
}

/* ==========================================================================
   Footer & About
   ========================================================================== */
.about-banner {
  background: linear-gradient(135deg, #145374 0%, #1d6b87 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 38px);
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.about-banner p {
  opacity: 0.92;
  margin: 8px 0 0;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.about-stat-box {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.about-stat-num {
  font-size: 24px;
  font-weight: 700;
  display: block;
}

.about-stat-label {
  font-size: 12.5px;
  opacity: 0.88;
}

@media (max-width: 780px) {
  .about-banner {
    grid-template-columns: 1fr;
  }
}

.site-footer {
  margin-top: 48px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--border-light);
  font-size: 13.5px;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
