/* Horizon 模板 - 顶栏导航、靛蓝主色、宽屏卡片 */
:root {
    --horizon-bg: #f1f5f9;
    --horizon-card: #fff;
    --horizon-primary: #4f46e5;
    --horizon-primary-hover: #4338ca;
    --horizon-text: #1e293b;
    --horizon-text2: #475569;
    --horizon-text3: #94a3b8;
    --horizon-border: #e2e8f0;
    --horizon-radius: 12px;
    --horizon-shadow: 0 1px 3px rgba(30, 41, 59, 0.08);
    --horizon-shadow-hover: 0 8px 20px rgba(30, 41, 59, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.horizon-body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--horizon-bg);
    color: var(--horizon-text);
    line-height: 1.6;
    min-height: 100vh;
}

.horizon-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶栏 */
.horizon-header {
    background: var(--horizon-card);
    border-bottom: 1px solid var(--horizon-border);
    box-shadow: var(--horizon-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.horizon-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    flex-wrap: wrap;
}

.horizon-logo {
    color: var(--horizon-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.horizon-logo:hover { color: var(--horizon-primary-hover); }

.horizon-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.horizon-nav-link {
    padding: 8px 14px;
    color: var(--horizon-text2);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--horizon-radius);
    transition: color .2s, background .2s;
}

.horizon-nav-link:hover { color: var(--horizon-primary); background: rgba(79, 70, 229, 0.08); }

.horizon-nav-link.is-active {
    color: var(--horizon-primary);
    font-weight: 600;
    background: rgba(79, 70, 229, 0.12);
}

.horizon-search {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex: 1;
    min-width: 0;
    max-width: 280px;
}

.horizon-search-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid var(--horizon-border);
    border-radius: var(--horizon-radius);
    background: var(--horizon-bg);
    color: var(--horizon-text);
    font-size: 14px;
}

.horizon-search-input::placeholder { color: var(--horizon-text3); }

.horizon-search-input:focus {
    outline: none;
    border-color: var(--horizon-primary);
}

.horizon-search-btn {
    padding: 8px 16px;
    background: var(--horizon-primary);
    border: none;
    border-radius: var(--horizon-radius);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.horizon-search-btn:hover { background: var(--horizon-primary-hover); }

.horizon-menu-btn {
    display: none;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--horizon-border);
    border-radius: var(--horizon-radius);
    color: var(--horizon-text);
    font-size: 18px;
    cursor: pointer;
}

.horizon-menu-btn:hover { background: var(--horizon-border); }

/* 主内容 */
.horizon-main { flex: 1; }

.horizon-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* 首页精选 */
.horizon-hero {
    margin-bottom: 36px;
}

.horizon-hero-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--horizon-text);
}

.horizon-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.horizon-hero-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--horizon-card);
    border-radius: var(--horizon-radius);
    overflow: hidden;
    box-shadow: var(--horizon-shadow);
    transition: box-shadow .2s, transform .2s;
}

.horizon-hero-card:hover {
    box-shadow: var(--horizon-shadow-hover);
    transform: translateY(-3px);
}

.horizon-hero-pic {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--horizon-border);
}

.horizon-hero-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.horizon-hero-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.4);
    color: #fff;
    font-size: 40px;
    opacity: 0;
    transition: opacity .2s;
}

.horizon-hero-card:hover .horizon-hero-play { opacity: 1; }

.horizon-hero-info { padding: 12px; }

.horizon-hero-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--horizon-primary);
    margin-bottom: 4px;
}

.horizon-hero-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.horizon-hero-meta {
    font-size: 12px;
    color: var(--horizon-text2);
    margin-top: 6px;
}

/* 区块 */
.horizon-block {
    margin-bottom: 36px;
}

.horizon-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.horizon-block-title {
    font-size: 18px;
    font-weight: 700;
}

.horizon-block-title a {
    color: var(--horizon-text);
    text-decoration: none;
}

.horizon-block-title a:hover { color: var(--horizon-primary); }

.horizon-block-more {
    font-size: 14px;
    color: var(--horizon-primary);
    text-decoration: none;
}

.horizon-block-more:hover { color: var(--horizon-primary-hover); text-decoration: underline; }

/* 卡片网格 */
.horizon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.horizon-card {
    background: var(--horizon-card);
    border-radius: var(--horizon-radius);
    overflow: hidden;
    box-shadow: var(--horizon-shadow);
    transition: box-shadow .2s, transform .2s;
}

.horizon-card:hover {
    box-shadow: var(--horizon-shadow-hover);
    transform: translateY(-2px);
}

.horizon-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.horizon-card-pic {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--horizon-border);
}

.horizon-card-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.horizon-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    color: #fff;
    font-size: 28px;
    opacity: 0;
    transition: opacity .2s;
}

.horizon-card:hover .horizon-card-play { opacity: 1; }

.horizon-card-score {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 12px;
    color: #fbbf24;
    background: rgba(0,0,0,.6);
    padding: 2px 6px;
    border-radius: 6px;
}

.horizon-card-num {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 11px;
    color: #fff;
    background: rgba(0,0,0,.6);
    padding: 2px 6px;
    border-radius: 6px;
}

.horizon-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    color: #fff;
    background: var(--horizon-primary);
    padding: 2px 6px;
    border-radius: 6px;
}

.horizon-card-info { padding: 10px; }

.horizon-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.horizon-card-meta {
    font-size: 12px;
    color: var(--horizon-text2);
    margin-top: 4px;
}

/* 列表页 */
.horizon-list-head { margin-bottom: 20px; }

.horizon-list-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.horizon-list-sub { font-size: 14px; color: var(--horizon-text2); }

.horizon-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    padding: 16px;
}

.horizon-pag-btn {
    padding: 10px 20px;
    background: var(--horizon-primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--horizon-radius);
    font-weight: 600;
}

.horizon-pag-btn:hover { background: var(--horizon-primary-hover); }

.horizon-pag-info { color: var(--horizon-text2); }

.horizon-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--horizon-text2);
}

/* 面包屑 */
.horizon-breadcrumb {
    font-size: 14px;
    color: var(--horizon-text2);
    margin-bottom: 20px;
}

.horizon-breadcrumb a {
    color: var(--horizon-primary);
    text-decoration: none;
}

.horizon-breadcrumb a:hover { text-decoration: underline; }

.horizon-bread-sep { margin: 0 6px; }

/* 详情 */
.horizon-detail {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
    align-items: start;
}

.horizon-detail-main { min-width: 0; }

.horizon-detail-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

.horizon-detail-ep {
    font-size: 16px;
    font-weight: 500;
    color: var(--horizon-primary);
    margin-left: 8px;
}

.horizon-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--horizon-text2);
}

.horizon-meta-tag {
    padding: 4px 10px;
    background: rgba(79, 70, 229, .12);
    color: var(--horizon-primary);
    border-radius: 6px;
}

.horizon-detail-desc { margin-top: 20px; }

.horizon-detail-desc h3 { font-size: 16px; margin-bottom: 8px; }

.horizon-detail-desc p {
    font-size: 14px;
    color: var(--horizon-text2);
    line-height: 1.7;
}

/* 播放器 */
.horizon-player { margin-bottom: 20px; }

.horizon-player-wrap {
    position: relative;
    border-radius: var(--horizon-radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--horizon-shadow-hover);
}

.horizon-player-box {
    aspect-ratio: 16/9;
    width: 100%;
}

.horizon-episode-nav {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.horizon-ep-nav-btn {
    padding: 10px 16px;
    background: var(--horizon-primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--horizon-radius);
    font-weight: 600;
    font-size: 14px;
}

.horizon-ep-nav-btn:hover { background: var(--horizon-primary-hover); }

.horizon-ep-nav-btn.is-disabled {
    background: var(--horizon-border);
    color: var(--horizon-text2);
    cursor: default;
}

.horizon-episode {
    margin-top: 20px;
    padding: 16px;
    background: var(--horizon-card);
    border-radius: var(--horizon-radius);
    box-shadow: var(--horizon-shadow);
}

.horizon-episode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.horizon-episode-title { font-size: 16px; font-weight: 600; }

.horizon-episode-sort {
    padding: 6px 12px;
    border: 1px solid var(--horizon-border);
    border-radius: 6px;
    background: var(--horizon-bg);
    color: var(--horizon-text2);
    font-size: 13px;
    cursor: pointer;
}

.horizon-episode-sort:hover { border-color: var(--horizon-primary); color: var(--horizon-primary); }

.horizon-episode-group { margin-bottom: 12px; }

.horizon-episode-line {
    font-size: 13px;
    color: var(--horizon-text2);
    margin-bottom: 8px;
}

.horizon-episode-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.horizon-ep-item {
    display: inline-block;
    padding: 8px 14px;
    background: var(--horizon-bg);
    border: 1px solid var(--horizon-border);
    border-radius: 6px;
    color: var(--horizon-text);
    text-decoration: none;
    font-size: 13px;
    transition: border-color .2s, background .2s, color .2s;
}

.horizon-ep-item:hover,
.horizon-ep-item.is-active {
    border-color: var(--horizon-primary);
    background: rgba(79, 70, 229, .1);
    color: var(--horizon-primary);
}

/* 侧边推荐 */
.horizon-detail-side { position: sticky; top: 24px; }

.horizon-side-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

.horizon-side-list { list-style: none; }

.horizon-side-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--horizon-border);
    text-decoration: none;
    color: inherit;
    transition: background .2s;
}

.horizon-side-item:hover { background: var(--horizon-bg); }

.horizon-side-pic {
    width: 72px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--horizon-border);
}

.horizon-side-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.horizon-side-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.horizon-side-name {
    font-size: 14px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.horizon-side-score { font-size: 12px; color: var(--horizon-primary); margin-top: 4px; }

/* 页脚 */
.horizon-footer {
    margin-top: auto;
    padding: 24px 20px;
    background: var(--horizon-card);
    border-top: 1px solid var(--horizon-border);
}

.horizon-footer-text {
    font-size: 13px;
    color: var(--horizon-text2);
    text-align: center;
}

.horizon-footer-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--horizon-border);
}

.horizon-footer-tag {
    font-size: 13px;
    color: var(--horizon-text2);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--horizon-bg);
    transition: color .2s, background .2s;
}

.horizon-footer-tag:hover {
    color: var(--horizon-primary);
    background: rgba(79, 70, 229, .12);
}

/* 移动端 */
@media (max-width: 900px) {
    .horizon-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 260px;
        max-width: 85vw;
        background: var(--horizon-card);
        flex-direction: column;
        align-items: stretch;
        padding: 60px 16px 24px;
        box-shadow: -4px 0 20px rgba(0,0,0,.1);
        z-index: 150;
        transform: translateX(100%);
        transition: transform .25s ease;
        overflow-y: auto;
    }
    .horizon-nav.is-open { transform: translateX(0); }
    .horizon-nav-link { padding: 12px 14px; }
    .horizon-search { margin-left: 0; max-width: none; }
    .horizon-menu-btn { display: block; }
}

@media (max-width: 768px) {
    .horizon-detail { grid-template-columns: 1fr; }
    .horizon-detail-side { position: static; }
    .horizon-hero-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .horizon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
