/*
 * Booksea UI v3 — quiet editorial product design.
 * styles.css supplies the resilient layout; this layer owns the visual system.
 */

:root {
  --ink: #15161a;
  --ink-soft: #34363d;
  --muted: #737780;
  --paper: #f4f4ef;
  --cream: #fbfbf8;
  --surface: rgba(255, 255, 252, .88);
  --surface-solid: #fffffc;
  --accent: #5b56e8;
  --accent-dark: #413bd0;
  --accent-soft: #eeedff;
  --cyan: #82d9e6;
  --success: #267a57;
  --warning: #bd741b;
  --danger: #c54242;
  --line: rgba(20, 22, 28, .095);
  --line-strong: rgba(20, 22, 28, .16);
  --shadow-sm: 0 8px 28px rgba(28, 30, 38, .055);
  --shadow-md: 0 24px 70px rgba(28, 30, 38, .10);
  --shadow-lg: 0 42px 100px rgba(24, 24, 35, .16);
  --radius-sm: 12px;
  --radius: 22px;
  --radius-lg: 34px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --green: var(--accent);
  --green-dark: var(--ink);
  --green-soft: var(--accent-soft);
  --gold: var(--warning);
  --rust: var(--danger);
}

html { background: var(--paper); }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.js body:not(.is-ready) main { opacity: .01; }
.js body.is-ready main { opacity: 1; transition: opacity .28s ease; }
a, button, input, select { -webkit-tap-highlight-color: transparent; }
::selection { color: #fff; background: var(--accent); }
:focus-visible { outline: 3px solid rgba(91, 86, 232, .25); outline-offset: 3px; }
.container { width: min(1200px, calc(100% - 56px)); }

/* Header */
.site-header {
  background: rgba(244, 244, 239, .78);
  border-bottom: 1px solid transparent;
  box-shadow: none;
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.site-header.is-scrolled {
  background: rgba(251, 251, 248, .9);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 35px rgba(22, 23, 29, .045);
}
.nav-wrap { min-height: 74px; gap: 38px; transition: min-height .35s var(--ease); }
.is-scrolled .nav-wrap { min-height: 64px; }
.brand { gap: 12px; }
.brand-mark {
  width: 39px;
  height: 39px;
  color: #fff;
  background: var(--ink);
  border-radius: 12px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .2), 0 9px 24px rgba(21, 22, 26, .14);
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  transition: transform .35s var(--ease), background .25s ease;
}
.brand:hover .brand-mark { background: var(--accent); transform: rotate(-5deg) scale(1.04); }
.brand strong { font-family: inherit; font-size: 17px; font-weight: 720; letter-spacing: -.015em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .16em; }
.main-nav, .account-nav { gap: 28px; font-size: 13px; }
.main-nav a, .account-nav > a, .link-button { color: #50535b; transition: color .2s ease; }
.main-nav a::after {
  right: 12%;
  bottom: -8px;
  left: 12%;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transform: scaleX(0);
  transition: transform .3s var(--ease);
}
.main-nav a:hover::after, .main-nav a.is-active::after { transform: scaleX(1); }
.main-nav a:hover, .main-nav a.is-active, .account-nav a:hover, .link-button:hover { color: var(--ink); }
.welcome { color: #858891; }

/* Universal controls */
.button {
  min-height: 46px;
  padding: 11px 23px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -.01em;
  line-height: 1.2;
  box-shadow: none;
  transition: color .25s ease, background .25s ease, border-color .25s ease, transform .3s var(--ease), box-shadow .3s ease;
}
.button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 13px 32px rgba(91, 86, 232, .22);
  transform: translateY(-2px);
}
.button:active { transform: translateY(0) scale(.98); }
.button-small { min-height: 36px; padding: 7px 16px; font-size: 12px; }
.button-secondary { color: var(--ink); background: transparent; border-color: var(--line-strong); }
.button-secondary:hover { color: var(--accent); background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.text-link, .back-link { color: var(--ink); font-weight: 680; transition: color .2s ease; }
.text-link:hover, .back-link:hover { color: var(--accent); }
.back-link { margin-bottom: 31px; }

/* Messages */
.message-stack { z-index: 35; }
.message {
  margin-top: 14px;
  padding: 14px 17px;
  background: rgba(255, 255, 252, .92);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.message-success { color: #176442; background: #eef9f2; border-color: #cce8d7; }
.message-error { color: #a03434; background: #fff1f0; border-color: #f0ceca; }
.message-info { color: #4c48b2; background: #f1f0ff; border-color: #dad8ff; }

/* Home */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 87% 15%, rgba(130, 217, 230, .22), transparent 27%),
    radial-gradient(circle at 65% 100%, rgba(91, 86, 232, .12), transparent 32%),
    var(--paper);
  border-bottom: 0;
}
.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image: radial-gradient(rgba(21, 22, 26, .13) .55px, transparent .55px);
  background-size: 8px 8px;
  opacity: .14;
  mask-image: linear-gradient(90deg, #000, transparent 65%);
}
.hero-grid { min-height: 690px; grid-template-columns: 1.06fr .94fr; gap: 32px; }
.hero-copy { padding: 104px 0 96px; }
.eyebrow {
  margin-bottom: 13px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .2em;
}
.hero h1, .page-banner h1, .detail-content h1, .auth-art h1,
.section-heading h2, .auth-card h2, .wallet-card h2, .wallet-card h3,
.reader-header h1, .description h2, .loan-title h3 {
  font-family: inherit;
}
.hero h1 {
  max-width: 720px;
  font-size: clamp(58px, 6.8vw, 88px);
  font-weight: 740;
  line-height: 1.02;
  letter-spacing: -.065em;
}
.hero h1 em {
  color: var(--accent);
  background: none;
  -webkit-text-fill-color: currentColor;
}
.hero-copy > p { max-width: 590px; margin: 29px 0 34px; color: #666a72; font-size: 17px; line-height: 1.75; }
.hero-search {
  max-width: 600px;
  padding: 6px;
  background: rgba(255, 255, 252, .9);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(34, 35, 44, .085);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s var(--ease);
}
.hero-search:focus-within { border-color: rgba(91, 86, 232, .45); box-shadow: 0 21px 58px rgba(61, 57, 155, .13); transform: translateY(-2px); }
.hero-search input { padding: 13px 16px; color: var(--ink); }
.hero-search input::placeholder { color: #9b9da4; }
.hero-search button { min-width: 112px; padding: 11px 21px; background: var(--ink); border-radius: 13px; font-weight: 680; transition: background .2s ease, transform .2s ease; }
.hero-search button:hover { background: var(--accent); transform: scale(1.02); }
.hero-stats { gap: 0; margin-top: 42px; }
.hero-stats div { min-width: 132px; padding: 0 28px; border-right: 1px solid var(--line-strong); }
.hero-stats div:first-child { padding-left: 0; }
.hero-stats div:last-child { border-right: 0; }
.hero-stats strong { font-family: inherit; font-size: 28px; font-weight: 740; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.hero-stats span { color: #868991; font-size: 11px; }

/* The hero product object */
.library-stage {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  min-height: 600px;
  align-self: stretch;
  perspective: 1200px;
}
.library-stage::after {
  position: absolute;
  right: 8%;
  bottom: 54px;
  width: 75%;
  height: 48px;
  content: "";
  background: rgba(20, 21, 30, .20);
  border-radius: 50%;
  filter: blur(28px);
  transform: translateZ(-20px);
}
.reading-device {
  position: absolute;
  z-index: 2;
  top: 93px;
  right: 5%;
  width: min(430px, 86%);
  height: 475px;
  overflow: hidden;
  color: #f8f8f6;
  background: #17181e;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 38px;
  box-shadow: var(--shadow-lg), inset 0 1px rgba(255, 255, 255, .14);
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) rotate(-2.2deg);
  transform-style: preserve-3d;
  transition: transform .55s var(--ease);
}
.reading-device::before {
  position: absolute;
  inset: -40% 30% 35% -20%;
  content: "";
  background: radial-gradient(circle, rgba(91, 86, 232, .72), transparent 65%);
  filter: blur(20px);
}
.reading-device::after {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 45%;
  height: 170%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transform: rotate(24deg);
  animation: deviceSheen 7s ease-in-out infinite;
}
.device-bar { position: relative; z-index: 2; display: flex; height: 62px; align-items: center; gap: 9px; padding: 0 25px; border-bottom: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.58); font-size: 11px; }
.device-bar i { width: 8px; height: 8px; background: #82d9e6; border-radius: 50%; box-shadow: 0 0 16px rgba(130,217,230,.8); }
.device-bar span { margin-right: auto; }
.device-bar b { letter-spacing: .18em; }
.device-content { position: relative; z-index: 2; padding: 56px 46px; }
.device-label { color: #aaa8ff; font-size: 9px; font-weight: 760; letter-spacing: .2em; }
.device-content h2 { margin: 13px 0 40px; font-size: 39px; line-height: 1.13; letter-spacing: -.045em; }
.reading-lines { display: grid; gap: 11px; }
.reading-lines i { display: block; width: 100%; height: 4px; background: rgba(255,255,255,.14); border-radius: 99px; }
.reading-lines i:nth-child(2) { width: 82%; }
.reading-lines i:nth-child(3) { width: 91%; }
.reading-lines i:nth-child(4) { width: 62%; }
.reading-progress { height: 4px; margin-top: 45px; overflow: hidden; background: rgba(255,255,255,.12); border-radius: 99px; }
.reading-progress span { display: block; width: 68%; height: 100%; background: linear-gradient(90deg, #7771ff, #82d9e6); border-radius: inherit; animation: readProgress 2.4s var(--ease) both; }
.device-content small { display: block; margin-top: 12px; color: rgba(255,255,255,.42); font-size: 10px; }
.stage-orbit { position: absolute; border: 1px solid rgba(91,86,232,.16); border-radius: 50%; }
.orbit-one { top: 45px; right: -35px; width: 470px; height: 470px; animation: orbit 18s linear infinite; }
.orbit-two { right: 105px; bottom: 18px; width: 280px; height: 280px; border-color: rgba(130,217,230,.24); animation: orbit 14s linear infinite reverse; }
.stage-orbit::after { position: absolute; top: 4%; left: 24%; width: 11px; height: 11px; content: ""; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 8px rgba(91,86,232,.08); }
.orbit-two::after { background: var(--cyan); }
.stage-chip {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 17px;
  color: var(--ink);
  background: rgba(255,255,252,.84);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 16px;
  box-shadow: 0 17px 45px rgba(26,27,36,.12);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: chipFloat 5s ease-in-out infinite;
}
.stage-chip b { font-size: 21px; letter-spacing: -.04em; }
.stage-chip span { color: #686b73; font-size: 10px; font-weight: 650; }
.stage-chip i { display: grid; width: 26px; height: 26px; place-items: center; color: #fff; background: var(--success); border-radius: 50%; font-size: 11px; font-style: normal; }
.chip-top { top: 130px; left: -4px; }
.chip-bottom { right: -7px; bottom: 82px; animation-delay: -2.2s; }

@keyframes deviceSheen { 0%, 58% { transform: translateX(-50%) rotate(24deg); } 82%, 100% { transform: translateX(340%) rotate(24deg); } }
@keyframes readProgress { from { width: 0; } to { width: 68%; } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes chipFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Sections and catalog */
.section { padding-top: 90px; padding-bottom: 100px; }
.section-heading { margin-bottom: 36px; }
.section-heading h2 { font-size: 39px; font-weight: 710; line-height: 1.12; letter-spacing: -.045em; }
.book-grid { gap: 22px; }
.book-card {
  min-height: 225px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s ease;
}
.book-card:hover { border-color: rgba(91,86,232,.22); box-shadow: var(--shadow-md); transform: translateY(-7px); }
.book-cover {
  min-height: 195px;
  color: #fff;
  background: linear-gradient(145deg, #5d5be1, #252550);
  border-radius: 11px 19px 19px 11px;
  box-shadow: inset -8px 0 rgba(255,255,255,.07), 0 15px 30px rgba(37,37,80,.20);
  transition: transform .5s var(--ease);
}
.book-card:hover .book-cover { transform: rotate(-1deg) scale(1.018); }
.book-card:nth-child(3n+2) .book-cover { background: linear-gradient(145deg, #23837e, #153e48); }
.book-card:nth-child(3n+3) .book-cover { background: linear-gradient(145deg, #b86b45, #5c2f35); }
.book-cover strong { font-family: "Songti SC", "STSong", serif; font-weight: 650; }
.book-cover i { border-color: rgba(255,255,255,.36); }
.book-card-body { padding-left: 18px; }
.tag { color: #504cb5; background: var(--accent-soft); font-weight: 650; }
.ebook-tag { color: #267455; background: #e9f7ef; }
.book-card h3 { font-family: inherit; font-weight: 690; letter-spacing: -.02em; }
.book-card h3 a:hover { color: var(--accent); }
.book-card-body > p { color: #858891; }
.book-meta > a { color: var(--ink); background: #f2f2ed; border-color: transparent; transition: color .2s ease, background .2s ease, transform .25s var(--ease); }
.book-meta > a:hover { color: #fff; background: var(--accent); transform: translateX(3px); }
.available { color: var(--success); }
.empty-state { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.empty-state h3 { font-family: inherit; }

.how-it-works { color: var(--ink); background: #eaeae4; border-top: 1px solid var(--line); }
.how-it-works .eyebrow { color: var(--accent); }
.steps { gap: 16px; background: transparent; }
.steps article { position: relative; overflow: hidden; padding: 38px; background: rgba(255,255,252,.72); border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius); transition: background .3s ease, transform .45s var(--ease); }
.steps article::after { position: absolute; right: -22px; bottom: -38px; color: rgba(91,86,232,.065); content: attr(data-step); font-size: 125px; font-weight: 800; line-height: 1; }
.steps article:hover { background: #fffffc; transform: translateY(-5px); }
.steps b { color: var(--accent); font: 720 29px/1 inherit; }
.steps h3 { font-family: inherit; font-weight: 700; letter-spacing: -.025em; }
.steps p { color: #6d7078; }

/* Inner page hero and filtering */
.page-banner {
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 15%, rgba(130,217,230,.2), transparent 26%),
    linear-gradient(180deg, #fafaf6, #efefea);
  border-bottom: 1px solid var(--line);
}
.page-banner .eyebrow { color: var(--accent); }
.page-banner h1 { font-size: 52px; font-weight: 730; letter-spacing: -.055em; }
.page-banner p { color: #70737b; }
.filter-panel { padding: 21px; background: rgba(255,255,252,.88); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filter-panel label, .field label { color: var(--ink-soft); font-weight: 660; }
.filter-panel input[type="text"], .filter-panel input:not([type]), .filter-panel select,
.field input, .purchase-form select {
  min-height: 49px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.filter-panel input:focus, .filter-panel select:focus, .field input:focus, .purchase-form select:focus { border-color: rgba(91,86,232,.72); box-shadow: 0 0 0 4px rgba(91,86,232,.1); transform: translateY(-1px); outline: 0; }
.result-summary strong { font-family: inherit; font-weight: 730; }
.pagination a { color: var(--accent); }

/* Detail */
.detail-grid { gap: 76px; }
.detail-cover { border-radius: 16px 28px 28px 16px; }
.detail-content h1 { font-size: 53px; font-weight: 740; line-height: 1.07; letter-spacing: -.055em; }
.detail-author { color: var(--muted); }
.book-facts, .book-facts div { border-color: var(--line); }
.book-facts dt { color: #8a8d95; }
.availability-box { padding: 22px; background: #eaeae5; border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius); }
.availability-box strong { font-family: inherit; font-weight: 730; }
.description h2 { font-weight: 710; letter-spacing: -.03em; }
.description p { color: #555860; }
.ebook-license { background: #efeffb; border-left-color: var(--accent); border-radius: 0 15px 15px 0; }
.ebook-license a, .reader-source a { color: var(--accent); }

/* Dashboard */
.member-banner { background: linear-gradient(145deg, #fafaf7, #e9e8f8); }
.member-heading h1 { font-weight: 730; }
.quota-card, .wallet-balance { color: #fff; background: #191a20; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.quota-card strong, .wallet-balance strong { font-family: inherit; font-weight: 760; }
.quota-card small, .wallet-balance small { color: rgba(255,255,255,.62); }
.return-guide { color: #565961; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 14px; }
.loan-row { padding: 18px 21px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 24px rgba(28,30,38,.035); transition: transform .35s var(--ease), box-shadow .35s ease; }
.loan-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.loan-overdue { border-left: 4px solid var(--danger); }
.loan-return-pending { border-left: 4px solid var(--warning); background: #fffaf1; }
.mini-cover { background: linear-gradient(145deg, #615dea, #292855); border-radius: 7px 12px 12px 7px; font-family: "Songti SC", serif; }
.loan-title h3 { font-weight: 680; }
.history-table-wrap { border-color: var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.history-table th { background: #ecece7; }
.history-table th, .history-table td { border-color: var(--line); }

/* Wallet */
.wallet-banner { color: var(--ink); background: linear-gradient(145deg, #fafaf7, #e9e8f8); }
.wallet-card { padding: 29px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.wallet-card h2, .wallet-card h3 { font-weight: 710; letter-spacing: -.03em; }
.setup-notice { color: #765011; background: #fff7e8; border-color: #efd79f; border-radius: 15px; }
.payment-result { color: #176442; background: #eef9f2; border-radius: 15px; }
.payment-failed { color: #a03434; background: #fff1f0; }
.transaction-row, .order-row { border-color: var(--line); }
.transaction-row em { font-family: inherit; font-weight: 730; }
.points-plus { color: var(--success); }
.points-minus { color: var(--danger); }
.rules-card li strong { color: var(--accent); font-family: inherit; font-weight: 740; }

/* Reader */
.reader-shell { background: #e9e9e3; }
.reader-header h1 { font-weight: 740; letter-spacing: -.05em; }
.reader-paper { background: #fffef9; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-md); }
.reader-content { color: #2d2e31; font-family: "Songti SC", "STSong", "SimSun", serif; }
.reader-pagination { border-color: var(--line); }

/* Authentication */
.auth-page { background: var(--paper); }
.auth-art { position: relative; overflow: hidden; color: #fff; background: #191a20; }
.auth-art::before { position: absolute; top: -18%; right: -20%; width: 560px; height: 560px; content: ""; background: radial-gradient(circle, rgba(91,86,232,.9), rgba(91,86,232,.08) 55%, transparent 70%); animation: authGlow 7s ease-in-out infinite; }
.auth-art::after { position: absolute; bottom: -17%; left: -15%; width: 420px; height: 420px; content: ""; border: 1px solid rgba(130,217,230,.25); border-radius: 50%; }
.auth-art > div { position: relative; z-index: 2; }
.auth-art .eyebrow { color: #aaa8ff; }
.auth-art h1 { font-weight: 750; letter-spacing: -.055em; }
.auth-art p { color: rgba(255,255,255,.62); }
.auth-panel { background: var(--paper); }
.auth-card { padding: 39px; background: rgba(255,255,252,.9); border: 1px solid rgba(255,255,255,.82); border-radius: 28px; box-shadow: var(--shadow-md); }
.auth-card h2 { font-weight: 740; letter-spacing: -.045em; }
.auth-intro, .help-text { color: #858891; }
.field-error { color: var(--danger); }
.field-invalid input { border-color: var(--danger); }
.form-error { color: #a03434; background: #fff1f0; border-radius: 12px; }
.auth-switch a { color: var(--accent); }
@keyframes authGlow { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.14); opacity: 1; } }

/* Footer and mobile navigation */
.site-footer { color: #8c8e95; background: #17181c; }
.footer-grid strong { color: #f5f5f1; font-family: inherit; font-weight: 680; }
.footer-grid span { color: #aaa8ff; }
.mobile-nav { background: rgba(248,248,244,.88); border-top-color: var(--line); box-shadow: 0 -12px 35px rgba(24,25,31,.07); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
.mobile-nav a, .mobile-nav button { color: #8b8e95; }
.mobile-nav a.active { color: var(--accent); background: var(--accent-soft); }

/* Motion */
.js .reveal { opacity: 0; transform: translateY(24px); filter: blur(5px); transition: opacity .75s var(--ease) var(--reveal-delay, 0ms), transform .75s var(--ease) var(--reveal-delay, 0ms), filter .75s ease var(--reveal-delay, 0ms); }
.js .reveal.is-visible { opacity: 1; transform: translateY(0); filter: blur(0); }

@media (max-width: 1050px) {
  .hero-grid { grid-template-columns: 1fr .78fr; }
  .reading-device { right: -7%; width: 410px; }
  .chip-top { left: -6%; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 30px, 1200px); }
  .site-header { background: rgba(248,248,244,.9); }
  .nav-wrap, .is-scrolled .nav-wrap { min-height: 61px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .hero-copy { padding: 58px 0 36px; }
  .hero h1 { font-size: clamp(45px, 13.5vw, 62px); line-height: 1.03; }
  .hero-copy > p { margin: 22px 0 27px; font-size: 15px; }
  .hero-search { border-radius: 16px; }
  .hero-search button { min-height: 44px; border-radius: 12px; }
  .hero-stats div { min-width: 0; flex: 1; padding: 0 15px; }
  .library-stage { min-height: 330px; }
  .reading-device { top: 20px; right: 3%; width: 84%; height: 285px; border-radius: 25px; transform: rotate(-2deg); }
  .device-bar { height: 42px; padding: 0 16px; }
  .device-content { padding: 26px 27px; }
  .device-content h2 { margin: 8px 0 20px; font-size: 25px; }
  .reading-lines { gap: 7px; }
  .reading-lines i { height: 3px; }
  .reading-progress { margin-top: 20px; }
  .orbit-one { top: -8px; right: -55px; width: 305px; height: 305px; }
  .orbit-two { display: none; }
  .stage-chip { padding: 9px 12px; border-radius: 12px; }
  .stage-chip b { font-size: 16px; }
  .chip-top { top: 48px; left: -4px; }
  .chip-bottom { right: -4px; bottom: 25px; }
  .section { padding-top: 57px; padding-bottom: 64px; }
  .section-heading h2 { font-size: 32px; }
  .book-card { border-radius: 20px; }
  .steps { gap: 13px; }
  .steps article { border-radius: 20px; }
  .page-banner { padding: 48px 0 41px; }
  .page-banner h1 { font-size: 41px; }
  .filter-panel { border-radius: 18px; }
  .detail-grid { gap: 42px; }
  .detail-content h1 { font-size: 40px; }
  .availability-box { border-radius: 18px; }
  .quota-card, .loan-row, .wallet-card { border-radius: 19px; }
  .reader-paper { border-radius: 20px; }
  .auth-art { min-height: 230px; }
  .auth-panel { background: var(--paper); }
  .auth-card { padding: 29px 24px; border-radius: 22px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 45px; }
  .hero-stats div { padding: 0 10px; }
  .book-card { border-radius: 18px; }
  .book-cover { border-radius: 10px 15px 15px 10px; }
  .wallet-card { padding: 22px; }
  .auth-card { padding: 25px 20px; }
  .stage-chip span { font-size: 9px; }
}

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

/* --------------------------------------------------------------------------
 * v4 — content-led reading UI inspired by Douban's calm information density.
 * This is an original implementation: green accent, warm neutral canvas,
 * compact metadata, and a phone-first navigation system.
 * ----------------------------------------------------------------------- */

:root {
  --accent: #0a8f63;
  --accent-dark: #08734f;
  --accent-soft: #e7f5ef;
  --cyan: #8bd8c1;
  --paper: #f6f6f1;
  --cream: #fbfbf7;
  --surface: rgba(255, 255, 251, .9);
  --surface-solid: #fffefb;
  --success: #0a8f63;
  --green: var(--accent);
  --green-dark: #17221e;
  --green-soft: var(--accent-soft);
}

.scroll-progress {
  position: fixed;
  z-index: 160;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0a8f63, #71cbb0);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .08s linear;
  pointer-events: none;
}

.nav-wrap { justify-content: space-between; }
.main-nav { margin-right: auto; }
.site-header { background: rgba(246, 246, 241, .88); }
.site-header.is-scrolled { background: rgba(252, 252, 248, .94); }
.main-nav a::after { background: var(--accent); }
.account-nav > .button { color: #fff; background: var(--accent); border-color: var(--accent); }

.button { background: var(--accent); border-color: var(--accent); }
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); box-shadow: 0 13px 32px rgba(10, 143, 99, .18); }
.button-secondary { color: var(--accent-dark); background: transparent; border-color: rgba(10, 143, 99, .22); }
.button-secondary:hover { color: var(--accent-dark); background: var(--accent-soft); }
.tap-wave {
  position: absolute;
  z-index: 5;
  width: 12px;
  height: 12px;
  margin: -6px;
  pointer-events: none;
  background: rgba(255,255,255,.48);
  border-radius: 50%;
  animation: tapWave .55s ease-out forwards;
}
.button, .hero-search button, .mobile-nav a { position: relative; overflow: hidden; }
@keyframes tapWave { to { opacity: 0; transform: scale(13); } }

.hero {
  background:
    radial-gradient(circle at 86% 17%, rgba(139,216,193,.32), transparent 25%),
    radial-gradient(circle at 65% 100%, rgba(10,143,99,.08), transparent 34%),
    var(--paper);
}
.hero::before { opacity: .09; mask-image: linear-gradient(90deg, #000, transparent 68%); }
.hero h1 em { color: var(--accent); }
.eyebrow { color: var(--accent); }
.hero-search:focus-within { border-color: rgba(10,143,99,.5); box-shadow: 0 21px 58px rgba(10,100,70,.12); }
.hero-search button { background: var(--accent); }
.hero-search button:hover { background: var(--accent-dark); }

.reading-device {
  color: var(--ink);
  background: #fffefb;
  border-color: rgba(255,255,255,.9);
  box-shadow: 0 42px 100px rgba(35,63,52,.16), inset 0 1px #fff;
}
.reading-device::before { background: radial-gradient(circle, rgba(139,216,193,.52), rgba(231,245,239,.34) 50%, transparent 70%); }
.reading-device::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.68), transparent); }
.device-bar { color: #7a827e; border-bottom-color: rgba(20,50,38,.08); }
.device-bar i { background: var(--accent); box-shadow: 0 0 16px rgba(10,143,99,.48); }
.device-bar b { color: var(--accent); font-size: 12px; letter-spacing: 0; }
.device-label { color: var(--accent); }
.device-content h2 { color: #17221e; }
.reading-lines i { background: rgba(23,34,30,.105); }
.reading-progress { background: rgba(23,34,30,.09); }
.reading-progress span { background: linear-gradient(90deg, #0a8f63, #8bd8c1); }
.device-content small { color: #919791; }
.stage-orbit { border-color: rgba(10,143,99,.15); }
.orbit-two { border-color: rgba(139,216,193,.35); }
.stage-orbit::after { background: var(--accent); box-shadow: 0 0 0 8px rgba(10,143,99,.07); }
.stage-chip i { background: var(--accent); }
.library-stage.is-tapped .reading-device { animation: cardTap .62s cubic-bezier(.2,1.45,.45,1); }
.library-stage.is-tapped .chip-top { animation: chipPop .62s cubic-bezier(.2,1.45,.45,1); }
@keyframes cardTap { 45% { transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) rotate(0) scale(.965); } }
@keyframes chipPop { 50% { transform: translateY(-14px) scale(1.06); } }

.book-card:hover { border-color: rgba(10,143,99,.24); }
.book-cover { background: linear-gradient(145deg, #158a66, #174b3d); box-shadow: inset -8px 0 rgba(255,255,255,.07), 0 15px 30px rgba(23,75,61,.18); }
.book-card:nth-child(3n+2) .book-cover { background: linear-gradient(145deg, #566d88, #293c52); }
.book-card:nth-child(3n+3) .book-cover { background: linear-gradient(145deg, #b27853, #694735); }
.tag { color: #08734f; background: var(--accent-soft); }
.book-card h3 a:hover, .text-link:hover, .back-link:hover { color: var(--accent); }
.book-meta > a:hover { background: var(--accent); }
.how-it-works { background: #ecece6; }
.how-it-works .eyebrow, .steps b { color: var(--accent); }
.steps article::after { color: rgba(10,143,99,.055); }
.page-banner { background: radial-gradient(circle at 82% 15%, rgba(139,216,193,.25), transparent 26%), linear-gradient(180deg,#fafaf7,#efefe9); }
.page-banner .eyebrow, .pagination a, .ebook-license a, .reader-source a, .rules-card li strong, .auth-switch a { color: var(--accent); }
.ebook-license { background: #edf7f2; border-left-color: var(--accent); }
.return-guide { border-left-color: var(--accent); }
.quota-card, .wallet-balance { background: linear-gradient(145deg,#17654f,#102e26); }
.auth-art { background: #14251f; }
.auth-art::before { background: radial-gradient(circle, rgba(10,143,99,.92), rgba(10,143,99,.08) 56%, transparent 70%); }
.auth-art .eyebrow { color: #91ddc4; }

/* Mobile is a separate product surface, not a compressed desktop layout. */
@media (max-width: 760px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); background: #f6f6f1; }
  .site-header { display: none; }
  .message-stack { position: fixed; z-index: 140; top: 12px; right: 12px; left: 12px; width: auto; }
  .message { margin-top: 0; }

  .hero { min-height: auto; padding-top: env(safe-area-inset-top); background: linear-gradient(180deg,#edf7f2 0,#f6f6f1 78%); }
  .hero::before { display: none; }
  .hero-copy { padding: 38px 0 23px; }
  .hero .eyebrow { margin-bottom: 10px; font-size: 9px; letter-spacing: .18em; }
  .hero h1 { max-width: 350px; font-size: clamp(41px, 12vw, 53px); line-height: 1.06; letter-spacing: -.062em; }
  .hero-copy > p { margin: 18px 0 22px; color: #637069; font-size: 14px; line-height: 1.7; }
  .hero-search { position: sticky; z-index: 8; top: 10px; width: 100%; padding: 5px; background: rgba(255,255,252,.94); border-radius: 14px; box-shadow: 0 12px 34px rgba(27,73,57,.105); }
  .hero-search input { min-height: 46px; padding: 10px 12px; font-size: 15px; }
  .hero-search button { min-width: 88px; min-height: 46px; padding: 8px 14px; border-radius: 10px; font-size: 13px; }
  .hero-stats { margin-top: 24px; padding: 16px 0 4px; border-top: 1px solid rgba(20,50,38,.09); }
  .hero-stats div { padding: 0 14px; }
  .hero-stats strong { font-size: 23px; }
  .hero-stats span { margin-top: 2px; font-size: 9px; }

  .library-stage { min-height: 295px; margin-top: 5px; }
  .reading-device { top: 28px; right: 4%; width: 88%; height: 246px; border-radius: 22px; box-shadow: 0 26px 58px rgba(30,77,60,.16); transform: rotate(-1.5deg); }
  .device-bar { height: 40px; padding: 0 15px; font-size: 9px; }
  .device-content { padding: 20px 24px; }
  .device-label { font-size: 7px; }
  .device-content h2 { margin: 6px 0 15px; font-size: 23px; line-height: 1.14; }
  .reading-lines { gap: 6px; }
  .reading-lines i { height: 3px; }
  .reading-progress { margin-top: 14px; }
  .device-content small { margin-top: 7px; font-size: 8px; }
  .orbit-one { top: 4px; right: -45px; width: 275px; height: 275px; }
  .stage-chip { padding: 8px 10px; border-radius: 11px; }
  .stage-chip b { font-size: 15px; }
  .stage-chip span { font-size: 8px; }
  .chip-top { top: 53px; left: -3px; }
  .chip-bottom { right: -2px; bottom: 12px; }

  .section { padding-top: 48px; padding-bottom: 55px; }
  .section-heading { align-items: center; margin-bottom: 20px; }
  .section-heading h2 { font-size: 28px; }
  .section-heading .eyebrow { display: none; }
  .section-heading > .text-link { padding: 7px 10px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; font-size: 11px; }
  .book-grid { gap: 12px; }
  .book-card {
    grid-template-columns: 88px minmax(0,1fr);
    min-height: 138px;
    padding: 10px;
    background: #fffefb;
    border-radius: 15px;
    box-shadow: 0 5px 18px rgba(31,59,48,.045);
  }
  .book-card:active { transform: scale(.985); }
  .book-cover { min-height: 118px; padding: 11px; border-radius: 7px 12px 12px 7px; }
  .book-cover strong { font-size: 14px; }
  .cover-category { top: 11px; left: 11px; font-size: 7px; }
  .book-card-body { padding: 3px 3px 2px 12px; }
  .book-tags { gap: 4px; }
  .book-tags .tag { padding: 2px 6px; font-size: 8px; }
  .book-card h3 { margin: 8px 0 2px; font-size: 16px; line-height: 1.3; }
  .book-card-body > p { font-size: 11px; }
  .stock { font-size: 9px; }
  .book-meta > a { width: 26px; height: 26px; }

  .how-it-works { padding: 50px 0 56px; }
  .steps article { padding: 24px; }
  .steps b { font-size: 22px; }
  .steps h3 { margin: 10px 0 5px; font-size: 18px; }

  .page-banner { padding: 38px 0 32px; background: #edf7f2; }
  .page-banner h1 { font-size: 36px; }
  .filter-panel { padding: 13px; border-radius: 15px; box-shadow: 0 8px 26px rgba(31,59,48,.055); }
  .filter-panel input[type="text"], .filter-panel input:not([type]), .filter-panel select, .field input { min-height: 46px; border-radius: 10px; }
  .detail-cover { width: min(210px,66vw); min-height: 300px; }
  .detail-content h1 { font-size: 35px; }
  .availability-box { padding: 15px; background: #edf1ec; }
  .member-banner, .wallet-banner { padding: 34px 0; background: #edf7f2; }
  .loan-row { border-radius: 15px; }
  .wallet-card, .auth-card { border-radius: 17px; box-shadow: 0 10px 35px rgba(31,59,48,.07); }
  .auth-art { min-height: 185px; padding: 30px 24px; }
  .auth-art h1 { font-size: 32px; }

  .mobile-nav {
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    min-height: 66px;
    padding: 6px;
    background: rgba(255,255,252,.92);
    border: 1px solid rgba(20,50,38,.10);
    border-radius: 21px;
    box-shadow: 0 13px 38px rgba(24,56,44,.14);
  }
  .mobile-nav a, .mobile-nav button { position: relative; min-height: 53px; gap: 3px; color: #8a948e; border-radius: 16px; transition: color .25s ease, background .25s ease, transform .35s cubic-bezier(.2,1.35,.4,1); }
  .mobile-nav a.active { color: var(--accent); background: var(--accent-soft); }
  .mobile-nav a.active::after { position: absolute; right: 42%; bottom: 3px; left: 42%; height: 3px; content: ""; background: var(--accent); border-radius: 99px; animation: navDot .45s cubic-bezier(.2,1.5,.4,1); }
  .mobile-nav a:active { transform: scale(.88); }
  .mobile-nav-icon { display: grid; width: 25px; height: 25px; place-items: center; font-size: 0; }
  .mobile-nav-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-nav a.active .mobile-nav-icon { animation: iconBounce .52s cubic-bezier(.2,1.55,.4,1); }
  .mobile-nav small { font-size: 9px; font-weight: 650; }
  @keyframes navDot { from { opacity: 0; transform: scaleX(0); } }
  @keyframes iconBounce { 45% { transform: translateY(-4px) scale(1.08); } }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 40px; }
  .hero-copy > p { font-size: 13px; }
  .hero-search button { min-width: 78px; padding-inline: 10px; }
  .chip-bottom { display: none; }
}
