html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f3efe7;
}

.audiobook-study-shell {
  --bg: #f3efe7;
  --bg-soft: #faf7f2;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: #fffdfa;
  --surface-accent: #edf4f1;
  --text: #1e2a2f;
  --text-muted: #5f6b70;
  --line: rgba(31, 45, 52, 0.1);
  --line-strong: rgba(31, 45, 52, 0.16);
  --primary: #1c6b67;
  --primary-strong: #114947;
  --primary-soft: rgba(28, 107, 103, 0.12);
  --accent: #d18d3f;
  --accent-soft: rgba(209, 141, 63, 0.14);
  --shadow-lg: 0 24px 50px rgba(34, 46, 54, 0.12);
  --shadow-md: 0 14px 32px rgba(34, 46, 54, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 340px;
  --player-width: 370px;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(209, 141, 63, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(28, 107, 103, 0.11), transparent 24%),
    linear-gradient(180deg, #f8f4ee 0%, var(--bg) 54%, #efeae1 100%);
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.audiobook-study-shell,
.audiobook-study-shell *,
.audiobook-study-shell *::before,
.audiobook-study-shell *::after {
  box-sizing: border-box;
}

.audiobook-study-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 72%);
  opacity: 0.35;
}

.audiobook-study-shell img,
.audiobook-study-shell svg {
  display: block;
}

.audiobook-study-shell button,
.audiobook-study-shell input,
.audiobook-study-shell iframe {
  font: inherit;
}

.audiobook-study-shell button {
  cursor: pointer;
}

.audiobook-study-shell a {
  color: inherit;
}

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

.audiobook-study-shell.ab-shell {
  position: relative;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.audiobook-study-shell .ab-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.audiobook-study-shell .ab-hero,
.audiobook-study-shell .ab-toolbar,
.audiobook-study-shell .ab-toc-panel,
.audiobook-study-shell .ab-detail-card,
.audiobook-study-shell .ab-player-card,
.audiobook-study-shell .ab-empty-state {
  border-radius: var(--radius-xl);
}

.audiobook-study-shell .ab-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.95fr);
  gap: 28px;
  padding: 34px;
  overflow: hidden;
}

.audiobook-study-shell .hero-copy {
  position: relative;
  z-index: 1;
}

.audiobook-study-shell .hero-copy h1,
.audiobook-study-shell .toc-head h2,
.audiobook-study-shell .ab-detail-card h2,
.audiobook-study-shell .ab-player-card h2,
.audiobook-study-shell .ab-empty-state h2,
.audiobook-study-shell .focus-card h3 {
  font-family: "Literata", serif;
  letter-spacing: -0.03em;
}

.audiobook-study-shell .hero-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 4.3rem);
  line-height: 0.98;
  max-width: 12ch;
}

.audiobook-study-shell .eyebrow,
.audiobook-study-shell .section-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.audiobook-study-shell .hero-subtitle,
.audiobook-study-shell .detail-summary,
.audiobook-study-shell .ab-empty-state p {
  color: var(--text-muted);
  line-height: 1.7;
}

.audiobook-study-shell .hero-subtitle {
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
}

.audiobook-study-shell .hero-metrics {
  display: grid;
  gap: 16px;
}

.audiobook-study-shell .metric-card {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 244, 0.72)),
    var(--surface-strong);
  border: 1px solid rgba(31, 45, 52, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.audiobook-study-shell .metric-label,
.audiobook-study-shell .metric-note {
  display: block;
}

.audiobook-study-shell .metric-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.audiobook-study-shell .metric-card strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 2.1rem;
  line-height: 1;
}

.audiobook-study-shell .metric-note {
  color: var(--text-muted);
  font-size: 0.93rem;
}

.audiobook-study-shell .mobile-toggle-card {
  display: none;
}

.audiobook-study-shell .menu-toggle,
.audiobook-study-shell .menu-close,
.audiobook-study-shell .chip,
.audiobook-study-shell .toc-item,
.audiobook-study-shell .nav-button {
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.audiobook-study-shell .menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 700;
}

.audiobook-study-shell .menu-toggle:hover,
.audiobook-study-shell .chip:hover,
.audiobook-study-shell .nav-button:hover,
.audiobook-study-shell .toc-item:hover {
  transform: translateY(-1px);
}

.audiobook-study-shell .menu-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.audiobook-study-shell .menu-toggle-icon svg,
.audiobook-study-shell .menu-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.audiobook-study-shell .ab-toolbar {
  display: grid;
  grid-template-columns: auto auto;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 20px 24px;
}

.audiobook-study-shell .chip:focus-visible,
.audiobook-study-shell .menu-toggle:focus-visible,
.audiobook-study-shell .toc-item:focus-visible,
.audiobook-study-shell .nav-button:focus-visible,
.audiobook-study-shell .menu-close:focus-visible {
  border-color: rgba(28, 107, 103, 0.48);
  box-shadow: 0 0 0 4px rgba(28, 107, 103, 0.15);
  outline: none;
}

.audiobook-study-shell .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.audiobook-study-shell .chip {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 700;
}

.audiobook-study-shell .chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #f7fbfa;
  box-shadow: 0 10px 24px rgba(28, 107, 103, 0.24);
}

.audiobook-study-shell .ab-toolbar-meta {
  text-align: right;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.audiobook-study-shell .ab-toolbar-meta strong {
  color: var(--text);
}

.audiobook-study-shell .ab-grid {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.audiobook-study-shell .ab-toc-panel {
  padding: 22px;
  overflow: hidden;
}

.audiobook-study-shell .toc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.audiobook-study-shell .toc-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.audiobook-study-shell .menu-close {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

.audiobook-study-shell .toc-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.audiobook-study-shell .toc-pill,
.audiobook-study-shell .meta-chip,
.audiobook-study-shell .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.audiobook-study-shell .toc-pill,
.audiobook-study-shell .meta-chip {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.audiobook-study-shell .toc-nav {
  max-height: 960px;
  overflow: auto;
  padding-right: 4px;
}

.audiobook-study-shell .chapter-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.audiobook-study-shell .toc-empty {
  padding: 20px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-muted);
  line-height: 1.6;
}

.audiobook-study-shell .toc-item {
  width: 100%;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 20px;
  text-align: left;
  background: rgba(255, 255, 255, 0.54);
}

.audiobook-study-shell .toc-item.is-active {
  background: linear-gradient(180deg, rgba(28, 107, 103, 0.16), rgba(28, 107, 103, 0.08));
  border-color: rgba(28, 107, 103, 0.24);
  box-shadow: 0 14px 30px rgba(28, 107, 103, 0.16);
}

.audiobook-study-shell .toc-item-index {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.audiobook-study-shell .toc-item-title {
  display: block;
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
}

.audiobook-study-shell .toc-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.audiobook-study-shell .toc-mini-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 45, 52, 0.08);
}

.audiobook-study-shell .ab-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--player-width);
  gap: 22px;
  align-items: start;
}

.audiobook-study-shell .ab-content-column {
  display: grid;
  gap: 22px;
}

.audiobook-study-shell .ab-detail-card,
.audiobook-study-shell .ab-player-card,
.audiobook-study-shell .ab-book-card,
.audiobook-study-shell .ab-empty-state {
  padding: 24px;
}

.audiobook-study-shell .ab-empty-state h2,
.audiobook-study-shell .ab-player-card h2,
.audiobook-study-shell .ab-detail-card h2 {
  margin: 0 0 10px;
}

.audiobook-study-shell .nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 800;
}

.audiobook-study-shell .ab-detail-card {
  display: grid;
  gap: 20px;
}

.audiobook-study-shell .ab-detail-card.is-refreshing,
.audiobook-study-shell .ab-player-card.is-refreshing {
  animation: card-fade 220ms ease;
}

@keyframes card-fade {
  from {
    opacity: 0.48;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.audiobook-study-shell .detail-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.audiobook-study-shell .ab-detail-card h2,
.audiobook-study-shell .ab-player-card h2,
.audiobook-study-shell .ab-empty-state h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  line-height: 1.15;
}

.audiobook-study-shell .detail-summary {
  margin: 0;
  font-size: 1rem;
}

.audiobook-study-shell .detail-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.audiobook-study-shell .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.audiobook-study-shell .status-badge {
  border: 1px solid transparent;
}

.audiobook-study-shell .status-badge.is-syllabus,
.audiobook-study-shell .status-badge.is-basic {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.audiobook-study-shell .status-badge.is-sos {
  background: var(--accent-soft);
  color: #8f5d1f;
}

.audiobook-study-shell .status-badge.is-category {
  background: rgba(31, 45, 52, 0.06);
  color: var(--text);
}

.audiobook-study-shell .focus-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 250, 248, 0.84));
}

.audiobook-study-shell .focus-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}

.audiobook-study-shell .focus-card h3 {
  margin: 0;
  font-size: 1.28rem;
}

.audiobook-study-shell .focus-list {
  margin: 0;
  padding-left: 18px;
}

.audiobook-study-shell .focus-list {
  display: grid;
  gap: 10px;
  color: var(--text-muted);
}

.audiobook-study-shell .chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.audiobook-study-shell .nav-button {
  flex: 1;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

.audiobook-study-shell .nav-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.audiobook-study-shell .ab-player-column {
  display: grid;
  gap: 22px;
}

.audiobook-study-shell .ab-player-card {
  position: relative;
}

.audiobook-study-shell .player-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.audiobook-study-shell .player-note {
  max-width: 24ch;
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.audiobook-study-shell .ab-book-card {
  position: relative;
}

.audiobook-study-shell .book-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.audiobook-study-shell .book-head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  line-height: 1.15;
  font-family: "Literata", serif;
  letter-spacing: -0.03em;
}

.audiobook-study-shell .book-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.audiobook-study-shell .book-note {
  margin: 0 0 16px;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.audiobook-study-shell .book-frame-wrap {
  padding: 12px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(209, 141, 63, 0.08), rgba(209, 141, 63, 0.02)),
    #fffdfa;
  border: 1px solid rgba(31, 45, 52, 0.08);
}

.audiobook-study-shell .book-frame-wrap iframe {
  width: 100%;
  min-height: 820px;
  border: 0;
  border-radius: 18px;
  background: #ffffff;
}

.audiobook-study-shell .player-frame-wrap {
  padding: 12px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(17, 73, 71, 0.08), rgba(17, 73, 71, 0.02)),
    #fffdfa;
  border: 1px solid rgba(31, 45, 52, 0.08);
}

.audiobook-study-shell .player-frame-wrap iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 18px;
  background: #ffffff;
}

.audiobook-study-shell .ab-empty-state {
  text-align: center;
  background:
    radial-gradient(circle at top center, rgba(209, 141, 63, 0.12), transparent 30%),
    rgba(255, 253, 250, 0.86);
}

.audiobook-study-shell .ab-footer {
  padding: 28px 8px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.audiobook-study-shell .ab-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 35, 42, 0.48);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.audiobook-study-shell.is-menu-open .ab-menu-backdrop {
  opacity: 1;
}

@media (max-width: 1280px) {
  .audiobook-study-shell .ab-content-grid {
    grid-template-columns: 1fr;
  }

  .audiobook-study-shell .ab-player-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audiobook-study-shell .ab-player-card {
    top: auto;
  }
}

@media (max-width: 1120px) {
  .audiobook-study-shell .ab-hero {
    grid-template-columns: 1fr;
  }

  .audiobook-study-shell .ab-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .audiobook-study-shell .ab-toolbar-meta {
    text-align: left;
  }
}

@media (max-width: 920px) {
  .audiobook-study-shell .ab-grid {
    grid-template-columns: 1fr;
  }

  .audiobook-study-shell .ab-toc-panel {
    position: fixed;
    top: 16px;
    left: 16px;
    bottom: 16px;
    z-index: 20;
    width: min(380px, calc(100vw - 32px));
    max-height: none;
    transform: translateX(-115%);
    transition: transform 220ms ease;
  }

  .audiobook-study-shell .toc-nav {
    max-height: calc(100vh - 220px);
  }

  .audiobook-study-shell.is-menu-open .ab-toc-panel {
    transform: translateX(0);
  }

  .audiobook-study-shell .menu-close,
  .audiobook-study-shell .mobile-toggle-card {
    display: block;
  }

  .audiobook-study-shell .ab-player-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .audiobook-study-shell.ab-shell {
    width: min(100% - 20px, 100%);
    padding-top: 14px;
  }

  .audiobook-study-shell .ab-hero,
  .audiobook-study-shell .ab-toolbar,
  .audiobook-study-shell .ab-detail-card,
  .audiobook-study-shell .ab-player-card,
  .audiobook-study-shell .ab-book-card,
  .audiobook-study-shell .ab-empty-state,
  .audiobook-study-shell .ab-toc-panel {
    border-radius: 22px;
  }

  .audiobook-study-shell .ab-hero,
  .audiobook-study-shell .ab-toolbar,
  .audiobook-study-shell .ab-detail-card,
  .audiobook-study-shell .ab-player-card,
  .audiobook-study-shell .ab-book-card,
  .audiobook-study-shell .ab-empty-state {
    padding: 20px;
  }

  .audiobook-study-shell .detail-topline,
  .audiobook-study-shell .player-head,
  .audiobook-study-shell .book-head,
  .audiobook-study-shell .chapter-nav {
    flex-direction: column;
  }

  .audiobook-study-shell .detail-meta,
  .audiobook-study-shell .player-note,
  .audiobook-study-shell .book-meta {
    justify-content: flex-start;
    text-align: left;
    max-width: none;
  }
  .audiobook-study-shell .player-frame-wrap iframe {
    min-height: 320px;
  }

  .audiobook-study-shell .book-frame-wrap iframe {
    min-height: 480px;
  }
}
