/* ============================================
   程女士 · AI 影评宇宙 - 全局样式
   唯一样式源，所有页面共用
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
    /* 颜色 */
    --bg: #f5f5f7;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f5;
    --text: #1a1a2e;
    --text-secondary: #555566;
    --text-muted: #888899;
    --accent: #e50914;
    --gold: #f5c518;
    --border: rgba(0, 0, 0, 0.1);

    /* 布局 */
    --max-width: 1400px;
    --topbar-height: 56px;
    --radius: 10px;

    /* 字体 */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-serif: 'Georgia', 'Noto Serif SC', 'Source Han Serif CN', 'SimSun', serif;
}

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Agent 专属链接（对人类隐藏，Agent 可发现） */
.agent-only {
    display: none;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- 顶部导航 ---------- */
.topbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #fff5f5;
    padding: 2px;
    object-fit: contain;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.brand-logo:hover {
    width: 100px;
    height: 100px;
    border-radius: 14px;
    padding: 6px;
}

.brand-name {
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-desc {
    color: var(--text-muted);
    font-size: 0.82em;
    font-weight: 400;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9em;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.topbar-nav a:hover {
    color: var(--text);
    background: var(--bg-hover);
}

/* ---------- 主内容区 ---------- */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 40px 60px;
}

/* ---------- 页面标题 ---------- */
.page-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-stats {
    display: flex;
    gap: 24px;
    color: var(--text-muted);
    font-size: 0.88em;
}

.page-stats span strong {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- 电影网格 - 桌面端 4 列 ---------- */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.movie-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--accent);
}

.poster-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e0e0e8;
}

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

.poster-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85em;
    background: #e8e8f0;
}

.rating-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78em;
    font-weight: 600;
    color: var(--gold);
}

.card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.card-subtitle {
    font-size: 0.85em;
    color: var(--accent);
    font-weight: 500;
    line-height: 1.4;
}

.card-excerpt {
    font-size: 0.82em;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.card-year {
    font-size: 0.8em;
    color: var(--text-muted);
}

.card-link {
    font-size: 0.82em;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.card-link:hover {
    text-decoration: underline;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 28px 0;
    border-top: 1px solid var(--border);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.88em;
}

.pagination-links {
    display: flex;
    gap: 8px;
}

.pagination-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88em;
    padding: 6px 14px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.pagination-link:hover {
    color: var(--text);
    background: var(--bg-hover);
}

/* ---------- 页脚 ---------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    text-align: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: 40px;
    padding-right: 40px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85em;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.8em;
}

.footer-text a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-text a:hover {
    color: var(--text-secondary);
}

.agent-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8em;
}

.agent-info a {
    color: var(--text-secondary);
    text-decoration: none;
}

.agent-info code {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--gold);
}

/* ---------- 关于区域 ---------- */
.about-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 48px;
    border: 1px solid var(--border);
}

.about-section h2 {
    font-size: 1.3em;
    margin-bottom: 12px;
}

.about-section p {
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.7;
}

/* ---------- 文章页专用样式 ---------- */
body.article-page {
    font-family: var(--font-serif);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

/* 文章头部 */
.article-hero {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 0;
}

.article-category {
    font-family: var(--font-sans);
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 16px;
}

.article-title {
    font-size: 2.4em;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.article-deck {
    font-size: 1.2em;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-weight: 400;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-sans);
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85em;
    font-weight: 600;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text);
}

.article-date {
    font-size: 0.8em;
    color: var(--text-muted);
}

.rating-inline {
    margin-left: auto;
    font-size: 1.1em;
    color: var(--gold);
    letter-spacing: 2px;
}

/* 文章海报 */
.article-poster {
    max-width: 760px;
    margin: 24px auto 0;
    padding: 0 24px;
}

.article-poster img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* 文章正文 */
.article-body {
    max-width: 760px;
    margin: 0 auto;
    padding: 36px 24px 0;
}

.review-text {
    font-size: 1.05em;
    line-height: 1.9;
    color: var(--text);
}

.review-text p {
    margin-bottom: 1.6em;
    text-align: justify;
}

.review-text p:last-child {
    margin-bottom: 0;
}

.rating-final {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.rating-final .stars {
    font-size: 1.6em;
    letter-spacing: 4px;
    color: var(--gold);
}

/* 文章页页脚 */
.footer-copy {
    font-family: var(--font-sans);
    font-size: 0.78em;
    color: var(--text-muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main {
        padding: 24px 20px 40px;
    }
    .topbar-inner {
        padding: 0 20px;
    }
    .brand-desc {
        display: none;
    }
    .article-container {
        padding: 0 20px;
    }
    .article-title {
        font-size: 1.6em;
    }
    .article-deck {
        font-size: 1.05em;
    }
}

@media (max-width: 600px) {
    .movies-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .page-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
}
