:root {
  color-scheme: light;
  --ink: #251d20;
  --muted: #74676a;
  --rose: #ac3f53;
  --red: #d96279;
  --paper: #faf5f5;
  --line: #f1e7e8;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; min-width: 0; }
h1, h2, p, ol { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #ad4053; outline-offset: 3px; }
.inner { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; inset: 12px auto auto 12px; z-index: 10; padding: 9px 15px; background: white; border-radius: 8px; }
.top-nav { background: #fcf8f8; border-bottom: 1px solid var(--line); }
.nav-row { min-height: 64px; display: flex; align-items: center; gap: clamp(22px, 4vw, 50px); }
.logo { flex: none; }
.logo img { object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.1vw, 27px); white-space: nowrap; }
.nav-links a { color: #302527; padding: 21px 0; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--rose); }
.nav-links a[aria-current] { font-weight: 700; box-shadow: inset 0 -2px var(--red); }
.nav-links a.download-link { padding: 7px 11px; border-radius: 7px; font-weight: 650; color: var(--rose); background: #f7e0e6; }
.nav-links a.download-link:hover { background: #f3d1dc; }
.search-form { margin-left: auto; display: flex; align-items: center; width: 258px; background: white; border: 1px solid #eee0e2; border-radius: 999px; }
.search-form input { min-width: 0; width: 100%; padding: 9px 0 9px 15px; border: 0; color: inherit; background: none; border-radius: inherit; }
.search-form button { flex: none; width: 38px; height: 36px; display: grid; place-items: center; border: 0; background: none; }
.site-footer { padding: 30px 0; text-align: center; background: #f7eeee; color: var(--muted); border-top: 1px solid var(--line); }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; margin-bottom: 10px; }
.site-footer p { font-size: 12px; }
.banner { background: #181519; padding: 23px 0; overflow: hidden; }
.banner-inner { position: relative; }
.banner-track { min-height: 352px; display: grid; grid-template-columns: minmax(0, 2.65fr) repeat(2, minmax(0, 1fr)); gap: 12px; }
.banner-card { position: relative; min-width: 0; height: 352px; overflow: hidden; isolation: isolate; color: #fff; border-radius: 12px; background: #492d40; }
.banner-bg, .banner-shade { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.banner-shade { z-index: -1; background: linear-gradient(90deg, #1a121ce8, #2b1b2b85 75%); }
.banner-card.is-active .banner-bg { filter: blur(13px); transform: scale(1.12); }
.banner-card:not(.is-active) .banner-shade { background: linear-gradient(0deg, #1a131eea 0%, #1a131e38 60%); }
.banner-card:not(.is-active) .banner-kicker, .banner-card:not(.is-active) .banner-copy p,
.banner-card:not(.is-active) .banner-cta, .banner-card:not(.is-active) .banner-cover { display: none; }
.banner-body { position: relative; height: 100%; padding: 29px 30px 34px; display: flex; align-items: center; gap: 17px; }
.banner-card:not(.is-active) .banner-body { align-items: end; padding: 20px 18px; }
.banner-card:not(.is-active) h2 { font-size: 17px; }
.banner-copy { position: relative; min-width: 0; flex: 1; }
.banner-kicker { display: block; color: #ffbdca; font-size: 12px; letter-spacing: .13em; margin-bottom: 12px; }
.banner h2 { font-size: clamp(23px, 3vw, 37px); line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
.banner p { margin: 12px 0 20px; font-size: 13px; color: #f5e4ec; line-height: 1.65; }
.banner-cover { width: clamp(126px, 19vw, 238px); aspect-ratio: 1; object-fit: cover; border-radius: 12px; box-shadow: 0 12px 30px #170b1574; }
.banner-cta { display: inline-flex; gap: 9px; padding: 8px 12px; border-radius: 7px; font-weight: 650; background: #fff1f4; color: #702c42; }
.banner-controls { position: absolute; display: flex; gap: 6px; bottom: 9px; right: 9px; }
.banner-controls button { border: 1px solid #ffffff62; color: white; width: 31px; height: 30px; border-radius: 50%; background: #211924bb; font-size: 20px; line-height: 1; }
.home-content { padding-block: 16px 35px; }
.tag-bar { display: flex; align-items: center; gap: 12px; background: white; border-radius: 11px; padding: 12px 17px; margin-bottom: 15px; }
.tag-bar .tag-list { flex: 1; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip { display: inline-block; padding: 5px 11px; line-height: 1.3; border-radius: 6px; font-size: 12px; background: #f8eeee; color: #654953; }
.tag-chip:hover { background: #f9d9e1; color: #9e384b; }
.subtle-link { font-size: 13px; color: var(--rose); flex: none; }
.home-columns, .detail-columns { display: grid; grid-template-columns: minmax(0, 850px) minmax(257px, 1fr); align-items: start; gap: 18px; }
.panel { background: white; border-radius: 12px; padding: 19px; margin-bottom: 17px; min-width: 0; border: 1px solid #f3e9e9; }
.panel-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { font-size: 19px; }
.panel-head h2::before { content: ""; display: inline-block; height: .85em; width: 3px; margin-right: 8px; border-radius: 99px; background: var(--red); }
.work-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 19px 14px; }
.work-card { display: block; min-width: 0; }
.work-cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: #f3e5eb; }
.work-name, .work-state { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-name { font-weight: 560; margin-top: 7px; }
.work-state { color: var(--muted); font-size: 12px; margin-top: 3px; }
.work-card:hover .work-name, .rank-list a:hover .rank-name, .related-item:hover strong { color: var(--rose); }
.rank-list { padding: 0; list-style: none; }
.rank-list li + li { border-top: 1px solid var(--line); }
.rank-list .rank-row { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 46px; }
.rank-num { font-weight: 800; color: #6a5960; text-align: center; font-variant-numeric: tabular-nums; }
.rank-list li:nth-child(1) .rank-num { color: #ad3650; }
.rank-list li:nth-child(2) .rank-num { color: #9b5316; }
.rank-list li:nth-child(3) .rank-num { color: #236878; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rank-status, .muted { font-size: 12px; color: var(--muted); }
.detail-hero { position: relative; isolation: isolate; overflow: hidden; background: #f5e4e9; }
.detail-background, .detail-mask { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.detail-background { filter: blur(28px); transform: scale(1.12); opacity: .34; }
.detail-mask { background: linear-gradient(90deg, #fcf3f5e8, #fff0f1b7), linear-gradient(0deg, #faf5f5, transparent 55%); z-index: -1; }
.detail-wrap { padding: 19px 0 30px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 9px; color: #654f58; font-size: 12px; margin-bottom: 15px; }
.crumbs a:hover { color: var(--rose); }
.detail-info { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 25px; align-items: start; }
.detail-cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #f0dfe7; box-shadow: 0 14px 26px #3d263121; }
.detail-meta { max-width: 810px; min-width: 0; }
.detail-eyebrow { color: var(--rose); letter-spacing: .1em; font-size: 12px; margin-bottom: 6px; }
.detail-meta h1 { font-size: clamp(23px, 3vw, 34px); line-height: 1.24; margin-bottom: 9px; overflow-wrap: anywhere; }
.detail-status { margin-bottom: 10px; color: #614d55; }
.detail-status span { margin-left: 10px; }
.synopsis { margin-block: 12px; line-height: 1.72; white-space: pre-line; overflow-wrap: anywhere; }
.synopsis.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.primary-link { display: inline-block; color: white; background: var(--rose); border-radius: 8px; padding: 9px 14px; margin-right: 8px; }
.synopsis-toggle { border: 0; background: none; color: var(--rose); margin: 0 11px 8px 0; padding: 0; }
.detail-columns { padding-block: 18px 34px; }
.episode-group { border: 1px solid var(--line); border-radius: 9px; margin-top: 8px; }
.episode-group summary { cursor: pointer; padding: 10px 13px; background: #fbf4f5; border-radius: inherit; color: #764450; }
.episode-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; list-style: none; padding: 9px; }
.episode-list li { background: #fbf9fa; padding: 8px 9px; border-radius: 7px; display: flex; align-items: baseline; gap: 9px; min-width: 0; overflow-wrap: anywhere; }
.episode-num { color: #8b6975; flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.related-item { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 9px; align-items: center; margin-bottom: 11px; }
.related-cover { width: 52px; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: #f3e5eb; }
.related-item small { display: block; color: var(--muted); margin-top: 4px; }
.related-item strong { display: block; overflow-wrap: anywhere; }
.standalone { padding-block: 26px 40px; }
.page-head { margin-bottom: 19px; }
.page-head h1 { font-size: clamp(24px, 4vw, 33px); }
.page-head p { color: var(--muted); margin-block: 6px 12px; }
.page-head .primary-link { margin-top: 14px; }
.full-ranking { max-width: 850px; }
.rank-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rank-tabs a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.rank-tabs a:hover { color: var(--rose); }
.rank-tabs a[aria-current] { background: var(--rose); color: white; border-color: var(--rose); font-weight: 650; }
.rank-board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.rank-board-grid .panel { margin-bottom: 0; }
.rank-note { margin-bottom: 7px; }
@media (max-width: 920px) { .rank-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rank-board-grid { grid-template-columns: minmax(0, 1fr); } }
.empty { padding: 14px; color: var(--muted); background: #fff; border-radius: 9px; }
.download-dialog { width: min(530px, calc(100% - 26px)); padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 22px 80px #27142148; }
.download-dialog::backdrop { background: #1b111a8c; }
.download-heading, .admin-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 23px; line-height: 1; }
.download-intro { margin: 8px 0 15px; }
.download-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 700px; }
.platform-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.platform-card h3 { margin: 0; font-size: 17px; }
.platform-card p { color: var(--muted); font-size: 12px; min-height: 2.5em; margin: 6px 0 10px; }
.platform-pending { display: inline-block; min-height: 34px; padding-block: 8px; color: var(--muted); }
.about-page { max-width: 930px; }
.about-hero { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(115deg, #fff 48%, #f7e6eb); padding: clamp(20px, 5vw, 45px); margin-bottom: 16px; }
.about-hero h1, .admin-heading h1 { font-size: clamp(23px, 4vw, 36px); }
.about-hero p:not(.detail-eyebrow) { max-width: 45em; margin-top: 12px; line-height: 1.75; color: var(--muted); }
.about-actions { display: flex; gap: 10px; align-items: center; margin-top: 19px; }
.contact-panel { padding: clamp(15px, 4vw, 28px); }
.contact-description { margin: -4px 0 15px; color: var(--muted); }
.contact-form, .admin-form { display: grid; gap: 10px; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contact-form label, .admin-form label { display: block; }
.contact-form input, .contact-form textarea, .admin-form input { display: block; width: 100%; padding: 9px 11px; border: 1px solid #d9c5ce; border-radius: 7px; font: inherit; background: #fff; color: inherit; }
.contact-form label input, .admin-form label input { margin-top: 6px; }
.contact-form textarea { resize: vertical; min-height: 105px; }
.form-button { justify-self: start; cursor: pointer; border: 0; padding: 9px 15px; margin-top: 3px; }
.form-notice { padding: 9px 12px; margin-bottom: 12px; background: #f0f7f2; color: #384e3c; border-radius: 7px; }
.form-error { background: #fcf0f1; color: #8d2037; }
.admin-shell { max-width: 780px; }
.admin-heading { align-items: center; margin-bottom: 15px; }
.admin-panel { padding: clamp(16px, 4vw, 25px); }
.text-button { border: 0; padding: 0; background: transparent; }
.message-item + .message-item { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.message-item > div { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.message-item time { color: var(--muted); font-size: 12px; }
.message-body { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sync-explain { margin: -4px 0 12px; }
.sync-phase { font-weight: 650; margin: 6px 0; }
.sync-progress { display: block; width: 100%; height: 9px; accent-color: var(--rose); }
.sync-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sync-stats > div { padding: 8px 9px; background: var(--paper); border-radius: 6px; }
.sync-stats dt { font-size: 12px; color: var(--muted); }
.sync-stats dd { margin: 3px 0 0; font-weight: 550; overflow-wrap: anywhere; }
.sync-error, .sync-poll-note, .sync-failures { margin-top: 8px; }
.sync-failures li { overflow-wrap: anywhere; }
[data-sync-button]:disabled { opacity: .65; cursor: default; }
@media (max-width: 600px) { .sync-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .inner { width: calc(100% - 32px); }
  .nav-row { gap: 24px; }
  .nav-links { gap: 18px; }
  .banner-track, .banner-card { min-height: 285px; height: 285px; }
  .banner-body { padding: 20px 17px; }
  .home-columns, .detail-columns { grid-template-columns: minmax(0, 1fr) minmax(210px, .44fr); gap: 12px; }
  .home-columns .work-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rank-list .rank-row { grid-template-columns: 22px minmax(0, 1fr); }
  .rank-status { display: none; }
}
@media (max-width: 700px) {
  .inner { width: calc(100% - 24px); }
  .nav-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 7px 0 10px; }
  .logo img { width: 87px; height: 30px; }
  .nav-links { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; flex-wrap: wrap; column-gap: 7px; font-size: 12px; }
  .nav-links a { padding: 9px 0; }
  .search-form { grid-column: 2; grid-row: 1; width: 100%; margin-top: 0; }
  .banner { padding: 12px 0; }
  .banner-track { display: flex; overflow-x: auto; gap: 8px; scroll-snap-type: x mandatory; }
  .banner-card { flex: 0 0 94%; scroll-snap-align: start; }
  .banner-card, .banner-track { height: 240px; min-height: 240px; }
  .banner-card:not(.is-active) .banner-body { padding-inline: 15px; }
  .banner-cover { width: clamp(101px, 30vw, 164px); }
  .banner-body { gap: 5px; }
  .banner-controls { bottom: 6px; }
  .banner-copy p { margin-block: 7px 10px; }
  .tag-bar { padding: 9px; }
  .home-columns, .detail-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .panel { padding: 13px; margin-bottom: 12px; }
  .work-grid, .home-columns .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .detail-info { grid-template-columns: minmax(100px, 35%) minmax(0, 1fr); gap: 11px; }
  .detail-wrap { padding-bottom: 12px; }
  .detail-meta .synopsis { margin-block: 7px; }
  .episode-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .download-dialog { padding: 15px; }
  .platform-card { padding: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
