/* ===== 网站地图页面专用样式 ===== */
.sitemap-header {
    padding: 20px 0 16px;
    border-bottom: 1px solid #eee8e0;
    margin-bottom: 24px;
}

.sitemap-header .page-title {
    margin-bottom: 6px;
    border-bottom: none;
    padding-bottom: 0;
}

.sitemap-header .sub-desc {
    color: #8a7a6a;
    font-size: 14px;
}

/* ===== 搜索框 ===== */
.search-section {
    background: #f5f0ea;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
    border: 1px solid #e8e0d8;
    transition: background-color 0.3s, border-color 0.3s;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd6ce;
    padding: 0 16px;
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: #8b5a2b;
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.15);
}

.search-box i {
    color: #b0a090;
    font-size: 16px;
    margin-right: 12px;
}

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

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

.search-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.search-btn, .reset-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.search-btn {
    background: #8b5a2b;
    color: #fff;
}

.search-btn:hover {
    background: #6a4320;
}

.reset-btn {
    background: #e8e0d8;
    color: #6a5a4a;
}

.reset-btn:hover {
    background: #d5cdc5;
    color: #3d2c1e;
}

.search-info {
    font-size: 13px;
    color: #8a7a6a;
    margin-top: 10px;
    display: none;
}

.search-info.active {
    display: block;
}

/* ===== 目录折叠 ===== */
.sitemap-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dir-item {
    border: 1px solid #eee8e0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s ease forwards;
}

.dir-item:nth-child(1) { animation-delay: 0.02s; }
.dir-item:nth-child(2) { animation-delay: 0.04s; }
.dir-item:nth-child(3) { animation-delay: 0.06s; }
.dir-item:nth-child(4) { animation-delay: 0.08s; }
.dir-item:nth-child(5) { animation-delay: 0.10s; }
.dir-item:nth-child(6) { animation-delay: 0.12s; }
.dir-item:nth-child(7) { animation-delay: 0.14s; }
.dir-item:nth-child(8) { animation-delay: 0.16s; }
.dir-item:nth-child(9) { animation-delay: 0.18s; }
.dir-item:nth-child(10) { animation-delay: 0.20s; }
.dir-item:nth-child(11) { animation-delay: 0.22s; }
.dir-item:nth-child(12) { animation-delay: 0.24s; }
.dir-item:nth-child(13) { animation-delay: 0.26s; }
.dir-item:nth-child(14) { animation-delay: 0.28s; }
.dir-item:nth-child(15) { animation-delay: 0.30s; }
.dir-item:nth-child(16) { animation-delay: 0.32s; }
.dir-item:nth-child(17) { animation-delay: 0.34s; }
.dir-item:nth-child(18) { animation-delay: 0.36s; }
.dir-item:nth-child(19) { animation-delay: 0.38s; }
.dir-item:nth-child(20) { animation-delay: 0.40s; }
.dir-item:nth-child(21) { animation-delay: 0.42s; }
.dir-item:nth-child(22) { animation-delay: 0.44s; }
.dir-item:nth-child(23) { animation-delay: 0.46s; }
.dir-item:nth-child(24) { animation-delay: 0.48s; }
.dir-item:nth-child(25) { animation-delay: 0.50s; }
.dir-item:nth-child(26) { animation-delay: 0.52s; }
.dir-item:nth-child(27) { animation-delay: 0.54s; }
.dir-item:nth-child(28) { animation-delay: 0.56s; }
.dir-item:nth-child(29) { animation-delay: 0.58s; }
.dir-item:nth-child(30) { animation-delay: 0.60s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dir-item:hover {
    border-color: #d5cdc5;
}

.dir-header {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    cursor: pointer;
    background: #faf8f5;
    transition: background 0.2s;
    user-select: none;
    gap: 10px;
}

.dir-header:hover {
    background: #f5f0ea;
}

.dir-header .dir-icon {
    color: #d4a843;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.dir-header .dir-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #3d2c1e;
}

.dir-header .dir-count {
    font-size: 12px;
    color: #b0a090;
    background: #e8e0d8;
    padding: 2px 10px;
    border-radius: 12px;
}

.dir-header .dir-toggle {
    color: #b0a090;
    font-size: 14px;
    transition: transform 0.3s;
}

.dir-header .dir-toggle.open {
    transform: rotate(90deg);
}

.dir-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.dir-body.open {
    max-height: 20000px;
}

.dir-files {
    padding: 6px 12px 12px 44px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 3px;
}

.dir-files .file-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    color: #5a4a3a;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.dir-files .file-link:hover {
    background: #f5f0ea;
    border-color: #e0d8d0;
    color: #3d2c1e;
}

.dir-files .file-link i {
    font-size: 12px;
    color: #b0a090;
    width: 16px;
    text-align: center;
}

.dir-files .file-link .highlight {
    background: #f0e0b0;
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #b0a090;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* ===== 加载状态 ===== */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #b0a090;
}

.loading-state i {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 进度条 ===== */
.loading-progress {
    width: 100%;
    max-width: 400px;
    margin: 12px auto 0;
    height: 3px;
    background: #e8e0d8;
    border-radius: 4px;
    overflow: hidden;
}

.loading-progress .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c9a87c, #8b5a2b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ===== 暗色模式 ===== */
body.dark .sitemap-header {
    border-bottom-color: #3d352e;
}

body.dark .sitemap-header .sub-desc {
    color: #8a7a6a;
}

body.dark .search-section {
    background: #2a2420;
    border-color: #3d352e;
}

body.dark .search-box {
    background: #1e1a16;
    border-color: #3d352e;
}

body.dark .search-box input {
    color: #d4c8b8;
}

body.dark .search-box input::placeholder {
    color: #6a5a4a;
}

body.dark .search-box i {
    color: #6a5a4a;
}

body.dark .reset-btn {
    background: #3d352e;
    color: #b0a090;
}

body.dark .reset-btn:hover {
    background: #4d453e;
    color: #d4c8b8;
}

body.dark .dir-item {
    border-color: #3d352e;
}

body.dark .dir-header {
    background: #2a2420;
}

body.dark .dir-header:hover {
    background: #3d352e;
}

body.dark .dir-header .dir-name {
    color: #e8d5b8;
}

body.dark .dir-header .dir-count {
    background: #3d352e;
    color: #8a7a6a;
}

body.dark .dir-header .dir-toggle {
    color: #6a5a4a;
}

body.dark .dir-files .file-link {
    color: #c0b0a0;
}

body.dark .dir-files .file-link:hover {
    background: #2a2420;
    border-color: #3d352e;
    color: #e8d5b8;
}

body.dark .dir-files .file-link i {
    color: #6a5a4a;
}

body.dark .dir-files .file-link .highlight {
    background: #4a3a2a;
    color: #f0e0b0;
}

body.dark .empty-state {
    color: #6a5a4a;
}

body.dark .search-info {
    color: #8a7a6a;
}

body.dark .loading-progress {
    background: #3d352e;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .search-section {
        padding: 16px;
    }
    
    .dir-files {
        grid-template-columns: 1fr;
        padding: 4px 8px 10px 32px;
    }
    
    .dir-header {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .dir-header .dir-name {
        font-size: 14px;
    }
    
    .dir-files .file-link {
        font-size: 13px;
        padding: 4px 8px;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .search-btn, .reset-btn {
        justify-content: center;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .search-section {
        padding: 12px;
    }
    
    .search-box {
        padding: 0 12px;
    }
    
    .search-box input {
        padding: 10px 0;
        font-size: 14px;
    }
    
    .dir-files {
        padding: 4px 4px 8px 20px;
    }
    
    .dir-files .file-link {
        font-size: 12px;
        padding: 3px 6px;
    }
}