/* ===== 防错乱基线 ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
img, video, iframe, embed, object { max-width: 100%; height: auto; display: block; }
img { object-fit: cover; }
table { max-width: 100%; }
pre, code { white-space: pre-wrap; word-break: break-word; overflow: auto; max-width: 100%; }
a, p, h1, h2, h3, li, span { overflow-wrap: anywhere; word-break: break-word; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main, section, article, aside { position: relative; }
[hidden] { display: none !important; }

/* ===== 变量与基础排版 ===== */
:root {
  --bg: #f5f1e6;
  --surface: #fffdf7;
  --ink: #33302a;
  --muted: #7f786b;
  --line: #e4dcc8;
  --dark: #2c2b27;
  --dark-2: #38362f;
  --beige: #efe8d4;
  --acc: #7c8f80;
  --acc2: #8c9cb0;
  --acc3: #b98f8f;
  --acc4: #c2a06f;
  --r-card: 18px;
  --r-pill: 999px;
  --shadow: 0 10px 24px rgba(60, 55, 40, .12);
}
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
body.nav-lock { overflow: hidden; }

/* 下划线滑入动效 */
.site-nav a, .v-title a, .h-title a, .more, .footer-links a, .breadcrumb a, .prose a {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  transition: background-size .3s ease, color .25s ease;
}
.site-nav a:hover, .v-title a:hover, .h-title a:hover, .more:hover, .footer-links a:hover, .breadcrumb a:hover, .prose a:hover {
  background-size: 100% 2px;
}

/* ===== 双层头部 ===== */
.site-header { background: var(--dark); color: #efe8d6; box-shadow: 0 2px 14px rgba(30, 28, 22, .3); }
.header-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.site-logo { flex-shrink: 0; font-size: 24px; font-weight: 800; letter-spacing: 1px; color: #f6f0dd; display: inline-flex; align-items: center; gap: 10px; }
.site-logo::before { content: ""; width: 10px; height: 26px; border-radius: 6px; background: linear-gradient(180deg, var(--acc3), var(--acc4)); flex-shrink: 0; }
.site-logo strong { font-weight: 800; }
.header-search { display: flex; flex: 1 1 320px; min-width: 0; max-width: 480px; margin-left: auto; border: 1px solid rgba(246, 240, 221, .35); border-radius: var(--r-pill); overflow: hidden; background: rgba(255, 255, 255, .08); }
.header-search input { flex: 1 1 auto; min-width: 0; padding: 10px 18px; border: 0; background: transparent; color: #f6f0dd; font-size: 16px; outline: none; }
.header-search input::placeholder { color: rgba(246, 240, 221, .55); }
.header-search button { flex-shrink: 0; padding: 10px 24px; border: 0; background: var(--acc); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .25s; }
.header-search button:hover { background: var(--acc2); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 10px; border: 1px solid rgba(246, 240, 221, .35); border-radius: 12px; background: transparent; cursor: pointer; flex-shrink: 0; }
.nav-toggle span { display: block; height: 2px; width: 100%; background: #f6f0dd; border-radius: 2px; transition: transform .25s, opacity .25s; }
.header-nav-row { background: var(--dark-2); border-top: 1px solid rgba(246, 240, 221, .08); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 8px 0; }
.site-nav a { color: #d8d2c0; padding: 8px 18px; border-radius: var(--r-pill); font-size: 15px; font-weight: 600; background-position: 16px calc(100% - 6px); }
.site-nav a:hover { color: #fff; background-color: rgba(255, 255, 255, .08); }
.site-nav .nav-home { border: 1px solid var(--acc); color: #cfe0d3; }
.nav-mask { position: fixed; inset: 0; background: rgba(28, 26, 22, .55); z-index: 900; }

/* ===== Hero 文本区 ===== */
.page-hero { padding-top: 30px; padding-bottom: 6px; }
.page-hero h1 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; margin-bottom: 6px; }
.hero-sub { color: var(--muted); font-size: 15px; margin: 0; }

/* ===== 通栏模块 ===== */
.block { padding: 38px 0; }
.block.alt { background: var(--beige); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.block-head h2 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; margin: 0; padding-left: 16px; position: relative; }
.block-head h2::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6px; height: 1.1em; border-radius: 4px; background: linear-gradient(180deg, var(--acc), var(--acc2)); }
.more { font-size: 14px; color: var(--acc); font-weight: 600; flex-shrink: 0; }

/* ===== 海报卡片 ===== */
.v-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.v-grid > *, .mix-grid > *, .h-list > *, .rank-list > *, .stat-grid > *, .footer-grid > * { min-width: 0; }
.v-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.v-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--acc); }
.poster { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; background: linear-gradient(135deg, #ddd6c2, #c9cfc6); }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.v-card:hover .poster img { transform: scale(1.05); }
.badge { position: absolute; top: 10px; left: 10px; padding: 3px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; color: #fff; background: var(--acc3); z-index: 2; }
.badge-a { background: var(--acc3); }
.badge-b { background: var(--acc2); }
.badge-c { background: var(--acc4); }
.badge-d { background: var(--acc); }
.v-title { margin: 12px 12px 4px; font-size: 15px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: auto 12px 12px; font-size: 12px; color: var(--muted); }
.cat { color: var(--acc); border: 1px solid var(--acc); padding: 1px 10px; border-radius: var(--r-pill); flex-shrink: 0; }

/* 首部大卡混合流 */
.mix-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 900px) {
  .mix-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mix-grid .v-card:first-child { grid-column: span 2; grid-row: span 2; }
  .mix-grid .v-card:first-child .v-title { font-size: 20px; }
  .mix-grid .v-card:first-child .v-meta { font-size: 14px; }
}

/* ===== 高分榜单 ===== */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); counter-reset: rank; }
.rank-item { counter-increment: rank; }
.rank-link { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 11px 20px; transition: border-color .25s, box-shadow .25s; }
.rank-link:hover { border-color: var(--acc2); box-shadow: var(--shadow); }
.rank-link::before { content: counter(rank, decimal-leading-zero); font-weight: 800; font-size: 17px; color: var(--acc4); flex-shrink: 0; }
.rank-item:nth-child(1) .rank-link::before { color: var(--acc3); }
.rank-item:nth-child(2) .rank-link::before { color: var(--acc2); }
.rank-item:nth-child(3) .rank-link::before { color: var(--acc); }
.rank-title { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.rank-cat { flex-shrink: 0; font-size: 12px; color: var(--muted); }

/* ===== 纯文字热点条 / 类型胶囊 ===== */
.hot-strip-block { background: var(--dark); color: #efe8d6; }
.hot-strip-block .block-head h2 { color: #f6f0dd; }
.hot-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.strip-link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 20px; border-radius: var(--r-pill); border: 1px solid var(--acc2); color: #e6e0cd; font-size: 14px; transition: background .25s, color .25s; }
.strip-link:nth-child(3n+2) { border-color: var(--acc3); }
.strip-link:nth-child(3n) { border-color: var(--acc4); }
.strip-link:hover { background: var(--acc2); color: #fff; }
.type-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.type-tag { padding: 8px 22px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--acc); font-size: 14px; font-weight: 600; transition: background .25s, color .25s; }
.type-tag:nth-child(4n+2) { border-color: var(--acc2); }
.type-tag:nth-child(4n+3) { border-color: var(--acc3); }
.type-tag:nth-child(4n) { border-color: var(--acc4); }
.type-tag:hover { background: var(--acc); color: #fff; }

/* ===== 面包屑 ===== */
.breadcrumb { padding-top: 18px; font-size: 13px; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; min-width: 0; }
.breadcrumb li + li::before { content: "›"; margin: 0 6px 0 0; color: var(--muted); }
.breadcrumb a { color: var(--acc); }

/* ===== 列表页横卡 ===== */
.list-head { margin-bottom: 22px; }
.list-head h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin-bottom: 4px; padding-left: 16px; position: relative; }
.list-head h1::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6px; height: 1.1em; border-radius: 4px; background: linear-gradient(180deg, var(--acc3), var(--acc4)); }
.h-list { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.h-card { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.h-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--acc2); }
.thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #ddd6c2, #c9cfc6); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.h-card:hover .thumb img { transform: scale(1.04); }
.h-body { padding: 16px 18px 16px 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.h-title { font-size: 18px; font-weight: 700; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.h-intro { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.h-meta { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.h-tags { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.h-tags a { font-size: 12px; padding: 2px 12px; border-radius: var(--r-pill); border: 1px solid var(--acc4); color: var(--acc4); transition: background .25s, color .25s; }
.h-tags a:hover { background: var(--acc4); color: #fff; }

/* ===== 分页（极简胶囊） ===== */
.pager { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 30px; }
.pager a { min-width: 44px; text-align: center; padding: 9px 22px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; transition: border-color .25s, color .25s; }
.pager a:hover { border-color: var(--acc); color: var(--acc); }

/* ===== 播放器 ===== */
.player-module { background: var(--dark); padding: 26px 0; margin-top: 16px; }
.player-wrap { position: relative; width: 100%; max-width: 1020px; margin: 0 auto; aspect-ratio: 16 / 9; overflow: hidden; background: #141310; border-radius: 16px; border: 1px solid rgba(246, 240, 221, .18); }
.hls-player { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

/* ===== 视频详情 ===== */
.detail-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; align-items: start; }
.poster-box { margin: 0; width: 100%; max-width: 300px; aspect-ratio: 2 / 3; overflow: hidden; position: relative; border-radius: var(--r-card); border: 2px solid var(--acc); background: linear-gradient(135deg, #ddd6c2, #c9cfc6); }
.poster-box img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { min-width: 0; }
.detail-info h1 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; margin-bottom: 12px; }
.score-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.score { font-size: 28px; font-weight: 800; color: var(--acc4); }
.status { padding: 3px 16px; border-radius: var(--r-pill); border: 1px solid var(--acc); color: var(--acc); font-size: 13px; font-weight: 600; }
.views { font-size: 13px; color: var(--muted); }
.info-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); font-size: 14px; }
.info-list li { min-width: 0; }
.info-list li > span:first-child { color: var(--muted); margin-right: 8px; }
.detail-intro { color: var(--muted); font-size: 15px; margin: 0; }
.detail-content { margin-top: 30px; }
.detail-content h2, .about-stats h2, .about-contact h2 { font-size: 20px; font-weight: 800; padding-left: 14px; position: relative; }
.detail-content h2::before, .about-stats h2::before, .about-contact h2::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 1.1em; border-radius: 4px; background: var(--acc2); }
.prose { max-width: 100%; font-size: 15px; }
.prose img { border-radius: 12px; margin: 12px auto; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose a { color: var(--acc); }
.prose blockquote { margin: 12px 0; padding: 10px 16px; border-left: 4px solid var(--acc); background: var(--beige); border-radius: 0 10px 10px 0; }

/* ===== 关于页 ===== */
.about-stats, .about-contact { margin-top: 28px; }
.stat-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; text-align: center; }
.stat-num { font-size: 32px; font-weight: 800; color: var(--acc); margin: 0 0 4px; }
.stat-label { margin: 0; color: var(--muted); font-size: 14px; }

/* ===== 无结果 / 内联搜索 ===== */
.no-result { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-card); color: var(--muted); }
.no-result-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.search-inline { display: flex; max-width: 420px; margin: 20px auto 0; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; background: #fff; }
.search-inline input { flex: 1 1 auto; min-width: 0; padding: 11px 18px; border: 0; font-size: 16px; outline: none; background: transparent; color: var(--ink); }
.search-inline button { flex-shrink: 0; padding: 11px 24px; border: 0; background: var(--acc); color: #fff; font-weight: 700; cursor: pointer; }
.search-inline button:hover { background: var(--acc2); }

/* ===== 页脚 ===== */
.site-footer { background: var(--dark); color: #c9c2ae; margin-top: 44px; padding-top: 40px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding-bottom: 30px; }
.footer-col h2 { font-size: 17px; color: #f6f0dd; font-weight: 800; margin-bottom: 10px; }
.footer-col p { margin: 0 0 8px; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a { color: #d8d2c0; }
.footer-bottom { border-top: 1px solid rgba(246, 240, 221, .12); padding: 16px; text-align: center; font-size: 13px; color: #98917f; }
.footer-bottom a { color: #c9c2ae; text-decoration: underline; }

/* ===== 404 ===== */
.page-404 { min-height: 80vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 16px; }
.err-box { max-width: 520px; width: 100%; }
.err-code { font-size: clamp(64px, 14vw, 120px); font-weight: 800; margin: 0; color: var(--acc3); letter-spacing: 4px; }
.page-404 h1 { font-size: clamp(20px, 4vw, 28px); font-weight: 800; }
.err-tip { color: var(--muted); font-size: 15px; }
.err-actions { margin-top: 24px; }
.btn-home { display: inline-block; padding: 11px 34px; border-radius: var(--r-pill); background: var(--acc); color: #fff; font-weight: 700; transition: background .25s; }
.btn-home:hover { background: var(--acc2); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 210px minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 768px) {
  .block { padding: 26px 0; }
  .nav-toggle { display: flex; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; margin-left: 0; }
  .header-nav-row .container { padding: 0; }
  .site-nav { display: none; }
  .site-nav.is-open { display: flex; flex-direction: column; gap: 6px; position: fixed; top: 0; left: 0; bottom: 0; width: min(78vw, 300px); max-height: 100vh; overflow-y: auto; background: var(--dark); z-index: 1000; padding: 26px 18px; box-shadow: 6px 0 28px rgba(0, 0, 0, .4); }
  .site-nav.is-open a { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(246, 240, 221, .14); }
  .h-card { grid-template-columns: minmax(0, 1fr); }
  .h-body { padding: 0 16px 16px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .poster-box { max-width: 240px; margin: 0 auto; }
  .rank-list { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 769px) {
  .nav-mask { display: none !important; }
}
@media (max-width: 480px) {
  .v-grid, .mix-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .page-hero h1 { font-size: 20px; }
  .header-search button { padding: 10px 18px; }
}
