
.main-content {
    padding-top: 80px;
    background: #f8f8f8;
    min-height: 100vh;
}

.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
}

.detail-main {
    flex: 1;
    min-width: 0; /* 防止flex子项溢出 */
}

.detail-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.sidebar-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 15px;
}

.sidebar-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-recommendations {
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-poster {
    width: 90px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}

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

.sidebar-info {
    flex: 1;
    min-width: 0;
    padding: 5px 0;
}

.sidebar-info h3 {
    font-size: 14px;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sidebar-info p {
    font-size: 12px;
    color: #999;
}

.sidebar-item:hover {
    background: #f9f9f9;
}

/* 响应式布局 */
@media (max-width: 992px) {
    .detail-container {
        flex-direction: column;
    }
    
    .detail-sidebar {
        width: 100%;
    }
    
    .sidebar-recommendations {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .sidebar-item {
        border: 1px solid #f0f0f0;
        border-radius: 8px;
        padding: 12px;
    }
}

.movie-info-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
}

.movie-content {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
    position: relative;
    height: auto;
    min-height: 360px;
}

.movie-poster-wrap {
    width: 240px;
    height: 360px;
    flex-shrink: 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.movie-poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
}

.movie-poster-wrap.loaded img {
    opacity: 1;
}

.movie-info-wrap {
    flex: 1;
    min-width: 0;
    padding: 10px 0;
    height: auto;
    min-height: 360px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.movie-title {
    font-size: 20px;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: flex;
    align-items: baseline;
    flex-shrink: 0;
}

.movie-title .year {
    font-size: 14px;
    color: #999;
    margin-left: 8px;
    font-weight: normal;
}

.movie-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    padding-right: 10px;
    margin: 0;
    overflow: visible;
}

.meta-item {
    display: flex;
    position: relative;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
    min-height: fit-content;
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-label {
    color: #999;
    width: 42px;
    flex-shrink: 0;
    position: relative;
    padding-right: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.meta-content {
    flex: 1;
    min-width: 0;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    padding: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 美化滚动条 */
.movie-meta::-webkit-scrollbar {
    width: 4px;
}

.movie-meta::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 2px;
}

.movie-meta::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.movie-meta::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* 主演特殊处理 */
.meta-item.actors {
    min-height: 36px;
}

.meta-item.actors span:last-child {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-item .rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item .rating strong {
    color: #ff6b81;
    font-size: 15px;
}

.meta-item .rating small {
    color: #999;
    font-size: 12px;
}

/* 骨架屏动画 */
.meta-item::before {
    content: '';
    position: absolute;
    left: 42px;
    right: 8px;
    top: 10px;
    height: calc(100% - 20px);
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    z-index: 1;
}

.movie-info-wrap.loaded .meta-item::before {
    display: none;
}

.movie-info-wrap.loaded .meta-content {
    opacity: 1;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.movie-desc {
    padding-top: 20px;
}

.movie-desc h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.description-content {
    position: relative;
}

.desc-text {
    font-size: 14px;
    line-height: 1.8;
    color: #666;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-bottom: 0;
}

.desc-text.collapsed {
    max-height: 3.6em;  /* 显示两行文字 */
    -webkit-line-clamp: 2;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expand-btn {
    position: absolute;
    right: 0;
    bottom: 0;
    background: #fff;
    padding: 0 0 0 20px;
    border: none;
    cursor: pointer;
    color: #ff6b81;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* 确保按钮在文字上层 */
    z-index: 2;
    /* 添加渐变背景遮罩 */
    background: linear-gradient(to left, #fff 60%, rgba(255,255,255,0));
}

.expand-btn:hover {
    color: #ff8296;
}

.expand-btn .less {
    display: none;
}

.description-content.expanded .expand-btn .more {
    display: none;
}

.description-content.expanded .expand-btn .less {
    display: inline;
}

.description-content.expanded .desc-text {
    max-height: none;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.expand-btn i {
    font-size: 12px;
    transition: transform 0.3s;
}

.description-content.expanded .expand-btn i {
    transform: rotate(180deg);
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .desc-text {
        font-size: 13px;
        line-height: 1.6;
    }
    
    .expand-btn {
        font-size: 12px;
        padding-left: 15px;
    }
}

@media (max-width: 768px) {
    .movie-content {
        flex-direction: column;
    }
    
    .movie-poster-wrap {
        width: 180px;
        margin: 0 auto 20px;
    }
}

/* 骨架屏样式 */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-wrapper {
    position: relative;
}

.skeleton-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-title {
    height: 32px;
    width: 70%;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line:nth-child(1) { width: 60%; }
.skeleton-line:nth-child(2) { width: 45%; }
.skeleton-line:nth-child(3) { width: 70%; }
.skeleton-line:nth-child(4) { width: 55%; }
.skeleton-line:nth-child(5) { width: 40%; }
.skeleton-line:nth-child(6) { width: 65%; }
.skeleton-line:nth-child(7) { width: 50%; }
.skeleton-line:nth-child(8) { width: 45%; }

.loaded .skeleton-poster,
.loaded .skeleton-title,
.loaded .skeleton-line {
    display: none;
}

.movie-meta .meta-item {
    position: relative;
}

.movie-meta .skeleton-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    z-index: 1;
}

.meta-label, 
.meta-item span:last-child {
    position: relative;
    z-index: 2;
}

.movie-info-wrap.loaded .skeleton-line {
    display: none;
}

.download-section {
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.no-downloads {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
}

.no-downloads i {
    font-size: 16px;
    margin-right: 8px;
}

.tab-header {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: color 0.3s;
}

.tab-btn i {
    font-size: 14px;
}

.tab-btn.active {
    color: #ff6b81;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ff6b81;
}

.source-selector {
    margin-bottom: 15px;
    /* padding: 15px 0; */
    border-bottom: 1px solid #f5f5f5;
}

.source-btn {
    padding: 6px 16px;
    border: 1px solid #eee;
    background: #fff;
    color: #666;
    border-radius: 4px;
    font-size: 13px;
}

.source-btn.active {
    background: #ff6b81;
    color: #fff;
    border-color: #ff6b81;
}

.download-item {
    display: flex;
    padding: 10px 12px;
    background: #f8f9fa;  /* 更柔和的背景色 */
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 8px;
    transition: background-color 0.2s;
}

.download-item:hover {
    background: #f2f3f5;  /* 悬停时背景色变化 */
}

.episode {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-right: 10px;
    flex: 1;
    min-width: 0;
}

.episode i {
    font-size: 14px;
    padding: 6px;
    border-radius: 6px;
    background: #fff;  /* 图标添加白色背景 */
    color: #666;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);  /* 轻微阴影 */
}

/* 不同类型的图标颜色 */
.episode i.fa-baidu {
    color: #3388ff;
}

.episode i.fa-cube {
    color: #00b8a9;
}

.episode i.fa-bolt {
    color: #ff6b81;
}

.episode i.fa-link {
    color: #6c757d;
}

.episode a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
    min-width: 0;
    padding: 4px 0;  /* 增加点击区域 */
}

.copy-btn {
    padding: 6px 12px;
    border: 1px solid #eee;
    background: #fff;
    color: #666;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: fit-content;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.copy-btn i {
    font-size: 12px;
    transition: transform 0.2s;
}

.copy-btn:hover {
    background: #ff6b81;
    color: #fff;
    border-color: #ff6b81;
    transform: translateY(-1px);  /* 轻微上浮效果 */
    box-shadow: 0 2px 4px rgba(255,107,129,0.2);
}

.copy-btn:active {
    transform: translateY(0);  /* 点击时取消上浮 */
}

/* 复制成功状态 */
.copy-btn.copied {
    background: #52c41a;
    color: #fff;
    border-color: #52c41a;
}

.copy-btn.copied i {
    transform: scale(1.2);  /* 复制成功时图标缩放效果 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    .download-item {
        padding: 8px 10px;
    }

    .episode {
        max-width: calc(100% - 70px);
        gap: 6px;
    }

    .episode i {
        font-size: 12px;
        padding: 5px;
        width: 22px;
        height: 22px;
    }

    .copy-btn {
        padding: 4px 10px;
        min-width: 65px;
        font-size: 11px;
    }

    .copy-btn i {
        font-size: 11px;
    }
}

/* 针对更小屏幕的优化 */
@media (max-width: 360px) {
    .episode {
        max-width: calc(100% - 65px);
    }

    .copy-btn {
        min-width: 60px;
    }
}

/* 添加标签面板的显示控制 */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-content {
    margin-top: 20px;
}

/* 添加来源内容的显示控制 */
.source-content {
    display: none;
}

.source-content.active {
    display: block;
}
