﻿/* styles.css - 所有CSS样式优化版 */
@import url('https://fonts.googleapis.com/css2?family=PingFang+SC:wght@300;400;500;600&display=swap');

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-bg-main: #06090f;
    --color-bg-card: #0f172a;
    --color-bg-nav: #0d1117;
    --color-bg-nav-links: #0a0d14;
    --color-text-primary: #ffffff;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-border: rgba(148, 163, 184, 0.1);
    --color-highlight: #f59e0b;
}

* {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg-main);
    color: var(--color-text-secondary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.container-main {
    width: 1240px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.search-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), #1e3a8a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.search-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* 筛选标签样式 */
.filter-tag {
    background-color: #1e293b;
    color: var(--color-text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    font-size: 14px;
    user-select: none;
}

.filter-tag:hover {
    background-color: #334155;
    transform: translateY(-1px);
}

.filter-tag.active {
    background: linear-gradient(135deg, var(--color-primary), #1e3a8a);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.filter-tag:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* 海报卡片 */
.poster-card {
    background-color: var(--color-bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
    height: auto;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.poster-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(37, 99, 235, 0.3);
}

/* 海报区域 */
.poster-container {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 320px;
    min-height: 320px;
    width: 100%;
    flex-shrink: 0;
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(45deg, #1e293b, #334155);
    transition: transform 0.5s ease;
    display: block;
}

.poster-container:hover .poster-img {
    transform: scale(1.05);
}

/* 播放按钮 */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    z-index: 3;
}

.poster-container:hover .play-button {
    opacity: 1;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* 内容区域 */
.poster-card > .p-4 {
    padding: 14px 16px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

/* 文字信息 */
.movie-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 22px;
}

.poster-card:hover .movie-title {
    color: #60a5fa;
}

.movie-description {
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    flex-shrink: 0;
    min-height: 39px;
    max-height: 39px;
}

/* 筛选面板 */
.filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-panel.open {
    max-height: 700px;
}

/* 二维码样式 */
.qr-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: var(--color-bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    width: 280px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    transform: translateY(10px);
}

.qr-trigger:hover .qr-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.qr-popup:before {
    content: '';
    position: absolute;
    top: -8px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--color-bg-card);
}

.qr-code-img {
    width: 200px;
    height: 200px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    border: 1px solid #e5e7eb;
}

.qr-code-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 0;
    color: var(--color-text-muted);
}

/* 年份和分类网格布局 */
.filter-grid-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.year-grid {
    display: grid;
    grid-template-columns: repeat(12, auto);
    gap: 8px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(12, auto);
    gap: 8px;
}

.year-grid-offset,
.category-grid-offset {
    display: grid;
    grid-template-columns: repeat(11, auto);
    gap: 8px;
    margin-left: calc(100% / 12);
}

.filter-tag, .category-tag {
    min-width: 72px;
    text-align: center;
}

.category-tag {
    background-color: #1e293b;
    color: var(--color-text-secondary);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    min-width: 72px;
    text-align: center;
    font-size: 14px;
    user-select: none;
}

.category-tag:hover {
    background-color: #334155;
    transform: translateY(-1px);
}

.category-tag.active {
    background: linear-gradient(135deg, var(--color-primary), #1e3a8a);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* 评分徽章 */
.rating-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-weight: bold;
    font-size: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* 响应式调整 */
@media (min-width: 1280px) {
    .poster-container {
        height: 340px;
    }
    
    .poster-card {
        min-height: 520px;
    }
}

@media (max-width: 1279px) and (min-width: 1024px) {
    .poster-container {
        height: 300px;
    }
    
    .poster-card {
        min-height: 480px;
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .poster-container {
        height: 260px;
    }
    
    .poster-card {
        min-height: 440px;
    }
    
    .poster-card > .p-4 {
        padding: 12px 14px 14px 14px;
    }
    
    .movie-title {
        font-size: 15px;
    }
    
    .movie-description {
        font-size: 12.5px;
        min-height: 37px;
        max-height: 37px;
    }
}

@media (max-width: 767px) {
    .poster-container {
        height: 220px;
    }
    
    .poster-card {
        min-height: 400px;
    }
    
    .poster-card > .p-4 {
        padding: 10px 12px 12px 12px;
        min-height: 160px;
    }
    
    .movie-title {
        font-size: 15px;
    }
    
    .movie-description {
        font-size: 12px;
        min-height: 34px;
        max-height: 34px;
    }
    
    .year-grid,
    .category-grid {
        grid-template-columns: repeat(6, auto) !important;
    }
    
    .year-grid-offset,
    .category-grid-offset {
        grid-template-columns: repeat(5, auto) !important;
        margin-left: calc(100% / 12);
    }
}

@media (max-width: 480px) {
    .poster-container {
        height: 200px;
    }
    
    .poster-card {
        min-height: 380px;
    }
    
    .movie-description {
        min-height: 30px;
        max-height: 30px;
        line-height: 1.4;
    }
    
    .year-grid,
    .category-grid {
        grid-template-columns: repeat(4, auto) !important;
    }
    
    .year-grid-offset,
    .category-grid-offset {
        grid-template-columns: repeat(3, auto) !important;
        margin-left: 0;
    }
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5);
}

.back-to-top:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* 重置筛选按钮 */
.reset-filters {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

.reset-filters:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1e293b;
    color: var(--color-text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 14px;
}

.page-btn:hover {
    background-color: #334155;
    border-color: var(--color-primary);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--color-primary), #1e3a8a);
    color: white;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn.disabled:hover {
    background-color: #1e293b;
    border-color: transparent;
    transform: none;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--color-bg-card);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-left: 4px solid var(--color-primary);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 350px;
    backdrop-filter: blur(10px);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

/* 收藏按钮 */
.favorite-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--color-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.favorite-btn:hover {
    color: #fbbf24;
    background: rgba(15, 23, 42, 0.9);
}

.favorite-btn.active {
    color: #fbbf24;
}

.favorite-btn.active i {
    color: #fbbf24;
}

/* 标签云效果 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .filter-tag {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 加载更多按钮 */
.load-more {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 30px auto;
    display: block;
    font-size: 14px;
}

.load-more:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-primary-dark), #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.load-more:disabled {
    background: #475569;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* 导航链接样式 */
.nav-link-item {
    transition: all 0.2s ease;
    position: relative;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
}

.nav-link-item:hover {
    color: var(--color-text-primary);
    background: rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.nav-link-item.active {
    color: #60a5fa;
    font-weight: 500;
    background: rgba(37, 99, 235, 0.15);
}

.nav-link-item.active:after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 1px;
}

/* 图片加载动画 */
.image-loading {
    position: relative;
    overflow: hidden;
}

.image-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 骨架屏加载效果 */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-card);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* 筛选面板标题 */
.filter-title-highlight {
    color: var(--color-highlight);
    font-weight: 600;
}

/* 焦点样式 */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

*:focus:not(.focus-visible) {
    outline: none;
}

/* 打印样式 */
@media print {
    .back-to-top,
    .notification,
    .qr-popup,
    .search-btn,
    .reset-filters,
    .load-more,
    .favorite-btn,
    .play-button,
    .audio-control {
        display: none !important;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .poster-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 音效音量控制 */
.audio-control {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 999;
    background: var(--color-bg-card);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.audio-control:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.audio-control.muted {
    opacity: 0.6;
}

.audio-control.muted i {
    color: #ef4444;
}

.audio-control:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* 移除了管理入口按钮的相关CSS */

/* 网盘提示样式 */
.disk-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.4), transparent);
    color: white;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.poster-container:hover .disk-hint {
    opacity: 1;
    transform: translateY(0);
}

.disk-hint i {
    margin-right: 8px;
    font-size: 12px;
    color: #60a5fa;
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

@media (max-width: 768px) {
    .disk-hint {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .disk-hint i {
        font-size: 10px;
        margin-right: 6px;
    }
    
    .audio-control {
        bottom: 20px;
        left: 20px;
        width: 40px;
        height: 40px;
    }
}

/* 可访问性改进 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 性能优化相关 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}