
:root {
    --color-primary: #4797b1;
    --color-green: #c5ecbe;
    --color-yellow: #f7f3ce;
    --color-pink: #ffdede;
    --color-white: #ffffff;
    --color-bg: #f8f9fa;
    --color-text: #1f2937;
    --color-text-secondary: #6b7280;
    --color-border: #e5e7eb;
    --color-star: #f59e0b;
    --radius: 6px;
    --max-width: 1200px;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: var(--color-text);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-nav {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 24px;
    gap: 16px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1.2rem;
    white-space: nowrap;
}
.brand-icon { font-weight: 700; font-size: 1.3rem; }
.nav-links { display: flex; list-style: none; gap: 4px; flex-wrap: wrap; }
.nav-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--color-primary); background: #f0f9ff; }
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 20px;
    transition: background 0.2s;
    white-space: nowrap;
}
.nav-user:hover { background: #f5f5f5; }
.nav-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 0.7rem;
}
.nav-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-user-info { font-size: 0.85rem; color: var(--color-text); line-height: 1.3; }
.nav-user-status { font-size: 0.7rem; color: var(--color-primary); }

.main-content { flex: 1; max-width: var(--max-width); margin: 0 auto; padding: 24px 20px 40px; width: 100%; }
.hero-banner {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 28px;
    height: 280px;
    background: #e8e8e8;
    display: flex;
    align-items: center;
}
.hero-banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.hero-overlay { position: relative; z-index: 2; padding: 32px 40px; max-width: 520px; }
.hero-tag {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 3px 12px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.hero-title { font-size: 2rem; font-weight: 700; color: #fff; margin-bottom: 8px; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.hero-subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.9); margin-bottom: 18px; line-height: 1.5; }
.hero-btn {
    display: inline-block;
    background: #fff;
    color: #1f2937;
    padding: 8px 22px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
}
.hero-btn:hover { opacity: 0.9; }
.hero-btn-secondary { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.6); margin-left: 8px; }
.hero-btn-secondary:hover { background: rgba(255,255,255,0.15); }

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.section-title { font-size: 1.2rem; font-weight: 600; color: #111827; }
.section-link { color: var(--color-primary); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.section-link:hover { text-decoration: underline; }

.weekly-rank-section {
    margin-bottom: 28px;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--color-border);
}
.weekly-rank-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.weekly-rank-grid::-webkit-scrollbar { height: 4px; }
.weekly-rank-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.rank-card {
    flex: 0 0 150px;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.rank-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.rank-card-img-wrap { position: relative; width: 100%; height: 200px; background: #f3f4f6; overflow: hidden; }
.rank-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.rank-card:hover .rank-card-img-wrap img { transform: scale(1.04); }
.rank-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.rank-badge.gold { background: #f0c040; color: #5c3d00; }
.rank-badge.silver { background: #bcc6d0; color: #333; }
.rank-badge.bronze { background: #d4946a; color: #fff; }
.rank-card-info { padding: 10px 12px; }
.rank-card-title { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-card-meta { font-size: 0.7rem; color: var(--color-text-secondary); margin-top: 2px; }
.rank-card-score { color: var(--color-star); font-weight: 600; font-size: 0.75rem; }

.hot-movies-section {
    margin-bottom: 28px;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--color-border);
}
.hot-movies-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.movie-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.movie-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.movie-card-img-wrap { position: relative; width: 100%; aspect-ratio: 2 / 3; background: #f3f4f6; overflow: hidden; }
.movie-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.movie-card:hover .movie-card-img-wrap img { transform: scale(1.04); }
.movie-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--color-primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 2;
}
.movie-card-quality {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 0.6rem;
    font-weight: 600;
    z-index: 2;
}
.movie-card-body { padding: 10px 12px 12px; }
.movie-card-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.movie-card-meta { font-size: 0.72rem; color: var(--color-text-secondary); display: flex; align-items: center; gap: 8px; }
.movie-card-score { color: var(--color-star); font-weight: 600; }
.movie-card-tag { background: #f0f0f0; padding: 1px 6px; border-radius: 3px; font-size: 0.65rem; }

.stars-section {
    margin-bottom: 28px;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--color-border);
}
.stars-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.star-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-align: center;
    padding: 20px 14px;
    transition: box-shadow 0.2s;
    cursor: pointer;
}
.star-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.star-avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    background: #f3f4f6;
    border: 2px solid var(--color-pink);
}
.star-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.star-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.star-role { font-size: 0.75rem; color: var(--color-text-secondary); margin-bottom: 6px; }
.star-hot-tag {
    display: inline-block;
    background: #fef0f0;
    color: #c0392b;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.plot-section {
    margin-bottom: 28px;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--color-border);
}
.plot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plot-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.plot-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.plot-card-img-wrap { width: 100%; height: 140px; background: #f3f4f6; overflow: hidden; }
.plot-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.plot-card:hover .plot-card-img-wrap img { transform: scale(1.03); }
.plot-card-body { padding: 12px 14px; }
.plot-card-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.plot-card-desc {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-section {
    margin-bottom: 28px;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--color-border);
}
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.detail-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    display: flex;
    gap: 14px;
    padding: 14px;
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}
.detail-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.detail-card-img-wrap { flex-shrink: 0; width: 90px; height: 120px; border-radius: 3px; overflow: hidden; background: #f3f4f6; }
.detail-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.detail-card-info { flex: 1; min-width: 0; }
.detail-card-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.detail-card-meta-row { font-size: 0.72rem; color: var(--color-text-secondary); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.detail-card-meta-row span { background: #f3f4f6; padding: 1px 6px; border-radius: 2px; white-space: nowrap; }
.detail-card-desc { font-size: 0.78rem; color: #4b5563; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.detail-card-score-big { font-size: 1.2rem; font-weight: 700; color: var(--color-star); flex-shrink: 0; align-self: center; }

.comments-section {
    margin-bottom: 28px;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--color-border);
}
.comments-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius);
    background: #fafafa;
    border: 1px solid #f0f0f0;
    transition: background 0.2s;
}
.comment-item:hover { background: #fff; }
.comment-avatar-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #e5e7eb;
}
.comment-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.comment-body { flex: 1; min-width: 0; }
.comment-user { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; }
.comment-meta { font-size: 0.7rem; color: #9ca3af; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.comment-stars { color: var(--color-star); font-weight: 500; }
.comment-text { font-size: 0.83rem; color: #4b5563; line-height: 1.5; }
.comment-movie-tag {
    background: #f0f9ff;
    color: var(--color-primary);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 500;
}

.bottom-nav {
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--color-border);
    padding: 32px 20px 20px;
    margin-top: auto;
    color: #4b5563;
}
.bottom-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.bottom-nav-col h4 { color: #111827; font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; }
.bottom-nav-col ul { list-style: none; }
.bottom-nav-col ul li { margin-bottom: 6px; }
.bottom-nav-col ul li a { color: #6b7280; text-decoration: none; font-size: 0.8rem; }
.bottom-nav-col ul li a:hover { color: var(--color-primary); }
.bottom-copyright {
    max-width: var(--max-width);
    margin: 20px auto 0;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

@media (max-width: 1024px) {
    .hot-movies-grid { grid-template-columns: repeat(3, 1fr); }
    .stars-grid { grid-template-columns: repeat(3, 1fr); }
    .plot-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .top-nav-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; }
    .nav-links { order: 3; width: 100%; justify-content: center; }
    .hot-movies-grid { grid-template-columns: repeat(2, 1fr); }
    .stars-grid { grid-template-columns: repeat(2, 1fr); }
    .plot-grid { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .bottom-nav-inner { grid-template-columns: repeat(2, 1fr); }
    .hero-banner { height: 220px; }
    .hero-title { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .hot-movies-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stars-grid { grid-template-columns: 1fr 1fr; }
    .plot-grid { grid-template-columns: 1fr; }
    .bottom-nav-inner { grid-template-columns: 1fr; }
    .weekly-rank-grid .rank-card { flex: 0 0 125px; }
    .rank-card-img-wrap { height: 160px; }
}
img[data-src] { background: #f3f4f6; transition: opacity 0.3s; }
img.loaded { opacity: 1; }
