/*
Theme Name: 自由影记
Theme URI: https://ziyoukan.cn
Description: 自由影记 - 基于TMDB API的电影资料库主题。零侵权风险，纯元数据展示。
Version: 1.0.0
Author: 自由影记
Author URI: https://ziyoukan.cn
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ziyouyingji
Tags: movie, database, tmdb, film-library

本主题仅用于电影元数据展示，不提供任何视频播放或下载功能。
*/

/* ========================================
   自由影记 - 核心样式
   ======================================== */

/* CSS 变量定义 */
:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #e94560;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-light: #f8f9fa;
    --bg-dark: #0f0f23;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.2);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* 重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.2em; }
h2 { font-size: 1.8em; }
h3 { font-size: 1.4em; }
h4 { font-size: 1.2em; }

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.site-header {
    background: var(--bg-dark);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo a {
    color: #fff;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 1px;
}

.site-logo span {
    color: var(--accent-color);
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: rgba(255,255,255,0.85);
    font-size: 15px;
    padding: 8px 0;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-normal);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* 移动端菜单 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

/* 搜索框 */
.header-search {
    display: flex;
    align-items: center;
}

.header-search input {
    padding: 8px 15px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    width: 200px;
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
    border-color: var(--accent-color);
    width: 260px;
}

.header-search input::placeholder {
    color: rgba(255,255,255,0.5);
}

/* 页面标题区 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 40px 0;
    margin-bottom: 40px;
}

.page-header h1 {
    margin-bottom: 10px;
}

.page-header p {
    color: rgba(255,255,255,0.8);
    font-size: 16px;
}

/* 筛选栏 */
.filter-section {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-bar .filter-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 10px;
}

.filter-tag {
    display: inline-block;
    padding: 6px 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 影视网格 */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.media-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.media-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.media-poster {
    position: relative;
    aspect-ratio: 2/3;
    background: #eee;
    overflow: hidden;
}

.media-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.media-card:hover .media-poster img {
    transform: scale(1.05);
}

.media-poster .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 14px;
}

.media-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.75);
    color: #ffd700;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
}

.media-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.media-type-badge.movie {
    background: #27ae60;
    color: #fff;
}

.media-type-badge.tv {
    background: #3498db;
    color: #fff;
}

.media-info {
    padding: 15px;
}

.media-info h3 {
    font-size: 15px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-light);
}

/* 详情页布局 */
.detail-layout {
    display: flex;
    gap: 50px;
    margin: 40px 0;
}

.detail-poster {
    flex: 0 0 300px;
}

.detail-poster img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.detail-content {
    flex: 1;
    min-width: 0;
}

.detail-content h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--accent-color);
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-item .label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.meta-item .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.meta-item .value.rating {
    color: var(--accent-color);
}

.section-title {
    font-size: 1.3em;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* 演职员表 */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cast-card {
    text-align: center;
}

.cast-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
    background: #eee;
}

.cast-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cast-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cast-role {
    font-size: 12px;
    color: var(--text-light);
}

/* 演员电影列表 */
.actor-movies {
    margin: 30px 0;
}

.actor-movies h3 {
    margin-bottom: 20px;
}

/* 排行榜 */
.ranking-list {
    margin: 30px 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.ranking-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.ranking-number {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    background: rgba(233, 69, 96, 0.1);
    border-radius: 50%;
    margin-right: 20px;
}

.ranking-poster {
    width: 60px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-right: 20px;
    background: #eee;
}

.ranking-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-info {
    flex: 1;
}

.ranking-info h4 {
    margin-bottom: 5px;
}

.ranking-info p {
    font-size: 13px;
    color: var(--text-light);
}

.ranking-score {
    text-align: center;
}

.ranking-score .score {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
}

.ranking-score .label {
    font-size: 11px;
    color: var(--text-light);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination .current {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* 页脚 */
.site-footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255,255,255,0.7);
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 14px;
}

.footer-disclaimer {
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    font-size: 13px;
    line-height: 1.8;
}

.footer-disclaimer p {
    margin-bottom: 10px;
}

.footer-disclaimer strong {
    color: var(--accent-color);
}

/* 免责声明 */
.disclaimer-box {
    background: var(--bg-light);
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.disclaimer-box strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-light);
}

.loading::before {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        padding: 20px;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 15px;
    }

    .menu-toggle {
        display: block;
    }

    .header-search input {
        width: 150px;
    }

    .header-search input:focus {
        width: 180px;
    }

    .detail-layout {
        flex-direction: column;
    }

    .detail-poster {
        flex: none;
        max-width: 250px;
        margin: 0 auto;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
}

/* 辅助类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }
.bg-light { background: var(--bg-light); }
