:root {
  color-scheme: light;
  --ink: #30211d;
  --soft-ink: #654b3e;
  --red: #862e25;
  --deep-red: #59201c;
  --paper: #fbf5e9;
  --tile: #fffdf7;
  --line: #d5c2aa;
  --focus: #075360;
  --display: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", "SimSun", serif;
  --text: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.125rem/1.5 var(--text); }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: #80382b30; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .63; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.shell { width: min(100% - 3rem, 75rem); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: .5rem; left: .5rem; z-index: 5; padding: .7rem; background: white; }
.masthead { padding: .8rem 0; background: #fffaf0; border-bottom: 1px solid #d8c2a7; }
.masthead-inner, .masthead nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; min-height: 3rem; text-decoration: none; color: var(--deep-red); font: bold 1.58rem var(--display); }
.brand-mark { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .38rem; font-size: 1.75rem; color: #fff4df; background: var(--red); box-shadow: inset 0 0 0 1px #bd8770, inset 0 0 0 4px var(--red), inset 0 0 0 5px #e5b78a; }
.top-button { min-height: 3rem; padding: .35rem .75rem; border: 1px solid #ccb59b; border-radius: .55rem; background: #fffaf0; color: var(--deep-red); font-weight: bold; }
.top-button[aria-pressed="true"], .top-button:hover:not(:disabled) { background: #f2e3cf; }
.top-button span { font-size: 1.2em; }
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 19.5rem;
  margin: 1.45rem 0 2.1rem;
  overflow: hidden;
  border-radius: .95rem;
  color: #fff6e6;
  background: linear-gradient(90deg, #421813 0%, #501c17 34%, #461a14b8 54%, #451b1507 78%), #6d2b20 url("assets/stage.webp") right 42% / min(77%, 52rem) auto no-repeat;
}
.hero::before { content: ""; position: absolute; inset: .48rem; pointer-events: none; border: 1px solid #e8b58e72; border-radius: .62rem; }
.hero-copy { position: relative; padding: 2.65rem 3.1rem; }
.hero h1 { max-width: 36rem; margin: 0; font: bold clamp(2rem, 5vw, 4rem)/1.22 var(--display); text-wrap: balance; }
.hero p { margin: .62rem 0 1.6rem; color: #fff3de; font-size: 1.18rem; }
.hero-actions, .watch-nav, .watch-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.action { display: inline-flex; align-items: center; justify-content: center; gap: .52rem; min-height: 3.45rem; padding: .65rem 1rem; border: 1px solid transparent; border-radius: .55rem; font-weight: bold; text-align: center; text-decoration: none; }
.hero-primary { color: #52211b; background: #ffe4b8; }
.hero-primary:hover:not(:disabled) { background: #fff1d9; }
.hero-primary span { font-size: .84em; }
.hero-secondary { color: #fff6e6; background: #4d211dcc; border-color: #efcaa3; }
.hero-secondary:hover:not(:disabled) { background: #742e23; }
.hero :focus-visible, .screen :focus-visible { outline-color: #ffdb8f; }
.catalog { scroll-margin-top: .6rem; }
.catalog-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.catalog h2 { margin: 0; font: bold 2.15rem/1.25 var(--display); color: var(--deep-red); }
.search input { width: min(100%, 17rem); min-height: 3.1rem; padding: .55rem .8rem; color: var(--ink); background: var(--tile); border: 1px solid #a89075; border-radius: .55rem; }
.search input::placeholder { color: #725c4b; opacity: 1; }
.categories { display: flex; flex-wrap: wrap; gap: .52rem; }
.category, .category-details summary { min-height: 3.02rem; padding: .52rem .83rem; border: 1px solid #cab399; border-radius: .46rem; color: #4d352a; background: var(--tile); font-weight: bold; }
.category:hover, .category-details summary:hover { background: #f3e5d2; }
.category[aria-pressed="true"] { color: #fff9ec; background: var(--red); border-color: var(--red); }
.category-details { margin-top: .52rem; }
.category-details summary { display: list-item; width: fit-content; cursor: pointer; }
.extra { margin-top: .55rem; }
.results-bar { margin: 1.02rem 0 .58rem; }
#catalog-status { margin: 0; color: var(--soft-ink); font-size: 1rem; }
.programs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.program { display: grid; grid-template-columns: minmax(0, 1fr) 3rem; align-items: start; gap: .2rem; min-width: 0; border: 1px solid var(--line); border-radius: .66rem; background: var(--tile); }
.program:focus-within, .program:hover { border-color: #9e6853; }
.program-link { align-self: stretch; display: flex; align-items: flex-start; gap: .72rem; min-height: 8.1rem; padding: .85rem .15rem .85rem .83rem; text-decoration: none; border-radius: .55rem; }
.play-mark { display: grid; place-items: center; flex: 0 0 2.4rem; height: 2.4rem; border-radius: 50%; background: #f3e1cd; color: var(--deep-red); font-size: .9rem; }
.program-text { display: grid; gap: .14rem; min-width: 0; }
.program-title { font-size: 1.35rem; line-height: 1.32; color: #392320; overflow-wrap: anywhere; }
.program-meta, .program-version, .program-way { font-size: .96rem; line-height: 1.4; color: var(--soft-ink); overflow-wrap: anywhere; }
.program-meta { color: var(--red); font-weight: bold; }
.program-way { font-weight: bold; }
.favorite-button { margin: .38rem .3rem 0 0; min-height: 2.8rem; padding: 0; border-radius: .48rem; border: 0; color: var(--red); background: transparent; font-size: 1.72rem; line-height: 1; }
.favorite-button:hover, .favorite-button[aria-pressed="true"] { background: #faead5; }
.outline { border-color: #ab8b70; background: var(--tile); color: var(--deep-red); }
.outline:hover { background: #f3e5d2; }
.primary { color: #fff9ed; background: var(--red); }
.primary:hover { background: var(--deep-red); }
.more { display: flex; margin: 1.35rem auto 0; }
.watch { width: min(100%, 62rem); margin: 1.5rem auto 0; }
.watch-nav { justify-content: space-between; }
.watch-heading { margin-block: 1rem; }
.watch h1 { margin: .12rem 0 0; font: bold clamp(2rem, 5vw, 3.3rem)/1.25 var(--display); }
.watch-meta, .watch-help { margin: 0; color: var(--soft-ink); }
.screen { position: relative; overflow: hidden; border-radius: .65rem; background: #111; }
#frame-slot { display: grid; align-items: center; width: 100%; aspect-ratio: 16 / 9; }
#frame-slot iframe { display: block; width: 100%; height: 100%; border: 0; background: #111; }
.watch-controls { margin-block: .9rem .55rem; }
.exit-screen { display: none; position: absolute; top: max(.45rem, env(safe-area-inset-top)); right: max(.45rem, env(safe-area-inset-right)); color: #fff; background: #291c17; border-color: #fff; }
.screen:fullscreen, .screen.window-full { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 0; }
.screen.window-full { position: fixed; inset: 0; z-index: 10; }
body.overlay-open { overflow: hidden; }
.screen:fullscreen #frame-slot, .screen.window-full #frame-slot { height: 100%; width: 100%; aspect-ratio: auto; }
.screen:fullscreen .exit-screen, .screen.window-full .exit-screen { display: flex; }
.footer { margin-top: 2rem; padding: 1rem 0 1.45rem; border-top: 1px solid var(--line); color: var(--soft-ink); font-size: .98rem; }
.footer span { margin-inline: .2rem; }
@media (max-width: 60rem) { .programs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 45rem) {
  .shell { width: calc(100% - 1.6rem); }
  .hero { background-image: linear-gradient(90deg, #401814f7 0%, #501c17d9 39%, #461a1470 100%), url("assets/stage.webp"); background-size: auto, cover; min-height: 16rem; }
  .hero-copy { padding: 1.6rem 1.35rem; }
  .hero h1 { font-size: clamp(1.85rem, 9.25vw, 3.1rem); }
  .hero p { font-size: 1.04rem; }
}
@media (max-width: 32rem) {
  .programs { grid-template-columns: 1fr; }
  .program-link { min-height: 7.45rem; }
  .catalog-top { align-items: stretch; }
  .search { flex: 1 1 9rem; }
  .search input { width: 100%; }
  .top-button { padding-inline: .5rem; }
  .hero { margin-bottom: 1.55rem; }
  .action { padding-inline: .82rem; }
  .hero-actions { gap: .55rem; }
}
@media (max-width: 22rem) {
  .hero-actions { align-items: stretch; flex-direction: column; }
}
