/* ========================================
   sitemap.css - 乾隆大藏经 网站地图样式
   优化版：更清晰、更美观、更舒适
   ======================================== */

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

body {
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    color: #2c2c2c;
    background: #f5f3ef;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px 50px;
    line-height: 1.7;
}

/* ===== 头部 ===== */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 18px;
    border-bottom: 3px solid #c9b59e;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.site-title {
    font-size: 26px;
    font-weight: 700;
    color: #3d2b1f;
}

.site-title a {
    color: #3d2b1f;
    text-decoration: none;
    transition: color 0.2s;
}

.site-title a:hover {
    color: #8a6b4f;
}

.site-title a i {
    color: #c9b59e;
    margin-right: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions a {
    color: #6b5a4a;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
}

.header-actions a:hover {
    background: #3d2b1f;
    color: #fff;
    border-color: #3d2b1f;
}

/* ===== 搜索区 ===== */
.search-section {
    margin-bottom: 28px;
    background: #fff;
    padding: 24px 28px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.search-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f5f3ef;
    border: 2px solid #e0d6cc;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s;
    min-width: 200px;
}

.search-box:focus-within {
    border-color: #c9b59e;
}

.search-box i {
    padding: 0 0 0 16px;
    color: #b0a090;
    font-size: 15px;
}

.search-box input {
    flex: 1;
    padding: 12px 14px;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    background: transparent;
    color: #333;
}

.search-box input::placeholder {
    color: #bbb;
}

.search-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-btn {
    padding: 12px 24px;
    background: #3d2b1f;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    transition: background 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-btn:hover {
    background: #5a3f2e;
}

.reset-btn {
    padding: 12px 20px;
    background: #f0ebe6;
    color: #6b5a4a;
    border: 2px solid #e0d6cc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reset-btn:hover {
    background: #e0d6cc;
    border-color: #c9b59e;
}

.search-stats {
    margin-top: 14px;
    font-size: 14px;
    color: #9a8a7a;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.search-stats em {
    font-style: normal;
    color: #3d2b1f;
    font-weight: 600;
}

.search-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.search-stats .stat-item i {
    color: #c9b59e;
    font-size: 14px;
}

/* ===== 分类统计标签 ===== */
.category-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 12px 0 18px;
    border-bottom: 1px solid #e8e0d8;
    margin-bottom: 28px;
}

.category-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #7a6a5a;
    background: #f0ebe6;
    padding: 2px 12px 2px 8px;
    border-radius: 20px;
}

.category-stats span i {
    font-size: 12px;
    color: #c9b59e;
}

.category-stats em {
    font-style: normal;
    color: #3d2b1f;
    font-weight: 600;
    font-size: 12px;
}

/* ===== 分类列表 ===== */
.sitemap-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-block {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e8e0d8;
    transition: box-shadow 0.25s;
}

.category-block:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.category-block .cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #faf8f5;
    border-bottom: 1px solid #e8e0d8;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.category-block .cat-header:hover {
    background: #f3efe9;
}

.category-block .cat-header i {
    font-size: 18px;
    color: #8a7a6a;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.category-block .cat-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #3d2b1f;
    flex: 1;
    margin: 0;
}

.category-block .cat-header .count {
    font-size: 12px;
    color: #9a8a7a;
    background: #e8e0d8;
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.category-block .cat-header .count i {
    font-size: 11px;
    color: #9a8a7a;
    width: auto;
    margin-right: 4px;
}

.category-block .cat-header .toggle-icon {
    font-size: 13px;
    color: #b0a090;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.category-block .cat-header .toggle-icon.open {
    transform: rotate(180deg);
}

.category-block .cat-body {
    padding: 12px 16px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2px 6px;
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.category-block .cat-body.collapsed {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
}

.category-block .cat-body a {
    display: block;
    padding: 5px 10px;
    color: #4a3a2a;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-block .cat-body a:hover {
    background: #f0ebe6;
    color: #3d2b1f;
}

.category-block .cat-body a i {
    margin-right: 6px;
    font-size: 11px;
    color: #b0a090;
    width: 14px;
    display: inline-block;
    text-align: center;
}

.category-block .cat-body a .vol {
    color: #c0b0a0;
    font-size: 11px;
    margin-left: 4px;
}

/* ===== 分类标题页（分类 index.html 专用） ===== */
.category-header-block {
    padding: 20px 0 12px;
    border-bottom: 3px solid #c9b59e;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.category-header-block i {
    font-size: 28px;
    color: #8a7a6a;
}

.category-header-block .cat-info h1 {
    font-size: 24px;
    font-weight: 700;
    color: #3d2b1f;
    margin: 0 0 2px 0;
}

.category-header-block .cat-info .meta {
    font-size: 14px;
    color: #9a8a7a;
}

.category-header-block .cat-info .meta i {
    font-size: 13px;
    color: #9a8a7a;
}

/* 分类列表网格（分类页面） */
.cat-link-grid {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e0d8;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2px 6px;
    padding: 12px 16px 16px;
}

.cat-link-grid a {
    display: block;
    padding: 5px 10px;
    color: #4a3a2a;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-link-grid a:hover {
    background: #f0ebe6;
    color: #3d2b1f;
}

.cat-link-grid a i {
    margin-right: 6px;
    font-size: 11px;
    color: #b0a090;
    width: 14px;
    display: inline-block;
    text-align: center;
}

.cat-link-grid a .vol {
    color: #c0b0a0;
    font-size: 11px;
    margin-left: 4px;
}

/* ===== 无结果 ===== */
.no-result {
    text-align: center;
    padding: 60px 20px;
    color: #b0a090;
    display: none;
}

.no-result i {
    font-size: 48px;
    color: #ddd;
    display: block;
    margin-bottom: 16px;
}

.no-result p {
    font-size: 16px;
}

/* ===== 底部链接 ===== */
.footer-links {
    text-align: center;
    padding: 28px 0 18px;
    border-top: 1px solid #e8e0d8;
    margin-top: 36px;
}

.footer-links a {
    display: inline-block;
    margin: 0 14px;
    color: #7a6a5a;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a i {
    margin-right: 6px;
    font-size: 14px;
}

.footer-links a:hover {
    color: #3d2b1f;
}

/* ===== 底部版权 ===== */
.footer {
    text-align: center;
    padding: 14px 0 10px;
    font-size: 13px;
    color: #c0b0a0;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    body {
        padding: 16px 12px 30px;
    }

    .site-title {
        font-size: 22px;
    }

    .site-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .header-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .header-actions a {
        font-size: 13px;
        padding: 4px 10px;
    }

    .search-section {
        padding: 16px 16px;
    }

    .search-row {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
        min-width: unset;
    }

    .search-box input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .search-actions {
        width: 100%;
    }

    .search-btn, .reset-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
        font-size: 14px;
    }

    .search-stats {
        font-size: 13px;
        gap: 6px 12px;
    }

    .category-block .cat-body {
        grid-template-columns: 1fr;
        padding: 8px 12px 12px;
    }

    .category-block .cat-body a {
        font-size: 13px;
        padding: 4px 8px;
        white-space: normal;
    }

    .category-block .cat-header {
        padding: 10px 14px;
    }

    .category-block .cat-header h2 {
        font-size: 15px;
    }

    .category-stats {
        font-size: 12px;
        gap: 4px 8px;
    }

    .category-stats span {
        font-size: 12px;
        padding: 1px 10px 1px 6px;
    }

    .cat-link-grid {
        grid-template-columns: 1fr;
        padding: 8px 12px 12px;
    }

    .cat-link-grid a {
        font-size: 13px;
        padding: 4px 8px;
        white-space: normal;
    }

    .category-header-block {
        flex-wrap: wrap;
        gap: 8px;
    }

    .category-header-block .cat-info h1 {
        font-size: 20px;
    }

    .footer-links a {
        margin: 4px 10px;
        font-size: 13px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .category-block .cat-body {
        grid-template-columns: repeat(2, 1fr);
    }

    .cat-link-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}