:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #0f1724;
  --panel2: #121a2a;
  --line: rgba(148, 163, 184, .18);
  --text: #e5eefb;
  --muted: #8ea0b8;
  --cyan: #67e8f9;
  --blue: #60a5fa;
  --green: #86efac;
  --amber: #fbbf24;
  --danger: #fb7185;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: 'Inter', 'Noto Sans SC', ui-sans-serif, system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(96, 165, 250, .18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(103, 232, 249, .12), transparent 30%),
    linear-gradient(135deg, #070a11 0%, #0b1020 48%, #05070d 100%);
  overflow-x: hidden;
  animation: bodyIn .5s cubic-bezier(.2, .8, .2, 1) both;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(103, 232, 249, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 72%);
}

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

a, button { cursor: pointer; }

.ambient span { position: fixed; width: 240px; height: 240px; border: 1px solid rgba(103, 232, 249, .08); border-radius: 999px; pointer-events: none; }
.ambient span:nth-child(1) { left: -80px; top: 12%; }
.ambient span:nth-child(2) { right: -90px; top: 38%; }
.ambient span:nth-child(3) { left: 46%; bottom: -150px; }

.hero-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  font: 600 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.eyebrow span { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan)); }

h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 600; line-height: 1.15; letter-spacing: -.025em; color: var(--text); margin-top: 10px; }

.lead { margin-top: 16px; color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 600px; }

.search-console {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 22px;
  background: rgba(15, 23, 36, .58);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 6, 23, .68);
  color: var(--text);
  padding: 15px 16px;
  font-size: 16px;
  outline: none;
}

input:focus { border-color: rgba(103, 232, 249, .5); box-shadow: 0 0 0 4px rgba(103, 232, 249, .08); }

button, .primary-action {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  color: #061018;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(103, 232, 249, .14);
  transition: transform .18s ease, box-shadow .18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover, .primary-action:hover { transform: translateY(-1px); box-shadow: 0 16px 40px rgba(103, 232, 249, .22); }

button[disabled] { opacity: .62; cursor: not-allowed; }

.quick-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 14px; }
.quick-links a, .ghost-link, .back-link { color: var(--cyan); text-decoration: none; }

.hero-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 70px 26px 26px;
  min-height: 330px;
  background: linear-gradient(145deg, rgba(18, 26, 42, .72), rgba(8, 13, 24, .86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 30px 90px rgba(0, 0, 0, .32);
  overflow: hidden;
}

.panel-status { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); display: flex; justify-content: center; align-items: center; }

.panel-status span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid rgba(134, 239, 172, .34);
  border-radius: 999px;
  color: var(--green);
  background: linear-gradient(135deg, rgba(34, 197, 94, .16), rgba(103, 232, 249, .08));
  box-shadow: 0 0 0 1px rgba(134, 239, 172, .08), 0 0 28px rgba(34, 197, 94, .16), inset 0 1px 0 rgba(255, 255, 255, .08);
  font: 700 12px 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .12em;
  white-space: nowrap;
}

.panel-status i { width: 9px; height: 9px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 5px rgba(134, 239, 172, .12), 0 0 18px rgba(134, 239, 172, .7); animation: pulseDot 1.8s ease-in-out infinite; }

.hero-panel svg { width: min(360px, 100%); height: 238px; display: block; margin: 0 auto; }
.page { fill: rgba(103, 232, 249, .08); stroke: url(#bookGlow); stroke-width: 1.6; }
.spine { fill: rgba(15, 23, 36, .9); stroke: url(#bookGlow); stroke-width: 1.6; stroke-linejoin: round; }
.flip-page { fill: rgba(134, 239, 172, .09); stroke: var(--green); stroke-width: 1.6; }
.flip-page-group { transform-box: fill-box; transform-origin: left center; animation: pageFlip 6.5s cubic-bezier(.65, .05, .35, .95) infinite; will-change: transform, opacity; }
@keyframes pageFlip { 0%, 55% { transform: scaleX(1); opacity: .95; } 78% { transform: scaleX(.05); opacity: .35; } 82%, 100% { transform: scaleX(0); opacity: 0; } }
.book-text-line { stroke: rgba(229, 238, 251, .35); stroke-width: 1.4; stroke-linecap: round; }
.shimmer-sweep { animation: shimmerMove 4.5s ease-in-out infinite; opacity: 0; }
@keyframes shimmerMove { 0% { transform: translateX(-60px); opacity: 0; } 25% { opacity: .7; } 75% { opacity: .7; } 100% { transform: translateX(150px); opacity: 0; } }
.particle { fill: var(--cyan); font-family: 'Noto Sans SC', 'Inter', sans-serif; font-weight: 600; opacity: 0; will-change: transform, opacity; }
.p1 { animation: floatUp 5s ease-out infinite 0s; }
.p2 { animation: floatUp 5s ease-out infinite .6s; }
.p3 { animation: floatUp 5s ease-out infinite 1.2s; }
.p4 { animation: floatUp 5s ease-out infinite 1.8s; }
.p5 { animation: floatUp 5s ease-out infinite 2.4s; }
.p6 { animation: floatUp 5s ease-out infinite 3s; }
.p7 { animation: floatUp 5s ease-out infinite 3.6s; }
.p8 { animation: floatUp 5s ease-out infinite 4.2s; }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(18px) scale(.85); } 15% { opacity: .85; } 85% { opacity: .4; } 100% { opacity: 0; transform: translateY(-80px) scale(1.1); } }
.magnifier { animation: scan 7s ease-in-out infinite alternate; }
@keyframes scan { 0% { transform: translateX(-48px); } 100% { transform: translateX(52px); } }
.magnifier-glass { fill: rgba(103, 232, 249, .06); stroke: var(--cyan); stroke-width: 2; }
.magnifier-handle { stroke: var(--cyan); stroke-width: 2.8; stroke-linecap: round; }
.magnifier-glow { fill: url(#lensGlow); animation: lensPulse 2.6s ease-in-out infinite; }
@keyframes lensPulse { 0%, 100% { opacity: .3; } 50% { opacity: .75; } }
@keyframes pulseDot { 50% { transform: scale(.72); box-shadow: 0 0 0 8px rgba(134, 239, 172, .08), 0 0 24px rgba(134, 239, 172, .82); } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px max(24px, calc((100vw - 1180px) / 2));
  background: rgba(8, 11, 18, .76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-logo { width: 38px; height: 38px; flex: 0 0 auto; filter: drop-shadow(0 0 14px rgba(103, 232, 249, .18)); transition: transform .18s ease, filter .18s ease; }
.brand:hover .brand-logo { transform: translateY(-1px) rotate(-2deg); filter: drop-shadow(0 0 18px rgba(103, 232, 249, .32)); }
.hero-brand { display: inline-flex; margin-bottom: 30px; font-size: 18px; }
.hero-brand .brand-logo { width: 44px; height: 44px; }
.prep-brand { margin-bottom: 22px; }

.top-search { flex: 1; display: grid; grid-template-columns: 1fr 96px; gap: 10px; }

.results-layout { width: min(1180px, calc(100% - 40px)); margin: 32px auto 80px; display: grid; grid-template-columns: 300px 1fr; gap: 22px; position: relative; z-index: 1; }
.search-brief, .book-card, .prep-card { border: 1px solid var(--line); background: rgba(15, 23, 36, .72); border-radius: 24px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 20px 60px rgba(0, 0, 0, .22); backdrop-filter: blur(18px); }
.search-brief { padding: 24px; height: max-content; position: sticky; top: 86px; }
.search-brief h1 { font-size: 26px; line-height: 1.2; word-break: break-word; font-weight: 600; }
.search-brief p { margin-top: 14px; color: var(--muted); line-height: 1.7; }
.brief-metrics { margin-top: 18px; }
.metric-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: rgba(2, 6, 23, .38); color: var(--muted); font: 13px 'JetBrains Mono', ui-monospace, monospace; }
.metric-tag b { color: var(--cyan); font-weight: 600; }

.status-line { margin-bottom: 16px; color: var(--muted); font: 13px ui-monospace, monospace; }
.status-chip { display: inline-flex; padding: 4px 8px; border: 1px solid rgba(103, 232, 249, .3); border-radius: 999px; color: var(--cyan); margin-right: 8px; }
.scan-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.82); } }

.results-list { display: grid; gap: 16px; }
.book-card { display: grid; grid-template-columns: 124px 1fr; gap: 18px; padding: 16px; transition: transform .18s ease, border-color .18s ease; }
.book-card:hover { transform: translateY(-2px); border-color: rgba(103, 232, 249, .38); }
.book-cover { width: 124px; min-height: 174px; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, rgba(103, 232, 249, .08), rgba(134, 239, 172, .07)); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font: 11px ui-monospace, monospace; align-self: start; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform .3s ease; }
.book-cover img:hover { transform: scale(1.04); }
.book-cover .placeholder { display: grid; place-items: center; width: 100%; height: 100%; min-height: 174px; }
.book-topline { display: flex; gap: 8px; align-items: center; color: var(--muted); font: 11px ui-monospace, monospace; }
.book-topline span { color: var(--cyan); }
.book-topline code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-body h2 { margin-top: 6px; font-size: 19px; line-height: 1.35; letter-spacing: -.015em; font-weight: 600; }
.book-line { margin-top: 9px; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.book-line svg { width: 16px; height: 16px; fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.book-year { color: #9fb2ca; }
.meta-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.meta-strip span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(2, 6, 23, .36); color: #c7d2fe; font-size: 12px; }
.book-desc { margin-top: 12px; color: var(--muted); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-actions { margin-top: 14px; }
.primary-action.compact { padding: 10px 14px; font-size: 13px; }

.searchable-link { color: var(--cyan); text-decoration: none; border-bottom: 1px dashed rgba(103, 232, 249, .4); padding-bottom: 1px; cursor: pointer; }
.searchable-link:hover { color: var(--green); border-color: rgba(134, 239, 172, .5); }

.pagination { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 28px; padding: 20px 0; }
.pagination a, .pagination span { padding: 10px 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; background: rgba(15, 23, 36, .72); font: 14px 'JetBrains Mono', ui-monospace, monospace; transition: all .18s; }
.pagination a:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 16px rgba(103, 232, 249, .12); }
.pagination span { color: var(--muted); border-color: transparent; background: transparent; }
.pagination span[data-current] { border-color: var(--cyan); color: var(--cyan); background: rgba(15, 23, 36, .72); }
.page-jump { display: inline-flex; align-items: center; gap: 6px; }
.page-jump input { width: 64px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(2, 6, 23, .68); color: var(--text); font: 13px 'JetBrains Mono', ui-monospace, monospace; text-align: center; -moz-appearance: textfield; }
.page-jump input::-webkit-outer-spin-button, .page-jump input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.page-jump button { padding: 8px 14px; border-radius: 10px; font: 600 13px 'JetBrains Mono', ui-monospace, monospace; }

.empty-state { border: 1px solid var(--line); border-radius: 24px; padding: 48px 28px; background: rgba(15, 23, 36, .58); color: var(--muted); text-align: center; }
.empty-state svg { width: 80px; height: 80px; opacity: .6; margin-bottom: 16px; }
.empty-state b { display: block; font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state span { display: block; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.suggest-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.suggest-tags button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(2, 6, 23, .36); color: var(--cyan); font: 13px 'JetBrains Mono', monospace; box-shadow: none; }
.suggest-tags button:hover { border-color: var(--cyan); background: rgba(103, 232, 249, .08); transform: none; box-shadow: 0 0 16px rgba(103, 232, 249, .12); }

.skeleton-card { display: grid; grid-template-columns: 124px 1fr; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 24px; background: rgba(15, 23, 36, .58); margin-bottom: 12px; }
.skeleton-card > div:first-child { width: 124px; height: 174px; border-radius: 18px; background: linear-gradient(90deg, rgba(148, 163, 184, .06), rgba(103, 232, 249, .1), rgba(148, 163, 184, .06)); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
.skeleton-card > div:last-child > div { height: 14px; border-radius: 8px; margin-bottom: 12px; background: linear-gradient(90deg, rgba(148, 163, 184, .06), rgba(103, 232, 249, .1), rgba(148, 163, 184, .06)); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
.skeleton-card > div:last-child > div:nth-child(1) { width: 72%; height: 18px; }
.skeleton-card > div:last-child > div:nth-child(2) { width: 45%; }
.skeleton-card > div:last-child > div:nth-child(3) { width: 60%; }
.skeleton-card > div:last-child > div:nth-child(4) { width: 30%; height: 10px; margin-top: 18px; }
@keyframes shimmer { 50% { opacity: .55; } }

.history-strip { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.hist-tag { padding: 5px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2, 6, 23, .36); color: var(--text); text-decoration: none; font-size: 13px; }
.hist-tag:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 12px rgba(103, 232, 249, .12); }
.hist-clear { margin-left: 6px; background: transparent; border: none; color: var(--muted); font-size: 12px; padding: 4px 8px; box-shadow: none; }
.hist-clear:hover { color: var(--danger); box-shadow: none; transform: none; }

.cover-preview { position: fixed; z-index: 9000; pointer-events: none; max-width: 260px; max-height: 360px; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(103, 232, 249, .2); background: #000; opacity: 0; transform: scale(.92); transition: opacity .22s ease, transform .22s ease; }
.cover-preview.show { opacity: 1; transform: scale(1); }

.compact-page { display: grid; justify-items: center; align-items: start; padding: 28px; padding-top: 80px; }
.prep-card { width: min(760px, 100%); padding: 30px; position: relative; z-index: 1; }
.prep-hero { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: center; }
.prep-hero h1 { font-size: 26px; }
.prep-hero p { margin-top: 10px; color: var(--muted); line-height: 1.7; }
.transfer-orb { width: 96px; height: 96px; border-radius: 28px; position: relative; background: radial-gradient(circle at 30% 25%, rgba(103, 232, 249, .32), rgba(103, 232, 249, .08)); border: 1px solid rgba(103, 232, 249, .28); overflow: hidden; }
.transfer-orb span { position: absolute; width: 34px; height: 24px; left: 14px; top: 38px; border-radius: 7px; background: linear-gradient(135deg, var(--cyan), var(--green)); animation: moveBox 1.8s ease-in-out infinite; }
.transfer-orb i { position: absolute; right: 15px; bottom: 26px; width: 42px; height: 8px; border-radius: 999px; background: rgba(134, 239, 172, .3); }
.transfer-orb.refreshing { animation: refreshFlash .7s ease both; }
@keyframes moveBox { 50% { transform: translate(34px, -10px) rotate(5deg); } }
@keyframes refreshFlash { 50% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(103, 232, 249, .07); } }

.info-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.info-grid div { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(2, 6, 23, .34); }
.info-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.info-grid b { word-break: break-word; }

.task-steps { margin-top: 22px; display: grid; gap: 10px; }
.task-step { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; color: var(--muted); background: rgba(2, 6, 23, .28); }
.task-step span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(148, 163, 184, .15); color: var(--muted); font-size: 12px; }
.task-step.active { color: var(--cyan); border-color: rgba(103, 232, 249, .36); }
.task-step.done { color: var(--green); }
.task-step.done span { background: rgba(134, 239, 172, .18); color: var(--green); }

.progress-track { width: 100%; height: 6px; border-radius: 999px; background: rgba(148, 163, 184, .12); overflow: hidden; margin-top: 14px; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .4s ease; }
.progress-bar.indet { width: 30%; animation: indeterm 1.8s ease-in-out infinite; }
@keyframes indeterm { 0% { margin-left: 0; width: 30%; } 50% { margin-left: 40%; width: 50%; } 100% { margin-left: 100%; width: 30%; } }

.message { margin-top: 18px; padding: 15px 16px; border-radius: 16px; background: rgba(251, 191, 36, .1); color: #fde68a; border: 1px solid rgba(251, 191, 36, .18); line-height: 1.6; }
.actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.secondary-action { border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; color: var(--text); background: rgba(15, 23, 36, .62); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.secondary-action:hover { border-color: rgba(103, 232, 249, .4); }
.retry-action { border: 1px solid rgba(251, 113, 133, .3); border-radius: 14px; padding: 13px 16px; color: var(--danger); background: rgba(251, 113, 133, .08); text-decoration: none; }
.retry-action:hover { background: rgba(251, 113, 133, .15); border-color: rgba(251, 113, 133, .5); }
.back-link { display: inline-flex; margin-top: 20px; }

.toast-host { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(15, 23, 36, .92); backdrop-filter: blur(18px); box-shadow: 0 12px 40px rgba(0, 0, 0, .36); color: var(--text); font: 14px/1.5 'Inter', 'Noto Sans SC', sans-serif; transform: translateX(120%); animation: toastIn .32s cubic-bezier(.2, .9, .25, 1) forwards; max-width: 420px; }
.toast.out { animation: toastOut .28s ease-in forwards; }
.toast.success { border-color: rgba(134, 239, 172, .4); background: linear-gradient(135deg, rgba(134, 239, 172, .1), rgba(15, 23, 36, .92)); }
.toast.success .toast-icon { color: var(--green); }
.toast.error { border-color: rgba(251, 113, 133, .4); background: linear-gradient(135deg, rgba(251, 113, 133, .1), rgba(15, 23, 36, .92)); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info { border-color: rgba(103, 232, 249, .4); background: linear-gradient(135deg, rgba(103, 232, 249, .1), rgba(15, 23, 36, .92)); }
.toast.info .toast-icon { color: var(--cyan); }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.toast-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toast-msg { flex: 1; min-width: 0; word-break: break-word; }
@keyframes toastIn { to { transform: translateX(0); } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }
input:focus-visible { outline-offset: -2px; }

@media (max-width: 820px) {
  .hero-shell, .results-layout { grid-template-columns: 1fr; gap: 24px; }
  .hero-panel { min-height: 280px; }
  .search-console, .top-search { grid-template-columns: 1fr; gap: 8px; }
  .topbar { gap: 10px; padding: 12px 16px; }
  .topbar > .ghost-link { order: 3; width: 100%; text-align: center; font-size: 13px; padding: 8px; }
  .brand { font-size: 15px; }
  .brand-logo { width: 32px; height: 32px; }
  .search-brief { position: static; padding: 20px; }
  .book-card { grid-template-columns: 1fr; gap: 12px; }
  .book-cover { width: 100%; min-height: 220px; max-height: 280px; }
  .book-cover img { width: 100%; height: 100%; object-fit: cover; }
  .skeleton-card { grid-template-columns: 1fr; }
  .skeleton-card > div:first-child { width: 100%; height: 180px; }
  .info-grid { grid-template-columns: 1fr; }
  .prep-hero { grid-template-columns: 1fr; gap: 16px; text-align: center; justify-items: center; }
  .task-steps { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .actions > * { width: 100%; justify-content: center; text-align: center; }
  .pagination { flex-wrap: wrap; gap: 8px; }
  .page-jump { width: 100%; justify-content: center; margin-top: 8px; }
  .hero-shell { padding: 0 12px; }
  .toast-host { top: 10px; right: 10px; left: 10px; }
  .toast { max-width: 100%; }
}

@media (max-width: 480px) {
  .hero-brand { font-size: 15px; }
  .hero-brand .brand-logo { width: 36px; height: 36px; }
  h1 { font-size: 24px; }
  .book-body h2 { font-size: 17px; }
  .meta-strip { gap: 6px; }
  .meta-strip span { font-size: 11px; padding: 5px 8px; }
}
