/* ============================================================
   墨屿 MOYU BOOKS — base system, shell, home & shared components
   ============================================================ */

:root {
  --font-sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Source Han Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --font-kai: "KaiTi", "STKaiti", "Kaiti SC", "FangSong", serif;
  --font-fang: "FangSong", "STFangsong", "SimSun", serif;

  --bg: #f4efe5;
  --bg-elevated: #fbf8f1;
  --surface: #f9f5ec;
  --surface-raised: #fffdf8;
  --surface-subtle: #ede6d9;
  --surface-deep: #e6ddcd;
  --ink: #211e18;
  --ink-soft: #4f4a40;
  --muted: #857d6f;
  --muted-light: #a39a8b;
  --line: rgba(48, 42, 33, 0.12);
  --line-strong: rgba(48, 42, 33, 0.22);
  --accent: #a44732;
  --accent-hover: #8b3826;
  --accent-soft: #f0ddd5;
  --accent-ink: #7c2e20;
  --gold: #b18a56;
  --gold-soft: #e8d7b9;
  --green: #64745c;
  --green-soft: #e3e9de;
  --blue: #536d7b;
  --amber: #a57739;
  --danger: #a84238;
  --shadow-sm: 0 8px 24px -16px rgba(37, 30, 20, 0.35);
  --shadow-md: 0 28px 60px -38px rgba(37, 30, 20, 0.48);
  --shadow-lg: 0 48px 100px -50px rgba(37, 30, 20, 0.58);
  --shadow-cover: 0 24px 42px -22px rgba(29, 23, 15, 0.55), 0 3px 8px rgba(29, 23, 15, 0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --container: 1320px;
  --header-h: 78px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --selection: rgba(164, 71, 50, 0.18);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #12110e;
  --bg-elevated: #191713;
  --surface: #1b1915;
  --surface-raised: #211f1a;
  --surface-subtle: #25221c;
  --surface-deep: #2d2922;
  --ink: #ece5d7;
  --ink-soft: #c3bbad;
  --muted: #928a7d;
  --muted-light: #6f685e;
  --line: rgba(236, 229, 215, 0.11);
  --line-strong: rgba(236, 229, 215, 0.22);
  --accent: #cf765d;
  --accent-hover: #e0876d;
  --accent-soft: #35241e;
  --accent-ink: #f0b6a5;
  --gold: #c7a069;
  --gold-soft: #3a3122;
  --green: #95a88b;
  --green-soft: #232a20;
  --blue: #8fa6b2;
  --amber: #cda366;
  --danger: #d5776d;
  --shadow-sm: 0 8px 24px -14px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 28px 60px -32px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 48px 100px -44px rgba(0, 0, 0, 0.8);
  --shadow-cover: 0 24px 45px -20px rgba(0, 0, 0, 0.75), 0 4px 10px rgba(0, 0, 0, 0.25);
  --selection: rgba(207, 118, 93, 0.25);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 640px at 88% -6%, rgba(177, 138, 86, 0.12), transparent 62%),
    radial-gradient(900px 520px at 2% 18%, rgba(164, 71, 50, 0.05), transparent 64%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

body.modal-open,
body.nav-open,
body.search-open {
  overflow: hidden;
}

::selection {
  background: var(--selection);
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, h5, p {
  margin: 0;
}

h1, h2, h3, h4 {
  font-weight: 600;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 10000;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

.site-grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
}

[data-theme="dark"] .site-grain {
  opacity: 0.13;
  mix-blend-mode: screen;
}

.container {
  width: min(var(--container), calc(100% - 96px));
  margin: 0 auto;
}

.container-narrow {
  width: min(980px, calc(100% - 96px));
  margin: 0 auto;
}

.icon {
  display: inline-block;
  vertical-align: -0.18em;
  flex: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.eyebrow.no-line::before {
  display: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.muted {
  color: var(--muted);
}

.serif {
  font-family: var(--font-serif);
}

.kai {
  font-family: var(--font-kai);
}

/* ------------------------------ Buttons ------------------------------ */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn-primary {
  background: var(--accent);
  color: #fff9ef;
  box-shadow: 0 12px 26px -18px rgba(164, 71, 50, 0.85);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 18px 32px -18px rgba(164, 71, 50, 0.72);
}

.btn-dark {
  background: var(--ink);
  color: var(--bg);
}

.btn-dark:hover {
  background: var(--accent);
  color: #fff8ee;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--surface-subtle);
}

.btn-soft {
  background: var(--surface-subtle);
  color: var(--ink);
}

.btn-soft:hover {
  background: var(--surface-deep);
}

.btn-gold {
  background: linear-gradient(135deg, #d0ad74, #b08a53);
  color: #211a0f;
}

.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 12px;
}

.btn-lg {
  height: 52px;
  padding: 0 30px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-soft);
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease);
}

.icon-btn:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.94);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.text-btn:hover .icon {
  transform: translateX(3px);
}

.text-btn .icon {
  transition: transform 0.25s var(--ease);
}

/* --------------------------- Announcement --------------------------- */
.announcement {
  position: relative;
  z-index: 90;
  background: #1e1c17;
  color: #e7dcc9;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  overflow: hidden;
}

[data-theme="dark"] .announcement {
  background: #080807;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.announcement.is-hidden {
  display: none;
}

.announcement-inner {
  width: min(var(--container), calc(100% - 96px));
  margin: 0 auto;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
}

.announcement p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.announcement a {
  color: #d4b382;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.announcement a:hover {
  color: #f1d8b1;
}

.announcement-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c16c50;
  box-shadow: 0 0 0 3px rgba(193, 108, 80, 0.16);
  animation: pulse 2.4s infinite;
}

.announcement-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a69b89;
}

.announcement-close:hover {
  color: #f0e5d4;
  background: rgba(255, 255, 255, 0.06);
}

/* ------------------------------ Header ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 12px 34px -30px rgba(30, 24, 15, 0.38);
}

.header-inner {
  width: min(var(--container), calc(100% - 96px));
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.brand-seal {
  width: 39px;
  height: 39px;
  position: relative;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fbf1e2;
  border-radius: 3px;
  transform: rotate(-2deg);
  box-shadow: 0 4px 12px -6px rgba(126, 47, 32, 0.7);
}

.brand-seal::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 245, 231, 0.48);
  border-radius: 1px;
}

.brand-seal i {
  font-family: var(--font-kai);
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  transform: translateY(1px);
}

.brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-type strong {
  font-family: var(--font-kai);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transform: translateX(-1px);
}

.brand-type small {
  font-size: 7px;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin-top: 5px;
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  font-size: 13.5px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translateX(-50%) scale(0.4);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--ink);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-pill {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  min-width: 208px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  font-size: 12px;
  transition: border-color 0.25s, background 0.25s, width 0.3s var(--ease);
}

.search-pill:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.search-pill-icon {
  display: flex;
}

.search-pill-text {
  flex: 1;
  text-align: left;
}

.search-pill kbd,
.search-panel-foot kbd {
  font-family: var(--font-sans);
  font-size: 9.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 5px;
  background: var(--bg-elevated);
  white-space: nowrap;
}

.theme-icon-dark {
  display: none;
}

[data-theme="dark"] .theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-icon-dark {
  display: flex;
}

.mobile-search,
.menu-toggle {
  display: none;
}

.auth-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 2px;
}

.header-login {
  height: 37px;
  padding: 0 19px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.header-login:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.wallet-chip {
  height: 37px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  font-size: 11.5px;
  color: var(--ink-soft);
  transition: background 0.25s;
}

.wallet-chip:hover {
  background: var(--surface-deep);
}

.wallet-chip strong {
  color: var(--ink);
  font-weight: 600;
}

.wallet-chip .icon {
  color: var(--gold);
}

.user-menu-wrap {
  position: relative;
}

.user-button {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 5px 2px 2px;
  border-radius: var(--radius-pill);
  transition: background 0.25s;
}

.user-button:hover {
  background: var(--surface-subtle);
}

.user-button .icon {
  color: var(--muted);
  transition: transform 0.25s;
}

.user-button[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 246px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top right;
  transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0.2s;
  z-index: 90;
}

.user-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 9px 13px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 7px;
}

.user-dropdown-head strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

.user-dropdown-head small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 2px;
}

.user-dropdown a,
.user-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 37px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.user-dropdown .icon {
  color: var(--muted);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 7px 3px;
}

.dropdown-admin {
  color: var(--muted);
}

.reading-progress-header {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* --------------------------- Avatar & tones --------------------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fbf7ed;
  font-family: var(--font-kai);
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: none;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.08);
}

.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 58%);
  pointer-events: none;
}

.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-md { width: 36px; height: 36px; font-size: 12px; }
.avatar-lg { width: 52px; height: 52px; font-size: 16px; }
.avatar-xl { width: 76px; height: 76px; font-size: 22px; }

.tone-1 { background: linear-gradient(145deg, #8b6a52, #5f4737); }
.tone-2 { background: linear-gradient(145deg, #617379, #435156); }
.tone-3 { background: linear-gradient(145deg, #8e8e63, #646544); }
.tone-4 { background: linear-gradient(145deg, #777391, #504d68); }
.tone-5 { background: linear-gradient(145deg, #5d8280, #3f5d5d); }
.tone-6 { background: linear-gradient(145deg, #a3746d, #774f4b); }
.tone-7 { background: linear-gradient(145deg, #748e9e, #506977); }
.tone-8 { background: linear-gradient(145deg, #9a7655, #6d523b); }
.tone-9 { background: linear-gradient(145deg, #667a63, #485646); }
.tone-10 { background: linear-gradient(145deg, #8d8170, #665d51); }

/* ----------------------------- Mobile nav ----------------------------- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 120;
  visibility: hidden;
  pointer-events: none;
}

.mobile-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(18, 15, 11, 0.38);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-nav-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(390px, 90vw);
  background: var(--bg-elevated);
  padding: 26px 28px 32px;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -20px 0 60px rgba(20, 15, 10, 0.18);
}

.mobile-nav.is-open {
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav.is-open::before {
  opacity: 1;
}

.mobile-nav.is-open .mobile-nav-panel {
  transform: none;
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.mobile-nav-links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 17px 2px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: 20px;
  transition: color 0.2s, padding 0.25s;
}

.mobile-nav-links a:hover {
  color: var(--accent);
  padding-left: 6px;
}

.mobile-nav-links small {
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.mobile-theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 23px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.mobile-theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.mobile-theme-toggle-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.mobile-theme-toggle-copy {
  flex: 1;
  min-width: 0;
}

.mobile-theme-toggle-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
}

.mobile-theme-toggle-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.mobile-theme-toggle-arrow {
  color: var(--muted);
  font-size: 13px;
}

.mobile-nav-foot {
  margin-top: auto;
  padding-top: 28px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-nav-foot p {
  font-family: var(--font-kai);
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* --------------------------- Search overlay --------------------------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  visibility: hidden;
  pointer-events: none;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 14, 10, 0.55);
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(5px);
}

.search-panel {
  position: relative;
  width: min(760px, calc(100% - 40px));
  margin: 11vh auto 0;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 24px 28px 18px;
  opacity: 0;
  transform: translateY(-14px) scale(0.985);
  transition: opacity 0.3s, transform 0.4s var(--ease);
}

.search-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.search-overlay.is-open .search-backdrop {
  opacity: 1;
}

.search-overlay.is-open .search-panel {
  opacity: 1;
  transform: none;
}

.search-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line-strong);
  padding: 0 0 15px;
}

.search-form .icon {
  color: var(--accent);
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.4;
  outline: 0;
}

.search-form input::placeholder {
  color: var(--muted-light);
}

.search-submit {
  height: 34px;
  padding: 0 17px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  white-space: nowrap;
}

.search-suggest {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 22px 0 14px;
}

.search-suggest-block {
  min-width: 0;
}

.search-suggest-label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 13px;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-chips button {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-soft);
  transition: all 0.2s;
}

.search-chips button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.search-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-recent a {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--ink-soft);
  min-width: 0;
}

.search-recent a span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-recent a:hover {
  color: var(--accent);
}

.search-recent .icon {
  color: var(--muted);
}

.search-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.search-panel-foot span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------ Footer ------------------------------ */
.site-footer {
  margin-top: 80px;
  background:
    radial-gradient(900px 400px at 85% 0%, rgba(177, 138, 86, 0.11), transparent 70%),
    #1b1915;
  color: #d9cfbe;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "MOYU";
  position: absolute;
  right: -30px;
  bottom: 40px;
  font-family: var(--font-serif);
  font-size: 220px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.025);
  letter-spacing: 0.04em;
  pointer-events: none;
}

.footer-main {
  width: min(var(--container), calc(100% - 96px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: 80px;
  padding: 76px 0 64px;
  position: relative;
  z-index: 1;
}

.brand-footer .brand-seal {
  background: #a44732;
}

.brand-footer .brand-type strong {
  color: #f4ecde;
}

.brand-footer .brand-type small {
  color: rgba(236, 226, 210, 0.4);
}

.footer-tagline {
  margin-top: 25px;
  font-family: var(--font-kai);
  font-size: 20px;
  line-height: 1.7;
  color: #cfc3b0;
  letter-spacing: 0.05em;
}

.footer-seal {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: rgba(217, 207, 190, 0.35);
  font-size: 9px;
  letter-spacing: 0.3em;
}

.footer-seal i {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(196, 160, 107, 0.35);
  color: #c4a06b;
  font-family: var(--font-kai);
  font-size: 18px;
  font-style: normal;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 0.7fr) 1.5fr;
  gap: 36px;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-column h4,
.footer-subscribe h4 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: #f1e8d9;
  margin-bottom: 10px;
}

.footer-column a {
  font-size: 11.5px;
  color: rgba(217, 207, 190, 0.58);
  transition: color 0.2s;
}

.footer-column a:hover {
  color: #e7c795;
}

.footer-subscribe p {
  font-size: 11px;
  line-height: 1.8;
  color: rgba(217, 207, 190, 0.48);
  margin-bottom: 6px;
}

.subscribe-form {
  margin-top: 8px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(236, 226, 210, 0.22);
  max-width: 270px;
}

.subscribe-form input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #eee3d0;
  height: 38px;
  font-size: 11.5px;
  outline: 0;
  min-width: 0;
}

.subscribe-form input::placeholder {
  color: rgba(217, 207, 190, 0.34);
}

.subscribe-form button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #d2b384;
}

.subscribe-form button:hover {
  color: #f1d8b1;
}

.footer-bottom {
  width: min(var(--container), calc(100% - 96px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(236, 226, 210, 0.09);
  padding: 21px 0 26px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: rgba(217, 207, 190, 0.32);
  position: relative;
  z-index: 1;
}

.footer-bottom-center {
  font-family: var(--font-kai);
  font-size: 12px;
  letter-spacing: 0.18em;
}

/* ------------------------------- Hero ------------------------------- */
.hero {
  position: relative;
  padding: 54px 0 16px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  width: 670px;
  height: 670px;
  right: -60px;
  top: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(178, 139, 86, 0.13), transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: 38%;
  bottom: 1%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(164, 71, 50, 0.055), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  width: min(1280px, calc(100% - 96px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  align-items: center;
  gap: 40px;
  min-height: 610px;
  position: relative;
  z-index: 2;
}

.hero-copy {
  padding: 48px 0 38px;
  position: relative;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 27px;
}

.hero-kicker .eyebrow {
  color: var(--accent);
}

.hero-kicker-line {
  width: 66px;
  height: 1px;
  background: var(--line-strong);
}

.hero-kicker span:last-child {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 5.6vw, 5.7rem);
  font-weight: 600;
  line-height: 1.17;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.hero-title .line {
  display: block;
}

.hero-title .line-2 {
  font-family: var(--font-kai);
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.015em;
  position: relative;
  display: inline-block;
  margin-top: 2px;
}

.hero-title .line-2::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 4%;
  bottom: -8px;
  height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='12' viewBox='0 0 420 12'%3E%3Cpath d='M2 8c76-6 148-4 218 0 67 4 128-2 198-5' fill='none' stroke='%23a44732' stroke-width='1.4' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  opacity: 0.65;
}

.hero-subcopy {
  margin-top: 26px;
  max-width: 455px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: 0.02em;
}

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

.hero-actions .btn {
  height: 49px;
}

.hero-actions .btn-primary {
  min-width: 153px;
}

.hero-actions .btn-ghost {
  gap: 10px;
  padding-left: 19px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 460px;
}

.hero-stat {
  padding-right: 27px;
  margin-right: 27px;
  border-right: 1px solid var(--line);
}

.hero-stat:last-child {
  border: 0;
  margin: 0;
  padding: 0;
}

.hero-stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-stat span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.hero-stage {
  position: relative;
  height: 620px;
  perspective: 1400px;
}

.hero-orbit {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 455px;
  height: 455px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.75;
}

.hero-orbit::before,
.hero-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed var(--line);
}

.hero-orbit::before {
  inset: 35px;
  animation: spin 80s linear infinite;
}

.hero-orbit::after {
  inset: 92px;
  border-style: solid;
  opacity: 0.6;
}

.hero-orbit-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  left: 12%;
  top: 10%;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 12%, transparent);
}

.hero-orbit-dot::before {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  top: 390px;
  left: 300px;
}

.hero-cover {
  position: absolute;
  transition: transform 0.7s var(--ease), box-shadow 0.5s;
  will-change: transform;
}

.hero-cover .book-cover {
  width: 100%;
  height: 100%;
}

.hero-cover-main {
  width: 292px;
  height: 414px;
  left: 50%;
  top: 47%;
  z-index: 5;
  transform: translate(-50%, -50%) rotate(-2.4deg);
}

.hero-cover-main .book-cover {
  box-shadow: 0 42px 70px -30px rgba(27, 20, 12, 0.68), 0 8px 18px rgba(27, 20, 12, 0.14);
}

.hero-cover-main:hover {
  transform: translate(-50%, -53%) rotate(-1deg);
}

.hero-cover-left {
  width: 175px;
  height: 248px;
  left: 24px;
  top: 93px;
  z-index: 2;
  transform: rotate(-11deg);
  opacity: 0.94;
}

.hero-cover-left .book-cover {
  box-shadow: 0 24px 44px -22px rgba(27, 20, 12, 0.45);
}

.hero-cover-right {
  width: 181px;
  height: 256px;
  right: 8px;
  bottom: 70px;
  z-index: 3;
  transform: rotate(8deg);
  opacity: 0.96;
}

.hero-cover-right .book-cover {
  box-shadow: 0 28px 48px -24px rgba(27, 20, 12, 0.5);
}

.hero-cover-back {
  width: 144px;
  height: 204px;
  right: 42px;
  top: 36px;
  z-index: 1;
  transform: rotate(13deg);
  opacity: 0.55;
  filter: blur(0.2px);
}

.hero-float {
  position: absolute;
  z-index: 8;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 12px 15px;
  animation: float 7s ease-in-out infinite;
}

.hero-float-quote {
  left: 6px;
  bottom: 100px;
  width: 206px;
  border-radius: 3px 14px 14px 14px;
  animation-delay: -2s;
}

.hero-float-quote span {
  display: block;
  font-family: var(--font-kai);
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.hero-float-quote small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.hero-float-live {
  right: 4px;
  top: 105px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  animation-delay: -4s;
}

.hero-float-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b8a61;
  box-shadow: 0 0 0 4px rgba(107, 138, 97, 0.13);
  animation: pulse 2.5s infinite;
}

.hero-float-live span {
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.hero-float-live strong {
  font-weight: 600;
}

.hero-float-rating {
  right: 20px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  animation-delay: -1s;
}

.hero-float-rating .rating-num {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-float-rating small {
  display: block;
  font-size: 8.5px;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-top: 3px;
}

.hero-vertical {
  position: absolute;
  right: -4px;
  top: 50%;
  writing-mode: vertical-rl;
  font-size: 8.5px;
  color: var(--muted);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  transform: translateY(-50%);
  z-index: 1;
}

.hero-issue {
  position: absolute;
  left: 36px;
  top: 31px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.hero-issue::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

/* ----------------------------- Campaigns ----------------------------- */
.campaign-ribbon {
  width: min(var(--container), calc(100% - 96px));
  margin: 8px auto 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
  z-index: 3;
}

.campaign-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 24px;
  border-right: 1px solid var(--line);
  min-width: 0;
  transition: background 0.25s;
}

.campaign-item:last-child {
  border-right: 0;
}

.campaign-item:hover {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.campaign-symbol {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  flex: none;
  font-family: var(--font-kai);
  font-size: 13px;
}

.campaign-item:nth-child(2) .campaign-symbol {
  color: var(--gold);
  background: var(--gold-soft);
}

.campaign-item:nth-child(3) .campaign-symbol {
  color: var(--green);
  background: var(--green-soft);
}

.campaign-copy {
  min-width: 0;
}

.campaign-copy strong {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.5;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.campaign-copy small {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.campaign-arrow {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.25s, color 0.25s;
}

.campaign-item:hover .campaign-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ------------------------------ Sections ------------------------------ */
.section {
  padding: 105px 0;
  position: relative;
}

.section-tight {
  padding: 68px 0;
}

.section-soft {
  background:
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 65%, transparent) 12%, color-mix(in srgb, var(--surface) 65%, transparent) 88%, transparent);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 42px;
}

.section-heading h2 {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.65rem);
  line-height: 1.3;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.section-heading p {
  max-width: 520px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.85;
}

.section-heading-action {
  flex: none;
  padding-bottom: 5px;
}

.section-heading-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
  padding-bottom: 4px;
}

/* ------------------------------- Covers ------------------------------- */
.book-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 2px 7px 7px 2px;
  background: #b7ad9b;
  box-shadow: var(--shadow-cover);
  isolation: isolate;
  transform: translateZ(0);
}

.book-cover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  z-index: 6;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.09) 55%, transparent);
  opacity: 0.6;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter 0.4s;
  user-select: none;
  -webkit-user-drag: none;
}

.cover-wash {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(10, 12, 11, 0.12) 0%, rgba(10, 12, 11, 0.02) 35%, rgba(9, 10, 9, 0.26) 66%, rgba(8, 9, 8, 0.78) 100%),
    linear-gradient(90deg, rgba(8, 9, 8, 0.38), transparent 36%, rgba(8, 9, 8, 0.18));
  pointer-events: none;
}

.cover-rule {
  position: absolute;
  z-index: 4;
  right: 12px;
  top: 51px;
  width: 1px;
  height: 46%;
  background: linear-gradient(180deg, rgba(249, 240, 225, 0.65), transparent);
  opacity: 0.55;
}

.cover-category {
  position: absolute;
  z-index: 4;
  top: 13px;
  left: 16px;
  font-size: 7.5px;
  letter-spacing: 0.18em;
  color: rgba(250, 243, 231, 0.78);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  max-width: 64%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-title {
  position: absolute;
  z-index: 4;
  right: 18px;
  top: 54px;
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.35vw, 35px);
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1.1;
  color: #f8f0e1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
  max-height: 70%;
  overflow: hidden;
}

.cover-author {
  position: absolute;
  z-index: 4;
  left: 16px;
  bottom: 14px;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: rgba(249, 241, 228, 0.78);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.cover-brand {
  position: absolute;
  z-index: 4;
  right: 15px;
  bottom: 14px;
  font-size: 6px;
  letter-spacing: 0.24em;
  color: rgba(249, 241, 228, 0.44);
}

.cover-badge {
  position: absolute;
  z-index: 5;
  top: 13px;
  right: 14px;
  padding: 3px 6px;
  background: rgba(248, 239, 224, 0.13);
  border: 1px solid rgba(248, 239, 224, 0.27);
  border-radius: 2px;
  color: rgba(250, 243, 231, 0.86);
  font-size: 7px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(4px);
}

.cover-shelf {
  position: absolute;
  z-index: 7;
  right: 11px;
  bottom: 11px;
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #f6eddd;
  background: rgba(22, 20, 16, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.25s, transform 0.3s var(--ease), background 0.25s;
}

.cover-shelf:hover {
  background: var(--accent);
}

.cover-shelf.is-saved {
  opacity: 1;
  transform: none;
  color: #f2d8b2;
}

.book-card:hover .cover-shelf {
  opacity: 1;
  transform: none;
}

.cover-progress {
  position: absolute;
  z-index: 7;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
}

.cover-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* ------------------------------ Book card ------------------------------ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 38px 28px;
}

.book-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.book-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.book-grid-sparse {
  grid-template-columns: repeat(4, minmax(0, 228px));
  justify-content: start;
}

@media (max-width: 1024px) {
  .book-grid-sparse {
    grid-template-columns: repeat(3, minmax(0, 215px));
  }
}

@media (max-width: 780px) {
  .book-grid-sparse {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.book-card {
  min-width: 0;
  position: relative;
}

.book-card-cover {
  display: block;
  position: relative;
  border-radius: 2px 7px 7px 2px;
  transition: transform 0.5s var(--ease);
  transform-origin: bottom center;
}

.book-card:hover .book-card-cover {
  transform: translateY(-7px) rotate(-0.35deg);
}

.book-card:hover .book-cover img {
  transform: scale(1.035);
}

.book-card-info {
  padding-top: 17px;
}

.book-card-info h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-info h3 a {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.35s var(--ease), color 0.2s;
}

.book-card-info h3 a:hover {
  color: var(--accent);
  background-size: 100% 1px;
}

.book-card-author {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 9.5px;
  color: var(--muted-light);
  white-space: nowrap;
  overflow: hidden;
}

.book-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--amber);
  font-size: 10px;
  font-weight: 500;
}

.book-meta-dot {
  opacity: 0.4;
}

.book-serial {
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 8px;
  color: var(--muted);
}

.book-card-progress {
  margin-top: 7px;
  font-size: 9.5px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------ Skeleton ------------------------------ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-subtle);
  border-radius: 4px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface-raised) 65%, transparent), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.6s infinite;
}

.skeleton-cover {
  aspect-ratio: 3 / 4;
  border-radius: 2px 7px 7px 2px;
}

.skeleton-line {
  height: 11px;
  margin-top: 14px;
}

.skeleton-line + .skeleton-line {
  margin-top: 8px;
}

/* --------------------------- Page loading --------------------------- */
.page-loading {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
}

.loading-mark {
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-family: var(--font-kai);
  font-size: 24px;
  animation: breathe 2.4s ease-in-out infinite;
}

.page-loading p {
  font-size: 11px;
  letter-spacing: 0.1em;
}

.loading-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 5px;
}

.loading-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.2s infinite;
}

.loading-dots i:nth-child(2) { animation-delay: 0.15s; }
.loading-dots i:nth-child(3) { animation-delay: 0.3s; }

.initial-loading {
  min-height: 70vh;
}

/* ---------------------------- Editorial bento ---------------------------- */
.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 24px;
}

.editorial-feature {
  position: relative;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 4px 26px 26px 26px;
  background:
    radial-gradient(500px 240px at 100% 0%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%),
    var(--surface);
  overflow: hidden;
  min-height: 338px;
}

.editorial-feature::before {
  content: "";
  position: absolute;
  left: -25px;
  top: -40px;
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.5;
}

.editorial-feature .book-cover {
  width: 100%;
  transform: rotate(-2deg);
  transition: transform 0.6s var(--ease);
}

.editorial-feature:hover .book-cover {
  transform: rotate(-0.5deg) translateY(-5px);
}

.editorial-feature-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.editorial-feature-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 15px;
}

.editorial-feature-label::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.editorial-feature h3 {
  font-family: var(--font-display);
  font-size: 31px;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.editorial-feature h3 a:hover {
  color: var(--accent);
}

.editorial-feature-author {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.editorial-quote {
  margin: 20px 0 22px;
  font-family: var(--font-kai);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-soft);
  position: relative;
  padding-left: 17px;
}

.editorial-quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: var(--accent);
  opacity: 0.55;
}

.editorial-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--muted);
}

.editorial-meta .book-rating {
  font-size: 11px;
}

.editorial-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 24px;
}

.editorial-mini {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 23px;
  align-items: center;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 4px 20px 20px 20px;
  background: var(--surface);
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease);
  overflow: hidden;
}

.editorial-mini:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  transform: translateX(3px);
}

.editorial-mini .book-cover {
  width: 104px;
}

.editorial-mini-copy {
  min-width: 0;
}

.editorial-mini-label {
  font-size: 8.5px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.editorial-mini h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.editorial-mini h3 a:hover {
  color: var(--accent);
}

.editorial-mini p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.editorial-mini-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 9px;
  color: var(--muted);
}

/* ------------------------------ Ranking ------------------------------ */
.trending-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 56px;
  align-items: start;
}

.trending-books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 26px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.tabs button {
  position: relative;
  padding: 11px 16px 13px;
  font-size: 11.5px;
  color: var(--muted);
  transition: color 0.2s;
  white-space: nowrap;
}

.tabs button::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button.is-active {
  color: var(--ink);
  font-weight: 500;
}

.tabs button.is-active::after {
  transform: scaleX(1);
}

.rank-panel {
  border: 1px solid var(--line);
  border-radius: 4px 22px 22px 22px;
  background: var(--surface);
  overflow: hidden;
}

.rank-panel-head {
  padding: 23px 24px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rank-panel-head h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.01em;
}

.rank-panel-head span {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.rank-list {
  padding: 7px 14px 12px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 9px;
  border-radius: 10px;
  transition: background 0.2s;
}

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

.rank-number {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--muted-light);
  width: 21px;
  flex: none;
  letter-spacing: -0.02em;
}

.rank-number.is-top {
  color: var(--accent);
  font-weight: 600;
}

.rank-thumb {
  width: 37px;
  height: 51px;
  flex: none;
  border-radius: 1px 3px 3px 1px;
  overflow: hidden;
  box-shadow: 0 5px 10px -5px rgba(0, 0, 0, 0.45);
}

.rank-thumb .book-cover {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.rank-thumb .cover-category,
.rank-thumb .cover-author,
.rank-thumb .cover-brand,
.rank-thumb .cover-rule {
  display: none;
}

.rank-thumb .cover-title {
  font-size: 6px;
  right: 4px;
  top: 5px;
  letter-spacing: 0.04em;
  max-height: 85%;
}

.rank-thumb .cover-wash {
  background: rgba(10, 10, 8, 0.25);
}

.rank-info {
  min-width: 0;
  flex: 1;
}

.rank-info strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-info small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-heat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: var(--muted);
  flex: none;
}

.rank-heat .icon {
  color: var(--accent);
  opacity: 0.8;
}

.rank-panel-foot {
  padding: 13px 24px 17px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rank-panel-foot a:hover {
  color: var(--accent);
}

/* ----------------------------- Categories ----------------------------- */
.category-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 49.9%, var(--line) 50%, transparent 50.1%) 0 0 / 33.333% 100%,
    color-mix(in srgb, var(--surface) 45%, transparent);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 -1px;
}

.category-tile {
  position: relative;
  display: flex;
  min-height: 178px;
  padding: 27px 27px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  transition: background 0.35s, color 0.35s;
}

.category-tile:nth-child(4n) {
  border-right: 0;
}

.category-tile:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.category-tile:hover {
  background: var(--surface-raised);
}

.category-glyph {
  position: absolute;
  right: 17px;
  bottom: -26px;
  font-family: var(--font-kai);
  font-size: 104px;
  line-height: 1;
  color: var(--ink);
  opacity: 0.055;
  transition: opacity 0.4s, transform 0.6s var(--ease), color 0.4s;
  pointer-events: none;
}

.category-tile:hover .category-glyph {
  opacity: 0.1;
  color: var(--accent);
  transform: translateY(-5px) rotate(-3deg);
}

.category-tile-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.category-en {
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.category-tile h3 {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.02em;
}

.category-tile p {
  margin-top: 8px;
  max-width: 190px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.65;
}

.category-tile-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
}

.category-tile-foot span {
  font-family: var(--font-serif);
  font-size: 11px;
}

.category-tile-foot .icon {
  transition: transform 0.3s;
}

.category-tile:hover .category-tile-foot .icon {
  transform: translateX(4px);
  color: var(--accent);
}

/* ---------------------------- New books strip ---------------------------- */
.new-books-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
}

/* ------------------------------ Authors ------------------------------ */
.author-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 24px;
}

.author-card {
  position: relative;
  padding: 30px;
  min-height: 260px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 4px 22px 22px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s, background 0.3s;
}

.author-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.author-card:first-child {
  background:
    radial-gradient(500px 260px at 100% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 68%),
    var(--surface);
}

.author-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.author-card-name strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
}

.author-card-name span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.06em;
}

.author-quote {
  margin-top: 26px;
  font-family: var(--font-kai);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-soft);
  position: relative;
  z-index: 1;
  padding-right: 15px;
}

.author-quote::before {
  content: "“";
  position: absolute;
  left: -5px;
  top: -19px;
  font-family: var(--font-serif);
  font-size: 44px;
  color: var(--accent);
  opacity: 0.28;
}

.author-card-bottom {
  margin-top: auto;
  padding-top: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.author-card-bottom span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.author-big-glyph {
  position: absolute;
  right: -10px;
  bottom: -37px;
  font-family: var(--font-kai);
  font-size: 160px;
  line-height: 1;
  color: var(--ink);
  opacity: 0.035;
  pointer-events: none;
}

.author-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.author-card-link:hover {
  color: var(--accent);
}

/* -------------------------- Membership band -------------------------- */
.membership-band {
  position: relative;
  border-radius: 3px 34px 34px 34px;
  background:
    radial-gradient(800px 450px at 82% 18%, rgba(189, 152, 97, 0.18), transparent 64%),
    radial-gradient(500px 400px at 8% 95%, rgba(164, 71, 50, 0.16), transparent 70%),
    #1c1a15;
  color: #ede4d4;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: stretch;
  min-height: 460px;
}

.membership-band::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(222, 198, 160, 0.15);
  border-radius: 2px 24px 24px 24px;
  pointer-events: none;
}

.membership-band-copy {
  padding: 65px 22px 60px 65px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.membership-band-copy .eyebrow {
  color: #c9a46d;
}

.membership-band-copy h2 {
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.membership-band-copy h2 em {
  font-family: var(--font-kai);
  font-style: normal;
  color: #d5b27b;
}

.membership-band-copy > p {
  margin-top: 18px;
  max-width: 430px;
  font-size: 12.5px;
  line-height: 1.9;
  color: rgba(237, 228, 212, 0.58);
}

.membership-perks {
  margin: 29px 0 33px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  max-width: 450px;
}

.membership-perks span {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: rgba(237, 228, 212, 0.74);
}

.membership-perks .icon {
  color: #c9a46d;
}

.membership-band-actions {
  display: flex;
  align-items: center;
  gap: 17px;
  flex-wrap: wrap;
}

.membership-band-actions .btn {
  background: #d0ad74;
  color: #211a10;
  box-shadow: 0 16px 34px -20px rgba(201, 164, 109, 0.8);
}

.membership-band-actions .btn:hover {
  background: #e0c08d;
}

.membership-band-actions .text-link {
  color: rgba(237, 228, 212, 0.68);
  border-color: rgba(237, 228, 212, 0.25);
}

.membership-band-actions .text-link:hover {
  color: #d5b27b;
  border-color: #d5b27b;
}

.membership-preview {
  position: relative;
  min-height: 460px;
}

.membership-preview-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-44%, -50%) rotate(2.4deg);
  width: min(355px, 82%);
  background: #f6efe2;
  color: #342e25;
  border-radius: 2px 14px 14px 14px;
  padding: 31px 29px 27px;
  box-shadow: 0 45px 80px -36px rgba(0, 0, 0, 0.75);
  z-index: 3;
}

.membership-preview-card::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(139, 104, 60, 0.22);
  border-radius: 1px 9px 9px 9px;
  pointer-events: none;
}

.preview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8px;
  letter-spacing: 0.16em;
  color: #8d7c65;
}

.preview-card-head span:last-child {
  color: #a44732;
}

.membership-preview-card h3 {
  margin: 23px 0 14px;
  font-family: var(--font-kai);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.membership-preview-card p {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 2.15;
  letter-spacing: 0.08em;
  text-align: justify;
  color: #4c4438;
}

.membership-preview-card p + p {
  margin-top: 8px;
}

.preview-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 25px;
  padding-top: 14px;
  border-top: 1px solid rgba(88, 67, 42, 0.16);
  font-size: 8px;
  color: #9a8770;
  letter-spacing: 0.12em;
}

.preview-card-stamp {
  width: 28px;
  height: 28px;
  border: 1px solid #a44732;
  display: grid;
  place-items: center;
  color: #a44732;
  font-family: var(--font-kai);
  font-size: 12px;
  transform: rotate(-6deg);
}

.membership-theme-chip {
  position: absolute;
  z-index: 5;
  right: 34px;
  top: 66px;
  width: 91px;
  height: 120px;
  border-radius: 2px 8px 8px 8px;
  background: linear-gradient(145deg, #26332d, #171f1b);
  border: 1px solid rgba(207, 174, 122, 0.36);
  box-shadow: 0 26px 50px -22px rgba(0, 0, 0, 0.7);
  transform: rotate(8deg);
  display: grid;
  place-items: center;
  animation: float 8s ease-in-out infinite;
}

.membership-theme-chip span {
  writing-mode: vertical-rl;
  font-family: var(--font-kai);
  font-size: 18px;
  letter-spacing: 0.18em;
  color: #d9bb86;
}

.membership-theme-chip small {
  position: absolute;
  bottom: 9px;
  font-size: 5px;
  letter-spacing: 0.2em;
  color: rgba(217, 187, 134, 0.45);
}

.membership-float-note {
  position: absolute;
  z-index: 4;
  left: 15px;
  bottom: 67px;
  padding: 9px 13px;
  border-radius: 8px;
  background: rgba(26, 24, 19, 0.72);
  border: 1px solid rgba(218, 194, 156, 0.18);
  color: rgba(237, 228, 212, 0.72);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  backdrop-filter: blur(6px);
  animation: float 7s ease-in-out infinite;
  animation-delay: -2s;
}

/* ------------------------------ Empty state ------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  min-height: 330px;
  border: 1px dashed var(--line-strong);
  border-radius: 3px 22px 22px 22px;
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 57px;
  height: 57px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 19px;
}

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.empty-state p {
  margin-top: 8px;
  max-width: 380px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.empty-state .btn {
  margin-top: 23px;
}

/* ------------------------------ Modal ------------------------------ */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-root.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 13, 9, 0.58);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.3s;
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(88vh, 840px);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 4px 25px 25px 25px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
  animation: modalIn 0.42s var(--ease);
}

.modal-wide {
  width: min(760px, 100%);
}

.modal-compact {
  width: min(430px, 100%);
}

.modal-close {
  position: absolute;
  right: 17px;
  top: 17px;
  z-index: 4;
}

.modal-head {
  padding-right: 35px;
  margin-bottom: 24px;
}

.modal-head h2 {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.modal-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

/* ------------------------------ Toast ------------------------------ */
.toast-root {
  position: fixed;
  z-index: 300;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 32px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 9px 17px 9px 11px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  line-height: 1.4;
  animation: toastIn 0.45s var(--ease);
  max-width: 480px;
}

.toast.is-leaving {
  animation: toastOut 0.3s var(--ease) forwards;
}

.toast-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #e8c891;
  flex: none;
}

.toast-success .toast-icon {
  color: #b8d5a8;
}

.toast-error .toast-icon {
  color: #e6a294;
}

.toast-info .toast-icon {
  color: #d8c3a0;
}

/* -------------------------- Shared form controls -------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.field label b {
  color: var(--accent);
  font-weight: 400;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 13px;
  font-size: 13px;
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  background: var(--surface-raised);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-light);
}

.textarea {
  resize: vertical;
  min-height: 108px;
  line-height: 1.8;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23857d6f' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 35px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-note {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.input-error {
  border-color: var(--danger) !important;
}

.form-error {
  display: none;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-size: 11px;
  line-height: 1.6;
}

.form-error.is-visible {
  display: flex;
}

.form-error .icon {
  margin-top: 1px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.7;
  cursor: pointer;
}

.checkbox input {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: none;
}

.checkbox a {
  color: var(--accent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
}

.chip-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip-amber { background: color-mix(in srgb, var(--amber) 13%, transparent); color: var(--amber); border-color: transparent; }
.chip-red { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); border-color: transparent; }
.chip-blue { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); border-color: transparent; }
.chip-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 9.5px;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.status-green { background: var(--green-soft); color: var(--green); }
.status-amber { background: color-mix(in srgb, var(--amber) 13%, transparent); color: var(--amber); }
.status-red { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); }
.status-blue { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.status-grey { background: var(--surface-subtle); color: var(--muted); }

/* ------------------------------ Animations ------------------------------ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px) scale(0.97); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.85s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 1220px) {
  .header-inner,
  .announcement-inner,
  .footer-main,
  .footer-bottom,
  .container,
  .container-narrow,
  .campaign-ribbon,
  .hero-inner {
    width: calc(100% - 64px);
  }

  .header-inner {
    gap: 26px;
  }

  .main-nav {
    gap: 23px;
  }

  .search-pill {
    min-width: 170px;
  }

  .search-pill kbd {
    display: none;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1.02fr) minmax(380px, 0.98fr);
  }

  .hero-stage {
    height: 580px;
    transform: scale(0.94);
    transform-origin: center right;
  }

  .hero-cover-main {
    width: 270px;
    height: 382px;
  }

  .hero-cover-left {
    left: -5px;
  }

  .hero-cover-right {
    right: -13px;
  }

  .trending-layout {
    grid-template-columns: minmax(0, 1fr) 345px;
    gap: 36px;
  }

  .editorial-feature {
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 28px;
    padding: 28px;
  }

  .editorial-feature h3 {
    font-size: 27px;
  }

  .footer-main {
    grid-template-columns: 0.8fr 2fr;
    gap: 50px;
  }

  .footer-columns {
    grid-template-columns: repeat(3, 0.65fr) 1.35fr;
    gap: 24px;
  }
}

@media (max-width: 1024px) {
  :root {
    --header-h: 70px;
  }

  .main-nav,
  .search-pill {
    display: none;
  }

  .mobile-search,
  .menu-toggle {
    display: inline-flex;
  }

  .header-actions {
    gap: 3px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(350px, 0.95fr);
    min-height: 570px;
    gap: 15px;
  }

  .hero-title {
    font-size: clamp(3.2rem, 5.4vw, 4.5rem);
  }

  .hero-stage {
    height: 540px;
    transform: scale(0.86);
    transform-origin: center right;
  }

  .hero-float-quote {
    left: -7px;
  }

  .campaign-item {
    padding: 14px 16px;
  }

  .campaign-copy small {
    display: none;
  }

  .editorial-grid {
    grid-template-columns: 1fr;
  }

  .editorial-feature {
    grid-template-columns: 210px 1fr;
  }

  .editorial-side {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
  }

  .editorial-mini {
    grid-template-columns: 90px 1fr;
    padding: 20px;
    gap: 18px;
  }

  .editorial-mini .book-cover {
    width: 90px;
  }

  .trending-layout {
    grid-template-columns: 1fr;
  }

  .rank-panel {
    margin-top: 5px;
  }

  .rank-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
  }

  .rank-panel-foot {
    display: none;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-tile:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .category-tile:nth-child(3n) {
    border-right: 0;
  }

  .category-tile:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .category-tile:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .author-grid {
    grid-template-columns: 1fr 1fr;
  }

  .author-card:first-child {
    grid-column: span 2;
    min-height: 230px;
  }

  .membership-band {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .membership-band-copy {
    padding: 54px 15px 48px 44px;
  }

  .membership-preview {
    transform: scale(0.9);
    transform-origin: center;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .footer-seal {
    display: none;
  }
}

@media (max-width: 780px) {
  body {
    font-size: 14px;
  }

  .container,
  .container-narrow,
  .header-inner,
  .announcement-inner,
  .footer-main,
  .footer-bottom,
  .campaign-ribbon,
  .hero-inner {
    width: calc(100% - 40px);
  }

  .announcement-inner {
    justify-content: flex-start;
    padding-right: 29px;
  }

  .announcement-inner p {
    font-size: 10px;
  }

  .announcement-inner a {
    display: none;
  }

  .announcement-pulse {
    display: none;
  }

  .brand-seal {
    width: 35px;
    height: 35px;
  }

  .brand-type strong {
    font-size: 22px;
  }

  .brand-type small {
    font-size: 6px;
  }

  .theme-toggle {
    display: none;
  }

  .wallet-chip {
    display: none;
  }

  .header-login {
    padding: 0 14px;
    height: 34px;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 0;
  }

  .hero-copy {
    padding: 22px 0 10px;
  }

  .hero-kicker {
    margin-bottom: 19px;
  }

  .hero-kicker .eyebrow {
    white-space: nowrap;
  }

  .hero-kicker span:last-child {
    display: none;
  }

  .hero-kicker-line {
    flex: 1;
    width: auto;
  }

  .hero-title {
    font-size: clamp(2.8rem, 11vw, 4rem);
    letter-spacing: -0.05em;
  }

  .hero-subcopy {
    margin-top: 20px;
    font-size: 13px;
    max-width: 92%;
  }

  .hero-actions {
    margin-top: 26px;
  }

  .hero-actions .btn {
    height: 46px;
  }

  .hero-stats {
    margin-top: 30px;
    padding-top: 18px;
  }

  .hero-stat {
    padding-right: 19px;
    margin-right: 19px;
  }

  .hero-stat strong {
    font-size: 18px;
  }

  .hero-stat span {
    font-size: 8.5px;
  }

  .hero-stage {
    height: 475px;
    margin: 10px 0 0;
    transform: none;
    transform-origin: center;
    width: 100%;
    max-width: 430px;
    margin-inline: auto;
  }

  .hero-cover-main {
    width: 214px;
    height: 302px;
    top: 51%;
  }

  .hero-cover-left {
    width: 128px;
    height: 182px;
    left: 2%;
    top: 72px;
  }

  .hero-cover-right {
    width: 134px;
    height: 190px;
    right: 0;
    bottom: 58px;
  }

  .hero-cover-back {
    width: 106px;
    height: 150px;
    right: 30px;
    top: 30px;
  }

  .hero-orbit {
    width: 330px;
    height: 330px;
  }

  .hero-orbit::before {
    inset: 23px;
  }

  .hero-orbit::after {
    inset: 60px;
  }

  .hero-orbit-dot::before {
    top: 240px;
    left: 255px;
  }

  .hero-float {
    transform: scale(0.88);
  }

  .hero-float-quote {
    left: -5px;
    bottom: 57px;
    width: 176px;
    border-radius: 2px 10px 10px 10px;
  }

  .hero-float-quote span {
    font-size: 12px;
  }

  .hero-float-live {
    right: -4px;
    top: 57px;
  }

  .hero-float-rating {
    right: 1px;
    bottom: 7px;
    padding: 9px 12px;
  }

  .hero-vertical,
  .hero-issue {
    display: none;
  }

  .campaign-ribbon {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .campaign-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 11px 6px;
  }

  .campaign-copy small {
    display: block;
    font-size: 8.5px;
  }

  .section {
    padding: 65px 0;
  }

  .section-tight {
    padding: 45px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
  }

  .section-heading h2 {
    font-size: 1.9rem;
  }

  .section-heading p {
    font-size: 11.5px;
  }

  .section-heading-actions {
    padding: 0;
    width: 100%;
    justify-content: space-between;
  }

  .section-heading-action {
    padding: 0;
  }

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 17px;
  }

  .book-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-card-info {
    padding-top: 12px;
  }

  .book-card-info h3 {
    font-size: 14px;
  }

  .book-card-author {
    font-size: 9.5px;
  }

  .book-card-foot {
    font-size: 8.5px;
  }

  .cover-title {
    font-size: clamp(19px, 6.4vw, 28px);
    right: 13px;
    top: 42px;
  }

  .cover-category {
    left: 12px;
    top: 10px;
    font-size: 6.5px;
  }

  .cover-badge {
    top: 9px;
    right: 10px;
    font-size: 6px;
  }

  .cover-author {
    left: 12px;
    bottom: 10px;
    font-size: 7.5px;
  }

  .cover-brand {
    right: 10px;
    bottom: 10px;
    font-size: 5.5px;
  }

  .cover-rule {
    right: 9px;
    top: 41px;
  }

  .cover-shelf {
    width: 28px;
    height: 28px;
    right: 8px;
    bottom: 8px;
    opacity: 1;
    transform: none;
  }

  .editorial-feature {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
    min-height: 0;
    border-radius: 3px 18px 18px 18px;
  }

  .editorial-feature-label {
    margin-bottom: 10px;
    font-size: 8px;
  }

  .editorial-feature h3 {
    font-size: 21px;
  }

  .editorial-quote {
    margin: 12px 0 14px;
    font-size: 13px;
    line-height: 1.75;
    padding-left: 12px;
  }

  .editorial-meta {
    font-size: 8.5px;
  }

  .editorial-side {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .editorial-mini {
    grid-template-columns: 76px 1fr;
    padding: 15px;
    gap: 15px;
  }

  .editorial-mini .book-cover {
    width: 76px;
  }

  .editorial-mini h3 {
    font-size: 16px;
  }

  .editorial-mini p {
    margin-top: 4px;
    font-size: 9.5px;
    -webkit-line-clamp: 2;
  }

  .editorial-mini-foot {
    margin-top: 7px;
    font-size: 8px;
  }

  .trending-books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 27px 17px;
  }

  .tabs {
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs button {
    padding: 9px 12px 12px;
    font-size: 10.5px;
  }

  .tabs button::after {
    left: 12px;
    right: 12px;
  }

  .rank-list {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-tile {
    min-height: 148px;
    padding: 20px;
  }

  .category-tile:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .category-tile:nth-child(2n) {
    border-right: 0;
  }

  .category-tile:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .category-tile h3 {
    font-size: 19px;
  }

  .category-tile p {
    font-size: 9.5px;
    max-width: 140px;
  }

  .category-glyph {
    font-size: 80px;
    right: 10px;
    bottom: -21px;
  }

  .author-grid {
    grid-template-columns: 1fr;
  }

  .author-card:first-child {
    grid-column: auto;
  }

  .author-card {
    padding: 23px;
    min-height: 220px;
  }

  .author-quote {
    font-size: 15px;
    margin-top: 22px;
  }

  .membership-band {
    grid-template-columns: 1fr;
    border-radius: 3px 24px 24px 24px;
  }

  .membership-band-copy {
    padding: 42px 29px 25px;
  }

  .membership-band-copy h2 {
    font-size: 2.1rem;
  }

  .membership-perks {
    gap: 10px;
    margin: 22px 0 26px;
  }

  .membership-perks span {
    font-size: 10px;
  }

  .membership-preview {
    min-height: 360px;
    transform: scale(0.82);
    margin: -15px 0 -15px;
  }

  .membership-preview-card {
    transform: translate(-50%, -50%) rotate(2deg);
    width: 290px;
  }

  .membership-theme-chip {
    right: 8px;
    top: 45px;
    width: 72px;
    height: 98px;
  }

  .membership-float-note {
    display: none;
  }

  .footer-main {
    padding: 50px 0 40px;
    gap: 37px;
  }

  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: 30px 22px;
  }

  .footer-subscribe {
    grid-column: span 2;
    padding-top: 8px;
  }

  .footer-tagline {
    margin-top: 18px;
    font-size: 18px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    padding: 17px 0 22px;
  }

  .footer-bottom-center {
    order: -1;
    font-size: 11px;
  }

  .site-footer {
    margin-top: 50px;
  }

  .modal-root {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-card {
    width: 100%;
    border-radius: 18px 18px 9px 9px;
    padding: 25px 21px;
    max-height: 88vh;
  }

  .modal-head h2 {
    font-size: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .search-panel {
    margin-top: 8vh;
    padding: 20px 20px 15px;
    border-radius: 18px;
  }

  .search-form input {
    font-size: 18px;
  }

  .search-suggest {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .search-suggest-block:last-child {
    display: none;
  }

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

  .toast-root {
    top: 12px;
  }

  .toast {
    font-size: 11px;
    padding: 8px 14px 8px 9px;
  }
}

/* Inner page entrance */
#main > .page {
  animation: pageIn 0.55s var(--ease) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.pagination a {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  color: var(--muted);
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.pagination a.is-active {
  background: var(--ink);
  color: var(--bg);
  pointer-events: none;
}

.pagination .pagination-arrow {
  border: 1px solid var(--line);
}

@media (max-width: 380px) {
  .hero-title {
    font-size: 2.55rem;
  }

  .hero-cover-main {
    width: 192px;
    height: 271px;
  }

  .hero-cover-left {
    width: 114px;
    height: 162px;
  }

  .hero-cover-right {
    width: 120px;
    height: 170px;
  }

  .hero-stage {
    height: 430px;
  }

  .hero-float-quote {
    width: 158px;
  }

  .book-grid,
  .trending-books,
  .new-books-grid {
    gap: 24px 14px;
  }
}
