/* 影搜 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);
    --radius: 12px;
    --radius-sm: 6px;
}

/* ===== Detail Layout (三栏) ===== */
.detail-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.detail-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
}
.detail-main {
    flex: 1;
    min-width: 0;
}
.detail-sidebar-right {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

/* ===== Sidebar: Category Nav ===== */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow);
}
.sidebar-card h3 {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .6rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.sidebar-cat-list { list-style: none; }
.sidebar-cat-list li { margin-bottom: .15rem; }
.sidebar-cat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .4rem .5rem;
    border-radius: var(--radius-xs);
    font-size: .85rem;
    color: var(--text-secondary);
    transition: .15s;
}
.sidebar-cat-list a:hover,
.sidebar-cat-list a.active {
    background: var(--primary-soft);
    color: var(--primary);
}
.sidebar-cat-count {
    font-size: .72rem;
    color: var(--text-muted);
    background: #f0f0f0;
    padding: .05rem .4rem;
    border-radius: 10px;
}
.sidebar-quick-links { display: flex; flex-direction: column; gap: .15rem; }
.sidebar-quick-links a {
    font-size: .85rem;
    color: var(--text-secondary);
    padding: .35rem .5rem;
    border-radius: var(--radius-xs);
    transition: .15s;
}
.sidebar-quick-links a:hover { background: var(--primary-soft); color: var(--primary); }

/* ===== Sidebar Right: Hot Ranking ===== */
.hot-list { list-style: none; }
.hot-list li { margin-bottom: .15rem; }
.hot-list a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .5rem;
    border-radius: var(--radius-xs);
    font-size: .82rem;
    color: var(--text-secondary);
    transition: .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hot-list a:hover { background: var(--primary-soft); color: var(--primary); }
.hot-list .hot-rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.hot-rank-top { background: #f5a623; }
.hot-rank-top2 { background: #999; }
.hot-rank-top3 { background: #cd7f32; }
.hot-rank-normal { background: #ddd; color: #888 !important; }

/* ===== Sidebar Right: Prev/Next ===== */
.prev-next { display: flex; flex-direction: column; gap: .35rem; }
.prev-next a {
    display: block;
    padding: .4rem .5rem;
    border-radius: var(--radius-xs);
    font-size: .82rem;
    color: var(--text-secondary);
    transition: .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prev-next a:hover { background: var(--primary-soft); color: var(--primary); }
.prev-next .pn-label { font-size: .7rem; color: var(--text-muted); display: block; }

/* ===== Detail: breadcrumb ===== */
.detail-breadcrumb {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: .55rem .9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}
.detail-breadcrumb a {
    color: var(--text-secondary);
    transition: color .15s;
}
.detail-breadcrumb a:hover { color: var(--primary); }
.detail-breadcrumb .bc-sep {
    margin: 0 .5rem;
    color: var(--border);
    font-size: .75rem;
}
.detail-breadcrumb .bc-current {
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* ===== Detail: Cover (居中，保持比例) ===== */
.detail-cover-wrap {
    text-align: center;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}
.detail-poster {
    width: 160px;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    display: block;
}
.detail-poster-placeholder {
    display: inline-flex;
    width: 160px;
    height: 240px;
    background: var(--bg-dark-card);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #555;
}

/* ===== Detail: Info Card ===== */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.info-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}
.info-card .cat-tag {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: .15rem .5rem;
    border-radius: 3px;
    font-size: .75rem;
    font-weight: 500;
}
.info-card .score-pill {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: rgba(245,158,11,.1);
    color: #f5a623;
    padding: .15rem .6rem;
    border-radius: 3px;
    font-size: .85rem;
    font-weight: 600;
}
.info-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: .35rem;
    line-height: 1.3;
}
.info-card .meta-line {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .25rem;
}

/* ===== Detail: Content Card ===== */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.content-card .meta-table { font-size: .9rem; line-height: 1.8; color: var(--text-secondary); }
.content-card .meta-table label { color: var(--text-muted); margin-right: .35rem; }
.content-card .meta-table strong { color: var(--text); }

/* ===== Detail: Article Content ===== */
.article-content {
    font-size: .95rem;
    line-height: 1.8;
    color: var(--text-secondary);
}
.article-content p { margin-bottom: 1rem; }
.article-content h2, .article-content h3 { color: var(--text); margin: 1.5rem 0 .75rem; }
.article-content img { border-radius: var(--radius-sm); margin: 1rem 0; max-width: 100%; }
.article-content a { color: var(--primary); }

/* ===== Detail: Tags Card ===== */
.tags-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.tags-card .tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags-card .tag-item {
    padding: .2rem .65rem;
    background: #f0f0f0;
    border-radius: 15px;
    font-size: .78rem;
    color: var(--text-secondary);
    transition: .2s;
}
.tags-card .tag-item:hover { background: var(--primary); color: #fff; }

/* ===== Download Panel (手风琴) ===== */
.dl-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.dl-panel-header {
    padding: .75rem 1rem;
    font-weight: 600;
    font-size: .95rem;
    border-bottom: 1px solid var(--border-light);
}
.dl-panel-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1rem;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text);
    background: #fafafa;
    border-bottom: 1px solid var(--border-light);
    transition: .15s;
    user-select: none;
}
.dl-panel-head:hover { background: #f5f5f5; }
.dl-panel-head .dl-arrow {
    font-size: .7rem;
    transition: transform .25s;
    color: var(--text-muted);
}
.dl-panel.is-open .dl-panel-head .dl-arrow { transform: rotate(180deg); }
.dl-panel-head .dl-disk-label {
    display: inline-block;
    padding: .1rem .45rem;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
}
.dl-disk-baidu { background: #2d84f7; }
.dl-disk-quark { background: #6633ff; }
.dl-disk-aliyun { background: #ff9900; }
.dl-disk-uc { background: #0099ff; }
.dl-disk-xunlei { background: #00c864; }
.dl-disk-other { background: #888; }
.dl-panel-body {
    display: none;
    padding: .5rem 0;
}
.dl-panel.is-open .dl-panel-body { display: block; }
.dl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .85rem;
    transition: background .15s;
}
.dl-item:hover { background: #fafbfc; }
.dl-item:last-child { border-bottom: none; }
.dl-item .dl-name {
    flex: 1;
    min-width: 120px;
    word-break: break-all;
    color: var(--text);
    font-weight: 500;
}
.dl-item .dl-size {
    color: var(--text-muted);
    font-size: .76rem;
    background: #f5f5f5;
    padding: .1rem .4rem;
    border-radius: 3px;
}
.dl-item .dl-pwd {
    font-size: .76rem;
    color: #d97706;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: .15rem .5rem;
    border-radius: 4px;
    margin: 0 .3rem;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    transition: .15s;
}
.dl-item .dl-pwd:hover { background: #fde68a; }
.dl-item.disabled { opacity: .4; }
.dl-item-actions { display: flex; gap: .4rem; flex-shrink: 0; align-items: center; }
.dl-copy-btn, .dl-dl-btn {
    padding: .35rem .8rem;
    border-radius: var(--radius-xs);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    transition: .15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.dl-copy-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.dl-dl-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: .35rem 1.1rem;
}
.dl-dl-btn:hover { background: var(--primary-dim); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.dl-copy-btn.copied { background: #10b981; border-color: #10b981; color: #fff; }
.dl-report-btn {
    padding: .3rem .5rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: .75rem;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
}
.dl-report-btn:hover { color: #ef4444; }
.dl-report-btn:disabled { opacity: .5; cursor: default; }
/* Download panel footer */
.dl-panel-footer {
    padding: .5rem 1rem;
    border-top: 1px solid var(--border-light);
    font-size: .8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dl-report-link { color: var(--text-muted); cursor: pointer; }
.dl-report-link:hover { color: var(--primary); }

/* ===== Related Recommendations (2-col poster grid) ===== */
.related-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.related-card h3 {
    padding: .75rem 1rem;
    font-size: .95rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
}
.related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-light);
    padding: .5rem;
    gap: .5rem;
    background: transparent;
}
.related-item {
    display: flex;
    gap: .5rem;
    padding: .5rem;
    border-radius: var(--radius-sm);
    transition: .2s;
    text-decoration: none;
    color: inherit;
}
.related-item:hover { background: var(--primary-soft); }
.related-thumb {
    width: 60px;
    height: 85px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-dark-card);
}
.related-thumb-placeholder {
    width: 60px;
    height: 85px;
    border-radius: var(--radius-xs);
    background: var(--bg-dark-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #555;
    flex-shrink: 0;
}
.related-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.related-info .r-title {
    font-size: .82rem;
    font-weight: 500;
    margin-bottom: .2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-info .r-meta {
    font-size: .72rem;
    color: var(--text-muted);
    display: flex;
    gap: .5rem;
}
.related-info .r-cat { color: var(--primary); }
.related-info .r-score { color: #f5a623; font-weight: 600; }
