:root {
  --ink: #1e1d1b;
  --muted: #666058;
  --paper: #f5f0e6;
  --paper-strong: #fffaf0;
  --line: #d9cfc0;
  --rust: #a94731;
  --teal: #12676f;
  --olive: #657344;
  --gold: #be8a2f;
  --night: #24282e;
  --card: #fff8ec;
  --shadow: 0 18px 40px rgba(30, 29, 27, 0.14);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(30, 29, 27, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(30, 29, 27, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

.copy-buffer {
  position: fixed;
  left: -9999px;
  top: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 230, 0.92);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--rust);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.1;
  white-space: nowrap;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper-strong);
  font-weight: 800;
}

.icon-button:hover {
  background: var(--ink);
  color: var(--paper-strong);
}

#openAchievementsBtn > span:first-child {
  font-size: 14px;
  line-height: 1;
}

#openFeedbackBtn > span:first-child {
  font-size: 19px;
  line-height: 1;
}

.count-pill {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--rust);
  color: white;
  font-size: 11px;
  line-height: 20px;
}

.achievement-count {
  background: var(--teal);
}

.watched-count {
  background: var(--olive);
}

.share-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper-strong);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.share-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.achievement-modal,
.feedback-modal,
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
}

.achievement-modal.open,
.feedback-modal.open,
.share-modal.open {
  display: block;
}

.achievement-backdrop,
.feedback-backdrop,
.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 29, 27, 0.42);
}

.achievement-panel,
.feedback-panel,
.share-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow-y: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.98);
  box-shadow: var(--shadow);
}

.achievement-close,
.feedback-close,
.share-close {
  position: sticky;
  top: 14px;
  float: right;
  z-index: 2;
  margin: 14px 14px 0 0;
}

.achievement-head,
.feedback-head,
.share-head {
  padding: 24px 24px 14px;
  border-bottom: 1px solid var(--line);
}

.achievement-head h2,
.feedback-head h2,
.share-head h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.achievement-head p:last-child,
.feedback-head p:last-child,
.share-head p:last-child {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.feedback-form {
  display: grid;
  gap: 12px;
  padding: 18px 24px 24px;
}

.hidden-field {
  position: absolute !important;
  left: -9999px !important;
  display: none !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.feedback-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
}

.feedback-box h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.feedback-form input[type="text"],
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}

.feedback-form input[type="text"] {
  min-height: 38px;
  padding: 0 10px;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 82px;
  padding: 10px;
  line-height: 1.55;
}

.share-preview {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  margin: 0 24px;
  padding: 12px;
  border: 1px solid rgba(30, 29, 27, 0.12);
  border-radius: 8px;
  background: #fffdf8;
}

.share-preview.share-preview-picks {
  grid-template-columns: 84px 1fr;
  background:
    radial-gradient(circle at 14% 18%, rgba(190, 138, 47, 0.18), transparent 34%),
    linear-gradient(135deg, #fffaf0, #eee2cf);
}

.share-preview.share-preview-generated {
  grid-template-columns: 132px 1fr;
  align-items: start;
  background: #fffaf0;
}

.share-preview img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(30, 29, 27, 0.16);
}

.share-preview.share-preview-picks img {
  width: 84px;
  height: 118px;
}

.share-preview img.share-generated-image {
  width: 132px;
  height: 176px;
  object-fit: cover;
}

.share-preview strong,
.share-preview span {
  display: block;
}

.share-preview strong {
  font-size: 16px;
  font-weight: 900;
}

.share-preview span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.share-preview-list {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  color: #3c3731;
  font-size: 12px;
  font-weight: 800;
}

.share-download-link {
  display: inline-flex;
  margin-top: 12px;
  text-decoration: none;
}

.share-groups {
  display: grid;
  gap: 16px;
  padding: 18px 24px 24px;
}

.share-group h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.share-option {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
}

.share-option strong,
.share-option span {
  display: block;
}

.share-option strong {
  font-size: 14px;
  font-weight: 900;
}

.share-option span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.share-option:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-strong);
}

.share-option-featured {
  border-color: rgba(169, 71, 49, 0.42);
  background: linear-gradient(135deg, rgba(255, 248, 236, 0.98), rgba(244, 222, 187, 0.98));
}

.share-option:hover span {
  color: rgba(255, 250, 240, 0.74);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.feedback-success {
  margin: 0;
  padding: 24px;
  color: var(--teal);
  font-size: 18px;
  font-weight: 900;
}

.achievement-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 24px 0;
}

.achievement-summary strong {
  font-size: 34px;
  line-height: 1;
}

.achievement-summary span {
  color: var(--muted);
  font-weight: 800;
}

.achievement-list {
  display: grid;
  gap: 10px;
  padding: 18px 24px 24px;
}

.achievement-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.achievement-card.unlocked {
  border-color: rgba(18, 103, 111, 0.42);
  background: #f4fbf8;
}

.achievement-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.achievement-card.unlocked .achievement-icon {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--paper-strong);
}

.achievement-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.achievement-title-row h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.achievement-title-row span {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.achievement-card p {
  margin-bottom: 10px;
  color: #4d453c;
  line-height: 1.5;
}

.achievement-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(30, 29, 27, 0.12);
}

.achievement-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 28px;
  padding: 24px 28px 40px;
}

.control-rail {
  position: static;
  align-self: start;
}

.decision-panel,
.summary-strip,
.collection-tile,
.movie-card,
.drawer-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.92);
}

.decision-panel {
  padding: 20px;
  box-shadow: var(--shadow);
}

.filter-sticky-tools {
  position: sticky;
  top: 86px;
  z-index: 12;
  display: grid;
  gap: 12px;
  margin: 0 -8px 18px;
  padding: 14px 8px 16px;
  border-bottom: 1px solid rgba(217, 207, 192, 0.84);
  background: rgba(255, 248, 236, 0.96);
  backdrop-filter: blur(12px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mobile-filter-close {
  display: none;
}

.mobile-filter-actions {
  display: none;
}

.search-box {
  margin: 0;
}

.search-box label,
.filter-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input[type="search"],
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
}

input[type="search"] {
  padding: 0 12px;
}

select {
  padding: 0 10px;
}

.filter-group {
  margin: 18px 0;
}

.filter-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.text-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 700;
}

.chip {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.chip:hover,
.chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-strong);
}

.filter-row {
  margin-top: 0;
}

.rail-clear-button {
  width: 100%;
}

.content-area {
  min-width: 0;
}

.mobile-filter-bar {
  display: none;
}

.summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 248, 236, 0.96), rgba(224, 215, 196, 0.96));
}

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

.summary-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.score-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
  min-width: 260px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.score-legend div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.legend-dot {
  flex: 0 0 auto;
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0;
  border-radius: 999px;
}

.legend-dot.tonight {
  background: var(--teal);
}

.legend-dot.canon {
  background: var(--rust);
}

.season-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px 20px 18px;
  overflow: hidden;
  border: 1px solid rgba(169, 71, 49, 0.34);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(238, 226, 207, 0.9));
  box-shadow: 0 12px 28px rgba(30, 29, 27, 0.08);
}

.season-banner::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--rust), var(--teal), var(--gold));
}

.season-copy {
  position: relative;
  min-width: 0;
}

.season-copy p:last-child {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.season-button {
  position: relative;
  min-width: 126px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper-strong);
  font-weight: 800;
}

.season-button:hover,
.season-button.active {
  border-color: var(--rust);
  background: var(--rust);
}

.collections,
.tonight-picker,
.observation-section,
.movie-section {
  margin-top: 26px;
  scroll-margin-top: 96px;
}

.section-head {
  margin-bottom: 14px;
}

.section-head.inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.results-toolbar {
  position: sticky;
  top: 76px;
  z-index: 15;
  margin: 0 -8px 14px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(217, 207, 192, 0.8);
  background: rgba(245, 240, 230, 0.92);
  backdrop-filter: blur(12px);
}

.text-button {
  min-height: 36px;
  padding: 0 12px;
}

.text-button:hover {
  border-color: var(--rust);
  color: var(--rust);
}

.text-button.active {
  border-color: var(--rust);
  background: rgba(169, 71, 49, 0.1);
  color: var(--rust);
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.intent-button {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  text-align: left;
}

.intent-button:hover,
.intent-button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-strong);
}

.intent-button strong,
.intent-button span {
  display: block;
}

.intent-button strong {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.2;
}

.intent-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.intent-button:hover span,
.intent-button.active span {
  color: rgba(255, 250, 240, 0.74);
}

.recommendation-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 248, 236, 0.98), rgba(238, 226, 207, 0.94));
  box-shadow: 0 14px 30px rgba(30, 29, 27, 0.1);
}

.recommendation-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 0;
}

.recommendation-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(0, 1.9fr);
  gap: 14px;
  min-height: 365px;
  padding: 18px;
}

.hero-recommendation,
.alt-recommendation {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
}

.hero-recommendation {
  overflow: hidden;
  min-height: 327px;
}

.hero-recommendation .poster-card {
  min-height: 0;
  height: 218px;
}

.hero-recommendation-body,
.alt-recommendation {
  min-height: 116px;
  padding: 14px;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(30, 29, 27, 0.08);
  background: linear-gradient(110deg, rgba(255, 250, 240, 0.72), rgba(232, 220, 202, 0.92), rgba(255, 250, 240, 0.72));
  background-size: 220% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes skeletonShimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.recommendation-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(18, 103, 111, 0.12);
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.recommendation-reason {
  margin: 10px 0 12px;
  color: #3c3731;
  font-size: 14px;
  line-height: 1.5;
}

.alt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.alt-recommendation:hover,
.hero-recommendation:hover {
  border-color: var(--ink);
}

.alt-recommendation h3 {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alt-meta {
  overflow: hidden;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-score-row strong {
  color: var(--ink);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.collection-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  text-align: left;
}

.collection-tile:hover {
  border-color: var(--ink);
  box-shadow: 0 10px 24px rgba(30, 29, 27, 0.12);
}

.collection-tile strong {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-tile span {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.observation-section {
  display: grid;
  gap: 12px;
}

.observation-section .section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.observation-intro {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.observation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.observation-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: stretch;
  min-height: 110px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.observation-card:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
  box-shadow: 0 8px 18px rgba(30, 29, 27, 0.1);
}

.observation-thumb {
  display: grid;
  place-items: center;
  min-height: 100%;
  overflow: hidden;
  font-size: 20px;
  font-weight: 900;
}

.observation-thumb.has-image {
  background: var(--night);
}

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

.observation-body {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
}

.observation-body h3 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.observation-body p {
  margin: 0;
  color: #38342f;
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.movie-card {
  overflow: hidden;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.movie-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 14px 28px rgba(30, 29, 27, 0.16);
}

.poster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  contain: layout paint;
  min-height: 250px;
  padding: 16px;
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 42%),
    var(--poster-color, var(--night));
}

.poster-card.has-image {
  background: var(--poster-color, var(--night));
}

.poster-card.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(18, 18, 17, 0.28), rgba(18, 18, 17, 0.08) 36%, rgba(18, 18, 17, 0.84)),
    linear-gradient(90deg, rgba(18, 18, 17, 0.42), transparent 62%);
  pointer-events: none;
}

.poster-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 2;
  border: 1px solid rgba(255, 250, 240, 0.45);
  pointer-events: none;
}

.poster-rank {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  padding: 4px 7px;
  border: 1px solid rgba(255, 250, 240, 0.6);
  color: #fffaf0;
  font-size: 12px;
  font-weight: 800;
}

.poster-title {
  position: relative;
  z-index: 3;
}

.poster-title .cn {
  display: block;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.12;
}

.poster-title .en {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.86;
}

.card-body {
  padding: 14px;
}

.meta-line,
.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
}

.meta-line span,
.tag-line span {
  display: inline-grid;
  place-items: center;
  min-height: 23px;
  padding: 0 7px;
  border: 1px solid rgba(217, 207, 192, 0.88);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.canon-status {
  color: var(--accent);
}

.card-copy {
  min-height: 62px;
  margin: 10px 0 12px;
  color: #38342f;
  font-size: 14px;
  line-height: 1.45;
}

.score-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.score-box {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
}

.score-box span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.score-box strong {
  font-size: 22px;
}

.bar {
  overflow: hidden;
  height: 5px;
  margin-top: 6px;
  border-radius: 999px;
  background: #e4d8c8;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar.tonight i {
  background: var(--teal);
}

.bar.canon i {
  background: var(--rust);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 38px 38px;
  gap: 8px;
}

.primary-button,
.mark-button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper-strong);
  font-weight: 800;
}

.primary-button:hover,
.mark-button:hover,
.mark-button.active {
  background: var(--rust);
  border-color: var(--rust);
}

.empty-state {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.empty-clear-button {
  margin-top: 16px;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.drawer.open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 29, 27, 0.42);
}

.drawer-panel {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(560px, calc(100vw - 36px));
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.drawer-close {
  position: sticky;
  top: 14px;
  float: right;
  z-index: 2;
  margin: 14px 14px 0 0;
}

.drawer-hero {
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-hero .poster-card {
  min-height: 260px;
  border-radius: 6px;
}

.drawer-main h2 {
  margin: 0 46px 8px 0;
  font-size: 28px;
}

.drawer-main .subtitle {
  color: var(--muted);
  font-weight: 700;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.drawer-body {
  display: grid;
  gap: 16px;
  padding: 20px 22px 24px;
}

.insight-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.insight-block h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.insight-block p {
  margin-bottom: 0;
  color: #3c3731;
  line-height: 1.6;
}

.fit-block {
  background: #fff8ea;
}

.fit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.fit-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(30, 29, 27, 0.12);
  border-radius: 999px;
  background: #fffdf8;
  color: #4d453c;
  font-size: 12px;
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.detail-cell {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.78);
}

.detail-cell span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-cell strong {
  font-size: 15px;
}

.related-list {
  display: grid;
  gap: 8px;
}

.related-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
}

.related-list button:hover {
  border-color: var(--ink);
}

.source-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .control-rail {
    position: static;
  }

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

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

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

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

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

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

@media (max-width: 760px) {
  body.mobile-filters-open {
    overflow: hidden;
  }

  body.mobile-filters-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(30, 29, 27, 0.42);
  }

  .topbar {
    align-items: center;
    gap: 10px;
    padding: 14px;
  }

  h1 {
    font-size: 21px;
  }

  .top-actions {
    flex: none;
    gap: 4px;
  }

  .icon-button {
    min-width: 32px;
    height: 36px;
    padding: 0 7px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 14px;
  }

  .content-area {
    order: 1;
  }

  .control-rail {
    display: none;
  }

  body.mobile-filters-open .control-rail {
    position: fixed;
    top: 76px;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 30;
    display: block;
    height: calc(100dvh - 90px);
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .decision-panel {
    padding: 16px;
  }

  .filter-sticky-tools {
    position: static;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  body.mobile-filters-open .decision-panel {
    min-height: 100%;
    box-shadow: var(--shadow);
  }

  .mobile-filter-close {
    display: inline-grid;
    place-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fffdf8;
    color: var(--ink);
    font-weight: 800;
  }

  .mobile-filter-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    margin: 18px -16px -16px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--line);
    background: rgba(255, 248, 236, 0.96);
    backdrop-filter: blur(12px);
  }

  .mobile-filter-actions .primary-button {
    width: 100%;
  }

  .mobile-filter-bar {
    position: sticky;
    top: 74px;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 248, 236, 0.94);
    backdrop-filter: blur(12px);
  }

  .mobile-filter-toggle {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: var(--paper-strong);
    font-weight: 800;
  }

  .mobile-filter-toggle[aria-expanded="true"] {
    border-color: var(--rust);
    background: var(--rust);
  }

  #mobileFilterSummary {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
  }

  .summary-strip {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .score-legend {
    justify-content: flex-start;
    min-width: 0;
  }

  .results-toolbar {
    top: 132px;
    margin-right: -4px;
    margin-left: -4px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .season-banner {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .season-button {
    width: 100%;
  }

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

  .intent-button {
    min-height: 68px;
  }

  .recommendation-head {
    flex-direction: column;
    padding: 16px 16px 0;
  }

  .recommendation-layout {
    padding: 16px;
  }

  .collection-grid,
  .observation-grid,
  .movie-grid,
  .drawer-hero,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .recommendation-panel .alt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-tile {
    min-height: auto;
  }

  .drawer-panel {
    inset: auto 0 0;
    width: 100%;
    max-height: 92vh;
    border-radius: 8px 8px 0 0;
  }

  .drawer-hero .poster-card {
    min-height: 220px;
  }
}
