:root {
  --ink: #282442;
  --paper: #f4f2fa;
  --surface: #ffffff;
  --line: #e3dff0;
  --muted: #77728c;
  --accent: #6353b3;
  --accent-deep: #4c3b97;
  --teal: #287d90;
  --shadow: 0 10px 28px rgb(61 46 105 / 8%);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
.film-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.masthead { position: sticky; top: 0; z-index: 10; background: rgb(250 248 255 / 96%); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.masthead .film-shell { min-height: 68px; display: flex; align-items: center; gap: 22px; }
.brand-mark { flex: 0 0 auto; color: var(--ink); font-size: 23px; font-weight: 800; letter-spacing: 0; }
.brand-mark em { color: var(--accent); font-style: normal; }
.brand-mark span { margin-left: 7px; color: var(--teal); font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: 0; vertical-align: middle; }
.genre-nav { display: flex; flex: 1; gap: 18px; align-items: center; }
.genre-nav a { color: #57516e; font-size: 14px; white-space: nowrap; }
.genre-nav a:hover, .genre-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.quick-search { display: flex; min-width: 220px; border: 1px solid var(--line); background: var(--surface); }
.quick-search input { width: 100%; min-width: 0; padding: 7px 10px; border: 0; outline: 0; background: transparent; }
.quick-search button, .action-button { cursor: pointer; border: 1px solid var(--accent); padding: 8px 14px; background: var(--accent); color: #fff; font-weight: 700; }
.quick-search button { flex-shrink: 0; white-space: nowrap; padding: 7px 11px; }
.nav-toggle { display: none; border: 0; background: transparent; color: var(--ink); font-weight: 700; }
.spotlight { position: relative; min-height: 350px; margin: 0 0 30px; border-radius: 22px; overflow: hidden; background: var(--ink); color: #fff; }
.spotlight::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(40 36 66 / 100%) 42%, rgb(40 36 66 / 55%) 70%, rgb(40 36 66 / 10%) 100%); }
.spotlight__bg { position: absolute; inset: 0 0 0 auto; width: 55%; height: 100%; object-fit: cover; }
.spotlight__inner { position: relative; z-index: 1; width: min(660px, 65%); padding: 46px 40px; }
.spotlight__kicker, .block-kicker { margin: 0 0 8px; color: var(--accent); font: 700 12px/1.3 ui-monospace, monospace; letter-spacing: 0; text-transform: uppercase; }
.spotlight__kicker { color: #c2b4ff; }
.spotlight h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.13; }
.spotlight__meta { display: flex; gap: 14px; color: #e5dff2; }
.spotlight__score { color: #fff2a7; font-weight: 700; }
.spotlight__plot { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; max-width: 48ch; color: #e5dff2; }
.spotlight__actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.action-button--ghost { border-color: currentColor; background: transparent; color: var(--accent); }
.spotlight .action-button--ghost { color: #fff; }
.action-button--sm { padding: 5px 10px; font-size: 13px; }
.breadcrumb { margin: 17px 0; color: var(--muted); font-size: 13px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: #b1a8c5; }
.category-switch, .opts, .line-tabs, .feature-card__tags, .tag-cloud, .region-list { display: flex; flex-wrap: wrap; gap: 8px; }
.category-switch { margin: 22px 0; }
.category-switch button, .tag, .tag-cloud a, .region-list a, .opts a, .line-tabs a { border: 1px solid var(--line); padding: 4px 9px; background: var(--surface); color: #625c77; font-size: 13px; }
.category-switch button { cursor: pointer; }
.category-switch button.is-active, .opts .is-active, .line-tabs .is-active { border-color: var(--accent); background: var(--accent); color: #fff; }
.content-columns { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: start; }
.content-section { margin: 28px 0; }
.block-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.block-heading h1, .block-heading h2, .rail-panel h2, .episode-panel h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.more, .meta, .subtitle, .play-meta { color: var(--muted); font-size: 13px; }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feature-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 210px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.feature-card__poster, .film-poster { position: relative; background: #e9e5f4; overflow: hidden; }
.feature-card__poster img { width: 100%; height: 100%; object-fit: cover; }
.feature-card__body { min-width: 0; padding: 14px; }
.feature-card__top { display: flex; gap: 10px; justify-content: space-between; }
.feature-card__title { margin: 0; font-size: 17px; overflow-wrap: anywhere; line-height: 1.3; }
.feature-card__score, .score-pill, .rating .num { color: var(--accent); font-weight: 800; }
.feature-card__plot { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: #625c77; font-size: 14px; }
.feature-card__foot { margin-top: 12px; }
.badge, .status, .score-pill { position: absolute; z-index: 1; padding: 3px 7px; font-size: 12px; }
.badge { top: 0; left: 0; background: var(--teal); color: #fff; }
.score-pill { top: 0; right: 0; background: #efe8ff; }
.status { right: 0; bottom: 0; background: rgb(15 30 40 / 84%); color: #fff; }
.poster-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.poster-card { min-width: 0; }
.poster-card .film-poster { aspect-ratio: 2 / 3; border-radius: 14px; }
.poster-card .film-poster img { width: 100%; height: 100%; object-fit: cover; }
.poster-card .title { overflow: hidden; margin: 8px 0 2px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.poster-card .meta { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.rail-panel, .catalog-filters, .synopsis-panel { border-radius: 16px; margin-bottom: 18px; padding: 17px; border: 1px solid var(--line); background: var(--surface); }
.rail-panel h2 { margin-bottom: 12px; font-size: 18px; }
.chart-list { padding: 0; margin: 0; list-style: none; }
.chart-list li { display: grid; grid-template-columns: 25px 1fr 34px; gap: 7px; align-items: center; padding: 7px 0; border-bottom: 1px solid #eeeaf6; }
.chart-list li:last-child { border: 0; }
.no { color: var(--muted); font-family: ui-monospace, monospace; }
.no.top { color: var(--accent); font-weight: 800; }
.rk-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-score { color: var(--accent); text-align: right; font-size: 13px; font-weight: 700; }
.catalog-filters { margin-top: 0; }
.catalog-filter-row { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid #eeeaf6; }
.catalog-filter-row:last-child { border: 0; }
.catalog-filter-row .label { color: var(--muted); font-size: 13px; }
.detail-summary { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 25px; padding: 24px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.detail-summary > .film-poster { aspect-ratio: 2 / 3; border-radius: 14px; align-self: start; }
.detail-summary > .film-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-copy h1 { margin: 0; font-size: 31px; line-height: 1.24; }
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 13px 0; }
.stars { color: #b17c20; letter-spacing: 2px; }
.info-list { padding: 0; list-style: none; }
.info-list li { padding: 3px 0; color: #625c77; }
.synopsis-panel p { margin: 0; color: #625c77; }
.comments { padding-top: 4px; }
.comment-form { display: grid; gap: 10px; padding: 15px; background: var(--surface); border: 1px solid var(--line); }
.comment-form__row { display: flex; gap: 10px; }
.comment-form input, .comment-form select, .comment-form textarea { width: 100%; border: 1px solid var(--line); padding: 8px; background: #fff; }
.comment-list { padding: 0; list-style: none; }
.comment-item { display: flex; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-avatar { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; }
.comment-body { min-width: 0; }
.comment-meta, .comment-foot { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.comment-body p { margin: 5px 0; }
.viewing-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
.resolution-compare { border-radius: 20px; padding: 20px; background: #242039; color: #f7f5ff; }
.resolution-compare__toolbar, .resolution-compare__controls, .resolution-pane__head, .play-title-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.resolution-compare__status, .resolution-compare__hint { color: #d0c9e4; font-size: 13px; }
.resolution-compare__controls .action-button { padding: 5px 8px; }
.resolution-compare__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.resolution-pane h2 { margin: 12px 0 7px; font-size: 15px; }
.player { position: relative; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; }
.res-badge { position: absolute; right: 7px; bottom: 7px; padding: 3px 5px; background: rgb(0 0 0 / 65%); font: 11px ui-monospace, monospace; }
.play-title-bar { margin-top: 15px; }
.play-title-bar h1 { margin: 0; font-size: 24px; }
.episode-panel { align-self: start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.episode-links { display: flex; flex-wrap: wrap; gap: 6px; }
.episode-links a { border-radius: 8px; min-width: 34px; padding: 4px 7px; border: 1px solid var(--line); text-align: center; font-size: 13px; }
.episode-links a[aria-current="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.page-footer { background: #ebe7f5; margin-top: 45px; padding: 25px 0; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 13px; }
.bottom-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.welcome-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px 0 8px; }
.welcome-panel h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); line-height: 1.35; }
.welcome-panel p:last-child { margin-bottom: 0; color: var(--muted); }
.category-switch button, .tag, .tag-cloud a, .region-list a, .opts a, .line-tabs a { border-radius: 8px; }
.action-button, .quick-search { border-radius: 10px; }
.action-button { display: inline-flex; align-items: center; justify-content: center; }
.action-button:hover, .quick-search button:hover { filter: brightness(.94); }
.quick-search { overflow: hidden; }
.brand-mark span { color: var(--accent); letter-spacing: 1px; }
.genre-nav a[aria-current="page"] { background: #eee9fc; border-radius: 8px; padding: 5px 9px; }
.home-page .content-columns > .content-section, .catalog-page .content-columns > .content-section { margin-top: 0; min-width: 0; }
.info-rail, .content-columns > article, .content-columns > aside, .viewing-layout > div { min-width: 0; }
.detail-page { grid-template-columns: minmax(0, 1fr) 250px; }
.detail-page .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.episode-panel .episode-links { max-height: 140px; overflow-y: auto; }
.detail-page #episodes .episode-links { margin-top: 14px; max-height: 230px; overflow-y: auto; }
.feature-card__meta, .feature-card__region { margin: 8px 0; font-size: 12px; color: var(--muted); }
.feature-card__tags { gap: 5px; }
.feature-card__tags .tag { padding: 2px 6px; font-size: 12px; }
.feature-card__score { flex: 0 0 auto; }
.comment-form { border-radius: 16px; }
.comment-form input, .comment-form select, .comment-form textarea { min-width: 0; border-radius: 8px; }
.comment-replies { list-style: none; margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: #eeebf7; }
.comment-replies li { display: flex; gap: 10px; }
.comment-avatar--sm { flex-basis: 26px; width: 26px; height: 26px; font-size: 12px; }
.resolution-compare .action-button--ghost { color: #e7e0ff; border-color: #807397; }
.resolution-compare__controls { flex-wrap: wrap; justify-content: flex-end; }
.res-select select { max-width: 100%; border: 1px solid #807397; border-radius: 6px; padding: 4px; background: #39314f; color: #fff; }
.player-res-inner { height: 100%; }
.player { border-radius: 12px; }
.catalog-empty { padding: 20px; color: var(--muted); }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 801px) and (max-width: 1080px) {
  .masthead .film-shell { flex-wrap: wrap; gap: 14px; padding: 14px 0; }
  .quick-search { flex: 1 0 100%; }
  .content-columns { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  .detail-page { grid-template-columns: minmax(0, 1fr) 220px; }
  .feature-list { grid-template-columns: 1fr; }
  .detail-summary { grid-template-columns: minmax(0, 1fr) 150px; padding: 18px; gap: 18px; }
  .resolution-compare__toolbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 800px) {
  .masthead .film-shell { flex-wrap: wrap; gap: 12px; padding: 12px 0; }
  .nav-toggle { display: block; margin-left: auto; }
  .genre-nav { display: none; order: 4; flex-basis: 100%; padding-top: 8px; overflow-x: auto; }
  .masthead.is-open .genre-nav { display: flex; }
  .quick-search { order: 3; flex: 1 0 100%; }
  .spotlight { min-height: 320px; margin-top: 0; }
  .spotlight__inner { padding: 42px 24px; }
  .content-columns, .viewing-layout { grid-template-columns: 1fr; }
  .detail-page > aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .home-page .info-rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .info-rail .rail-panel { margin-bottom: 0; }
  .info-rail { margin-bottom: 20px; }
  .catalog-page .info-rail > .rail-panel { display: none; }
  .catalog-filter-row { grid-template-columns: 50px minmax(0, 1fr); }
  .catalog-filters { margin-bottom: 0; }
  .detail-summary { grid-template-columns: minmax(0, 1fr) 180px; }
  .resolution-compare__toolbar { flex-direction: column; align-items: flex-start; }
  .resolution-compare__controls { justify-content: flex-start; }
  .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .feature-list { grid-template-columns: 1fr; }
  .home-page .info-rail { grid-template-columns: 1fr; }
  .home-page .info-rail .rail-panel:not(:first-child) { display: none; }
  .home-page .chart-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .welcome-panel { align-items: flex-start; flex-direction: column; padding-top: 22px; }
  .welcome-panel > .action-button { align-self: flex-start; }
  .spotlight__inner { width: 100%; padding: 30px 22px; }
  .spotlight__bg { width: 100%; opacity: .35; }
  .spotlight::after { background: linear-gradient(90deg, rgb(40 36 66 / 94%), rgb(40 36 66 / 56%)); }
  .detail-page > aside { grid-template-columns: 1fr; }
  .detail-page .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comment-form__row { flex-direction: column; }
  .block-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .resolution-compare__grid { grid-template-columns: 1fr; }
  .resolution-compare { padding: 12px; }
  .duo-nav { min-width: 0; }
}

@media (max-width: 560px) {
  .film-shell { width: min(100% - 24px, 1240px); }
  .spotlight h1 { font-size: 34px; }
  .feature-card { grid-template-columns: 110px minmax(0, 1fr); min-height: 170px; }
  .feature-card__body { padding: 10px; }
  .feature-card__plot { display: none; }
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-summary { grid-template-columns: minmax(0, 1fr) 110px; padding: 12px; gap: 14px; }
  .detail-copy h1 { font-size: 22px; }
  .info-list { font-size: 13px; }
  .resolution-compare__grid { grid-template-columns: 1fr; }
  .resolution-compare__toolbar, .play-title-bar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 360px) { .detail-summary { grid-template-columns: 1fr; } .detail-summary > .film-poster { width: 130px; } .home-page .chart-list { grid-template-columns: 1fr; } }
