:root {
  --bg: #121315;
  --bg-elevated: #191b20;
  --panel: rgba(19, 21, 26, 0.82);
  --panel-strong: rgba(24, 27, 33, 0.94);
  --paper: #f2ede4;
  --paper-muted: #d7cec1;
  --ink: #efe8dc;
  --ink-strong: #141414;
  --muted: #948b80;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #c77544;
  --accent-deep: #8f4725;
  --success: #2f936b;
  --danger: #b45454;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.17), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 250, 239, 0.08), transparent 30%),
    linear-gradient(180deg, #0d0f12 0%, #121315 52%, #0f1013 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
textarea,
pre,
p,
h1,
h2,
h3 {
  margin: 0;
}

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.25;
  pointer-events: none;
}

.ambient-left {
  top: -160px;
  left: -120px;
  background: rgba(199, 117, 68, 0.32);
}

.ambient-right {
  right: -120px;
  bottom: -140px;
  background: rgba(255, 255, 255, 0.16);
}

.page,
.auth-page {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
}

.page {
  padding: 28px 0 56px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.eyebrow,
.panel-label,
.section-kicker p,
.user-label,
.metric span,
.aside-card span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow,
.panel-label,
.section-kicker p {
  color: var(--paper-muted);
}

.site-head,
.hero-card,
.panel,
.auth-card,
.auth-aside,
.verify-panel {
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.site-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 16px 22px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(15, 17, 22, 0.86);
}

.site-head-left {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

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

.site-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
}

.site-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.site-brand-copy strong {
  font-family: "DM Serif Display", "Songti SC", serif;
  font-size: 28px;
  line-height: 0.95;
}

.site-brand-copy span {
  color: var(--paper-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.brand-title,
.site-head h1,
.auth-aside h1,
.verify-panel h1 {
  font-family: "DM Serif Display", "Songti SC", serif;
  font-weight: 400;
}

.brand-title {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 0.96;
}

.topbar-copy,
.panel-copy,
.auth-copy,
.form-footnote,
.card-meta,
.history-meta,
.message,
.status-pre {
  color: var(--paper-muted);
}

.status-stack {
  display: grid;
  gap: 14px;
}

.status-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-row span {
  color: var(--paper-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-row strong {
  font-size: 18px;
  line-height: 1.35;
}

.head-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--paper-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  color: var(--paper);
}

.nav-link-active {
  color: #fff6ef;
  background: linear-gradient(135deg, rgba(199, 117, 68, 0.9), rgba(143, 71, 37, 0.9));
}

.head-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  min-width: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.user-name {
  white-space: nowrap;
}

.user-avatar,
.settings-avatar-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(199, 117, 68, 0.45), rgba(76, 44, 29, 0.25)),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 34px;
  height: 34px;
}

.user-avatar-image,
.settings-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-fallback,
.settings-avatar-fallback {
  font-weight: 800;
  color: #fff6ef;
  text-transform: uppercase;
}

.user-avatar-fallback {
  font-size: 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn-active {
  background: rgba(199, 117, 68, 0.18);
  border-color: rgba(199, 117, 68, 0.36);
}

.btn-head {
  padding: 11px 15px;
  border-radius: 999px;
}

.logout-form {
  display: contents;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.7fr);
  gap: 18px;
  margin-top: 20px;
}

.hero-card {
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.hero-card-main {
  padding: 28px;
}

.hero-card-cinema {
  background:
    radial-gradient(circle at top right, rgba(199, 117, 68, 0.18), transparent 26%),
    var(--panel);
}

.hero-card-main h2 {
  margin-top: 12px;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1;
  max-width: 14ch;
}

.hero-copy {
  max-width: 60ch;
  margin-top: 14px;
  line-height: 1.7;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.metric {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.hero-card-side {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(242, 237, 228, 0.1), rgba(242, 237, 228, 0.03)),
    var(--panel-strong);
}

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

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 7px rgba(199, 117, 68, 0.12);
}

.status-pre {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.workspace-grid-movies {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-grid-books {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-grid > .panel {
  display: flex;
  flex-direction: column;
}

.panel-search #search-results {
  overflow: visible;
}

.panel-history #history-list {
  overflow: visible;
}

.panel-history .pagination-bar-compact,
.llm-sidebar .pagination-bar-compact {
  margin-top: auto;
}

.panel-history .actions,
.llm-sidebar .actions {
  margin-top: 12px;
}

.llm-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.panel-results {
  margin-top: 18px;
}

.route-result-cache {
  display: none;
}

.llm-main {
  display: grid;
  gap: 18px;
}

.llm-hero {
  margin-top: 20px;
}

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

.llm-sidebar {
  position: static;
  display: flex;
  flex-direction: column;
}

.llm-sidebar #llm-history-list {
  overflow: visible;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.panel-head h2,
.auth-card h2 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.08;
}

.count-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
}

.search-box {
  display: flex;
  gap: 12px;
  margin: 20px 0 18px;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.pagination-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.pagination-stack .pagination-bar {
  margin-top: 0;
}

.pagination-bar-numbered {
  justify-content: stretch;
}

.pagination-pages {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.pagination-page-btn,
.pagination-ellipsis {
  min-width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.pagination-page-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper-muted);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.pagination-page-btn:hover {
  transform: translateY(-1px);
  color: var(--paper);
  border-color: rgba(199, 117, 68, 0.42);
  background: rgba(199, 117, 68, 0.14);
}

.pagination-page-btn.active {
  color: var(--ink-strong);
  background: linear-gradient(180deg, #df9661 0%, #bf6f40 100%);
  border-color: rgba(223, 150, 97, 0.72);
}

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

.pagination-bar-compact {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
}

.pagination-bar-compact .btn {
  width: 100%;
}

.pagination-bar-compact .btn:last-child {
  justify-self: end;
}

.pagination-copy {
  color: var(--paper-muted);
  text-align: center;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

input:focus {
  outline: none;
  border-color: rgba(199, 117, 68, 0.7);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

input::placeholder,
textarea::placeholder {
  color: rgba(239, 232, 220, 0.42);
}

textarea {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  resize: vertical;
  min-height: 104px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

textarea:focus {
  outline: none;
  border-color: rgba(199, 117, 68, 0.7);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  color: #fff6ef;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  white-space: nowrap;
  flex-wrap: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.assistant-close-btn,
.assistant-head-btn,
.detail-close-btn {
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(143, 71, 37, 0.26);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.btn-linklike {
  text-decoration: none;
}

.btn-full {
  width: 100%;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.actions-single {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 180px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.media-card {
  padding: 0;
  overflow: hidden;
}

.media-card-clickable,
.history-item-clickable {
  cursor: pointer !important;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.media-card-clickable:hover,
.media-card-clickable:focus-visible,
.history-item-clickable:hover,
.history-item-clickable:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(199, 117, 68, 0.32);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  outline: none;
}

.media-card-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 14px 68px;
  min-height: 210px;
}

.media-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-status,
.media-submeta {
  color: var(--paper-muted);
  font-size: 12px;
}

.media-description {
  color: var(--paper);
  font-size: 13px;
  line-height: 1.6;
}

.media-card .media-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-poster {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(199, 117, 68, 0.18), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.media-poster-image,
.media-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-poster-fallback,
.media-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff6ef;
  font-family: "DM Serif Display", "Songti SC", serif;
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.22), transparent 40%),
    rgba(255, 255, 255, 0.05);
}

.media-poster-fallback span {
  font-size: 36px;
}

.media-thumb {
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 14px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.media-thumb-fallback span {
  font-size: 24px;
}

.card-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(199, 117, 68, 0.14);
  color: #f6d4bf;
  font-size: 11px;
  font-weight: 800;
}

.card h3 {
  font-size: 16px;
  line-height: 1.32;
}

.card-meta {
  font-size: 13px;
  line-height: 1.55;
}

.card-note {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(199, 117, 68, 0.08);
  border: 1px solid rgba(199, 117, 68, 0.18);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.6;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.media-card .card-actions {
  position: absolute;
  left: 14px;
  bottom: 14px;
  margin-top: 0;
  justify-content: flex-start;
}

.card-actions .btn {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 240px;
}

.history-list.empty,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 20px;
  text-align: center;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper-muted);
}

.history-item {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-item-rich {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-item-rich-main {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.history-item-copy {
  min-width: 0;
}

.history-item-copy strong {
  display: block;
  margin-bottom: 4px;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.history-item strong {
  font-size: 14px;
  line-height: 1.4;
}

.history-meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.history-remove {
  min-width: auto;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.panel-hint {
  margin-top: -2px;
  margin-bottom: 14px;
  color: #f6d4bf;
  font-size: 13px;
  line-height: 1.5;
}

.modal-open {
  overflow: hidden;
}

.detail-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 28px;
}

.detail-modal-shell[hidden] {
  display: none;
}

.detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 13, 0.76);
  backdrop-filter: blur(10px);
}

.detail-modal-card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  border-radius: 30px;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(13, 14, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

.detail-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 9px 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}

.detail-modal-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr);
  gap: 22px;
  align-items: stretch;
}

.detail-modal-poster {
  min-height: 420px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(199, 117, 68, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
}

.detail-modal-poster-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-modal-poster-fallback {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: grid;
  place-items: center;
  color: #fff6ef;
  font-family: "DM Serif Display", "Songti SC", serif;
  font-size: 88px;
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.26), transparent 30%),
    rgba(255, 255, 255, 0.05);
}

.detail-modal-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
}

.detail-modal-badge {
  margin: 0;
  color: #f6d4bf;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 800;
}

.detail-modal-copy h3 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
}

.detail-modal-meta,
.detail-modal-status {
  margin: 0;
  color: var(--paper-muted);
  line-height: 1.6;
}

.detail-modal-status {
  color: #f6d4bf;
}

.detail-modal-divider {
  width: 100%;
  height: 1px;
  margin: 4px 0 2px;
  background: linear-gradient(90deg, rgba(199, 117, 68, 0.3), rgba(255, 255, 255, 0.04));
}

.detail-modal-description {
  margin: 0;
  color: var(--paper);
  font-size: 15px;
  line-height: 1.8;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.llm-box {
  display: grid;
  gap: 14px;
  margin: 18px 0 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.llm-box-strong {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(242, 237, 228, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.llm-box-copy {
  display: grid;
  gap: 8px;
}

.llm-box-copy strong {
  font-size: 16px;
}

.llm-box-copy p {
  color: var(--paper-muted);
  line-height: 1.7;
}

.llm-send-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.llm-send-hint {
  color: var(--paper-muted);
  font-size: 13px;
  line-height: 1.5;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(199, 117, 68, 0.14);
  border: 1px solid rgba(199, 117, 68, 0.18);
  color: #f6d4bf;
  font-size: 13px;
  font-weight: 700;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 0.88fr);
  gap: 18px;
  width: 100%;
}

.auth-aside,
.auth-card,
.verify-panel {
  border-radius: 32px;
}

.auth-aside {
  padding: 34px 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(17, 19, 24, 0.92);
}

.auth-aside h1,
.verify-panel h1 {
  margin-top: 14px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.96;
  max-width: 11ch;
}

.auth-copy {
  max-width: 52ch;
  margin-top: 16px;
  line-height: 1.8;
}

.aside-stack {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.aside-card {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.aside-card strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
}

.aside-card p {
  margin-top: 8px;
  color: var(--paper-muted);
  line-height: 1.7;
}

.auth-card,
.verify-panel {
  padding: 30px 28px;
  background: linear-gradient(180deg, rgba(26, 29, 35, 0.96), rgba(18, 20, 24, 0.96));
}

.auth-card-head {
  margin-bottom: 22px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
  color: var(--paper);
}

.message {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.message-success {
  color: #d7f4e4;
  background: rgba(47, 147, 107, 0.16);
  border-color: rgba(47, 147, 107, 0.32);
}

.message-error {
  color: #ffd7d7;
  background: rgba(180, 84, 84, 0.16);
  border-color: rgba(180, 84, 84, 0.3);
}

.form-footnote {
  margin-top: 18px;
  font-size: 14px;
}

.form-footnote a {
  color: #f6d4bf;
  text-decoration: none;
}

.verify-panel {
  width: min(720px, 100%);
}

.verify-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

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

.is-hidden {
  display: none !important;
}

.settings-hero {
  margin-top: 20px;
}

.settings-hero h2 {
  max-width: none;
  width: 100%;
}

.settings-hero .hero-copy {
  max-width: 86ch;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.settings-panel {
  padding: 24px;
}

.assistant-fab {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 46;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(199, 117, 68, 0.96), rgba(168, 91, 45, 0.96));
  color: #fff8f2;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.assistant-fab-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff8f2;
}

.assistant-fab-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.assistant-fab-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.assistant-open {
  overflow: hidden;
}

.assistant-drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}

.assistant-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.22);
  opacity: 0;
  transition: opacity 180ms ease;
}

.assistant-drawer-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(760px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(24, 26, 31, 0.98), rgba(14, 16, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.4);
  transform: translateX(calc(100% + 24px));
  transition: transform 220ms ease;
}

.assistant-drawer-open {
  pointer-events: auto;
}

.assistant-drawer-open .assistant-drawer-backdrop {
  opacity: 1;
}

.assistant-drawer-open .assistant-drawer-panel {
  transform: translateX(0);
}

.assistant-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.assistant-drawer-title {
  display: grid;
  gap: 6px;
}

.assistant-dataset-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(199, 117, 68, 0.14);
  color: #f6d4bf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.assistant-close-btn {
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}

.assistant-drawer-body {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 0;
}

.assistant-session-pane {
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 0;
  overflow: auto;
}

.assistant-pane-head {
  margin-bottom: 12px;
  color: var(--paper-muted);
  font-size: 13px;
  font-weight: 700;
}

.assistant-session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assistant-session-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.assistant-session-main,
.assistant-session-delete {
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper);
  cursor: pointer;
}

.assistant-session-main {
  min-height: 62px;
  max-height: 62px;
  padding: 11px 12px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  text-align: left;
  overflow: hidden;
}

.assistant-session-main strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assistant-session-main span {
  display: block;
  color: var(--paper-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assistant-session-delete {
  width: 38px;
  display: grid;
  place-items: center;
  color: rgba(255, 241, 232, 0.8);
  background: rgba(255, 255, 255, 0.04);
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.assistant-session-delete:hover {
  background: rgba(185, 73, 73, 0.16);
  color: #ffd8d8;
  transform: translateY(-1px);
}

.assistant-delete-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.assistant-session-active .assistant-session-main,
.assistant-session-active .assistant-session-delete {
  background: rgba(199, 117, 68, 0.18);
  border: 1px solid rgba(199, 117, 68, 0.24);
}

.watchlist-fab {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(26, 28, 34, 0.98), rgba(15, 17, 22, 0.98));
  color: #fff8f2;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.bookshelf-fab {
  position: fixed;
  left: 18px;
  top: calc(50% - 72px);
  transform: translateY(-50%);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(26, 28, 34, 0.98), rgba(15, 17, 22, 0.98));
  color: #fff8f2;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.bookshelf-fab-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(199, 117, 68, 0.18);
  color: #f6d4bf;
}

.bookshelf-fab-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.bookshelf-fab-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.bookshelf-fab-copy strong {
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.05em;
}

.bookshelf-fab-copy span {
  color: var(--paper-muted);
  font-size: 12px;
}

.bookshelf-open {
  overflow: hidden;
}

.bookshelf-drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 54;
  pointer-events: none;
}

.bookshelf-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.18);
  opacity: 0;
  transition: opacity 180ms ease;
}

.bookshelf-drawer-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: min(408px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(24, 26, 31, 0.98), rgba(14, 16, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.4);
  transform: translateX(calc(-100% - 24px));
  transition: transform 220ms ease;
}

.bookshelf-drawer-open {
  pointer-events: auto;
}

.bookshelf-drawer-open .bookshelf-drawer-backdrop {
  opacity: 1;
}

.bookshelf-drawer-open .bookshelf-drawer-panel {
  transform: translateX(0);
}

.bookshelf-flyer {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 58;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.22), transparent 34%),
    rgba(20, 21, 27, 0.96);
}

.bookshelf-flyer span {
  color: #fff6ef;
  font-family: "DM Serif Display", "Songti SC", serif;
  font-size: 24px;
}

.bookshelf-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bookshelf-drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bookshelf-drawer-panel .panel-copy {
  margin: 0;
}

.bookshelf-drawer-panel .history-list {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.bookshelf-drawer-panel .history-list.empty {
  min-height: 220px;
}

.recommendation-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
  align-items: stretch;
}

.archive-sidebar,
.archive-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(72vh, 860px);
  overflow: hidden;
}

.archive-sidebar {
  gap: 0;
}

.archive-main {
  padding-bottom: 18px;
}

.dataset-switch {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}

.dataset-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--paper);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dataset-pill-active {
  background: rgba(199, 117, 68, 0.16);
  border-color: rgba(199, 117, 68, 0.26);
  color: #f6d4bf;
}

.archive-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.archive-list-subtitle {
  color: var(--paper-muted);
  font-size: 12px;
}

.archive-run-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.archive-run-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.archive-run-item,
.archive-run-delete {
  border: 0;
  color: var(--paper);
  cursor: pointer;
}

.archive-run-item {
  width: 100%;
  padding: 12px 12px 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  display: grid;
  gap: 4px;
}

.archive-run-item strong,
.archive-run-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-run-item span {
  color: var(--paper-muted);
  font-size: 11px;
  margin: 0;
}

.archive-run-entry-active .archive-run-item,
.archive-run-item-active {
  background: rgba(199, 117, 68, 0.16);
  border-color: rgba(199, 117, 68, 0.26);
}

.archive-run-delete {
  width: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 241, 232, 0.78);
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.archive-run-delete:hover {
  background: rgba(185, 73, 73, 0.16);
  color: #ffd8d8;
  transform: translateY(-1px);
}

.archive-empty-state {
  display: grid;
  gap: 10px;
  place-items: start;
}

.archive-empty-state h2 {
  margin: 0;
}

.archive-empty-state p {
  margin: 0;
  color: var(--paper-muted);
  line-height: 1.7;
}

.archive-detail {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.archive-results-stick {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 0 12px;
  background: linear-gradient(180deg, rgba(18, 20, 25, 0.98), rgba(18, 20, 25, 0.92));
}

.archive-results-stick h3 {
  margin: 0;
  font-size: 19px;
}

.archive-recommendations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.archive-book-card,
.archive-media-card {
  cursor: pointer;
  min-height: 0;
  border-radius: 16px;
}

.archive-book-card {
  gap: 4px;
  padding: 8px 10px;
}

.archive-book-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.archive-book-card-top h3 {
  margin: 0;
  min-width: 0;
}

.archive-book-card h3,
.archive-media-card h3 {
  font-size: 13px;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-book-card .card-meta,
.archive-media-card .card-meta,
.archive-media-card .media-submeta {
  margin: 0;
  font-size: 10px;
  line-height: 1.2;
}

.archive-book-card .media-description,
.archive-media-card .media-description {
  display: none;
}

.archive-book-card .card-badge,
.archive-media-card .card-badge {
  padding: 2px 6px;
  font-size: 10px;
  flex-shrink: 0;
}

.archive-media-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  overflow: hidden;
}

.archive-media-card .media-poster {
  aspect-ratio: auto;
  min-height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
}

.archive-media-card .media-card-body {
  min-height: 0;
  gap: 4px;
  padding: 8px 10px;
}

.archive-media-card .media-card-top {
  gap: 6px;
}

.archive-media-card .media-status {
  font-size: 10px;
  padding: 2px 6px;
}

.archive-poster-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.archive-poster-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff6ef;
  font-family: "DM Serif Display", "Songti SC", serif;
  font-size: 28px;
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.22), transparent 30%),
    rgba(255, 255, 255, 0.05);
}

.watchlist-fab-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(199, 117, 68, 0.18);
  color: #f6d4bf;
}

.watchlist-fab-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.watchlist-fab-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.watchlist-fab-copy strong {
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.05em;
}

.watchlist-fab-copy span {
  color: var(--paper-muted);
  font-size: 12px;
}

.watchlist-open {
  overflow: hidden;
}

.watchlist-drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 54;
  pointer-events: none;
}

.watchlist-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.18);
  opacity: 0;
  transition: opacity 180ms ease;
}

.watchlist-drawer-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: min(408px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(24, 26, 31, 0.98), rgba(14, 16, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.4);
  transform: translateX(calc(-100% - 24px));
  transition: transform 220ms ease;
}

.watchlist-drawer-open {
  pointer-events: auto;
}

.watchlist-drawer-open .watchlist-drawer-backdrop {
  opacity: 1;
}

.watchlist-drawer-open .watchlist-drawer-panel {
  transform: translateX(0);
}

.watchlist-flyer {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 58;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.22), transparent 34%),
    rgba(20, 21, 27, 0.96);
}

.watchlist-flyer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.watchlist-flyer-fallback span {
  color: #fff6ef;
  font-family: "DM Serif Display", "Songti SC", serif;
  font-size: 24px;
}

.watchlist-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.watchlist-drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.watchlist-drawer-panel .panel-copy {
  margin: 0;
}

.watchlist-drawer-panel .history-list {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.watchlist-drawer-panel .history-list.empty {
  min-height: 220px;
}

.assistant-chat-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.assistant-chat-messages {
  min-height: 0;
  overflow: auto;
  padding: 18px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assistant-message {
  display: flex;
}

.assistant-message-user {
  justify-content: flex-end;
}

.assistant-message-assistant {
  justify-content: flex-start;
}

.assistant-bubble {
  max-width: min(92%, 560px);
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
}

.assistant-message-user .assistant-bubble {
  background: rgba(199, 117, 68, 0.18);
  border-color: rgba(199, 117, 68, 0.24);
}

.assistant-bubble p {
  margin: 0;
  line-height: 1.7;
}

.assistant-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-topic-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(199, 117, 68, 0.14);
  color: #f6d4bf;
  font-size: 12px;
  font-weight: 800;
}

.assistant-item-grid {
  display: grid;
  gap: 10px;
}

.assistant-item-grid-books {
  grid-template-columns: 1fr;
}

.assistant-item-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.assistant-item-card-book {
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.assistant-item-card-book strong,
.assistant-item-copy strong {
  font-size: 14px;
  line-height: 1.45;
}

.assistant-item-card-book p,
.assistant-item-copy p {
  margin: 0;
  color: var(--paper-muted);
  font-size: 12px;
  line-height: 1.55;
}

.assistant-item-card-media {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
}

.assistant-item-poster {
  width: 84px;
  height: 112px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.assistant-item-poster-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.assistant-item-poster-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff6ef;
  font-family: "DM Serif Display", "Songti SC", serif;
  background:
    radial-gradient(circle at top left, rgba(199, 117, 68, 0.24), transparent 30%),
    rgba(255, 255, 255, 0.05);
}

.assistant-item-copy {
  display: grid;
  gap: 6px;
  align-content: start;
}

.assistant-input-pane {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
}

.assistant-input {
  width: 100%;
  min-height: 108px;
  resize: vertical;
}

.assistant-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.assistant-input-hint {
  margin: 0;
  color: var(--paper-muted);
  font-size: 12px;
  line-height: 1.5;
}

.assistant-empty {
  padding: 18px 14px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--paper-muted);
  text-align: center;
  line-height: 1.6;
}

.assistant-empty-chat {
  margin: auto 0;
}

.settings-avatar-stage {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 8px 0 20px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-avatar-preview {
  width: 88px;
  height: 88px;
}

.settings-avatar-fallback {
  font-size: 28px;
}

.settings-avatar-copy {
  display: grid;
  gap: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.field-grow {
  min-width: 0;
}

.field-file input[type="file"] {
  padding: 14px 16px;
}

.field-readonly {
  display: grid;
  gap: 8px;
}

.field-static {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
}

.actions-inline {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
}

.btn-inline {
  white-space: nowrap;
}

.reveal {
  animation: reveal 0.58s ease both;
}

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

@media (max-width: 980px) {
  .site-head,
  .site-head-left,
  .site-head-right,
  .hero-grid,
  .workspace-grid,
  .recommendation-layout,
  .llm-layout,
  .auth-grid,
  .settings-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .site-head {
    align-items: flex-start;
  }

  .site-head-left,
  .site-head-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

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

  .assistant-drawer-panel {
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: min(100vw - 20px, 760px);
  }

  .watchlist-drawer-panel {
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(100vw - 20px, 420px);
  }

  .bookshelf-drawer-panel {
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(100vw - 20px, 420px);
  }

  .assistant-drawer-body {
    grid-template-columns: 1fr;
    grid-template-rows: 180px minmax(0, 1fr);
  }

  .assistant-session-pane {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .detail-modal-poster,
  .detail-modal-poster-fallback {
    min-height: 300px;
  }

  .actions,
  .verify-actions,
  .pagination-bar {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .pagination-pages {
    justify-content: center;
  }

  .archive-detail-head,
  .archive-summary-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .page,
  .auth-page {
    width: min(calc(100vw - 18px), 1220px);
  }

  .page {
    padding: 16px 0 30px;
  }

  .topbar,
  .site-head,
  .panel,
  .hero-card,
  .auth-aside,
  .auth-card,
  .verify-panel,
  .detail-modal-card {
    border-radius: 24px;
    padding: 20px;
  }

  .hero-metrics,
  .actions,
  .archive-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .search-box {
    flex-direction: column;
  }

  .pagination-bar {
    align-items: stretch;
  }

  .pagination-page-btn,
  .pagination-ellipsis {
    min-width: 34px;
    height: 34px;
  }

  .llm-send-row {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-avatar-stage {
    flex-direction: column;
    align-items: flex-start;
  }

  .assistant-fab {
    right: 14px;
  }

  .watchlist-fab {
    left: 14px;
  }

  .bookshelf-fab {
    left: 14px;
  }

  .assistant-drawer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .assistant-head-actions,
  .assistant-input-actions {
    width: 100%;
    justify-content: space-between;
  }

  .assistant-fab {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .watchlist-fab {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .bookshelf-fab {
    top: auto;
    bottom: 78px;
    transform: none;
  }

  .assistant-drawer-panel {
    inset: 0;
    width: 100%;
    border-radius: 0;
  }

  .watchlist-drawer-panel {
    inset: 0;
    width: 100%;
    border-radius: 0;
  }

  .bookshelf-drawer-panel {
    inset: 0;
    width: 100%;
    border-radius: 0;
  }

  .detail-modal-shell {
    padding: 14px;
  }

  .detail-close-btn {
    top: 14px;
    right: 14px;
  }
}
