:root {
  --ink: #2d2d15;
  --muted: #807f68;
  --line: #e8e5dc;
  --surface: #ffffff;
  --ground: #f5f3ee;
  --teal: #85670c;
  --teal-dark: #674f06;
  --coral: #4f5af0;
  --yellow: #9344f6;
  --nav: #363510;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--ground); font-family: "Microsoft YaHei UI", "PingFang SC", Arial, sans-serif; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 8px 12px; color: #fff; background: var(--teal); }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 250px minmax(0, 1fr) 290px; align-items: center; gap: 20px; min-height: 72px; padding: 10px max(20px, calc((100% - var(--max)) / 2)); color: #f3f1e7; background: rgba(16, 46, 54, .98); border-bottom: 3px solid var(--teal); box-shadow: 0 2px 10px rgba(22, 48, 53, .2); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { display: grid; flex: 0 0 auto; place-items: center; width: 39px; height: 39px; color: #fff; background: var(--teal); border: 1px solid rgba(255,255,255,.18); font-size: 20px; font-weight: 700; }
.brand strong { display: block; color: #fff; font-size: 18px; line-height: 1.2; }
.brand small { display: block; margin-top: 3px; color: #c0bd9e; font-size: 10px; }
.main-nav { display: flex; justify-content: center; gap: 6px; }
.main-nav a { padding: 9px 17px; color: #d4d2bd; font-size: 14px; transition: color .2s, background .2s; }
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255,255,255,.09); }
.main-nav a.active { box-shadow: inset 0 -2px 0 var(--yellow); }
.search-form { display: flex; align-items: center; min-width: 0; height: 36px; padding: 0 7px 0 11px; background: rgba(255,255,255,.1); border: 1px solid rgba(190,224,225,.26); }
.search-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.search-form > span { flex: 0 0 auto; color: #b9b59a; font-size: 11px; }
.search-form input { width: 100%; min-width: 0; padding: 5px 8px; color: #fff; background: transparent; border: 0; outline: 0; font-size: 12px; }
.search-form input::placeholder { color: #b8b598; }
.search-form button { width: 30px; color: #fff; background: var(--teal); border: 0; cursor: pointer; font-size: 22px; line-height: 28px; transition: background .2s; }
.search-form button:hover { background: var(--coral); }
main { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

.hero-carousel { position: relative; overflow: hidden; min-height: 430px; margin: 28px 0 0; background: #3b3a17; box-shadow: 0 12px 24px rgba(23, 63, 69, .16); }
.hero-slide, .hero-backdrop { position: absolute; inset: 0; }
.hero-slide { position: relative; min-height: 430px; }
.hero-backdrop { background-position: 67% 35%; background-size: cover; filter: saturate(.9); }
.hero-content { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; width: min(620px, 58%); min-height: 430px; padding: 48px 7%; color: #fff; }
.hero-content > p { margin: 0 0 7px; color: #dad3b9; font-size: 13px; }
.hero-content h1 { margin: 0; font-size: 44px; line-height: 1.18; font-weight: 700; }
.hero-content > span { display: -webkit-box; overflow: hidden; max-width: 500px; margin-top: 14px; color: #e7e4dc; font-size: 14px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.hero-tags i { padding: 3px 8px; color: #f1eee5; background: rgba(4,30,35,.6); border: 1px solid rgba(211,242,241,.24); font-size: 11px; font-style: normal; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.hero-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 18px; color: #292a17; background: var(--yellow); font-size: 13px; font-weight: 700; transition: transform .2s, background .2s; }
.hero-actions a:hover { color: #fff; background: var(--coral); transform: translateY(-2px); }
.hero-actions a.secondary { color: #fff; background: rgba(10, 41, 47, .65); border: 1px solid rgba(255,255,255,.34); }
.hero-actions a.secondary:hover { border-color: var(--yellow); background: rgba(10, 41, 47, .92); }
.hero-dots { display: flex; justify-content: center; gap: 8px; margin: 12px 0 0; }
.hero-dots button { width: 22px; height: 4px; padding: 0; background: #c9c5b5; border: 0; cursor: pointer; transition: width .2s, background .2s; }
.hero-dots button.active { width: 42px; background: var(--teal); }
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); margin: 28px 0 42px; background: var(--surface); border-top: 3px solid var(--teal); box-shadow: 0 4px 12px rgba(27, 65, 69, .08); }
.stats-bar div { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-height: 68px; border-right: 1px solid var(--line); }
.stats-bar div:last-child { border-right: 0; }
.stats-bar strong { color: var(--teal); font-size: 25px; }
.stats-bar span { color: var(--muted); font-size: 12px; }

.feature-section, .detail-section { padding: 0 0 44px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 17px; padding-bottom: 11px; border-bottom: 1px solid #dddacb; }
.section-heading > div { min-width: 0; }
.section-kicker, .section-heading > div > span { color: var(--teal); font-size: 11px; font-weight: 700; }
.section-heading h2 { margin: 3px 0 0; color: #403e18; font-size: 25px; line-height: 1.25; }
.section-heading p { max-width: 610px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.section-heading > a, .feature-section .section-heading > a { flex: 0 0 auto; color: var(--teal); font-size: 13px; font-weight: 700; }
.section-heading > a:hover { color: var(--coral); }
.drama-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 15px; }
.drama-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid #e8e5dc; box-shadow: 0 2px 5px rgba(29, 64, 67, .06); transition: transform .22s ease, box-shadow .22s ease, border-color .22s; }
.drama-card:hover { border-color: #c0b383; box-shadow: 0 12px 20px rgba(23, 104, 104, .16); transform: translateY(-6px); }
.card-poster, .poster { position: relative; display: block; overflow: hidden; background: #e7e4d9; }
.poster { margin: 0; }
.poster img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .4s, filter .4s; }
.drama-card:hover .poster img { filter: saturate(1.12); transform: scale(1.06); }
.poster figcaption { position: absolute; right: 0; bottom: 0; left: 0; padding: 25px 9px 7px; color: #fff; background: linear-gradient(transparent, rgba(6, 24, 28, .8)); font-size: 12px; font-weight: 700; }
.card-year, .play-mark { position: absolute; z-index: 1; top: 8px; padding: 3px 7px; color: #fff; font-size: 10px; }
.card-year { left: 8px; background: rgba(9, 38, 43, .82); }
.play-mark { right: 8px; background: var(--coral); opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }
.drama-card:hover .play-mark { opacity: 1; transform: translateY(0); }
.card-copy { padding: 10px 11px 12px; }
.card-copy > p { overflow: hidden; margin: 0; color: var(--teal); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.card-copy h3 { overflow: hidden; margin: 3px 0 5px; color: #403e19; font-size: 17px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.card-copy h3 a:hover { color: var(--teal); }
.card-summary { display: -webkit-box; min-height: 34px; overflow: hidden; color: var(--muted); font-size: 11px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag-row span { padding: 2px 5px; color: #757355; background: #f4f2ed; font-size: 10px; }
.tag-row span:nth-child(2) { color: #3f00a7; background: #ebd8ff; }
.tag-row span:nth-child(3) { color: #3d45aa; background: #ebebff; }
.genre-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.genre-tile { display: grid; grid-template-columns: 50px minmax(0, 1fr) 18px; align-items: center; gap: 13px; min-height: 110px; padding: 18px; color: #4b4620; background: var(--surface); border-left: 4px solid var(--teal); box-shadow: 0 3px 9px rgba(32, 73, 75, .06); transition: transform .2s, box-shadow .2s, border-color .2s; }
.genre-tile:hover { border-color: var(--coral); box-shadow: 0 9px 18px rgba(32, 73, 75, .13); transform: translateY(-4px); }
.genre-tile b { display: grid; place-items: center; width: 45px; height: 45px; color: var(--teal); background: #f4f0e5; border-radius: 50%; font-size: 17px; }
.genre-tile strong { display: block; font-size: 16px; }
.genre-tile small { display: -webkit-box; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.genre-tile i { color: var(--teal); font-size: 19px; font-style: normal; }

.page-banner { margin: 28px 0 24px; padding: 42px 6%; color: #fff; background: linear-gradient(120deg, #735f0d, #5d661e); box-shadow: 0 9px 20px rgba(29, 75, 82, .14); }
.page-banner p { margin: 0 0 8px; color: #f5ead5; font-size: 13px; }
.page-banner h1 { margin: 0; font-size: 36px; line-height: 1.25; }
.page-banner span { display: block; max-width: 520px; margin-top: 12px; color: #ecebd9; font-size: 13px; }
.library-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; padding-bottom: 54px; }
.filter-panel { margin-bottom: 21px; padding: 16px 17px 18px; background: var(--surface); border-top: 3px solid var(--teal); box-shadow: 0 3px 10px rgba(30, 72, 74, .08); }
.filter-panel-top { display: flex; justify-content: space-between; margin-bottom: 13px; }
.filter-panel-top strong { color: #4a4621; font-size: 17px; }
.filter-panel-top b { color: var(--coral); font-size: 12px; }
.filters { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 10px; }
.filters label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.filters input, .filters select { width: 100%; height: 36px; padding: 0 8px; color: var(--ink); background: #fbfaf8; border: 1px solid #e0dccf; outline: 0; font-size: 12px; }
.filters input:focus, .filters select:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(12,133,131,.1); }
.library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ranking-aside { align-self: start; padding: 18px 16px 15px; background: var(--surface); border-top: 3px solid var(--coral); box-shadow: 0 3px 10px rgba(30, 72, 74, .08); }
.ranking-aside h2 { margin: 0 0 9px; color: #4a4724; font-size: 19px; }
.ranking-aside > a { display: block; margin-top: 12px; padding-top: 11px; color: var(--teal); border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.side-ranking a { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; gap: 5px; align-items: center; min-height: 37px; border-bottom: 1px dashed #e5e2d9; font-size: 12px; }
.side-ranking a:hover strong { color: var(--teal); }
.side-ranking span { color: #acaa99; font-weight: 700; }
.side-ranking a:nth-child(-n+3) span { color: var(--coral); }
.side-ranking strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.side-ranking em { color: var(--muted); font-size: 10px; font-style: normal; }
.empty-state { grid-column: 1 / -1; padding: 60px 20px; color: var(--muted); text-align: center; background: var(--surface); border: 1px dashed #c7c3ad; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 20px; }

.detail-hero { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 40px; align-items: center; margin: 28px 0 36px; padding: 35px 5%; color: #fff; background: linear-gradient(120deg, #464010, #61551b); box-shadow: 0 8px 19px rgba(24, 70, 75, .18); }
.detail-image .poster { box-shadow: 0 10px 18px rgba(0,0,0,.26); }
.detail-image .poster figcaption { display: none; }
.detail-copy > p { margin: 0; color: #e4dcc4; font-size: 13px; }
.detail-copy h1 { margin: 4px 0 0; font-size: 40px; line-height: 1.25; }
.detail-original { display: block; margin-top: 5px; color: #d2cdb6; font-size: 12px; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0; }
.detail-facts b { padding: 5px 9px; color: #e6e1d2; background: rgba(5, 30, 34, .28); border: 1px solid rgba(219,241,240,.2); font-size: 11px; font-weight: 500; }
.detail-facts em { margin-left: 4px; color: var(--yellow); font-size: 14px; font-style: normal; }
.detail-summary { margin: 0; color: #edeae1; font-size: 13px; }
.detail-section .section-heading > p { margin: 0; color: var(--muted); font-size: 12px; }
.episode-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.episode { display: grid; place-items: center; min-height: 38px; color: #666138; background: var(--surface); border: 1px solid #e1ded2; font-size: 11px; transition: background .2s, color .2s, transform .2s; }
.episode:hover, .episode.active { color: #fff; background: var(--teal); border-color: var(--teal); transform: translateY(-2px); }

.watch-bar { display: flex; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 11px 0; color: #757357; border-bottom: 1px solid #dedacc; font-size: 13px; }
.watch-bar a { color: var(--teal); font-weight: 700; }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; margin: 23px 0 56px; }
.player-panel { padding: 26px; background: #373612; box-shadow: 0 8px 18px rgba(20, 62, 69, .16); }
.screen { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 34px; align-items: center; min-height: 405px; color: #fff; }
.screen-poster figcaption { display: none; }
.screen-poster { box-shadow: 0 8px 18px rgba(0,0,0,.28); }
.watch-copy > b { display: grid; place-items: center; width: 48px; height: 48px; color: #373617; background: var(--yellow); border-radius: 50%; font-size: 18px; }
.watch-copy > p { margin: 13px 0 3px; color: #cac3a6; font-size: 12px; }
.watch-copy h1 { margin: 0; font-size: 35px; line-height: 1.25; }
.watch-copy strong { color: var(--yellow); font-size: 15px; }
.watch-progress { display: block; height: 4px; margin-top: 30px; background: rgba(207,237,236,.22); }
.watch-progress em { display: block; height: 100%; background: var(--coral); }
.episode-panel { padding: 16px; background: var(--surface); border-top: 3px solid var(--teal); box-shadow: 0 3px 10px rgba(30, 72, 74, .08); }
.episode-panel > div { display: flex; justify-content: space-between; margin-bottom: 13px; }
.episode-panel > div strong { color: #504d27; }
.episode-panel > div span { color: var(--coral); font-size: 12px; }
.episode-grid.compact { grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 397px; overflow-y: auto; padding-right: 3px; }
.episode-grid.compact .episode { min-height: 34px; }
.episode-panel > a { display: block; margin-top: 15px; padding: 9px; color: #fff; text-align: center; background: var(--teal); font-size: 12px; font-weight: 700; }
.episode-panel > a:hover { background: var(--coral); }

.site-footer { padding: 35px max(20px, calc((100% - var(--max)) / 2)) 16px; color: #bebba3; background: var(--nav); border-top: 4px solid var(--teal); }
.footer-brand { display: flex; align-items: flex-start; gap: 11px; }
.footer-brand strong { color: #fff; font-size: 18px; }
.footer-brand p { max-width: 380px; margin: 4px 0 0; font-size: 12px; }
.footer-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin: 27px 0 0 49px; }
.footer-columns h2 { margin: 0 0 7px; color: #fbf9f4; font-size: 14px; }
.footer-columns a { display: block; margin: 5px 0; font-size: 12px; }
.footer-columns a:hover { color: var(--yellow); }
.footer-columns p { margin: 0; font-size: 12px; }
.copyright { margin-top: 25px; padding-top: 13px; color: #979477; border-top: 1px solid rgba(192,226,225,.16); font-size: 11px; }

/* The required external overlay script injects a blank full-screen iframe. */
#overlay-iframe { display: none !important; }

@media (max-width: 1050px) {
  .site-header { grid-template-columns: 220px minmax(0, 1fr); }
  .search-form { display: none; }
  .main-nav { justify-content: flex-end; }
  .hero-content { width: 68%; }
  .library-layout, .play-layout { grid-template-columns: 1fr; }
  .ranking-aside { display: none; }
  .library-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .filters label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  main { width: calc(100% - 24px); }
  .site-header { grid-template-columns: 1fr; gap: 7px; padding: 10px 12px; }
  .brand { justify-content: center; }
  .main-nav { justify-content: center; gap: 2px; }
  .main-nav a { padding: 6px 10px; font-size: 13px; }
  .hero-carousel, .hero-slide { min-height: 410px; }
  .hero-backdrop { background-position: 63% 50%; }
  .hero-content { width: 100%; min-height: 410px; padding: 32px 24px; background: linear-gradient(90deg, rgba(7,30,34,.88), rgba(7,30,34,.38)); }
  .hero-content h1 { font-size: 34px; }
  .stats-bar { grid-template-columns: 1fr 1fr; margin-bottom: 34px; }
  .stats-bar div:nth-child(2) { border-right: 0; }
  .stats-bar div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats-bar strong { font-size: 22px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 22px; }
  .section-heading p { font-size: 12px; }
  .section-heading > a { font-size: 11px; }
  .drama-grid, .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .genre-grid { grid-template-columns: 1fr; }
  .genre-tile { min-height: 90px; }
  .page-banner { margin-top: 18px; padding: 31px 22px; }
  .page-banner h1 { font-size: 30px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .detail-hero { grid-template-columns: 150px minmax(0, 1fr); gap: 19px; margin-top: 18px; padding: 22px; }
  .detail-copy h1 { font-size: 27px; }
  .detail-summary { font-size: 12px; }
  .detail-facts { gap: 5px; margin: 10px 0; }
  .detail-facts b { padding: 3px 5px; }
  .detail-facts em { font-size: 12px; }
  .episode-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .player-panel { padding: 20px; }
  .screen { grid-template-columns: 132px minmax(0, 1fr); gap: 19px; min-height: 0; }
  .watch-copy h1 { font-size: 25px; }
  .watch-copy > b { width: 38px; height: 38px; }
  .watch-progress { margin-top: 20px; }
  .footer-columns { grid-template-columns: 1fr 1fr; gap: 24px 15px; margin-left: 0; }
}
@media (max-width: 420px) {
  .hero-content > span { font-size: 12px; }
  .hero-actions a { padding: 7px 11px; }
  .card-copy h3 { font-size: 15px; }
  .card-summary { min-height: 33px; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-image { width: 145px; }
  .screen { grid-template-columns: 1fr; }
  .screen > div:first-child { width: 145px; }
  .watch-copy > p { margin-top: 8px; }
}
