:root {
  --bg: #eef1ed;
  --panel: #ffffff;
  --ink: #1f2522;
  --muted: #6b746f;
  --line: #dbe2dc;
  --green: #2f6f59;
  --blue: #42677d;
  --gold: #bb904a;
  --shadow: 0 18px 40px rgba(31, 37, 34, 0.08);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
button, input, select { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  min-width: 0;
}
.side-rail {
  position: sticky;
  top: 0;
  align-self: start;
  display: grid;
  gap: 22px;
  min-height: 100vh;
  padding: 24px;
  background: #17221d;
  color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; }
.brand span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green), var(--blue));
}
.side-rail nav { display: grid; gap: 10px; }
.side-rail nav a {
  padding: 12px 14px;
  border-radius: 16px;
  color: #dce7e1;
  font-weight: 800;
}
.side-rail nav a:hover, .side-rail nav a[aria-current="page"] { background: rgba(255,255,255,0.1); color: #fff; }
.rail-note {
  align-self: end;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
}
.rail-note p { color: #bdcbc4; margin: 6px 0 0; }
.main-workspace {
  min-width: 0;
  padding: 24px;
}
.workspace-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.workspace-top span, .section-head span, .detail-state {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.workspace-top h1 { margin: 0; font-size: clamp(2rem, 4vw, 4rem); line-height: 1; }
.search input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(31, 37, 34, 0.12);
  border-radius: 999px;
  background: #fff;
  padding: 0 16px;
}
.search input::placeholder, .footer p, .footer a, .guide-grid p, .list-row small, .catalog-card p, .detail-sub, .detail-copy p {
  color: var(--muted);
}

.spotlight-desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px minmax(280px, 0.72fr);
  gap: 18px;
  min-width: 0;
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.spotlight-copy { display: grid; align-content: center; gap: 14px; min-width: 0; }
.spotlight-copy h2 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 3.8rem); line-height: 1.05; }
.spotlight-copy p, .catalog-console p, .detail-desc { margin: 0; color: #48544e; }
.spotlight-copy > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 128px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #fff;
  font-weight: 900;
}
.spotlight-poster, .detail-poster {
  overflow: hidden;
  border-radius: 22px;
  background: #dfe5dc;
}
.spotlight-poster img, .detail-poster img { height: 100%; object-fit: cover; }
.spotlight-mini, .dense-list { display: grid; gap: 10px; min-width: 0; }
.type-dock {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.type-dock a {
  display: grid;
  place-items: center;
  min-height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(47,111,89,0.94), rgba(66,103,125,0.9));
  color: #fff;
  font-weight: 900;
}
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.72fr);
  gap: 18px;
  min-width: 0;
  margin-bottom: 18px;
}
.left-stack, .right-stack { display: grid; gap: 18px; min-width: 0; }
.panel, .catalog-console, .filter-console, .catalog-card, .detail-stage, .footer > div, .guide-grid article {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(31,37,34,0.08);
  box-shadow: var(--shadow);
}
.panel { border-radius: 24px; padding: 20px; min-width: 0; }
.section-head { display: grid; gap: 6px; margin-bottom: 14px; }
.section-head h2, .section-head h3, .catalog-console h2, .detail-main h1 { margin: 0; line-height: 1.16; }
.tile-mosaic {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.media-tile { display: grid; gap: 8px; min-width: 0; }
.media-tile.wide { grid-row: span 2; }
.tile-cover {
  position: relative;
  overflow: hidden;
  display: block;
  height: 100%;
  min-height: 180px;
  border-radius: 18px;
  background: #dfe5dc;
}
.media-tile:not(.wide) .tile-cover { aspect-ratio: 2 / 3; min-height: 0; }
.tile-cover img { height: 100%; object-fit: cover; transition: transform 220ms ease; }
.media-tile:hover img { transform: scale(1.04); }
.tile-cover > span, .tile-cover > b {
  position: absolute;
  top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  font-size: .84rem;
  font-weight: 900;
}
.tile-cover > span { left: 10px; background: rgba(31,37,34,.72); }
.tile-cover > b { right: 10px; background: rgba(187,144,74,.92); color: #18130d; }
.tile-hover {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  padding: 18px 14px 14px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(31,37,34,.88));
  transform: translateY(100%);
  transition: transform 220ms ease;
}
.media-tile:hover .tile-hover { transform: translateY(0); }
.tile-title, .catalog-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 900;
}
.list-row {
  display: grid;
  grid-template-columns: 34px 58px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  background: rgba(47,111,89,.06);
}
.list-row:hover { background: rgba(47,111,89,.1); transform: translateY(-1px); }
.list-row b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(47,111,89,.12);
  color: var(--green);
}
.list-row img { width: 58px; aspect-ratio: 2/3; object-fit: cover; border-radius: 10px; }
.list-row span { display: grid; min-width: 0; }
.list-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row em { justify-self: end; color: var(--gold); font-style: normal; font-weight: 900; }
.small-poster-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.guide-grid article { border-radius: 20px; padding: 18px; }
.catalog-console {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 16px;
}
.catalog-console strong {
  display: grid;
  place-items: center;
  min-width: 170px;
  min-height: 54px;
  border-radius: 16px;
  background: rgba(47,111,89,.1);
  color: var(--green);
}
.filter-console {
  display: grid;
  gap: 14px;
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 16px;
}
.filter-row, .select-row, .meta-row, .tag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.filter {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(31,37,34,.12);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}
.filter:hover, .filter.active { background: rgba(47,111,89,.08); border-color: rgba(47,111,89,.3); }
.select-row label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
.select-row select {
  height: 42px;
  min-width: 150px;
  padding: 0 12px;
  border: 1px solid rgba(31,37,34,.12);
  border-radius: 14px;
  background: #fff;
}
.catalog-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}
.catalog-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  border-radius: 20px;
  padding: 12px;
}
.catalog-poster {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #dfe5dc;
}
.catalog-poster img { height: 100%; object-fit: cover; aspect-ratio: 2/3; }
.catalog-poster span {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  place-items: center;
  min-height: 38px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(31,37,34,.88));
  transform: translateY(100%);
  transition: transform 180ms ease;
}
.catalog-poster:hover span { transform: translateY(0); }
.catalog-copy { display: grid; align-content: start; gap: 8px; min-width: 0; }
.catalog-top { display: flex; justify-content: space-between; gap: 10px; }
.catalog-top b { color: var(--green); }
.catalog-top strong { color: var(--gold); }
.meta-row span, .tag-row a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(47,111,89,.08);
  color: var(--green);
  font-size: .9rem;
  font-weight: 800;
}
.detail-stage {
  display: grid;
  grid-template-columns: minmax(260px,320px) minmax(0,1fr);
  gap: 22px;
  border-radius: 26px;
  padding: 22px;
  margin-bottom: 18px;
}
.detail-main { display: grid; align-content: start; gap: 14px; min-width: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; }
.detail-grid div { padding: 13px 15px; border-radius: 16px; background: rgba(47,111,89,.07); }
.detail-grid dt { color: var(--muted); margin-bottom: 5px; }
.detail-grid dd { margin: 0; font-weight: 900; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.episode-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.episode-grid button { min-height: 42px; border: 1px solid rgba(31,37,34,.12); border-radius: 14px; background: #fff; cursor: pointer; }
.detail-copy { display: grid; gap: 10px; }
.footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 6px 0 30px;
}
.footer > div { border-radius: 20px; padding: 18px; }
.copy { grid-column: 1 / -1; margin: 0; text-align: center; color: var(--muted); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-rail { position: static; min-height: auto; }
  .side-rail nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .spotlight-desk, .home-layout, .detail-stage, .detail-columns { grid-template-columns: 1fr; }
  .catalog-board { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .main-workspace { padding: 14px; }
  .workspace-top, .type-dock, .tile-mosaic, .small-poster-list, .guide-grid, .catalog-board, .catalog-card, .detail-grid, .footer { grid-template-columns: 1fr; }
  .side-rail nav { grid-template-columns: 1fr; }
  .spotlight-poster, .detail-poster { width: min(220px,100%); }
  .episode-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}


/* stable responsive guards */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img, video, canvas, svg { max-width: 100%; }
h1, h2, h3, h4, p, a, span, strong, small, b, em, li { min-width: 0; overflow-wrap: anywhere; }
main, header, footer, section, article, aside, nav, div { min-width: 0; }
.poster-grid, .feature-grid, .movie-grid, .library-grid, .library-list, .related-grid, .content-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
