/* 影搜 CMS - 主样式: 导航/首页/分类/页脚/通用组件
   浅色主题 · 白底红强调 · 响应式 */

:root {
    --primary: #e50914;
    --primary-dim: #b80610;
    --primary-soft: rgba(229, 9, 20, .08);
    --bg: #f4f5f7;
    --bg-card: #ffffff;
    --bg-dark-card: #1a1a24;
    --text: #2a2a2a;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #eee;
    --border-light: #f0f0f0;
    --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
    --shadow-hover: 0 8px 24px rgba(0,0,0,.12);
    --radius: 12px;
    --radius-sm: 6px;
    --radius-xs: 4px;
    --max-width: 1280px;
    --header-height: 60px;
    --sidebar-width: 210px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--header-height);
}
.brand { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
    padding: .3rem .55rem;
    border-radius: var(--radius-xs);
    letter-spacing: .05em;
}
.brand-logo { height: 32px; }
.brand-text { font-weight: 600; font-size: 1rem; color: var(--text); }
.site-nav { display: flex; gap: .25rem; flex: 1; }
.nav-link {
    padding: .5rem .9rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .9rem;
    transition: .2s;
}
.nav-link:hover,
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.header-search { display: flex; align-items: center; }
.search-input {
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    padding: .4rem .75rem;
    color: var(--text);
    font-size: .85rem;
    width: 160px;
    border-right: none;
    transition: width .3s;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    width: 220px;
}
.search-btn {
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: .4rem .6rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: .2s;
}
.search-btn:hover { color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }

/* ===== Main ===== */
.site-main { padding: 1.5rem 0 3rem; min-height: calc(100vh - var(--header-height) - 180px); }

/* ===== Hero (首页) ===== */
.hero { text-align: center; padding: 1.5rem 0; margin-bottom: .5rem; }
.hero-title { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.hero-desc { color: var(--text-secondary); font-size: .95rem; margin-top: .35rem; }

/* ===== Sections ===== */
.section { margin-bottom: 2.5rem; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--border-light);
}
.section-head h2 {
    font-size: 1.15rem;
    font-weight: 600;
    position: relative;
}
.section-head h2::after {
    content: '';
    position: absolute;
    bottom: -.55rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}
.section-more {
    font-size: .85rem;
    color: var(--text-muted);
    transition: .2s;
}
.section-more:hover { color: var(--primary); }
.section-hint {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: .5rem;
}

/* ===== Hot Scroll (首页热门推荐) ===== */
.hot-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
}
.hot-scroll::-webkit-scrollbar { height: 4px; }
.hot-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
.hot-scroll:hover::-webkit-scrollbar-thumb { background: #bbb; }
.hot-scroll-inner {
    display: flex;
    gap: 1rem;
    padding-right: 1rem;
}
.hot-card {
    flex: 0 0 150px;
    width: 150px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    transition: .25s;
    border: 1px solid var(--border);
}
.hot-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.hot-card-cover {
    position: relative;
    width: 100%;
    height: 210px;
    background: var(--bg-dark-card);
    overflow: hidden;
}
.hot-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.hot-card:hover .hot-card-cover img { transform: scale(1.05); }
.hot-card-cover .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #555;
}
/* Rank badges */
.hot-rank {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 800;
    color: #fff;
    border-radius: 0 0 var(--radius-xs) 0;
}
.hot-rank-1 { background: linear-gradient(135deg, #ffd700, #ff8c00); }
.hot-rank-2 { background: linear-gradient(135deg, #c0c0c0, #808080); }
.hot-rank-3 { background: linear-gradient(135deg, #cd7f32, #8b4513); }
.hot-card-info { padding: .5rem .65rem; }
.hot-card-title {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .3rem;
}
.hot-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .75rem;
}
.hot-card-cat {
    color: #fff;
    background: var(--primary);
    padding: .05rem .4rem;
    border-radius: 3px;
    font-size: .7rem;
}
.hot-card-score { color: #f5a623; font-weight: 600; font-size: .75rem; }
.hot-card-views { color: var(--text-muted); font-size: .72rem; }

/* ===== Card Grid (分类/搜索/首页网格) ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}
.movie-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: .25s;
    position: relative;
    display: flex;
    flex-direction: column;
}
.movie-card:hover {
    border-color: var(--primary-soft);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.card-cover {
    position: relative;
    width: 100%;
    padding-bottom: 150%; /* 2:3 poster ratio */
    background: var(--bg-dark-card);
    overflow: hidden;
    flex-shrink: 0;
}
.card-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .3s;
}
.movie-card:hover .card-cover img { transform: scale(1.05); }
.card-cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #555;
}
/* NEW badge */
.card-new-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 0 0 var(--radius-xs) 0;
    z-index: 2;
}
.card-score {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: rgba(0,0,0,.7);
    color: #f5a623;
    font-size: .75rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 3px;
    z-index: 2;
}
.card-badge-top {
    position: absolute;
    top: .5rem;
    left: .5rem;
    background: var(--primary);
    color: #fff;
    font-size: .65rem;
    padding: .15rem .4rem;
    border-radius: 3px;
    z-index: 2;
}
.card-info { padding: .5rem .65rem; }
.card-title {
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .2rem;
    color: var(--text);
}
.card-subtitle {
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .3rem;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.card-meta .card-cat {
    color: var(--primary);
    font-size: .7rem;
}
.card-views { margin-left: auto; white-space: nowrap; }
.card-star { color: #f5a623; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: .9rem;
    cursor: pointer;
    transition: .2s;
    text-decoration: none;
}
.btn:hover { border-color: #ccc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dim); }
.btn-ghost { border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--border); color: var(--text); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-xs { padding: .2rem .5rem; font-size: .72rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Badges ===== */
.badge { display: inline-flex; padding: .12rem .45rem; border-radius: var(--radius-xs); font-size: .72rem; background: #f0f0f0; color: var(--text-secondary); }
.badge-danger { background: rgba(239,68,68,.1); color: #ef4444; }
.badge-success { background: rgba(16,185,129,.1); color: #10b981; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* ===== Category Header ===== */
.category-header {
    padding: 1rem 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: .75rem;
    border-bottom: 1px solid var(--border);
}
.category-header h1 { font-size: 1.4rem; font-weight: 600; }
.category-header .count { color: var(--text-muted); font-size: .9rem; }
.category-breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.category-breadcrumb a { color: var(--text-secondary); }
.category-breadcrumb a:hover { color: var(--primary); }
.category-breadcrumb span { margin: 0 .35rem; }

/* ===== Search Header ===== */
.search-header {
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.search-header h1 { font-size: 1.4rem; font-weight: 600; }
.search-header p { color: var(--text-muted); font-size: .9rem; margin-top: .35rem; }
.search-header strong { color: var(--primary); }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: .35rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.page-link {
    padding: .4rem .75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: .85rem;
    transition: .2s;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-dots { padding: .4rem .3rem; color: var(--text-muted); }

/* ===== Tags ===== */
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-item {
    padding: .25rem .75rem;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: .8rem;
    color: var(--text-secondary);
    transition: .2s;
}
.tag-item:hover { background: var(--primary); color: #fff; }

/* ===== Auth Pages ===== */
.auth-page { max-width: 400px; margin: 2rem auto; }
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.auth-title { font-size: 1.4rem; font-weight: 600; text-align: center; margin-bottom: 1.5rem; }
.auth-form .form-group { margin-bottom: 1rem; }
.auth-form label { display: block; font-size: .85rem; color: var(--text-secondary); margin-bottom: .35rem; }
.auth-form .form-control {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: var(--text);
    background: #fafafa;
    transition: .2s;
}
.auth-form .form-control:focus { outline: none; border-color: var(--primary); background: #fff; }
.auth-footer { display: flex; justify-content: space-between; margin-top: 1rem; font-size: .85rem; }
.auth-footer a { color: var(--primary); }
.alert {
    padding: .7rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .85rem;
}
.alert-error { background: rgba(239,68,68,.08); color: #ef4444; border: 1px solid rgba(239,68,68,.2); }
.alert-success { background: rgba(16,185,129,.08); color: #10b981; border: 1px solid rgba(16,185,129,.2); }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state a { color: var(--primary); }

/* ===== Error Page ===== */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-page h1 { font-size: 1.3rem; margin: .5rem 0; }
.error-page p { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ===== Footer ===== */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 2rem 0 1.5rem;
    margin-top: 2rem;
}
.footer-inner { text-align: center; }
.footer-nav { margin-bottom: 1rem; display: flex; justify-content: center; gap: 1.5rem; }
.footer-nav a { color: var(--text-secondary); font-size: .85rem; transition: .2s; }
.footer-nav a:hover { color: var(--primary); }
.footer-brand { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.footer-desc { color: var(--text-muted); font-size: .85rem; margin-bottom: .75rem; }
.footer-bottom { font-size: .8rem; color: var(--text-muted); display: flex; justify-content: center; gap: 1rem; }
.footer-bottom a:hover { color: var(--primary); }

/* ===== Profile Page ===== */
.profile-page { max-width: 600px; margin: 1rem auto; }
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.profile-card h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: center; }
.stat-item { padding: 1rem; background: #fafafa; border-radius: var(--radius-sm); }
.stat-num { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.level-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 500;
}
.level-normal { background: #e8e8e8; color: #666; }
.level-member { background: rgba(16,185,129,.1); color: #10b981; }
.level-vip { background: rgba(245,158,11,.1); color: #f59e0b; }

/* ===== Article List ===== */
.article-list { display: flex; flex-direction: column; gap: .75rem; }
.article-list-item {
    display: flex;
    gap: .75rem;
    padding: .75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: .2s;
}
.article-list-item:hover { border-color: var(--primary-soft); }
.list-thumb { width: 100px; height: 66px; object-fit: cover; border-radius: var(--radius-xs); flex-shrink: 0; background: var(--bg-dark-card); }
.list-body { flex: 1; min-width: 0; }
.list-title { font-size: .95rem; font-weight: 500; margin-bottom: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-summary { font-size: .8rem; color: var(--text-muted); margin-bottom: .25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-meta { display: flex; gap: .75rem; font-size: .75rem; color: var(--text-muted); }
.list-meta .meta-cat { color: var(--primary); }

/* ===== v2.1: 用户操作栏（收藏+打分） ===== */
.user-actions-bar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: .65rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.fav-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all .2s ease;
}
.fav-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239,68,68,.05);
}
.fav-btn.is-favorited {
    color: #fff;
    border-color: #ef4444;
    background: #ef4444;
}
.fav-btn .fav-icon { font-size: 1rem; line-height: 1; }

.rating-box {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .82rem;
    color: var(--text-muted);
}
.rating-label { font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.rating-stars { display: inline-flex; gap: 1px; }
.rate-star {
    font-size: 1.15rem;
    color: var(--border);
    cursor: pointer;
    transition: color .1s, transform .1s;
    user-select: none;
    line-height: 1;
}
.rate-star:hover { transform: scale(1.2); }
.rate-star:hover, .rate-star.active { color: #f5a623; }
.rating-info { color: var(--text-muted); font-size: .78rem; margin-left: .25rem; }

/* ===== v2.1: 搜索建议 ===== */
.search-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}
.suggest-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    transition: .15s;
}
.suggest-item:hover { background: var(--bg-hover); }
.suggest-item:last-child { border-bottom: none; }
.suggest-thumb { width: 36px; height: 50px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.suggest-info { display: flex; flex-direction: column; gap: 2px; }
.suggest-title { font-size: .85rem; font-weight: 500; }
.suggest-score { font-size: .75rem; color: #f5a623; }

/* ===== v2.1: 热门搜索 ===== */
.hot-searches {
    margin-bottom: 2rem;
}
.hot-searches h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.hot-search-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .5rem;
}
.hot-search-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: .15s;
}
.hot-search-item:hover { background: var(--bg-hover); }
.hot-search-item.hot-top .hot-rank { color: var(--primary); font-weight: bold; }
.hot-rank { width: 20px; text-align: center; color: var(--text-muted); font-size: .85rem; }
.hot-keyword { flex: 1; font-size: .85rem; }
.hot-count { font-size: .72rem; color: var(--text-muted); }

/* ===== v2.1: 用户收藏页 ===== */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.empty-box {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-box .btn { margin-top: 1rem; }
