/* ============================================================
   1836 视频站 - 前台样式
   深色现代风格，布局还原采集原站 1836df.com 的结构
   ============================================================ */

/* ---------- 基础 ---------- */
:root {
    --bg: #0f1115;
    --bg-2: #171a21;
    --bg-3: #1e222c;
    --border: #2a2f3a;
    --text: #e6e8ec;
    --muted: #8a93a6;
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --accent: #3498db;
    --radius: 8px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--primary); }
img { display: block; max-width: 100%; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ---------- 头部 ---------- */
.site-header {
    background: var(--bg-2);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 60px;
    flex-wrap: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.logo-icon {
    width: 34px; height: 34px;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: 1px; }

.main-nav { flex: 1; }
.nav-list {
    list-style: none;
    display: flex;
    gap: 4px;
}
.nav-item { position: relative; }

.nav-item > a {
    display: block;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 15px;
    color: var(--text);
    transition: background .2s;
}
.nav-item > a:hover,
.nav-item.active > a { background: var(--primary); color: #fff; }

/* 子分类下拉 */
.sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 140px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.5);
    list-style: none;
    padding: 6px 0;
    z-index: 200;
}
.nav-item.has-sub:hover .sub-nav { display: block; }
.sub-nav li a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}
.sub-nav li a:hover { background: var(--primary); color: #fff; }

.search-box {
    display: flex;
    flex-shrink: 0;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}
.search-box input {
    border: none;
    background: transparent;
    color: var(--text);
    padding: 7px 14px;
    width: 200px;
    outline: none;
    font-size: 14px;
}
.search-btn {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
}
.search-btn:hover { background: var(--primary-dark); }

/* ---------- 主内容区的独立搜索条（第二排通栏） ---------- */
.search-bar {
    width: 100%;
    max-width: 640px;
    margin: 0 auto 22px;
    border-radius: 24px;
}
.search-bar input {
    flex: 1;
    width: auto;
    min-width: 0;
    padding: 9px 18px;
    font-size: 15px;
}

/* ---------- 主体 ---------- */
.site-main { padding: 24px 16px 40px; min-height: 60vh; }

.block-title {
    font-size: 18px;
    font-weight: 700;
    margin: 22px 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}
.title-sub {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
    margin-left: 8px;
    letter-spacing: 1px;
}

/* ---------- 热门排行 ---------- */
.hot-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    background: var(--bg-2);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border);
}
.hot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-3);
    border-radius: 6px;
    padding: 8px;
    transition: transform .2s;
    overflow: hidden;
}
.hot-item:hover { transform: translateY(-3px); border-color: var(--primary); }
.hot-rank {
    font-size: 22px;
    font-weight: 800;
    color: var(--muted);
    min-width: 24px;
    text-align: center;
    font-style: italic;
}
.hot-rank.rank-top { color: var(--primary); }
.hot-thumb {
    width: 72px; height: 46px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.hot-info { display: flex; flex-direction: column; min-width: 0; }
.hot-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hot-views { font-size: 12px; color: var(--muted); }

/* ---------- 视频卡片网格 ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.video-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,.45);
    border-color: var(--primary);
}
.card-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.card-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.video-card:hover .card-cover img { transform: scale(1.06); }
.card-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 44px; height: 44px;
    background: rgba(0,0,0,.55);
    border: 2px solid rgba(255,255,255,.85);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.video-card:hover .card-play { opacity: 1; }
.card-body { padding: 10px 12px 12px; }
.card-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

/* ---------- 分页（网格矩阵样式，仿图2） ---------- */
.pagination {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 6px;
    margin-top: 30px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.pagination a,
.pagination span.current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination span.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}
.pagination span.ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 15px;
    letter-spacing: 1px;
    pointer-events: none;
}
/* 输入页码 + 跳转按钮（网格右下角，跨 2 列） */
.pagination .page-jump {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    grid-column: span 2;
    min-width: 0;
}
.page-jump form {
    display: flex;
    align-items: center;
    gap: 6px;
}
.jump-input {
    width: 68px;
    min-height: 32px;
    padding: 0 6px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-align: center;
    font-size: 14px;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.jump-input::-webkit-inner-spin-button,
.jump-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.jump-input:focus { border-color: var(--primary); }
.jump-input::placeholder { color: var(--muted); }
.jump-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 6px;
    padding: 0 14px;
    min-height: 34px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.jump-btn:hover { background: var(--primary); color: #fff; }
.page-hint { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

/* ---------- 播放页 ---------- */
.player-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
.player-wrap {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.player-wrap video { width: 100%; aspect-ratio: 16/9; display: block; background: #000; }

.play-lines {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.lines-label { color: var(--muted); font-size: 13px; }
.line-btn {
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.line-btn small { color: var(--muted); }
.line-btn:hover { border-color: var(--primary); }
.line-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.line-btn.active small { color: rgba(255,255,255,.8); }

.video-info { margin-top: 18px; }
.video-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.video-meta { display: flex; gap: 18px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.video-intro { margin-top: 16px; }
.video-intro h3 {
    font-size: 15px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
    margin-bottom: 8px;
}
.video-intro p { color: var(--muted); font-size: 14px; }

.player-side { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.player-side .block-title { margin-top: 0; }
.related-list { list-style: none; }
.related-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background .2s;
}
.related-item:hover { background: var(--bg-3); }
.related-thumb {
    width: 92px; height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.related-info { display: flex; flex-direction: column; min-width: 0; }
.related-title {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-meta { font-size: 12px; color: var(--muted); margin-top: auto; }

/* ---------- 其它 ---------- */
.empty-tip {
    text-align: center;
    color: var(--muted);
    padding: 60px 20px;
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 24px 0;
    color: var(--muted);
    font-size: 13px;
}
.footer-sub { font-size: 12px; color: #5b6475; margin-top: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .video-grid { grid-template-columns: repeat(4, 1fr); }
    .hot-grid { grid-template-columns: repeat(3, 1fr); }
    .player-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    /* 顶栏仅 logo + 分类导航，搜索框已独立为第二排通栏条 */
    .header-inner {
        flex-wrap: nowrap;
        height: 54px;
        gap: 6px;
        padding: 0 8px;
    }
    .main-nav { flex: 1; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .main-nav::-webkit-scrollbar { display: none; }
    .nav-list { flex-wrap: nowrap; width: max-content; }
    .nav-item > a { padding: 8px 10px; font-size: 14px; white-space: nowrap; }

    .search-bar { margin: 16px auto 20px; }
    .search-bar .search-btn { padding: 0 14px; }

    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .hot-grid { grid-template-columns: repeat(2, 1fr); }
}
