

.filter-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.filter-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: var(--font-size-md);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Encyclopedia detail card - beautified */
.encyclopedia-detail {
    background-color: var(--hx-ffffff);
    border: 1px solid var(--color-border);
    border-radius: 15px;
    padding: 44px 48px 40px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

/* Subtle accent line at top of card */
.encyclopedia-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 48px;
    right: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--hx-c97638), var(--accent));
    border-radius: 0 0 3px 3px;
}

.encyclopedia-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.encyclopedia-stats .stat-item svg {
    opacity: 0.55;
    stroke-width: 2;
}

.encyclopedia-stats .stat-item:hover {
    color: var(--accent);
}

.encyclopedia-stats .stat-item:hover svg {
    opacity: 1;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.related-card {
    display: block;
    padding: var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition-fast);
    border: 1px solid var(--color-border);
}

.related-card:hover {
    background-color: var(--color-primary);
    color: var(--hx-ffffff);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--gold) 20%, transparent);
}

.related-card:hover .related-card-meta {
    color: rgba(255, 255, 255, 0.8);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    max-width: 45%;
}

.nav-item:hover {
    background-color: var(--color-primary);
    color: var(--hx-ffffff);
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-item:hover .nav-label {
    color: rgba(255, 255, 255, 0.8);
}

.nav-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 词条信息 */
.info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.hot-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.hot-item:last-child {
    border-bottom: none;
}

.hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.hot-rank.top {
    background-color: var(--color-primary);
    color: var(--hx-ffffff);
}

/* 最新词�?*/
.latest-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.latest-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.latest-item:last-child {
    border-bottom: none;
}

/* ======================================
 * 参考文�?
 * ====================================== */
.references-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.references-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.reference-list {
    list-style: none;
}

/* ======================================
 * 响应�?
 * ====================================== */
/* ======================================
 * Encyclopedia List Page - 3-Column Grid
 * ====================================== */

/* Grid container */
.enc-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Card item */
.enc-list a {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--hx-ffffff);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    overflow: hidden;
}

.enc-list a:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--gold) 10%, transparent);
    transform: translateY(-3px);
}

.enc-list a:hover .enc-list-cover {
    transform: scale(1.03);
}

.enc-list a:hover .enc-title {
    color: var(--color-primary);
}

/* ======================================
 * Responsive - Encyclopedia List Grid
 * ====================================== */
@media (max-width: 992px) {
    .enc-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .enc-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .enc-list-cover {
        height: 120px;
    }
}

/* ======================================
 * 响应式
 * ====================================== */

@media (max-width: 1200px) {
    .encyclopedia-content {
        flex-direction: column;
    }
    
    .encyclopedia-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .encyclopedia-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .encyclopedia-title {
        font-size: var(--font-size-xl);
    }
    
    .encyclopedia-meta {
        flex-wrap: wrap;
    }
    
    .encyclopedia-nav {
        flex-direction: column;
    }
    
    .nav-item {
        max-width: 100%;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .encyclopedia-grid {
        grid-template-columns: 1fr;
    }
    
    .encyclopedia-title {
        font-size: var(--font-size-lg);
    }
    
    .encyclopedia-actions {
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
}

.encyclopedia-sidebar .info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: var(--hx-fafafa);
    border-radius: 8px;
}

.encyclopedia-sidebar .info-label {
    font-size: 11px;
    color: var(--hx-aaaaaa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.encyclopedia-toc-float .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.encyclopedia-toc-float .toc-item {
    margin-bottom: 2px;
}

.encyclopedia-toc-float .toc-item.toc-h1 a {
    font-size: 14px;
    font-weight: 700;
    color: var(--hx-222222);
    padding-left: 12px;
}

.encyclopedia-toc-float .toc-item.toc-h2 a {
    font-size: 13px;
    font-weight: 500;
    color: var(--hx-444444);
    padding-left: 20px;
}

.encyclopedia-toc-float .toc-item.toc-h3 a {
    font-size: 12px;
    font-weight: 400;
    color: var(--hx-888888);
    padding-left: 32px;
}

.encyclopedia-toc-float .toc-item a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.encyclopedia-toc-float .toc-item a:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--gold) 6%, transparent);
}

.encyclopedia-toc-float .toc-item a.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--gold) 8%, transparent);
    font-weight: 600;
}

/* ======================================
 * 百科详情页（对齐 encyclopedia-detail-preview.html）
 * 基类复用：.page-head/.head-title/.desc（terms.css）、.article-layout/.sidebar（article.css）、
 *           .author-panel/.toc-widget/.float-actions（detail.css/components.css）
 * 全部 token 化，零裸 hex（§18.20）
 * ====================================== */

/* 页面头部卡片（全宽 banner，位于 .container 外，全宽自然生效） */
.page-encyclopedia-detail .page-head {
    background: var(--bg);
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 0;
    margin-bottom: 0;
}
/* 全宽 banner 内部内容约束回页面宽度 */
.page-encyclopedia-detail .page-head > * {
    max-width: var(--w);
    margin-left: auto;
    margin-right: auto;
}
.page-encyclopedia-detail .head-title {
    padding: 24px 28px 0;
    display: flex;
    align-items: baseline;
    gap: 24px;
    flex-wrap: wrap;
}
.page-encyclopedia-detail .head-title h1 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(28px, 3.4vw, 40px);
    letter-spacing: .01em;
    margin: 0;
    color: var(--ink);
}
.page-encyclopedia-detail .page-head .desc {
    margin-top: 8px;
    padding: 0 28px 12px;
    color: var(--muted);
    font-size: 14.5px;
    max-width: 44em;
    line-height: 1.8;
}
.page-encyclopedia-detail .breadcrumb {
    width: 100%;
    margin-bottom: 14px;
}

/* 百科布局（flex vs article 的 grid） */
.page-encyclopedia-detail .article-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    background: var(--bg);
}
body.sidebar-hidden .page-encyclopedia-detail .article-layout {
    display: block;
}

/* 头部统计行 */
.page-encyclopedia-detail .page-head .ph-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 0;
    padding-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
    width: 100%;
}
.page-head .ph-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.page-head .ph-meta svg { opacity: .6; }

/* Tab 导航（仅渲染有真实数据的 Tab） */
.ency-header-tabs {
    display: flex;
    gap: 28px;
    margin-top: 0;
    padding: 10px 28px 2px;
    border-top: 1px solid var(--line);
}
.eht-item {
    position: relative;
    padding: 10px 0 12px;
    border: none;
    background: none;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.eht-item::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: var(--transition);
}
.eht-item:hover { color: var(--ink); }
.eht-item.active { color: var(--ink); font-weight: 600; }
.eht-item.active::after { transform: scaleX(1); }

/* Tab 内容切换 */
.ency-tab-content { margin-top: 28px; }
.ency-tab-pane { display: none; }
.ency-tab-pane.active { display: block; }

/* 头条主图 */
.ency-hero {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 28px;
}
.ency-hero img { width: 100%; max-height: 460px; object-fit: cover; display: block; }
.ency-hero .hero-overlay {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 28px 24px 20px;
    background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
}
.ency-hero .hero-tag {
    display: inline-block;
    padding: 5px 14px;
    background: var(--gold);
    color: var(--hx-ffffff);
    font-size: 13px;
    border-radius: 999px;
}

/* 正文排版（衬线，对齐设计稿） */
.ency-body {
    font-family: var(--serif);
    font-size: 17px;
    line-height: 2;
    color: var(--ink);
}
.ency-body h2 { font-size: 25px; font-weight: 700; margin: 44px 0 18px; padding-bottom: 10px; border-bottom: 3px solid var(--gold); color: var(--ink); line-height: 1.4; }
.ency-body h3 { font-size: 21px; font-weight: 600; margin: 32px 0 14px; color: var(--ink); line-height: 1.5; }
.ency-body h4 { font-size: 18px; font-weight: 600; margin: 26px 0 12px; color: var(--ink); }
.ency-body p { margin-bottom: 22px; }
.ency-body ul, .ency-body ol { margin-bottom: 22px; padding-left: 24px; }
.ency-body li { margin-bottom: 8px; }
.ency-body blockquote { margin: 24px 0; padding: 16px 22px; border-left: 4px solid var(--gold); background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); font-style: italic; }
.ency-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 22px 0; }
.ency-body table { width: 100%; border-collapse: collapse; margin: 22px 0; }
.ency-body table th, .ency-body table td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.ency-body table th { background: var(--bg-soft); font-weight: 600; }
.ency-body a { color: var(--gold); text-decoration: none; border-bottom: 1px dashed var(--gold); }

/* 相关词条 */
.related-terms { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.related-terms h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; margin-bottom: 14px; color: var(--ink); }
.term-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.term-tag { display: inline-block; padding: 6px 16px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); cursor: default; }

/* 参见 */
.see-also { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.see-also h4 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--ink); }
.see-also a { display: block; padding: 8px 0; color: var(--gold); text-decoration: none; font-size: 14px; border-bottom: 1px dashed var(--line); }
.see-also a:hover { color: var(--ink); }

/* 参考文献（容器；列表由 reference-list.php 渲染 .ref-list/.ref-link） */
.references { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.references .ref-list { margin: 0; padding-left: 22px; }
.references .ref-link { margin-bottom: 8px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.references .ref-link a { color: var(--gold); }

/* 作者面板子结构（基类 .author-panel 在 detail.css/components.css） */
.author-panel .ap-top { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding: 18px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.author-panel .ap-avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--gold-soft); display: grid; place-items: center; }
.author-panel .ap-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-panel .ap-info { display: flex; flex-direction: column; }
.author-panel .ap-info h5 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0 0 2px; color: var(--ink); }
.author-panel .ap-role { font-size: 13px; color: var(--muted); }
.author-panel .ap-follow { margin-left: auto; padding: 7px 18px; border: 1px solid var(--gold); border-radius: 999px; background: var(--bg); color: var(--gold); cursor: pointer; font-size: 13px; font-family: var(--sans); transition: var(--transition); }
.author-panel .ap-follow:hover { background: var(--gold-soft); }
.author-panel .ap-follow.active { background: var(--gold); color: var(--hx-ffffff); border-color: var(--gold); }

/* 关联相册（作用域类名，避开 list.css/album.css 的 .album-grid/.album-card 冲突，禁四） */
.ency-album-section { margin-top: 8px; }
.ea-title { font-family: var(--serif); font-size: 20px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.ea-desc { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.ency-album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.ency-album-card { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); text-decoration: none; transition: var(--transition); }
.ency-album-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.ency-album-cover { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.ency-album-cover img { width: 100%; height: 100%; object-fit: cover; }
.ency-album-count { position: absolute; right: 10px; bottom: 10px; padding: 3px 10px; background: rgba(0,0,0,.55); color: var(--hx-ffffff); font-size: 12px; border-radius: 999px; }
.ency-album-body { padding: 14px 16px 16px; }
.ency-album-body h4 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.ency-album-author { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.ency-album-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }

/* 侧边栏区块 */
.sb-section { margin-bottom: 22px; }
.sb-section h5 { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.sb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-cats a { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); text-decoration: none; transition: var(--transition); cursor: pointer; }
.sb-cats a:hover { border-color: var(--gold); color: var(--gold); }
.sb-cats a.active { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.sb-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); text-decoration: none; transition: var(--transition); }
.sb-item:hover { background: var(--bg-soft); }
.sb-item-cover { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg-soft); }
.sb-item-cover img { width: 100%; height: 100%; object-fit: cover; }
.sb-item-body h6 { font-size: 14px; font-weight: 500; margin: 0 0 3px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-meta { font-size: 12px; color: var(--muted); }

/* 响应式 */
@media (max-width: 768px) {
    .ency-album-grid { grid-template-columns: 1fr; }
}
