/* ============================================================
   HanJu 模板 V1.0 —— 苹果CMS V10 专用
   单文件样式：原生 CSS Grid + CSS 变量，无任何第三方框架
   ============================================================ */

/* ---------- 变量 & 基础重置 ---------- */
:root {
    --c-primary: #f4395f;          /* 主题色（韩剧粉红） */
    --c-primary-dark: #d92e4f;
    --c-score: #7091fc;            /* 评分标签 */
    --c-year: #ff9900;             /* 年份标签 */
    --c-warn: #ff9900;
    --c-text: #303133;
    --c-text-2: #6b7280;
    --c-text-3: #9ca3af;
    --c-line: #ebeef5;
    --c-bg: #f6f7f9;
    --c-card: #ffffff;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, .06);
    --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--c-text);
    background: var(--c-bg);
}

a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-primary); }
ul, ol { list-style: none; }
img { max-width: 100%; border: 0; vertical-align: middle; }
button, input, select, textarea { font: inherit; outline: none; }

.icon { width: 1em; height: 1em; fill: currentColor; vertical-align: -.125em; }
.icon-sym { display: none; }               /* SVG 符号表容器 */
.icon-stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.text-overflow { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.text-muted { color: var(--c-text-2); }
.text-red { color: var(--c-primary); }
.text-center { text-align: center; }
.clearfix::after { content: ""; display: table; clear: both; }

/* ---------- 布局容器 ---------- */
.container { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.main { min-height: 60vh; padding: 20px 0 40px; }
.row-flex { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.col-main { flex: 1 1 720px; min-width: 0; }
.col-side { flex: 0 0 300px; width: 300px; }
@media (max-width: 991px) { .col-side { flex: 1 1 100%; width: auto; } }

/* ---------- 顶部导航 ---------- */
.site-header { background: var(--c-card); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.site-header .bd { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.logo img { height: 34px; }
.logo .logo-text { font-size: 24px; font-weight: 700; color: var(--c-primary); letter-spacing: 1px; }
.logo .logo-text small { color: var(--c-text-3); font-size: 12px; font-weight: 400; margin-left: 6px; }

.nav-menu { display: flex; gap: 4px; }
.nav-menu > li { position: relative; }
.nav-menu > li > a { display: block; padding: 8px 14px; border-radius: 6px; font-size: 15px; }
.nav-menu > li > a:hover, .nav-menu > li.active > a { color: var(--c-primary); background: #fdf0f3; }

/* 头部搜索 */
.search-box { margin-left: auto; display: flex; align-items: center; position: relative; }
.search-box form { display: flex; align-items: center; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 999px; overflow: hidden; }
.search-box input { border: 0; background: transparent; padding: 8px 16px; width: 220px; }
.search-box button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; color: var(--c-text-2); }
.search-box button:hover { color: var(--c-primary); }
.hot-search { position: absolute; top: 100%; right: 0; margin-top: 8px; width: 260px; background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; display: none; z-index: 20; }
.search-box:hover .hot-search, .hot-search.show { display: block; }
.hot-search p a { display: block; padding: 4px 0; }
.badge { display: inline-block; min-width: 18px; text-align: center; border-radius: 4px; font-size: 12px; color: #fff; background: var(--c-text-3); padding: 0 4px; margin-right: 6px; line-height: 18px; }
.badge-1 { background: #f4395f; } .badge-2 { background: #ff7a45; } .badge-3 { background: #ffb024; }

.user-menu { display: flex; align-items: center; gap: 8px; }
.user-menu > li { position: relative; }
.user-menu a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--c-text-2); font-size: 17px; }
.user-menu a:hover { color: var(--c-primary); background: #fdf0f3; }
.history-box { position: absolute; right: 0; top: 100%; margin-top: 8px; width: 300px; background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; display: none; z-index: 20; }
.user-menu li:hover .history-box { display: block; }
.history-box p { padding: 4px 0; border-bottom: 1px dashed var(--c-line); }
.history-box p:last-child { border-bottom: 0; }

.nav-toggle, .search-toggle { display: none; }

@media (max-width: 991px) {
    .nav-menu { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--c-card); flex-direction: column; padding: 8px; box-shadow: var(--shadow); }
    .nav-menu.open { display: flex; }
    .nav-menu > li > a { padding: 12px 16px; }
    .nav-toggle, .search-toggle { display: flex; }
    .search-box { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--c-card); padding: 12px 16px; margin: 0; }
    .search-box.open { display: flex; }
    .search-box form, .search-box input { width: 100%; }
    .hot-search { left: 16px; right: 16px; width: auto; }
    .logo img, .logo .logo-text { font-size: 20px; }
}

/* ---------- 面板（板块） ---------- */
.panel { background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.panel-hd { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--c-line); flex-wrap: wrap; gap: 8px; }
.panel-hd .title { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-hd .title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--c-primary); }
.panel-hd .more { margin-left: auto; color: var(--c-text-2); font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.panel-bd { padding: 16px 18px; }
.panel-bd.no-pad { padding: 0; }

/* ---------- 视频网格 & 卡片 ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid .card.hidden-m { display: none; }
@media (min-width: 992px) { .grid .card.hidden-m { display: block; } }

/* 固定两列网格（侧栏「高分推荐」等：任何宽度都保持每行 2 个）
   minmax(0,1fr) 防止长标题把列撑破 */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col-side .grid-2 { gap: 12px; }
.col-side .grid-2 .card-title { margin-top: 6px; font-size: 13px; }
.col-side .grid-2 .tag { font-size: 11px; padding: 0 5px; line-height: 16px; }
.col-side .grid-2 .card-remarks { font-size: 11px; padding: 3px 6px; }
.col-side .grid-2 .card-tags { top: 6px; left: 6px; right: 6px; }
/* 侧栏在窄屏折叠为通栏，列数仍是 2；只限制整块最大宽度，
   避免通栏时单张海报被拉到 470px 宽、700px 高那么夸张 */
@media (max-width: 991px) {
    .col-side .grid-2 { max-width: 460px; }
}

.card { position: relative; }
.card-thumb { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, #eceef2 25%, #f7f8fa 45%, #eceef2 65%) center / 100% 100%; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; position: absolute; inset: 0; }
.card-thumb img.loaded { opacity: 1; }
.card-thumb .play-mask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .25); color: #fff; font-size: 34px; opacity: 0; transition: opacity .25s; }
.card-thumb:hover .play-mask { opacity: 1; }
.card-tags { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 6px; }
.tag { color: #fff; font-size: 12px; border-radius: 4px; padding: 1px 6px; line-height: 18px; }
.tag-score { background: var(--c-score); }
.tag-year { background: var(--c-year); }
.card-remarks { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; text-align: right; font-size: 12px; }
.card-title { margin-top: 8px; font-size: 14px; font-weight: 500; }
.card-actor { margin-top: 2px; font-size: 12px; color: var(--c-text-3); }

/* ---------- 文字排行列表 ---------- */
.rank-list { padding: 6px 18px; }
.rank-list li a { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--c-line); }
.rank-list li:last-child a { border-bottom: 0; }
.rank-list .name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-list .date { color: var(--c-text-3); font-size: 12px; margin-left: 8px; }

/* ---------- 筛选（分类列表页） ---------- */
.screen { padding: 6px 18px 14px; }
.screen-row { display: flex; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--c-line); }
.screen-row:last-child { border-bottom: 0; }
.screen-row .label { color: var(--c-text-2); padding: 3px 10px 3px 0; white-space: nowrap; }
.screen-row ul { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.screen-row a { display: block; padding: 3px 12px; border-radius: 999px; color: var(--c-text-2); }
.screen-row a:hover { color: var(--c-primary); }
.screen-row a.on { background: var(--c-primary); color: #fff; }

/* ---------- 分页 ---------- */
.page-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 20px 18px; }
.page-bar a, .page-bar span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 6px; background: var(--c-bg); color: var(--c-text-2); }
.page-bar span.on, .page-bar a:hover { background: var(--c-primary); color: #fff; }

/* ---------- 详情页 ---------- */
.breadcrumb { padding: 12px 18px 0; color: var(--c-text-3); font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.breadcrumb a:hover { color: var(--c-primary); }

.detail-info { display: flex; gap: 24px; }
.detail-thumb { flex: 0 0 210px; }
.detail-thumb .card-thumb { aspect-ratio: 2 / 3; }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.detail-data { flex: 1; min-width: 0; }
.detail-data h1 { font-size: 24px; margin-bottom: 10px; }
.detail-data .meta { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; }
.detail-data .meta .k { color: var(--c-text-2); margin-right: 4px; }
.split-line { margin: 0 10px; border-left: 1px solid var(--c-line); }
.detail-desc { margin-top: 8px; color: var(--c-text-2); }
.detail-operate { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 767px) { .detail-info { flex-direction: column; } .detail-thumb { flex: 0 0 auto; width: 150px; } }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: 6px; border: 1px solid var(--c-line); background: var(--c-bg); color: var(--c-text-2); cursor: pointer; transition: all .2s; font-size: 14px; }
.btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* 剧情简介折叠 */
.desc-body { color: var(--c-text-2); line-height: 1.9; }
.desc-body.fold { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle { color: var(--c-primary); cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }

/* ---------- 播放地址选项卡 & 集数列表 ---------- */
.tab-nav { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.tab-nav a { padding: 6px 16px; border-radius: 999px; background: var(--c-bg); color: var(--c-text-2); }
.tab-nav a.on { background: var(--c-primary); color: #fff; }
.tab-pane { display: none; }
.tab-pane.on { display: block; }
.ep-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 320px; overflow: auto; padding: 2px; }
.ep-list a { display: flex; align-items: center; justify-content: center; padding: 9px 4px; border: 1px solid var(--c-line); border-radius: 6px; color: var(--c-text-2); }
.ep-list a:hover, .ep-list a.on { border-color: var(--c-primary); color: var(--c-primary); background: #fdf0f3; }
.tab-foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px; margin-bottom: 8px; color: var(--c-text-3); font-size: 13px; }

/* ---------- 播放页 ---------- */
.player-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-box iframe, .player-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.play-title h1 { font-size: 18px; }
.play-side { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 专题 ---------- */
.topic-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.topic-card { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #2b2f38; }
.topic-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; opacity: 0; }
.topic-card img.loaded { opacity: .9; }
.topic-card .name { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; font-size: 16px; }

/* ---------- 友情链接 / 合作伙伴 ---------- */
.link-text { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.link-text a { color: var(--c-text-2); }
.link-text a:hover { color: var(--c-primary); }

/* ---------- 留言 / 表单 ---------- */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; color: var(--c-text-2); }
.form-item input, .form-item textarea, .form-item select { width: 100%; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: 6px; background: var(--c-bg); }
.form-item textarea { min-height: 100px; resize: vertical; }
.msg-item { padding: 14px 0; border-bottom: 1px dashed var(--c-line); }
.msg-item .hd { display: flex; justify-content: space-between; color: var(--c-text-3); font-size: 12px; margin-bottom: 6px; }

/* ---------- 页脚 ---------- */
.site-footer { background: #1f2228; color: #8b909b; padding: 30px 0 80px; margin-top: 20px; font-size: 13px; }
.site-footer a { color: #b6bbc5; margin: 0 8px; }
.site-footer a:hover { color: #fff; }
.site-footer .foot-nav { text-align: center; margin-bottom: 12px; }
.site-footer .copyright { text-align: center; line-height: 2; }

/* 底部移动导航 */
.footer-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--c-card); box-shadow: 0 -2px 10px rgba(0, 0, 0, .08); display: none; z-index: 90; }
.footer-nav ul { display: flex; }
.footer-nav li { flex: 1; }
.footer-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; font-size: 12px; color: var(--c-text-2); }
.footer-nav a.on, .footer-nav a:hover { color: var(--c-primary); }
.footer-nav .icon { font-size: 20px; }
@media (max-width: 767px) {
    .footer-nav { display: block; }
    body { padding-bottom: 52px; }
}

/* 返回顶部 */
.back-top { position: fixed; right: 20px; bottom: 90px; width: 44px; height: 44px; border-radius: 50%; background: var(--c-card); box-shadow: var(--shadow); display: none; align-items: center; justify-content: center; color: var(--c-text-2); font-size: 20px; cursor: pointer; z-index: 95; }
.back-top.show { display: flex; }
.back-top:hover { color: var(--c-primary); }
@media (max-width: 767px) { .back-top { bottom: 66px; right: 14px; } }

/* 空数据 */
.empty-tip { text-align: center; color: var(--c-text-3); padding: 50px 0; }
.empty-tip .icon { font-size: 40px; display: block; margin: 0 auto 10px; }

/* 演员页 */
.actor-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.actor-card .card-thumb { aspect-ratio: 10 / 13; }

/* 地图页 */
.map-list { display: flex; flex-wrap: wrap; gap: 10px; }
.map-list a { padding: 6px 14px; background: var(--c-bg); border-radius: 6px; color: var(--c-text-2); }
