/* 观影年鉴：纸白、墨黑、一个钴蓝强调色，其余颜色都留给海报 */
:root {
    --paper: #f3f3f0;
    --ink: #111214;
    --muted: #6b6e75;
    --grid: #1112141a;
    --cell: #11121409;
    --surface: #fbfbf9;
    --accent: #2340ff;
    --on-accent: #ffffff;
    --display: 'Archivo', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
    --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root { color-scheme: dark; --paper: #0f1013; --ink: #ecece8; --muted: #8e919a; --grid: #ecece81c; --cell: #ecece80a; --surface: #17181c; --accent: #8593ff; --on-accent: #0f1013; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 var(--sans); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 30; top: 8px; left: 8px; padding: 12px; background: var(--surface); }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: 20px; }
.label { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* 顶栏 */
.top { display: flex; align-items: center; gap: 28px; padding-block: 18px; border-bottom: 1px solid var(--ink); flex-wrap: wrap; }
.wordmark { font: 800 13px var(--display); font-stretch: 125%; letter-spacing: .04em; margin-right: auto; }
.primary-nav { display: flex; align-items: center; gap: 20px; color: var(--muted); }
.primary-nav button { white-space: nowrap; }
.primary-nav button[aria-current] { color: var(--ink); font-weight: 700; }
.primary-nav button:hover { color: var(--ink); }
.search-box { display: flex; align-items: center; gap: 8px; width: 180px; border-bottom: 1px solid var(--grid); padding-bottom: 4px; color: var(--muted); }
.search-box svg { width: 15px; height: 15px; flex-shrink: 0; stroke-width: 1.5; }
.search-box input { width: 100%; background: none; border: 0; outline-offset: 4px; font-size: 13px; }
.feedback { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.feedback:empty { display: none; }

/* 正在看：年鉴之前的「此刻」一栏 */
.now { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; padding-block: 20px; border-bottom: 1px solid var(--grid); align-items: start; }
.now h2 { margin: 0; font: 700 22px/1.2 var(--sans); }
.now h2 small { display: block; margin-top: 6px; }
.now-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.now-list button { display: block; width: 100%; text-align: left; }
.now-list img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--cell); }
.now-list p { margin: 8px 0 0; display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.now-list p span { font: 500 11px var(--mono); color: var(--accent); white-space: nowrap; }
.now-list button:hover img { filter: brightness(1.05); }

/* 大年份 + 年份柱状图 */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 40px; align-items: end; padding-block: 40px 28px; }
.year { margin: 0; font: 900 clamp(96px, 19vw, 240px)/.8 var(--display); font-stretch: 62%; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.year-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 150px; }
.year-bars button { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; gap: 6px; color: var(--muted); }
.year-bars .bar { background: var(--grid); min-height: 3px; transition: background .2s; }
.year-bars .n, .year-bars .y { font: 500 11px var(--mono); text-align: center; }
.year-bars .y { border-top: 1px solid var(--grid); padding-top: 4px; }
.year-bars button:hover .bar { background: var(--muted); }
.year-bars button[aria-pressed="true"] { color: var(--ink); }
.year-bars button[aria-pressed="true"] .bar { background: var(--accent); }

/* 年度小结：统计写成一段话，数字用展示字体突出 */
.summary { margin: 0; padding-block: 28px 30px; border-block: 1px solid var(--ink); font: 400 clamp(20px, 2.4vw, 28px)/1.75 var(--sans); text-wrap: pretty; }
.summary em { font: 700 1.5em/1 var(--display); font-stretch: 80%; font-style: normal; font-variant-numeric: tabular-nums; color: var(--accent); margin-inline: .08em; }
.summary b { font-weight: 700; }

#almanac > section { padding-block: 44px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font: 700 22px var(--sans); }

/* 日历：12 行 × 31 列，看过片的那天换成海报 */
.cal-scroll { overflow-x: auto; }
.cal { display: grid; grid-template-columns: 40px repeat(31, minmax(22px, 1fr)); gap: 3px; min-width: 760px; padding-top: 6px; }
.cal .m { font: 500 11px/1 var(--mono); color: var(--muted); align-self: center; }
.cal .dnum { font: 10px var(--mono); color: var(--muted); text-align: center; }
.cal .c { aspect-ratio: 2 / 3; background: var(--cell); position: relative; }
.cal .c.x { background: none; }
.cal .c img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cal .c[data-count]::after { content: attr(data-count); position: absolute; right: -3px; top: -5px; z-index: 1; font: 700 9px/14px var(--mono); min-width: 14px; text-align: center; background: var(--accent); color: var(--on-accent); border-radius: 7px; }
.cal .c button { position: absolute; inset: 0; }
.cal .c button:hover img, .cal .c button:focus-visible img, .cal .c button[aria-pressed="true"] img { outline: 2px solid var(--accent); outline-offset: 1px; }

.focus { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; margin-top: 24px; padding-block: 20px; border-top: 1px solid var(--grid); }
.focus:empty { display: none; }
.focus img { width: 160px; max-width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--cell); }
.focus h3 { margin: 4px 0; font: 900 32px/1.2 var(--sans); }
.focus .meta { font: 12px var(--mono); color: var(--muted); }
.focus blockquote { margin: 16px 0 0; padding-left: 14px; border-left: 3px solid var(--accent); font-size: 16px; max-width: 36em; white-space: pre-wrap; overflow-wrap: anywhere; }
.focus-more { margin-top: 16px; font-size: 13px; border-bottom: 1px solid currentColor; }
.focus-others { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.focus-others button { text-decoration: underline; text-underline-offset: 3px; }

.genres { display: flex; height: 44px; border: 1px solid var(--ink); }
.genres span { display: flex; align-items: center; padding-inline: 8px; font: 500 12px var(--sans); white-space: nowrap; overflow: hidden; border-right: 1px solid var(--ink); min-width: 0; }
.genres span:last-child { border-right: 0; }
.genres span:first-child { background: var(--accent); color: var(--on-accent); }

.top-rated { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; padding-bottom: 20px; }
.top-rated button { display: block; width: 100%; text-align: left; }
.top-rated img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; background: var(--cell); }
.top-rated .cap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; margin-top: 8px; }
.top-rated .rk { font: 800 26px/1 var(--display); font-stretch: 62%; color: var(--accent); grid-row: span 2; }
.top-rated .tt { font-weight: 700; overflow-wrap: anywhere; line-height: 1.35; }
.top-rated .sc { font: 12px var(--mono); color: var(--muted); }

/* 其他分类：海报网格 */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding-block: 40px 20px; border-bottom: 1px solid var(--ink); }
.list-head h1 { margin: 6px 0 0; font: 900 clamp(40px, 7vw, 72px)/1 var(--sans); }
.list-subtitle { margin: 10px 0 0; color: var(--muted); }
.type-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.type-filters button { padding: 6px 12px; font-size: 13px; color: var(--muted); border: 1px solid var(--grid); }
.type-filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.poster-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px 16px; padding-block: 28px 20px; }
.poster-grid:empty { display: none; }
.poster-card { position: relative; display: block; width: 100%; text-align: left; min-width: 0; }
.must-see-badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; font: 700 11px/1.4 var(--sans); color: var(--on-accent); background: var(--accent); }
.poster-card img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--cell); transition: transform .2s; }
.poster-card:hover img { transform: translateY(-3px); }
.poster-card h2 { margin: 10px 0 2px; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; justify-content: space-between; gap: 6px; font: 11px var(--mono); color: var(--muted); }
.card-rating { color: var(--accent); white-space: nowrap; }
.empty-state { padding-block: 60px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; font: 700 22px var(--sans); }
.empty-state p { color: var(--muted); margin: 0 0 16px; }
.text-button { padding: 8px 14px; border: 1px solid var(--ink); }

.site-footer { display: flex; justify-content: space-between; gap: 16px; padding-block: 40px 60px; margin-top: 40px; border-top: 1px solid var(--grid); font: 11px var(--mono); color: var(--muted); letter-spacing: .08em; }

/* 详情弹窗 */
dialog { width: min(880px, calc(100% - 32px)); max-height: 85svh; background: var(--surface); color: var(--ink); border: 1px solid var(--ink); padding: 0; }
dialog::backdrop { background: #0009; backdrop-filter: blur(4px); }
.dialog-close { position: sticky; top: 12px; float: right; z-index: 2; margin: 12px 12px -48px 0; width: 36px; height: 36px; font-size: 24px; background: var(--surface); border: 1px solid var(--grid); }
.detail-layout { display: grid; grid-template-columns: 32% minmax(0, 1fr); padding: 36px; gap: 32px; }
#detail-poster { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--cell); }
#detail-title { font: 900 30px/1.3 var(--sans); margin: 4px 40px 6px 0; }
.detail-original { color: var(--muted); font: 12px var(--mono); margin: 0 0 20px; }
.detail-ratings { display: flex; gap: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--grid); }
.detail-ratings span { display: grid; gap: 2px; font-size: 11px; color: var(--muted); }
.detail-ratings strong { font: 700 28px/1.1 var(--display); font-stretch: 80%; color: var(--accent); }
#detail-meta { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; margin: 18px 0; }
#detail-meta dt { color: var(--muted); }
#detail-meta dd { margin: 0; }
.detail-body section { margin-top: 20px; }
.detail-body section h3 { margin: 0 0 6px; font: 500 11px var(--mono); letter-spacing: .12em; color: var(--muted); }
.detail-body section p { margin: 0; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
/* 防剧透：简介默认模糊，点击后显示 */
.spoiler { position: relative; }
.spoiler p { filter: blur(6px); user-select: none; transition: filter .25s; }
.spoiler.revealed p { filter: none; user-select: auto; }
.spoiler-reveal { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; font: 500 13px var(--sans); color: var(--ink); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.spoiler-reveal:hover { color: var(--accent); }
#detail-note-section p { padding-left: 12px; border-left: 3px solid var(--accent); }
.detail-link { display: inline-block; margin-top: 24px; font-size: 13px; border-bottom: 1px solid var(--accent); color: var(--accent); }
.no-script { margin: 40px 20px; }

@media (max-width: 1000px) {
    .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .intro { grid-template-columns: 1fr; gap: 24px; }
    .top-rated { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .focus { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
    .focus h3 { font-size: 24px; }
    .now { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .top { gap: 12px 20px; }
    .wordmark { width: 100%; }
    .primary-nav { gap: 14px; font-size: 13px; }
    .search-box { width: 100%; }
    /* 手机上正在看改成横向滑动，不把年鉴挤出首屏 */
    .now-list { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; }
    .now-list button { scroll-snap-align: start; }
    .now-list p { flex-direction: column; gap: 0; }
    .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-layout { display: block; padding: 24px 20px; }
    #detail-poster { width: 110px; margin-bottom: 16px; }
    .site-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
