/* ═══════════════════════════════════════════════════════════════════
   LitFolio — CSS Design System
   Themes: classical | literary | modern | minimalist | scifi
   Modes: dark | light
═══════════════════════════════════════════════════════════════════ */

/* ── Theme Tokens ─────────────────────────────────────────────── */
:root {
  /* Dark base */
  --bg-primary:     #08090e;
  --bg-secondary:   #0f1018;
  --bg-card:       #12141e;
  --bg-card-hover: #181b28;
  --surface:       #1a1d2e;
  --surface-2:      #22263a;
  --border:         rgba(255,255,255,0.07);
  --border-hover:   rgba(255,255,255,0.14);

  --text-primary:   #e8e6e1;
  --text-secondary: #9b9890;
  --text-muted:    #5a5852;

  --accent:         #c9a84c;
  --accent-hover:   #dbbf6a;
  --accent-glow:    rgba(201,168,76,0.2);

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.6);
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  --font-body: 'Noto Serif SC', 'Crimson Pro', Georgia, serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Reading defaults */
  --reader-bg:        #f0ebe0;
  --reader-text:      #2c2824;
  --reader-muted:     #8a7e74;
  --reader-border:    #d4cfc6;
  --reader-shadow:    #1a1410;
  --reader-spine:     #c8bfb0;
  --reader-page-edge:  #e8e0d5;
  --reader-font:      'Noto Serif SC', 'Crimson Pro', Georgia, serif;
  --reader-size:      18px;
  --reader-line:       1.85;

  /* Nav */
  --nav-bg:         rgba(8,9,14,0.88);
  --nav-border:     rgba(255,255,255,0.06);
}

/* ── Light Mode ───────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary:     #f5f2ec;
  --bg-secondary:   #eee9e1;
  --bg-card:       #faf8f3;
  --bg-card-hover: #f3efe6;
  --surface:       #ede8de;
  --surface-2:      #e4ddd2;
  --border:         rgba(0,0,0,0.08);
  --border-hover:   rgba(0,0,0,0.14);
  --text-primary:   #2c2824;
  --text-secondary: #6b6159;
  --text-muted:    #a09890;
  --accent:         #8b5e3c;
  --accent-hover:   #a0714a;
  --accent-glow:    rgba(139,94,60,0.15);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.14);
  --nav-bg:         rgba(245,242,236,0.88);
  --nav-border:     rgba(0,0,0,0.06);
  --reader-bg:      #faf8f3;
  --reader-text:     #2c2824;
  --reader-muted:    #8a7e74;
  --reader-border:   #d4cfc6;
  --reader-shadow:   #1a1410;
  --reader-spine:    #c8bfb0;
  --reader-page-edge: #e8e0d5;
}

/* ── Classical Theme (Reader) ────────────────────────────────── */
[data-book-theme="classical"] {
  --reader-bg:        #f0ebe0;
  --reader-text:      #2c2824;
  --reader-muted:     #8a7e74;
  --reader-border:    #d4cfc6;
  --reader-shadow:    #1a1410;
  --reader-spine:     #c8bfb0;
  --reader-page-edge:  #e8e0d5;
  --reader-font:      'Noto Serif SC', 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --reader-size:      19px;
  --reader-line:       1.9;
}

/* ── Literary Theme (Reader) ─────────────────────────────────── */
[data-book-theme="literary"] {
  --reader-bg:        #0f1c2e;
  --reader-text:      #d4c5a9;
  --reader-muted:     #7a8fa8;
  --reader-border:    #1e3a5f;
  --reader-shadow:    #060e18;
  --reader-spine:     #1e3a5f;
  --reader-page-edge:  #162844;
  --reader-font:      'Source Serif 4', 'Noto Serif SC', Georgia, serif;
  --reader-size:      18px;
  --reader-line:       1.8;
}

/* ── Modern Theme (Reader) ────────────────────────────────────── */
[data-book-theme="modern"] {
  --reader-bg:        #ffffff;
  --reader-text:      #111827;
  --reader-muted:     #6b7280;
  --reader-border:    #e5e7eb;
  --reader-shadow:    #9ca3af;
  --reader-spine:     #d1d5db;
  --reader-page-edge:  #f3f4f6;
  --reader-font:      'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --reader-size:      17px;
  --reader-line:       1.75;
}

/* ── Minimalist Theme (Reader) ─────────────────────────────────── */
[data-book-theme="minimalist"] {
  --reader-bg:        #faf9f6;
  --reader-text:      #1a1a1a;
  --reader-muted:     #999;
  --reader-border:    #e0ddd6;
  --reader-shadow:    #ccc;
  --reader-spine:     #e8e4dc;
  --reader-page-edge:  #f4f1ec;
  --reader-font:      'Noto Serif SC', Georgia, serif;
  --reader-size:      18px;
  --reader-line:       2;
}

/* ── Sci-Fi Theme (Reader) ────────────────────────────────────── */
[data-book-theme="scifi"] {
  --reader-bg:        #080d1a;
  --reader-text:      #00e5cc;
  --reader-muted:     #3d8c8c;
  --reader-border:    #1a3a4a;
  --reader-shadow:    #001020;
  --reader-spine:     #0d2030;
  --reader-page-edge:  #0a1828;
  --reader-font:      'Space Mono', monospace;
  --reader-size:      16px;
  --reader-line:       1.7;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

::selection { background: var(--accent-glow); color: var(--accent); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

.hidden { display: none !important; }

/* ── Layout ──────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 768px) { .container { padding: 0 20px; } }

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 600;
}
.nav__logo { display: flex; align-items: center; }
.nav__brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}

.nav__links { display: flex; gap: 8px; }
.nav__link {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.nav__link:hover { color: var(--text-primary); background: var(--surface); }
.nav__link.active { color: var(--accent); background: var(--accent-glow); }

.nav__actions { display: flex; align-items: center; gap: 8px; }
.nav__icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
}
.nav__icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.icon-sun, .icon-moon { transition: opacity 0.3s; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
.lang-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; }

/* ═══════════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 32px 40px;
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(201,168,76,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 60%, rgba(100,80,200,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  max-width: 560px;
  animation: fadeInUp 0.8s ease both;
}

.hero__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  font-family: var(--font-sans);
}

.hero__title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.hero__desc {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 440px;
}

.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  cursor: pointer;
  transition: all 0.25s;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero__books {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 16px;
  animation: fadeIn 1s ease 0.3s both;
}
@media (max-width: 900px) { .hero__books { display: none; } }

/* Hero floating books */
.hero-book {
  width: 120px;
  height: 170px;
  border-radius: 4px 8px 8px 4px;
  background-size: cover;
  background-position: center;
  box-shadow: -4px 4px 16px rgba(0,0,0,0.4), -1px 0 0 rgba(255,255,255,0.05);
  transform: rotateY(-8deg) rotateX(3deg);
  transition: transform 0.4s ease;
  cursor: pointer;
}
.hero-book:nth-child(2) { transform: rotateY(-4deg) rotateX(5deg) translateY(-12px); }
.hero-book:nth-child(3) { transform: rotateY(-12deg) rotateX(1deg) translateY(8px); }
.hero-book:hover { transform: rotateY(0deg) rotateX(0deg) translateY(-8px); }

/* ═══════════════════════════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════════════════════════ */
.section { padding: 80px 0; }
.section--alt { background: var(--bg-secondary); }
.section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.section__title {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.section__more { font-size: 14px; color: var(--accent); font-family: var(--font-sans); }
.section__more:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   BOOK GRID
═══════════════════════════════════════════════════════════════ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.book-grid--list { grid-template-columns: 1fr; gap: 12px; }

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}
.book-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.book-card__cover {
  width: 100%;
  height: 200px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.book-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4) 100%);
}

.book-card__body { padding: 16px; }
.book-card__genre {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
  font-family: var(--font-sans);
}
.book-card__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}
.book-card__author { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.book-card__desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card__meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--text-muted); font-family: var(--font-sans); }
.book-card__lang-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* List view variant */
.book-card--list { display: flex; flex-direction: row; }
.book-card--list .book-card__cover { width: 100px; height: 140px; flex-shrink: 0; }
.book-card--list .book-card__body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   GENRE GRID
═══════════════════════════════════════════════════════════════ */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.genre-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}
.genre-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.genre-card__icon { font-size: 32px; margin-bottom: 12px; }
.genre-card__name { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.genre-card__count { font-size: 12px; color: var(--text-muted); font-family: var(--font-sans); }

/* ═══════════════════════════════════════════════════════════════
   ABOUT
═══════════════════════════════════════════════════════════════ */
.about-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}
.about-card__icon { color: var(--accent); margin-bottom: 24px; }
.about-card__title { font-size: 28px; font-weight: 300; margin-bottom: 20px; }
.about-card__text { font-size: 16px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 12px; }

/* ═══════════════════════════════════════════════════════════════
   LIBRARY
═══════════════════════════════════════════════════════════════ */
.page--library { padding-top: 80px; min-height: 100vh; }

.library-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px;
}
@media (max-width: 900px) { .library-layout { grid-template-columns: 1fr; } }

.library-sidebar { position: sticky; top: 80px; height: fit-content; }
@media (max-width: 900px) { .library-sidebar { position: static; } }

.sidebar-section { margin-bottom: 28px; }
.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-family: var(--font-sans);
}

.filter-list { display: flex; flex-direction: column; gap: 4px; }
.filter-item {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-family: var(--font-sans);
}
.filter-item:hover { background: var(--surface); color: var(--text-primary); }
.filter-item--active { background: var(--accent-glow); color: var(--accent); font-weight: 600; }

.library-main {}
.library-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.library-title { font-size: 32px; font-weight: 300; }
.library-count { font-size: 14px; color: var(--text-muted); font-family: var(--font-sans); }
.library-empty { text-align: center; padding: 60px; color: var(--text-muted); font-size: 15px; }

/* ═══════════════════════════════════════════════════════════════
   BOOK DETAIL
═══════════════════════════════════════════════════════════════ */
.page--book { padding-top: 60px; }

.book-hero {
  padding: 40px 0;
  position: relative;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  margin: 0 32px 24px;
  transition: all 0.2s;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); }

.book-hero__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 700px) { .book-hero__inner { grid-template-columns: 1fr; } }

.book-hero__cover-wrap { perspective: 600px; }
.book-hero__cover {
  width: 200px;
  height: 290px;
  border-radius: 4px 10px 10px 4px;
  background-size: cover;
  background-position: center;
  box-shadow: -6px 6px 24px rgba(0,0,0,0.5), -1px 0 0 rgba(255,255,255,0.05);
  transform: rotateY(-8deg);
  transition: transform 0.4s ease;
}
.book-hero__cover:hover { transform: rotateY(0deg); }

.book-hero__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
}
.tag--lang {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.book-hero__title { font-size: 36px; font-weight: 700; line-height: 1.2; margin-bottom: 8px; letter-spacing: -0.02em; }
.book-hero__author { font-size: 18px; color: var(--text-secondary); margin-bottom: 20px; font-family: var(--font-sans); }
.book-hero__desc { font-size: 16px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 24px; }
.book-hero__meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-family: var(--font-sans);
  flex-wrap: wrap;
}

.btn-read {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s;
}
.btn-read:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }

/* TOC */
.book-toc { padding: 40px 0 80px; }
.toc-title { font-size: 22px; font-weight: 300; margin-bottom: 24px; color: var(--text-primary); }
.toc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.toc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.toc-item:hover { border-color: var(--accent); background: var(--bg-card-hover); transform: translateX(4px); }
.toc-item__num {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
  font-family: var(--font-mono);
}
.toc-item__title { font-size: 14px; color: var(--text-primary); flex: 1; }
.toc-item__pages { font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   READER — CORE
═══════════════════════════════════════════════════════════════ */
.page--reader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Reader Top Bar */
.reader-minibar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 10;
  gap: 12px;
}
.reader-minibar__back {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.reader-minibar__back:hover { border-color: var(--accent); color: var(--accent); }
.reader-minibar__title {
  flex: 1; font-size: 13px; color: var(--text-secondary);
  font-family: var(--font-sans); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.reader-minibar__actions { display: flex; align-items: center; gap: 4px; }
.reader-minibar__progress {
  font-size: 11px; color: var(--text-muted); font-family: var(--font-mono);
  padding: 0 6px; white-space: nowrap;
}
.reader-minibar__btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
}
.reader-minibar__btn:hover { border-color: var(--border); color: var(--text-primary); background: var(--surface); }
.reader-bar__back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  max-width: 200px;
  transition: color 0.2s;
}
.reader-bar__back:hover { color: var(--text-primary); }
.reader-bar__back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-bar__center { flex: 1; text-align: center; }
.reader-bar__chapter { font-size: 13px; color: var(--text-secondary); font-family: var(--font-sans); }
.reader-bar__actions { display: flex; align-items: center; gap: 6px; }
.reader-bar__progress { font-size: 12px; color: var(--text-muted); padding: 0 8px; font-family: var(--font-mono); }
.reader-bar__btn {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.reader-bar__btn:hover { border-color: var(--accent); color: var(--accent); }

/* Full-screen Immersive Reader */
.reader-fullscreen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 24px 12px;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   READER — 3D BOOK
═══════════════════════════════════════════════════════════════ */
.book-wrapper {
  display: flex;
  position: relative;
  perspective: 1800px;
  width: 100%;
  max-width: 1000px;
  height: 85vh;
}

.book-page {
  flex: 1;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.book-page--left {
  border-radius: 8px 0 0 8px;
  margin-right: -1px;
}

.book-page--right {
  border-radius: 0 8px 8px 0;
  margin-left: -1px;
}

.book-page__inner {
  width: 100%;
  height: 100%;
  background: var(--reader-bg);
  padding: 48px 44px;
  overflow-y: auto;
  color: var(--reader-text);
  font-family: var(--reader-font);
  font-size: var(--reader-size);
  line-height: var(--reader-line);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.book-page__inner::-webkit-scrollbar { width: 3px; }
.book-page__inner::-webkit-scrollbar-thumb { background: var(--reader-border); }

/* Page content typography */
.book-page__inner h1 { font-size: 1.8em; font-weight: 700; margin-bottom: 0.5em; line-height: 1.3; }
.book-page__inner h2 { font-size: 1.4em; font-weight: 600; margin: 1.5em 0 0.5em; border-bottom: 1px solid var(--reader-border); padding-bottom: 0.3em; }
.book-page__inner h3 { font-size: 1.15em; font-weight: 600; margin: 1.2em 0 0.4em; }
.book-page__inner p { margin-bottom: 1em; text-align: justify; text-align-last: left; }
.book-page__inner blockquote { border-left: 3px solid var(--accent); margin: 1.2em 0; padding: 0.5em 1em; background: rgba(0,0,0,0.04); font-style: italic; color: var(--reader-muted); border-radius: 0 4px 4px 0; }
.book-page__inner table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.9em; }
.book-page__inner th { background: rgba(0,0,0,0.06); padding: 8px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--reader-border); }
.book-page__inner td { padding: 6px 12px; border-bottom: 1px solid var(--reader-border); }
.book-page__inner a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(201,168,76,0.4); }
.book-page__inner code { font-family: var(--font-mono); font-size: 0.85em; background: rgba(0,0,0,0.06); padding: 2px 5px; border-radius: 3px; }
.book-page__inner pre { background: rgba(0,0,0,0.06); padding: 1em; border-radius: 6px; overflow-x: auto; margin: 1em 0; }
.book-page__inner pre code { background: none; padding: 0; }

/* Sci-Fi theme specific */
[data-book-theme="scifi"] .book-page__inner blockquote { border-color: #00e5cc; }
[data-book-theme="scifi"] .book-page__inner h2 { border-color: #1a3a4a; }
[data-book-theme="scifi"] .book-page__inner th { background: rgba(0,229,204,0.06); }
[data-book-theme="scifi"] .book-page__inner code { background: rgba(0,229,204,0.08); color: #00e5cc; }

/* Page flip shadow */
.book-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.2), transparent);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}
.book-page--right::before {
  background: linear-gradient(to left, rgba(0,0,0,0.2), transparent);
}

/* Flipping state */
.book-page--left.flipped {
  transform: rotateY(-180deg);
  transform-origin: right center;
  z-index: 10;
}
.book-page--right.flipped {
  transform: rotateY(180deg);
  transform-origin: left center;
  z-index: 10;
}

/* Page numbers */
.book-page__footer {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.page-num {
  font-size: 11px;
  color: var(--reader-muted);
  font-family: var(--font-mono);
  background: var(--reader-bg);
  padding: 2px 10px;
  border-radius: 10px;
}

/* Book spine */
.book-spine {
  width: 24px;
  height: 100%;
  background: linear-gradient(to right, var(--reader-spine), var(--reader-shadow), var(--reader-spine));
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.2);
}

/* Reader Controls */
.reader-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  padding: 0 16px;
}

.flip-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.flip-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.1); }
.flip-btn:active { transform: scale(0.95); }

.flip-progress {
  flex: 1;
  max-width: 300px;
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.flip-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ═══════════════════════════════════════════════════════════════
   TOC PANEL (overlay)
═══════════════════════════════════════════════════════════════ */
.toc-overlay, .settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.toc-panel {
  width: 320px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}
.toc-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}
.toc-panel__close, .settings-panel__close {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.toc-panel__close:hover, .settings-panel__close:hover { color: var(--text-primary); }
.toc-panel__list { overflow-y: auto; flex: 1; padding: 12px; }
.toc-panel__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-sans);
}
.toc-panel__item:hover { background: var(--surface); }
.toc-panel__item--active { background: var(--accent-glow); }
.toc-panel__item--active .toc-panel__item-title { color: var(--accent); }
.toc-panel__item-num { font-size: 12px; font-weight: 700; color: var(--text-muted); min-width: 24px; font-family: var(--font-mono); }
.toc-panel__item-title { font-size: 14px; color: var(--text-secondary); flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   SETTINGS PANEL
═══════════════════════════════════════════════════════════════ */
.settings-overlay { justify-content: center; align-items: center; }
.settings-panel {
  width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  animation: fadeInUp 0.3s ease;
  overflow: hidden;
}
.settings-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
}
.settings-panel__body { padding: 20px 22px; display: flex; flex-direction: column; gap: 20px; }

.setting-row { display: flex; align-items: center; gap: 16px; }
.setting-label { font-size: 13px; color: var(--text-secondary); min-width: 60px; font-family: var(--font-sans); }
.setting-control { display: flex; align-items: center; gap: 10px; flex: 1; }
.setting-btn {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.setting-btn:hover { border-color: var(--accent); color: var(--accent); }
.setting-btn--active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.theme-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch--active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg-secondary);
}
.footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer__brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-family: var(--font-sans); }
.footer__copy { font-size: 13px; color: var(--text-muted); }
.footer__links { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); font-family: var(--font-sans); }
.footer__links a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav__links { display: none; }
  .hero { padding: 80px 20px 40px; }
  .hero__title { font-size: 36px; }
  .library-layout { padding: 20px 16px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
  .book-wrapper { max-width: 100%; height: 78vh; }
  .book-page__inner { padding: 24px 20px; }
  .book-spine { width: 12px; }
  .settings-panel { width: 92vw; }
  .toc-panel { width: 85vw; }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════════════════════════════ */
.page--admin {
  min-height: calc(100vh - 72px);
  padding: 0;
}

.admin-layout {
  display: flex;
  min-height: calc(100vh - 72px);
}

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.admin-sidebar__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.admin-nav__item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.admin-nav__item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.admin-nav__item--active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

.admin-sidebar__info {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.admin-info-val {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.admin-main {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

.admin-tab__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-tab__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-admin-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-admin-primary:hover { opacity: 0.85; }

.btn-admin-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-admin-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Books list */
.admin-books-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-filter-group select {
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
}

.admin-search input {
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  width: 200px;
}

.admin-search input::placeholder { color: var(--text-muted); }

.admin-book-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-book-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.admin-book-card:hover { border-color: var(--accent); }

.admin-book-card__cover {
  width: 40px;
  height: 54px;
  border-radius: 3px;
  background: var(--reader-bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--reader-muted);
  font-size: 18px;
}

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

.admin-book-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.admin-book-card__meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.admin-book-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
}
.btn-icon-sm:hover { border-color: var(--accent); color: var(--accent); }

.admin-book-card__lang {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-book-card__lang--zh { background: rgba(201,168,76,0.15); color: var(--accent); }
.admin-book-card__lang--en { background: rgba(0,150,136,0.15); color: #009688; }

/* Editor */
.editor-book-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-book-selector select {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  height: 55vh;
  min-height: 300px;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.editor-pane__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-save-chapter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-save-chapter:hover { opacity: 0.8; }

.editor-textarea {
  flex: 1;
  width: 100%;
  padding: 16px;
  background: var(--bg-primary);
  border: none;
  color: var(--reader-text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  resize: none;
  outline: none;
}

.editor-textarea::placeholder { color: var(--text-muted); }

.editor-preview {
  flex: 1;
  padding: 20px 28px;
  overflow-y: auto;
  color: var(--reader-text);
  font-family: var(--reader-font);
  font-size: 15px;
  line-height: var(--reader-line);
  background: var(--reader-bg);
}

.editor-preview h1 { font-size: 1.6em; font-weight: 700; margin-bottom: 0.4em; }
.editor-preview h2 { font-size: 1.3em; font-weight: 600; margin: 1.2em 0 0.4em; border-bottom: 1px solid var(--reader-border); padding-bottom: 0.3em; }
.editor-preview h3 { font-size: 1.1em; font-weight: 600; margin: 1em 0 0.3em; }
.editor-preview p { margin-bottom: 0.9em; }
.editor-preview blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: 0.5em 1em; background: rgba(0,0,0,0.04); font-style: italic; }
.editor-preview code { font-family: var(--font-mono); font-size: 0.85em; background: rgba(0,0,0,0.06); padding: 2px 5px; border-radius: 3px; }
.editor-preview pre { background: rgba(0,0,0,0.06); padding: 1em; border-radius: 6px; overflow-x: auto; margin: 1em 0; }
.editor-preview table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.9em; }
.editor-preview th { background: rgba(0,0,0,0.06); padding: 6px 10px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--reader-border); }
.editor-preview td { padding: 5px 10px; border-bottom: 1px solid var(--reader-border); }

.editor-preview__hint {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin-top: 40px;
}

.editor-chapters {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.editor-chapters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.editor-chapter-list {
  display: flex;
  flex-direction: column;
}

.editor-chapter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
  color: var(--text-primary);
}

.editor-chapter-item:last-child { border-bottom: none; }
.editor-chapter-item:hover { background: var(--bg-secondary); }
.editor-chapter-item--active { background: var(--accent-dim); color: var(--accent); }

.editor-chapter-item__num {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 24px;
  flex-shrink: 0;
}

.editor-chapter-item__title { flex: 1; }
.editor-chapter-item__words { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

/* Upload */
.upload-layout {
  max-width: 600px;
}

.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.upload-dropzone:hover,
.upload-dropzone--dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.upload-dropzone__text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.upload-dropzone__hint {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-target {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.upload-target label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.upload-target select {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
}

.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.upload-queue-item__name { flex: 1; font-family: var(--font-mono); color: var(--text-primary); }
.upload-queue-item__status { font-size: 11px; }
.upload-queue-item__status--done { color: #4caf50; }
.upload-queue-item__status--error { color: #f44336; }
.upload-queue-item__status--pending { color: var(--text-muted); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0,0,0,0.3);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal__header h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.modal__close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); border: none;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
}
.modal__close:hover { background: var(--border); color: var(--text-primary); }

.modal__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-row input,
.form-row select,
.form-row textarea {
  padding: 9px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
}

.form-row textarea { resize: vertical; line-height: 1.5; }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: toastIn 0.2s ease;
  pointer-events: auto;
}

.toast--success { border-left: 3px solid #4caf50; }
.toast--error { border-left: 3px solid #f44336; }
.toast--info { border-left: 3px solid var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive admin */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    padding: 12px 16px;
    gap: 12px;
    overflow-x: auto;
  }
  .admin-sidebar__header { padding: 0; border: none; margin: 0; white-space: nowrap; }
  .admin-nav { flex-direction: row; padding: 0; }
  .admin-sidebar__info { display: none; }
  .admin-main { padding: 20px 16px; }
  .editor-layout { grid-template-columns: 1fr; height: auto; }
  .editor-pane { height: 40vh; min-height: 200px; }
}

