/* style.css */

/* --- 1. 全局变量定义 (默认为亮色 Light Mode) --- */
:root {
    --bg-body: #ffffff;
    --bg-card: #f8f9fa;
    --bg-input: #f1f1f1;
    --text-main: #222222;
    --text-sub: #555555;      /* 亮色模式下的辅助文字 */
    --border-color: #e0e0e0;
    --poster-filter: none;
    --poster-hover-filter: none;
    --shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* --- 2. 暗色模式适配 (System Dark Mode) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0a0a0a;
        --bg-card: #141414;
        --bg-input: #111111;
        --text-main: #e0e0e0;
        --text-sub: #a0a0a0;  /* 暗色模式下的辅助文字 */
        --border-color: #222222;
        --poster-filter: grayscale(30%);
        --poster-hover-filter: grayscale(0%);
        --shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
}

/* --- 3. 基础样式 --- */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 300;
    line-height: 1.6;
    min-height: 100vh;
    /* 移除 transition，因为跟随系统切换通常不需要过渡动画，且避免闪烁 */
}

a { text-decoration: none; color: inherit; transition: opacity 0.3s; }
a:hover { opacity: 0.7; }

.container { max-width: 1200px; padding-left: 20px; padding-right: 20px; }

/* --- 4. 头部与导航 --- */
.site-header { 
    padding: 40px 0 20px; 
    text-align: center; 
    position: relative; 
}
.logo { 
    font-size: 1.8rem; 
    font-weight: 800; 
    letter-spacing: 4px; 
    color: var(--text-main); 
    text-transform: uppercase; 
    display: inline-block; 
    /* 移除之前的 margin-bottom，让 flex 布局控制垂直位置 */
    margin: 0; 
}

/* 返回链接样式 */
.back-link {
    color: var(--text-sub) !important;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.back-link:hover {
    color: var(--text-main) !important;
    text-decoration: underline;
}

/* --- 5. 首页元素 --- */
.archive-bar { margin-bottom: 40px; margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; font-family: monospace; font-size: 0.85rem; color: var(--text-sub); }
.archive-item.active { color: var(--text-main); text-decoration: underline; }

.movie-item { margin-bottom: 40px; }
.poster-wrapper { 
    position: relative; 
    aspect-ratio: 2/3; 
    background: var(--bg-card); 
    overflow: hidden; 
    margin-bottom: 15px; 
    border-radius: 2px; /* 圆角 2px */
}
.poster-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    filter: var(--poster-filter); 
    transition: transform 0.5s ease, filter 0.5s ease; 
}
.poster-wrapper:hover .poster-img { transform: scale(1.03); filter: var(--poster-hover-filter); }

.movie-title { font-size: 1.1rem; font-weight: 600; color: var(--text-main); margin-bottom: 4px; line-height: 1.3; }
.movie-year { color: var(--text-sub); font-weight: normal; font-size: 0.9em; }
.movie-meta { font-size: 0.75rem; color: var(--text-sub); font-family: monospace; letter-spacing: 1px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.rating-num { color: var(--bg-body); font-weight: bold; background: var(--text-main); padding: 1px 6px; border-radius: 2px; }
.short-review { font-size: 0.9rem; color: var(--text-sub); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }

/* --- 6. 详情页调整 --- */
.detail-poster-wrapper {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 2/3;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border-radius: 2px; /* 新增：详情页海报圆角 */
    overflow: hidden;   /* 确保图片圆角生效 */
}
.desc-text { font-size: 1.05rem; line-height: 1.8; color: var(--text-main); white-space: pre-wrap; text-align: left; text-indent: 0; margin-top: 10px; }

@media (max-width: 767px) {
    .detail-poster-wrapper { margin: 0 auto 30px auto; max-width: 200px; }
    .movie-info-col { text-align: left; padding: 0 10px; }
    .movie-title { font-size: 1.6rem; }
}

/* --- 7. Footer --- */
footer { border-top: 1px solid var(--border-color); padding: 40px 0; margin-top: 60px; color: var(--text-sub); font-size: 0.8rem; text-align: center; text-transform: uppercase; letter-spacing: 2px; }

/* --- 8. 404 页面 --- */
.error-page { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.error-code { font-size: 8rem; font-weight: 800; line-height: 1; color: var(--text-main); letter-spacing: -4px; margin-bottom: 10px; opacity: 0.1; }
.error-message { font-size: 1.5rem; font-weight: 300; color: var(--text-main); margin-bottom: 30px; letter-spacing: 2px; text-transform: uppercase; }
.btn-home { border: 1px solid var(--text-sub); color: var(--text-main); padding: 10px 30px; border-radius: 50px; font-size: 0.9rem; letter-spacing: 1px; transition: all 0.3s; background: transparent; }
.btn-home:hover { background-color: var(--text-main); color: var(--bg-body); border-color: var(--text-main); }
/* --- style.css 追加内容：分页组件样式 --- */
.pagination {
    margin-top: 40px;
    margin-bottom: 60px;
}

.page-link {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    margin: 0 3px;
    border-radius: 4px;
    font-size: 0.9rem;
    padding: 8px 16px;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: var(--border-color);
    color: var(--text-main);
    border-color: var(--text-sub);
}

.page-item.active .page-link {
    background-color: var(--text-main);
    color: var(--bg-body);
    border-color: var(--text-main);
    font-weight: bold;
}

.page-item.disabled .page-link {
    background-color: var(--bg-body);
    color: var(--text-sub);
    border-color: var(--border-color);
    opacity: 0.5;
}
