/* =========================================
   Optima 影视模板 - 完整样式
   ========================================= */

/* ===== 全局基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 1px;
    color: #333;
    background: #f5f7fa;
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

a:hover {
    color: #1677ff;
}

ul, ol {
    list-style: none;
}

img {
    border: 0;
    max-width: 100%;
    vertical-align: middle;
}

h1, h2, h3, h4 {
    font-weight: 600;
    color: #1d2129;
}

/* ===== 顶部公告栏 ===== */
.optima-top-bar {
    height: 32px;
    line-height: 32px;
    background: #f0f2f5;
    border-bottom: 1px solid #e5e6eb;
    font-size: 12px;
    color: #86909c;
}

.optima-top-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
}

.optima-top-links a {
    color: #86909c;
    margin: 0 4px;
}

.optima-top-links a:hover {
    color: #1677ff;
}

/* ===== 主导航 ===== */
.optima-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.optima-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.optima-logo {
    font-size: 22px;
    font-weight: 700;
    color: #1677ff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.optima-nav {
    flex: 1;
    display: flex;
    gap: 4px;
}

.optima-nav > li {
    position: relative;
}

.optima-nav > li > a {
    display: block;
    padding: 0 18px;
    line-height: 68px;
    font-size: 15px;
    color: #4e5969;
    font-weight: 500;
}

.optima-nav > li > a.active,
.optima-nav > li > a:hover {
    color: #1677ff;
}

/* PC二级下拉 */
.optima-nav li ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 140px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 6px 0;
    display: none;
    z-index: 99;
}

.optima-nav li:hover ul {
    display: block;
}

.optima-nav li ul li a {
    display: block;
    padding: 0 18px;
    line-height: 38px;
    font-size: 13px;
    color: #4e5969;
}

.optima-nav li ul li a:hover {
    background: #f2f3f5;
    color: #1677ff;
}

/* 搜索框 */
.optima-search {
    flex-shrink: 0;
}

.optima-search form {
    display: flex;
    align-items: center;
}

.optima-search input {
    width: 220px;
    height: 38px;
    border: 1px solid #e5e6eb;
    background: #f7f8fa;
    border-radius: 19px;
    padding: 0 18px;
    outline: none;
    font-size: 13px;
    transition: all 0.3s;
}

.optima-search input:focus {
    border-color: #1677ff;
    background: #fff;
}

.optima-search button {
    height: 38px;
    padding: 0 20px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 19px;
    cursor: pointer;
    font-size: 13px;
    margin-left: -38px;
}

/* 移动端菜单按钮 */
.optima-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}

.optima-menu-btn span {
    width: 24px;
    height: 2px;
    background: #1d2129;
    border-radius: 2px;
    transition: 0.3s;
}

/* ===== 面包屑导航 ===== */
.bread-crumb-nav {
    max-width: 1280px;
    margin: 16px auto;
    padding: 0 20px;
    font-size: 13px;
    color: #86909c;
}

.bread-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.bread-crumbs li {
    display: flex;
    align-items: center;
}

.bread-crumbs li + li::before {
    content: "›";
    margin: 0 8px;
    color: #c9cdd4;
}

.bread-crumbs li a {
    color: #86909c;
    transition: color 0.3s;
}

.bread-crumbs li a:hover {
    color: #1677ff;
}

.bread-crumbs li.home a {
    color: #1677ff;
    font-weight: 500;
}

.bread-crumbs li.back {
    margin-left: auto;
}

.bread-crumbs li.back a {
    padding: 3px 10px;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    background: #fff;
}

.bread-crumbs li.back a:hover {
    border-color: #1677ff;
    color: #1677ff;
}

.fn-clear::after {
    content: "";
    display: block;
    clear: both;
}

/* ===== 主容器 ===== */
.optima-container {
    max-width: 1280px;
    margin: 0 auto 30px;
    padding: 0 20px;
    display: flex;
    gap: 24px;
}

.optima-main {
    flex: 1;
    min-width: 0;
}

.optima-aside {
    width: 320px;
    flex-shrink: 0;
}

/* ===== 区块标题 ===== */
.optima-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1677ff;
}

.optima-section-title h3 {
    font-size: 1px;
}

.optima-section-title a {
    font-size: 13px;
    color: #86909c;
}

.optima-section-title a:hover {
    color: #1677ff;
}

/* ===== 分区带侧边排行榜布局 ===== */
.optima-section-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 32px;
}

.optima-section-main {
    flex: 1;
    min-width: 0;
}

.optima-section-side {
    width: 300px;
    flex-shrink: 0;
}

/* ===== 首页焦点推荐区 ===== */
.optima-featured {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    height: 360px;
    margin-bottom: 30px;
}

.optima-featured-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e6eb;
}

.optima-featured-item:first-child {
    grid-row: span 2;
}

.optima-featured-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.optima-featured-item:hover img {
    transform: scale(1.05);
}

.optima-featured-mask {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
}

.optima-featured-mask h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 4px;
}

.optima-featured-item:first-child .optima-featured-mask h4 {
    font-size: 20px;
}

.optima-featured-mask p {
    font-size: 12px;
    opacity: 0.85;
}

/* =========================================
   筛选页：左右滑动
   ========================================= */
.optima-filter-panel {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.optima-filter-group {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px dashed #f0f2f5;
}

.optima-filter-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.optima-filter-label {
    width: 60px;
    flex-shrink: 0;
    font-size: 13px;
    color: #86909c;
    padding-top: 4px;
    font-weight: 500;
}

.optima-filter-options {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.optima-filter-options::-webkit-scrollbar {
    display: none;
}

.optima-filter-options a {
    flex: 0 0 auto;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 13px;
    background: #f5f7fa;
    color: #4e5969;
    white-space: nowrap;
}

.optima-filter-options a.active {
    background: #1677ff;
    color: #fff;
}

.optima-filter-options a:hover {
    background: #e8f3ff;
    color: #1677ff;
}

.optima-filter-options a.active:hover {
    background: #1677ff;
    color: #fff;
}

/* ===== 排序栏 ===== */
.optima-sort-bar {
    background: #fff;
    border-radius: 10px;
    padding: 0 20px;
    margin-bottom: 20px;
    height: 44px;
    line-height: 44px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.optima-sort-list {
    display: flex;
    gap: 24px;
}

.optima-sort-item {
    font-size: 13px;
    color: #4e5969;
}

.optima-sort-item.active {
    color: #1677ff;
    font-weight: 500;
}

/* =========================================
   视频卡片：封面固定比例，不再被遮挡
   ========================================= */
.optima-video-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.optima-video-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}

.optima-video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.optima-card-cover {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #e5e6eb;
    overflow: hidden;
    flex: none;
}

.optima-card-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.optima-video-card:hover .optima-card-cover img {
    transform: scale(1.06);
}

.optima-card-score {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(22, 119, 255, 0.9);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    z-index: 2;
}

.optima-card-episode {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 2;
}

.optima-card-info {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
}

.optima-card-info h4 {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.optima-card-info p {
    font-size: 12px;
    color: #86909c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 分页 ===== */
.optima-pagination {
    text-align: center;
    margin-top: 30px;
}

.optima-pagination a {
    display: inline-block;
    min-width: 34px;
    height: 34px;
    line-height: 32px;
    padding: 0 12px;
    margin: 0 4px;
    border: 1px solid #e5e6eb;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    color: #4e5969;
}

.optima-pagination a.current {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
}

.optima-pagination a:hover:not(.current) {
    border-color: #1677ff;
    color: #1677ff;
}

/* ===== 侧边栏组件 ===== */
.optima-widget {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.optima-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f2f5;
}

.optima-rank-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    border-bottom: 1px dashed #f0f2f5;
}

.optima-rank-list li:last-child {
    border-bottom: none;
}

.optima-rank-num {
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: #f2f3f5;
    border-radius: 4px;
    font-size: 12px;
    color: #86909c;
    flex-shrink: 0;
    font-weight: 500;
}

.optima-rank-list li:nth-child(1) .optima-rank-num {
    background: #ff4d4f;
    color: #fff;
}

.optima-rank-list li:nth-child(2) .optima-rank-num {
    background: #ff7a45;
    color: #fff;
}

.optima-rank-list li:nth-child(3) .optima-rank-num {
    background: #ffc53d;
    color: #fff;
}

.optima-rank-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.optima-rank-hits {
    font-size: 12px;
    color: #c9cdd4;
    flex-shrink: 0;
}

/* ===== 详情页 ===== */
.optima-detail-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.optima-detail-head {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.optima-detail-poster {
    width: 200px;
    height: 280px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f2f5;
}

.optima-detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.optima-detail-body {
    flex: 1;
    min-width: 0;
}

.optima-detail-body h1 {
    font-size: 24px;
    margin-bottom: 16px;
}

.optima-detail-meta {
    line-height: 2.2;
    font-size: 14px;
    color: #4e5969;
}

.optima-detail-meta dt {
    display: inline-block;
    width: 70px;
    color: #86909c;
}

.optima-detail-meta dd {
    display: inline;
    margin-right: 12px;
}

.optima-detail-btn {
    margin-top: 20px;
}

.optima-detail-btn a {
    display: inline-block;
    padding: 10px 32px;
    background: #1677ff;
    color: #fff;
    border-radius: 6px;
    font-size: 15px;
}

.optima-detail-btn a:hover {
    background: #0958d9;
}

.optima-detail-block {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f2f5;
}

.optima-detail-block h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.optima-detail-block p {
    color: #4e5969;
    line-height: 1.8;
    font-size: 14px;
}

/* ===== 集数列表 ===== */
.optima-episode-wrap {
    margin-top: 10px;
}

.optima-episode-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.optima-episode-item {
    width: calc(10% - 7.2px);
}

.optima-episode-item a {
    display: block;
    text-align: center;
    padding: 8px 0;
    background: #f5f7fa;
    border-radius: 6px;
    font-size: 13px;
}

.optima-episode-item a:hover {
    background: #e8f3ff;
    color: #1677ff;
}

.optima-episode-more {
    text-align: center;
    margin-top: 16px;
}

.optima-episode-more a {
    color: #1677ff;
    cursor: pointer;
    font-size: 13px;
}

.optima-episode-hidden {
    display: none;
}

/* ===== 播放器 ===== */
.optima-player-box {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    aspect-ratio: 16 / 9;
}

.optima-player-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== 评论区 ===== */
.optima-comment-section {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.optima-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
}

.optima-comment-header h2 {
    font-size: 18px;
}

.optima-comment-count {
    font-size: 13px;
    color: #86909c;
}

.optima-comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px dashed #f0f2f5;
}

.optima-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1677ff, #4096ff);
    color: #fff;
    text-align: center;
    line-height: 40px;
    flex-shrink: 0;
    font-size: 14px;
}

.optima-comment-body {
    flex: 1;
    min-width: 0;
}

.optima-comment-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
}

.optima-comment-user {
    font-weight: 500;
    color: #1d2129;
}

.optima-comment-tag {
    color: #86909c;
    font-size: 12px;
}

.optima-comment-stars {
    color: #ff7a45;
    font-size: 12px;
}

.optima-comment-time {
    margin-left: auto;
    color: #c9cdd4;
    font-size: 12px;
}

.optima-comment-text {
    font-size: 14px;
    color: #4e5969;
    line-height: 1.7;
}

.optima-comment-useful {
    text-align: right;
    margin-top: 8px;
    font-size: 12px;
    color: #c9cdd4;
}

/* ===== 底部 ===== */
.optima-footer {
    background: #1d2129;
    padding: 32px 0 24px;
    margin-top: 40px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

.optima-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.optima-footer-links {
    margin-bottom: 16px;
}

.optima-footer-links a {
    color: rgba(255,255,255,0.75);
    margin: 0 10px;
}

.optima-footer-links a:hover {
    color: #4096ff;
}

.optima-footer p {
    line-height: 2;
}

/* ===== 回到顶部 ===== */
.optima-back-top {
    position: fixed;
    right: 30px;
    bottom: 60px;
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    line-height: 48px;
    cursor: pointer;
    display: none;
    z-index: 99;
    font-size: 18px;
    color: #1677ff;
    transition: all 0.3s;
}

.optima-back-top:hover {
    background: #1677ff;
    color: #fff;
}

/* =========================================
   响应式适配
   ========================================= */
@media screen and (max-width: 1200px) {
    .optima-video-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media screen and (max-width: 1024px) {
    .optima-video-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .optima-aside {
        width: 280px;
    }

    .optima-section-side {
        width: 260px;
    }

    .optima-featured {
        height: 300px;
    }

    .optima-episode-item {
        width: calc(20% - 6.4px);
    }
}

@media screen and (max-width: 768px) {
    .optima-top-bar {
        display: none;
    }

    .optima-header-inner {
        height: 56px;
        gap: 15px;
    }

    .optima-logo {
        font-size: 18px;
    }

    .optima-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .optima-nav.show {
        display: flex;
    }

    .optima-nav > li > a {
        line-height: 48px;
        border-bottom: 1px solid #f0f2f5;
        padding: 0 20px;
    }

    /* 移动端二级菜单 */
    .optima-nav li ul {
        position: static;
        transform: none !important;
        box-shadow: none;
        display: none;
        padding: 0 0 0 30px;
        background: #f7f8fa;
        border-radius: 0;
    }

    .optima-nav li.sub-open ul {
        display: block;
    }

    .optima-nav li ul li a {
        line-height: 40px;
        border-bottom: 1px solid #eef0f3;
        color: #4e5969;
    }

    .optima-menu-btn {
        display: flex;
    }

    .optima-search input {
        width: 140px;
        height: 34px;
    }

    .optima-search button {
        height: 34px;
    }

    .optima-container {
        flex-direction: column;
    }

    .optima-aside {
        width: 100%;
    }

    .optima-section-row {
        flex-direction: column;
    }

    .optima-section-side {
        width: 100%;
    }

    .optima-featured {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 180px 120px 120px;
        height: auto;
    }

    .optima-featured-item:first-child {
        grid-column: span 2;
        grid-row: span 1;
    }

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

    /* 手机端封面同样固定比例 */
    .optima-card-cover {
        aspect-ratio: 3 / 4;
    }

    .optima-detail-head {
        flex-direction: column;
        align-items: center;
    }

    .optima-detail-body {
        text-align: center;
    }

    .optima-episode-item {
        width: calc(25% - 6px);
    }
}

@media screen and (max-width: 480px) {
    .optima-video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .optima-card-cover {
        aspect-ratio: 3 / 4;
    }

    .optima-search input {
        width: 100px;
    }

    .optima-featured {
        grid-template-rows: 160px 100px 100px;
    }

    .optima-episode-item {
        width: calc(33.33% - 5.3px);
    }
}
