:root {
  color-scheme: dark;
  --bg: #111310;
  --panel: #1a1d18;
  --raised: #22251f;
  --line: #32372e;
  --text: #f3f4ec;
  --muted: #acb0a4;
  --soft: #868c80;
  --accent: #d9f77a;
  --ink: #202713;
  --danger: #ffaaa3;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --display: "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  font: 100%/1.55 var(--sans);
  background: var(--bg);
  color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select, input[type="checkbox"] { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; opacity: .55; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: calc(100% - 100px); max-width: 1320px; margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { border-bottom: 1px solid #282c24; }
.header-inner, .admin-header { min-height: 75px; display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; }
.brand { display: inline-flex; justify-self: start; align-items: center; gap: .65rem; font-size: 1.13rem; font-weight: 750; line-height: 1.2; letter-spacing: .06em; white-space: nowrap; }
.brand-sub { display: block; color: var(--soft); font-size: .64rem; letter-spacing: .14em; margin-top: .3rem; font-weight: 700; }
.site-nav { align-self: stretch; display: flex; gap: clamp(.35rem, 1.9vw, 2rem); }
.site-nav button { position: relative; border: 0; padding: .125rem .4rem 0; background: none; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.site-nav button:hover, .site-nav button[aria-pressed="true"] { color: var(--text); }
.site-nav button[aria-pressed="true"]::after { content: ""; position: absolute; bottom: 0; left: .4rem; right: .4rem; height: 2px; background: var(--accent); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: .65rem; }
.search { height: 40px; max-width: 200px; display: flex; gap: .45rem; align-items: center; padding: 0 .65rem; border: 1px solid var(--line); background: #1b1e19; border-radius: 8px; }
.search:focus-within { border-color: var(--accent); }
.search input { width: 100%; padding: 0; border: 0; background: transparent; outline: 0; color: var(--text); font-size: .86rem; min-width: 0; }
.search svg, .icon-button svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.65; }
.search svg { color: var(--soft); }
.icon-button { display: inline-grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; color: var(--text); border: 1px solid var(--line); background: var(--panel); border-radius: 8px; }
.icon-button:hover { background: var(--raised); border-color: #555e4a; }
.hero { position: relative; isolation: isolate; display: grid; align-items: end; overflow: hidden; min-height: clamp(350px, 30vw, 448px); margin-top: 27px; border: 1px solid #343c32; border-radius: 15px; background: #192b29; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #101711 1%, #101711f1 18%, #101711bd 35%, #10171146 66%, transparent 100%), linear-gradient(0deg, #1014107a 0%, transparent 42%); }
.hero-image { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
.hero-image.portrait { left: auto; width: 69%; object-position: center 46%; }
.hero-content { max-width: 610px; padding: clamp(28px, 4vw, 63px); }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1.55rem; color: var(--accent); font-size: .86rem; font-weight: 700; letter-spacing: .13em; }
.eyebrow span:first-child { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.hero-subtitle { font-size: clamp(.72rem, 1.2vw, .9rem); letter-spacing: .23em; color: #c9d5bb; font-weight: 650; overflow-wrap: anywhere; }
.hero h1 { font-family: var(--display); font-size: clamp(2.65rem, 5.1vw, 4.65rem); line-height: 1.13; font-weight: 800; letter-spacing: .05em; margin: .4rem 0 .8rem; overflow-wrap: anywhere; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { color: #c7d4c2; font-size: .88rem; }
.hero-summary { margin-top: .8rem; color: #e0e5d9; line-height: 1.72; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero .button { margin-top: 1.5rem; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .55rem; min-height: 42px; padding: .52rem .95rem; border: 1px solid transparent; border-radius: 8px; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.primary { color: var(--ink); background: var(--accent); }
.primary:hover { background: #e4ff9b; }
.secondary { border-color: var(--line); color: var(--text); background: var(--panel); }
.secondary:hover { background: var(--raised); border-color: #555e4a; }
.danger { color: var(--danger); background: transparent; border-color: #704b47; }
.danger:hover { background: #412b29; }
.catalog { margin: 2.25rem 0 3rem; scroll-margin: 1rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .7rem; }
.section-heading h2 { font-size: 1.65rem; letter-spacing: .06em; }
.section-title p { color: var(--soft); font-size: .88rem; }
.select-group { display: flex; flex-wrap: wrap; gap: .6rem; }
select { appearance: none; color: var(--text); border: 1px solid var(--line); background: var(--panel); border-radius: 8px; min-height: 39px; padding: .38rem 2rem .38rem .68rem; }
.select-group label, .form-grid label:has(select) { position: relative; }
.select-group label::after, .form-grid label:has(select)::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); position: absolute; right: .82rem; bottom: 1.06rem; pointer-events: none; }
.select-group select { font-size: .86rem; }
.chips { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin: .85rem 0 1.25rem; }
.chips button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: .875rem; border-radius: 99px; padding: .3rem .78rem; }
.chips button:hover { color: var(--text); border-color: #666f56; }
.chips button[aria-pressed="true"] { background: #303a1d; color: var(--accent); border-color: #63773b; }
.catalog-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.4rem 1rem; }
.film-card { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; min-width: 0; }
.poster { display: grid; place-items: center; position: relative; isolation: isolate; aspect-ratio: 2 / 3; background: #242b23; border: 1px solid #3a4034; border-radius: 10px; overflow: hidden; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 240ms ease; }
.film-card:hover .poster { border-color: #869856; }
.film-card:hover .poster img { transform: scale(1.04); }
.poster-status { z-index: 1; position: absolute; top: .55rem; left: .55rem; max-width: calc(100% - 1.1rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: .76rem; color: #eaf0e1; background: #151a14e8; border: 1px solid #e4efdc2b; padding: .18rem .46rem; border-radius: 5px; }
.poster-status.ongoing { color: var(--accent); }
.card-title { display: block; margin-top: .52rem; font-weight: 720; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-meta { display: block; color: var(--muted); font-size: .8rem; margin-top: .12rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.empty { display: grid; place-items: center; min-height: 140px; padding: 1.2rem; border: 1px dashed var(--line); border-radius: 10px; text-align: center; color: var(--muted); }
.pagination { margin-top: 2rem; display: flex; gap: .9rem; align-items: center; justify-content: center; font-size: .875rem; color: var(--muted); }
.site-footer { border-top: 1px solid #282c24; color: var(--soft); }
.footer-inner { min-height: 69px; display: flex; justify-content: space-between; align-items: center; font-size: .85rem; }
.footer-inner a:hover { color: var(--text); }
.detail { width: min(680px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 1.75rem; border: 1px solid #48533e; border-radius: 15px; background: var(--panel); color: var(--text); }
.detail::backdrop { background: #080a08c7; }
.detail-close { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; }
.detail-header { display: grid; grid-template-columns: minmax(80px, 146px) 1fr; align-items: start; gap: 1.3rem; margin: 0 2.1rem 1.4rem 0; }
.detail h2 { font-size: clamp(1.5rem, 4vw, 2.15rem); line-height: 1.2; overflow-wrap: anywhere; }
.detail h3 { font-size: 1rem; margin: 0 0 .7rem; }
.detail-subtitle, .detail-meta, .detail-progress { margin: .42rem 0; color: var(--muted); overflow-wrap: anywhere; }
.detail-progress { color: var(--accent); font-size: .9rem; }
.detail-summary { margin-top: .7rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.resource-list { display: grid; gap: .55rem; }
.resource { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; padding: .7rem; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; }
.resource-name { display: flex; gap: .5rem; align-items: center; font-size: .95rem; font-weight: 700; }
.resource-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; font-size: .8rem; color: #171d0e; background: var(--accent); }
.resource-mark.baidu { background: #c7cbff; color: #1c2153; }
.resource-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.resource-actions code { color: var(--muted); }
.resource-actions .button { min-height: 36px; padding: .3rem .65rem; font-size: .84rem; }
.detail-foot { margin-top: .95rem; display: flex; justify-content: flex-end; }
.toast { position: fixed; z-index: 3; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 30px); background: var(--accent); color: var(--ink); border: 0; border-radius: 8px; padding: .6rem .9rem; font-weight: 700; text-align: center; }
.muted { color: var(--muted); }
.admin-main { min-height: calc(100vh - 80px); padding-block: 2.5rem 3.5rem; }
.admin-main h1 { font-size: 1.8rem; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.login-panel { width: min(100%, 440px); margin: 3rem auto; padding: 1.65rem; }
.login-panel p { margin: .35rem 0 1rem; }
.login-panel form { display: grid; gap: .85rem; }
.login-panel .button { justify-self: start; }
.workbench { margin-top: 1.15rem; display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.film-list, .editor { padding: 1.1rem; }
.film-list > input { margin-bottom: .6rem; }
.editor { padding: 1.4rem; }
.editor h2 { font-size: 1.35rem; }
.editor h3 { color: #dde8cc; font-size: 1rem; margin-bottom: .72rem; }
.form-section { border-top: 1px solid var(--line); margin-top: .95rem; padding-top: .95rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem .95rem; }
.full { grid-column: 1 / -1; }
.admin-main label { font-size: .9rem; color: #d5dace; }
.admin-main input:not([type="checkbox"]), .admin-main textarea, .admin-main select { display: block; width: 100%; min-width: 0; min-height: 41px; margin-top: .24rem; padding: .4rem .65rem; border: 1px solid #3b4035; border-radius: 7px; background: #131610; color: var(--text); }
.admin-main select { padding-right: 1.9rem; }
.admin-main textarea { resize: vertical; }
.admin-main input::placeholder, .admin-main textarea::placeholder { color: var(--soft); }
.cover-editor { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: .9rem; margin-bottom: .9rem; }
.cover-preview { display: grid; place-items: center; position: relative; aspect-ratio: 2 / 3; border: 1px dashed #55604b; border-radius: 7px; overflow: hidden; color: var(--soft); font-size: .76rem; }
.cover-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hint { color: var(--muted); font-size: .83rem; margin-top: .25rem; }
.required { color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: .4rem; }
.check input { width: 1rem; height: 1rem; accent-color: var(--accent); }
.recognize { margin: .55rem 0 .8rem; }
.editor-actions { display: flex; gap: .7rem 1rem; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .9rem; }
.save-row { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.error { color: var(--danger); font-size: .88rem; width: 100%; order: 4; }
.admin-item { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .42rem; text-align: left; border: 1px solid transparent; border-radius: 7px; background: none; min-width: 0; }
.admin-item:hover, .admin-item[aria-pressed="true"] { border-color: #4d5a40; background: var(--raised); }
.admin-item .poster { width: 34px; flex: 0 0 auto; border-radius: 5px; }
.admin-item > span { min-width: 0; }
.admin-item strong, .admin-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item small { color: var(--muted); font-size: .77rem; }
.list-empty { padding: .45rem 0; font-size: .86rem; color: var(--muted); }
@media (max-width: 1050px) {
  .shell { width: calc(100% - 64px); }
  .header-inner { grid-template-columns: auto 1fr auto; gap: .8rem; }
  .site-nav { justify-content: center; }
  .catalog-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .shell { width: calc(100% - 38px); }
  .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem .7rem; }
  .hero { min-height: 350px; }
}
@media (max-width: 640px) {
  .header-inner { grid-template-columns: auto minmax(0, 1fr); gap: 0 .55rem; padding-top: .6rem; }
  .brand img { width: 35px; height: 35px; }
  .brand { font-size: 1rem; gap: .45rem; }
  .site-nav { order: 3; grid-column: 1 / -1; height: 45px; justify-content: space-around; gap: .2rem; }
  .header-actions { gap: .4rem; min-width: 0; }
  .search { height: 35px; padding-inline: .4rem; }
  .icon-button { width: 35px; height: 35px; }
  .hero { margin-top: 16px; min-height: 330px; border-radius: 11px; }
  .hero-content { padding: 24px 20px; }
  .hero::after { background: linear-gradient(90deg, #101711d9, #1017114d), linear-gradient(0deg, #101410ed, transparent 80%); }
  .hero-image { object-position: 66% center; }
  .hero-image.portrait { width: 100%; }
  .eyebrow { margin-bottom: .85rem; }
  .hero-summary { font-size: .9rem; }
  .hero .button { margin-top: 1rem; }
  .catalog { margin-top: 1.45rem; }
  .section-heading { flex-wrap: wrap; gap: .5rem; }
  .section-heading h2 { font-size: 1.4rem; }
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workbench { grid-template-columns: 1fr; }
  .film-list { max-height: 220px; overflow: auto; }
  .admin-main { padding-top: 1.25rem; }
}
@media (max-width: 470px) {
  .shell { width: calc(100% - 28px); }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-meta { font-size: .8rem; }
  .form-grid { grid-template-columns: 1fr; }
  .detail { padding: 1.05rem; }
  .detail-header { grid-template-columns: minmax(68px, 95px) 1fr; gap: .7rem; margin-right: 1.8rem; }
  .detail-close { top: .65rem; right: .65rem; }
  .admin-header { gap: .45rem; }
  .admin-header .button { padding-inline: .45rem; font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
