/*
   Cupfox visual system
   Warm tea-brown palette, high content density, readable long-session browsing.
*/
:root {
  --tea: #6B5C4D;
  --tea-soft: #A78B6D;
  --ink: #25211E;
  --paper: #F7F4EF;
  --paper-2: #EEE8E0;
  --text: #292724;
  --muted: #746E67;
  --accent: #D97732;
  --line: rgba(37, 33, 30, .14);
  --line-strong: rgba(37, 33, 30, .24);
  --shadow: 0 18px 48px rgba(53, 43, 35, .10);
  --shadow-soft: 0 8px 28px rgba(53, 43, 35, .07);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shell: 1240px;
  --reading: 760px;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; font-size: 16px; line-height: 1.72; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(217,119,50,.22); color: var(--ink); }

.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 760px); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; transform: translateY(-160%); background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: rgba(247,244,239,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-row { height: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: max-content; }
.brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; }
.brand span { display: grid; line-height: 1.1; }
.brand strong { font-size: 17px; letter-spacing: .02em; color: var(--ink); }
.brand small { margin-top: 4px; font-size: 10px; letter-spacing: .24em; color: var(--tea); }
.main-nav { display: flex; align-items: center; justify-content: center; gap: 6px; }
.nav-link { position: relative; padding: 10px 13px; border-radius: 10px; color: #514a44; font-weight: 650; font-size: 15px; }
.nav-link:hover { background: var(--paper-2); color: var(--ink); }
.nav-link.is-active { background: var(--ink); color: #fff; }
.header-search { display: flex; align-items: center; width: min(330px, 29vw); border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; overflow: hidden; }
.header-search input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 10px 4px 10px 15px; background: transparent; color: var(--ink); }
.header-search button { border: 0; background: transparent; padding: 10px 14px; color: var(--tea); font-weight: 750; cursor: pointer; }
.header-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,119,50,.12); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 12px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; cursor: pointer; }
.menu-toggle span:not(.sr-only) { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }

.eyebrow { display: inline-block; margin-bottom: 10px; color: var(--tea); font-size: 12px; line-height: 1.4; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 750; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px rgba(217,119,50,.20); }
.button--primary:hover { background: #c96828; box-shadow: 0 14px 30px rgba(217,119,50,.26); }
.button--quiet { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.button--quiet:hover { background: var(--paper-2); }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: #80512d; font-weight: 760; }
.text-link span { transition: transform .18s ease; }
.text-link:hover span { transform: translateX(4px); }

.home-hero { padding: 56px 0 42px; overflow: hidden; }
.hero-layout { display: grid; grid-template-columns: minmax(0, .94fr) minmax(440px, 1.06fr); gap: 54px; align-items: center; }
.hero-copy h1 { max-width: 760px; margin: 0; color: var(--ink); font-size: clamp(40px, 5.4vw, 72px); line-height: 1.06; letter-spacing: -.045em; }
.hero-lead { max-width: 680px; margin: 24px 0 0; color: #5d5650; font-size: 18px; line-height: 1.85; }
.hero-search { margin-top: 30px; max-width: 670px; }
.hero-search > label, .search-page-form > label { display: block; margin-bottom: 9px; color: var(--ink); font-weight: 750; font-size: 14px; }
.search-control { display: flex; padding: 5px; border: 1px solid var(--line-strong); background: #fff; border-radius: 15px; box-shadow: var(--shadow-soft); }
.search-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(217,119,50,.11), var(--shadow-soft); }
.search-control input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 12px 13px; color: var(--ink); }
.search-control button { flex: 0 0 auto; border: 0; border-radius: 11px; background: var(--ink); color: #fff; padding: 10px 18px; font-weight: 750; cursor: pointer; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-visual { position: relative; min-height: 540px; display: flex; align-items: center; justify-content: center; }
.hero-visual::before { content: ""; position: absolute; inset: 6% -20% 7% 10%; background: linear-gradient(135deg, #e8dfd3, #f3ede5); border-radius: 44% 56% 58% 42% / 42% 43% 57% 58%; transform: rotate(-4deg); }
.hero-visual > img { position: relative; z-index: 1; width: 88%; aspect-ratio: 4/3; object-fit: cover; border-radius: 30px; box-shadow: 0 30px 80px rgba(49,38,30,.20); }
.hero-panel { position: absolute; z-index: 2; left: 0; bottom: 24px; display: grid; grid-template-columns: repeat(2, minmax(92px,1fr)); gap: 8px; width: min(330px, 74%); padding: 16px; background: rgba(37,33,30,.94); color: #fff; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; box-shadow: var(--shadow); }
.hero-panel > span { grid-column: 1/-1; color: #d8cabb; font-size: 12px; letter-spacing: .12em; }
.hero-panel a { padding: 8px 10px; background: rgba(255,255,255,.08); border-radius: 9px; font-weight: 700; }
.hero-panel a:hover { background: var(--accent); }

.section { padding: 78px 0; }
.section--flush-top { padding-top: 34px; }
.section--tinted { background: var(--paper-2); border-block: 1px solid rgba(37,33,30,.06); }
.section-heading { max-width: 780px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: clamp(30px, 4vw, 48px); line-height: 1.16; letter-spacing: -.03em; }
.section-heading p { margin: 15px 0 0; color: var(--muted); }
.section-heading--split { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr); gap: 48px; align-items: end; }
.section-heading--split p { margin: 0 0 6px; }

.type-rail { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.type-tile { position: relative; min-height: 270px; overflow: hidden; border-radius: 18px; background: var(--ink); box-shadow: var(--shadow-soft); }
.type-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(24,20,17,.85), rgba(24,20,17,.08) 60%); }
.type-tile img { width: 100%; height: 100%; min-height: 270px; object-fit: cover; transition: transform .35s ease; }
.type-tile:hover img { transform: scale(1.035); }
.type-tile span { position: absolute; z-index: 2; inset: auto 18px 18px; color: #fff; }
.type-tile strong { display: block; font-size: 22px; }
.type-tile small { display: block; margin-top: 3px; color: rgba(255,255,255,.76); }

.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.media-grid--dense { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.media-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 1px 0 rgba(255,255,255,.7) inset; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.media-card:hover { transform: translateY(-3px); border-color: rgba(107,92,77,.32); box-shadow: var(--shadow-soft); }
.media-card__image { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: #ded6cd; }
.media-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.media-card:hover .media-card__image img { transform: scale(1.025); }
.media-card__type { position: absolute; left: 12px; bottom: 12px; padding: 5px 9px; background: rgba(37,33,30,.88); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 780; letter-spacing: .08em; }
.media-card__body { padding: 18px 18px 17px; }
.media-card__body h3 { margin: 0; font-size: 21px; line-height: 1.35; color: var(--ink); }
.media-card__body h3 a:hover { color: #80512d; }
.media-card__body p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 9px 0 14px; color: #665f59; font-size: 14px; line-height: 1.72; }
.media-card--compact .media-card__body { padding: 15px; }
.media-card--compact .media-card__body h3 { font-size: 18px; }
.media-card--compact .media-card__body p { -webkit-line-clamp: 2; font-size: 13px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; list-style: none; }
.tag-list li { padding: 4px 8px; border-radius: 999px; background: var(--paper-2); color: #655d55; font-size: 11px; line-height: 1.5; }
.tag-list--large { gap: 9px; margin-top: 20px; }
.tag-list--large li { padding: 7px 11px; background: rgba(107,92,77,.12); color: var(--tea); font-size: 13px; font-weight: 700; }

.discovery-band { background: var(--ink); color: #fff; }
.discovery-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .8fr); gap: 58px; align-items: center; }
.discovery-art img { width: 100%; aspect-ratio: 1.38; object-fit: cover; border-radius: 24px; opacity: .92; }
.discovery-copy .eyebrow { color: #c9ad8d; }
.discovery-copy h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.15; letter-spacing: -.025em; }
.discovery-copy p { color: #cfc7bf; margin: 18px 0 0; }
.discovery-copy .text-link { color: #f2bd91; margin-top: 24px; }
.inline-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.inline-links a { padding: 7px 11px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: #f4eee8; font-size: 13px; }
.inline-links a:hover { background: rgba(255,255,255,.08); }

.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0; }
.faq-item button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 19px 2px; border: 0; background: transparent; text-align: left; font-size: 18px; font-weight: 760; cursor: pointer; }
.faq-item button span { flex: 0 0 auto; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.faq-item button[aria-expanded="true"] span { transform: rotate(45deg); }
.faq-answer { max-width: 800px; padding: 0 42px 20px 2px; color: var(--muted); }
.faq-answer p { margin: 0; }

.official-note { padding-block: 58px; }
.official-layout { display: flex; justify-content: space-between; align-items: center; gap: 40px; padding: 36px; background: #fff; border: 1px solid var(--line); border-radius: 22px; }
.official-layout h2 { margin: 0; color: var(--ink); font-size: clamp(26px, 3vw, 38px); line-height: 1.2; }
.official-layout p { max-width: 760px; margin: 12px 0 0; color: var(--muted); }

.breadcrumbs { margin-bottom: 26px; font-size: 13px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin: 0 8px; color: #b2aaa2; }
.breadcrumbs a:hover { color: var(--tea); }

.page-hero { padding: 44px 0 62px; }
.page-hero__grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(400px, .75fr); gap: 54px; align-items: center; }
.page-hero h1, .library-intro h1, .search-hero h1, .detail-copy h1 { margin: 0; color: var(--ink); font-size: clamp(38px, 5vw, 64px); line-height: 1.08; letter-spacing: -.04em; }
.page-hero p { max-width: 710px; margin: 20px 0 0; color: #5e5751; font-size: 17px; }
.page-hero__media { position: relative; }
.page-hero__media::before { content: ""; position: absolute; inset: -15px 10px 15px -15px; background: var(--paper-2); border-radius: 26px; }
.page-hero__media img { position: relative; width: 100%; aspect-ratio: 1.34; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.filter-chips a { padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: #5d554f; font-weight: 680; font-size: 13px; }
.filter-chips a:hover, .filter-chips a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.content-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 10px 14px; background: rgba(255,255,255,.74); border: 1px solid var(--line); border-radius: 13px; }
.content-toolbar > div { display: flex; align-items: baseline; gap: 10px; }
.content-toolbar strong { color: var(--ink); }
.content-toolbar span { color: var(--muted); font-size: 13px; }
.content-toolbar a { color: #80512d; font-size: 13px; font-weight: 750; }
.content-toolbar--sticky { position: sticky; top: calc(var(--header-h) + 8px); z-index: 8; backdrop-filter: blur(12px); }
.watch-guide { padding-top: 40px; }
.two-column-note { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .65fr); gap: 50px; align-items: start; }
.two-column-note h2 { margin: 0; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.2; color: var(--ink); }
.two-column-note p { color: var(--muted); }
.note-panel { padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.note-panel h3 { margin: 0; font-size: 20px; color: var(--ink); }
.note-panel p { margin: 8px 0 14px; }

.library-intro { padding: 40px 0 28px; }
.library-intro__row { display: grid; grid-template-columns: minmax(0,1fr) minmax(340px,.55fr); gap: 50px; align-items: center; }
.library-intro p { max-width: 720px; color: var(--muted); font-size: 17px; }
.library-intro img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 18px; }
.library-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 34px; align-items: start; }
.library-sidebar { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 15px; }
.sidebar-block { padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.sidebar-title { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.sidebar-nav { display: grid; gap: 3px; }
.sidebar-nav a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: #5a534d; }
.sidebar-nav a:hover { background: var(--paper-2); }
.sidebar-nav a.is-active { background: var(--ink); color: #fff; }
.sidebar-nav small { opacity: .62; }
.sidebar-search form { display: grid; gap: 8px; }
.sidebar-search input { min-width: 0; width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 10px; background: var(--paper); outline: 0; }
.sidebar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,119,50,.10); }
.sidebar-search button { border: 0; border-radius: 9px; background: var(--tea); color: #fff; padding: 9px 10px; font-weight: 740; cursor: pointer; }
.library-main { min-width: 0; }
.library-list { display: grid; gap: 14px; }
.library-row { display: grid; grid-template-columns: minmax(210px, .33fr) minmax(0,1fr); min-height: 230px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; transition: box-shadow .18s ease, border-color .18s ease; }
.library-row:hover { border-color: rgba(107,92,77,.34); box-shadow: var(--shadow-soft); }
.library-row__image { overflow: hidden; background: #ddd5cc; }
.library-row__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.library-row:hover .library-row__image img { transform: scale(1.025); }
.library-row__body { display: flex; flex-direction: column; padding: 20px 22px; }
.library-row__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--tea); font-size: 12px; font-weight: 720; }
.library-row__body h2 { margin: 7px 0 6px; color: var(--ink); font-size: 25px; line-height: 1.3; }
.library-row__body h2 a:hover { color: #80512d; }
.library-row__body > p { margin: 0; color: #655e58; font-size: 14px; }
.library-row__bottom { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.library-row__bottom span { max-width: 80%; color: var(--muted); font-size: 12px; }
.library-row__bottom a { flex: 0 0 auto; color: #80512d; font-size: 12px; font-weight: 770; }

.detail-hero { padding: 40px 0 44px; }
.detail-hero__grid { display: grid; grid-template-columns: minmax(360px,.82fr) minmax(0,1fr); gap: 54px; align-items: center; }
.detail-poster { position: relative; }
.detail-poster::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; background: #ded5ca; border-radius: 22px; }
.detail-poster img { position: relative; width: 100%; aspect-ratio: 1.4; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); }
.detail-summary { max-width: 700px; margin: 20px 0 0; color: #5e5751; font-size: 18px; line-height: 1.86; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.detail-content-grid { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 26px; align-items: start; }
.prose-card, .fit-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.prose-card { padding: 30px; }
.prose-card h2, .fit-card h2 { margin: 0; color: var(--ink); font-size: 28px; line-height: 1.28; }
.prose-card > p { margin: 16px 0 0; max-width: 860px; color: #5e5751; font-size: 16px; }
.highlight-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 26px; }
.highlight-grid > div { min-height: 190px; padding: 18px; background: var(--paper); border: 1px solid rgba(37,33,30,.08); border-radius: 14px; }
.highlight-grid span { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 760; }
.highlight-grid strong { display: block; color: var(--ink); font-size: 17px; }
.highlight-grid p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.fit-card { position: sticky; top: calc(var(--header-h) + 16px); padding: 24px; }
.fit-card > p { color: var(--muted); }
.fit-card dl { margin: 22px 0 0; }
.fit-card dl > div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.fit-card dt { color: var(--muted); font-size: 12px; }
.fit-card dd { margin: 0; color: var(--ink); font-size: 13px; }
.fit-card a { color: #80512d; font-weight: 720; }

.search-hero { padding: 42px 0 34px; }
.search-hero__grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,.56fr); gap: 46px; align-items: center; }
.search-hero p { max-width: 700px; margin: 18px 0 0; color: var(--muted); }
.search-page-form { margin-top: 24px; }
.search-hero img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-soft); }
.empty-state { display: grid; justify-items: center; padding: 70px 30px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.empty-state h2 { margin: 0; color: var(--ink); font-size: 30px; }
.empty-state p { max-width: 650px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 15px; border-radius: 50%; background: var(--paper-2); color: var(--tea); font-size: 36px; }
.suggestion-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.suggestion-cloud a { padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); }
.suggestion-cloud a:hover { background: var(--ink); color: #fff; }
.search-results { display: grid; gap: 14px; }
.search-result { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 22px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.search-result__image { overflow: hidden; border-radius: 12px; background: #ddd5cc; }
.search-result__image img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; }
.result-type { color: var(--tea); font-size: 12px; font-weight: 740; }
.search-result h2 { margin: 5px 0 7px; color: var(--ink); font-size: 24px; }
.search-result h2 a:hover { color: #80512d; }
.search-result p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.search-result .text-link { font-size: 13px; }

.error-page { min-height: 64vh; display: grid; place-items: center; text-align: center; }
.error-code { display: block; color: var(--tea-soft); font-size: clamp(78px,16vw,170px); font-weight: 900; line-height: .8; letter-spacing: -.08em; opacity: .35; }
.error-page h1 { margin: 25px 0 0; color: var(--ink); font-size: clamp(32px,5vw,52px); }
.error-page p { max-width: 650px; margin: 14px auto 0; color: var(--muted); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 24px; }

.site-footer { margin-top: 20px; padding: 58px 0 20px; background: var(--ink); color: #e9e3dc; }
.footer-grid { display: grid; grid-template-columns: 1.15fr .7fr .9fr; gap: 56px; }
.brand--footer strong { color: #fff; }
.brand--footer small { color: #c8ab8d; }
.footer-brand p, .footer-note p { max-width: 420px; color: #aaa19a; font-size: 13px; }
.footer-links { display: grid; align-content: start; gap: 10px; }
.footer-links a { color: #d9d0c7; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-note strong { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 44px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.10); color: #8f8780; font-size: 12px; }
.footer-bottom a:hover { color: #fff; }

:focus-visible { outline: 3px solid rgba(217,119,50,.45); outline-offset: 3px; }

@media (max-width: 1080px) {
  .header-row { grid-template-columns: auto 1fr auto; gap: 16px; }
  .header-search { display: none; }
  .main-nav { justify-content: flex-end; }
  .hero-layout { grid-template-columns: minmax(0,1fr) minmax(360px,.9fr); gap: 34px; }
  .hero-copy h1 { font-size: clamp(40px,5vw,58px); }
  .hero-visual { min-height: 470px; }
  .type-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .type-tile, .type-tile img { min-height: 240px; }
  .media-grid--dense { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .library-layout { grid-template-columns: 200px minmax(0,1fr); gap: 24px; }
  .library-row { grid-template-columns: 210px minmax(0,1fr); }
  .detail-content-grid { grid-template-columns: 1fr 300px; }
  .highlight-grid { grid-template-columns: 1fr; }
  .highlight-grid > div { min-height: 0; }
}

@media (max-width: 820px) {
  :root { --header-h: 68px; }
  .shell, .narrow { width: min(calc(100% - 28px), var(--shell)); }
  .site-header { height: auto; min-height: var(--header-h); }
  .header-row { position: relative; grid-template-columns: 1fr auto; min-height: var(--header-h); }
  .brand img { width: 40px; height: 40px; }
  .menu-toggle { display: inline-flex; }
  .main-nav { position: absolute; top: calc(100% + 1px); left: 0; right: 0; display: none; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 0 0 14px 14px; box-shadow: var(--shadow-soft); }
  .main-nav.is-open { display: grid; }
  .nav-link { padding: 12px 13px; }
  .hero-layout, .page-hero__grid, .library-intro__row, .search-hero__grid, .detail-hero__grid, .discovery-layout, .two-column-note { grid-template-columns: 1fr; }
  .home-hero { padding-top: 36px; }
  .hero-visual { min-height: 390px; margin-top: -10px; }
  .hero-visual > img { width: 94%; }
  .hero-panel { left: 2%; bottom: 4%; }
  .section { padding: 58px 0; }
  .section--flush-top { padding-top: 24px; }
  .section-heading--split { grid-template-columns: 1fr; gap: 12px; }
  .media-grid, .media-grid--dense { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-hero__media { max-width: 680px; }
  .library-layout { grid-template-columns: 1fr; }
  .library-sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .sidebar-nav { grid-template-columns: repeat(5,minmax(0,1fr)); overflow-x: auto; padding-bottom: 4px; }
  .sidebar-nav a { min-width: 100px; }
  .detail-poster { max-width: 680px; }
  .detail-content-grid { grid-template-columns: 1fr; }
  .fit-card { position: static; }
  .highlight-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1/-1; }
}

@media (max-width: 580px) {
  body { font-size: 15px; }
  .shell, .narrow { width: min(calc(100% - 22px), var(--shell)); }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 9px; }
  .home-hero { padding-top: 28px; }
  .hero-copy h1 { font-size: 38px; }
  .hero-lead { font-size: 16px; }
  .search-control { padding: 4px; }
  .search-control button { padding-inline: 13px; }
  .hero-actions .button { flex: 1 1 180px; }
  .hero-visual { min-height: 320px; }
  .hero-visual > img { width: 100%; border-radius: 20px; }
  .hero-panel { left: 6px; right: 6px; bottom: 8px; width: auto; }
  .section { padding: 46px 0; }
  .section-heading h2 { font-size: 32px; }
  .type-rail { grid-template-columns: 1fr 1fr; gap: 9px; }
  .type-tile, .type-tile img { min-height: 190px; }
  .type-tile span { inset: auto 12px 12px; }
  .type-tile strong { font-size: 18px; }
  .type-tile small { font-size: 11px; }
  .media-grid, .media-grid--dense { grid-template-columns: 1fr; }
  .media-card { display: grid; grid-template-columns: 126px minmax(0,1fr); }
  .media-card__image { height: 100%; min-height: 150px; aspect-ratio: auto; }
  .media-card__body { padding: 14px; }
  .media-card__body h3 { font-size: 18px; }
  .media-card__body p { -webkit-line-clamp: 2; margin-bottom: 10px; font-size: 12px; }
  .official-layout { display: grid; padding: 24px; }
  .page-hero { padding: 30px 0 42px; }
  .page-hero h1, .library-intro h1, .search-hero h1, .detail-copy h1 { font-size: 38px; }
  .filter-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-chips a { white-space: nowrap; }
  .content-toolbar { align-items: flex-start; flex-direction: column; gap: 4px; }
  .content-toolbar > div { flex-wrap: wrap; }
  .library-sidebar { grid-template-columns: 1fr; }
  .sidebar-block { padding: 13px; }
  .library-row { grid-template-columns: 118px minmax(0,1fr); min-height: 190px; }
  .library-row__body { padding: 14px; }
  .library-row__body h2 { font-size: 19px; }
  .library-row__body > p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; }
  .library-row__bottom span { display: none; }
  .detail-hero { padding-top: 28px; }
  .detail-summary { font-size: 16px; }
  .prose-card, .fit-card { padding: 20px; }
  .highlight-grid { grid-template-columns: 1fr; }
  .search-result { grid-template-columns: 96px minmax(0,1fr); gap: 14px; }
  .search-result__image img { min-height: 124px; }
  .search-result h2 { font-size: 19px; }
  .search-result p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .site-header, .site-footer, .hero-actions, .filter-chips, .header-search, .menu-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .section, .home-hero, .page-hero, .detail-hero { padding: 24px 0; }
  .media-card, .library-row, .prose-card, .fit-card { break-inside: avoid; box-shadow: none; }
}
