/* ===== 首页专用样式 ===== */

/* ===== Hero区域 ===== */
.hero-section {
    text-align: center;
    padding: 40px 20px 32px;
    background: linear-gradient(145deg, #fcf8f0 0%, #f5ede4 100%);
    border-radius: 16px;
    margin-bottom: 32px;
    border: 1px solid #e8ddd0;
    transition: background 0.3s, border-color 0.3s;
}

.hero-section .hero-icon {
    font-size: 44px;
    color: #c9a87c;
    margin-bottom: 10px;
}

.hero-section h1 {
    font-size: 34px;
    font-weight: 700;
    color: #3d1f00;
    margin-bottom: 4px;
    letter-spacing: 4px;
}

.hero-section .hero-sub {
    font-size: 17px;
    color: #8a7a6a;
    margin-bottom: 14px;
    letter-spacing: 2px;
}

.hero-section .hero-desc {
    max-width: 600px;
    margin: 0 auto 18px;
    font-size: 14px;
    line-height: 1.9;
    color: #6a5a4a;
}

.hero-search {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    border-radius: 50px;
    border: 2px solid #ddd6ce;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.hero-search:focus-within {
    border-color: #c9a87c;
    box-shadow: 0 4px 20px rgba(201, 168, 124, 0.25);
}

.hero-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    font-size: 14px;
    background: transparent;
    color: #3d1f00;
    font-family: inherit;
    min-width: 80px;
}

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

.hero-search button {
    padding: 12px 26px;
    border: none;
    background: #c9a87c;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hero-search button:hover {
    background: #b8966a;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 36px;
    padding: 14px 0 0;
    flex-wrap: wrap;
}

.stats-bar .stat-item {
    text-align: center;
}

.stats-bar .stat-item .stat-num {
    font-size: 24px;
    font-weight: 700;
    color: #c9a87c;
}

.stats-bar .stat-item .stat-label {
    font-size: 12px;
    color: #8a7a6a;
    margin-top: 1px;
}

/* ===== 通用标题 ===== */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #3d1f00;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.section-title i {
    color: #c9a87c;
}

.section-title .more-link {
    font-size: 13px;
    font-weight: 400;
    color: #8a7a6a;
    margin-left: auto;
}

.section-title .more-link:hover {
    color: #c9a87c;
}

/* ===== 分类网格 ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 32px;
}

.category-grid .cat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fcf8f0;
    border-radius: 8px;
    border: 1px solid #e8ddd0;
    color: #4a3a2a;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    word-break: break-word;
}

.category-grid .cat-item:hover {
    background: #f5efe8;
    border-color: #c9a87c;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(201, 168, 124, 0.2);
}

.category-grid .cat-item i {
    font-size: 15px;
    color: #c9a87c;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.category-grid .cat-item .cat-count {
    margin-left: auto;
    font-size: 11px;
    color: #b0a090;
    background: #e8ddd0;
    padding: 0 7px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ===== 三列布局 ===== */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.home-grid .grid-section {
    background: #fcf8f0;
    border-radius: 12px;
    padding: 14px 16px 12px;
    border: 1px solid #e8ddd0;
    transition: background 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.home-grid .grid-section .section-title {
    font-size: 15px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e8ddd0;
    padding-bottom: 6px;
    flex-shrink: 0;
}

.home-grid .grid-section .section-title i {
    font-size: 14px;
    flex-shrink: 0;
}

.home-grid .grid-section .section-title .badge {
    font-weight: 400;
    font-size: 11px;
    color: #b0a090;
    margin-left: auto;
}

.home-grid .grid-section .list-wrap {
    flex: 1;
    min-height: 260px;
    overflow: hidden;
}

/* ===== 列表样式 ===== */
.recommend-list, .recent-list, .hot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommend-list li, .recent-list li, .hot-list li {
    padding: 4px 0;
    border-bottom: 1px solid #f0ebe5;
}

.recommend-list li:last-child, .recent-list li:last-child, .hot-list li:last-child {
    border-bottom: none;
}

.recommend-list a, .recent-list a, .hot-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #5a4a3a;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
    overflow: hidden;
    min-width: 0;
}

.recommend-list a:hover, .recent-list a:hover, .hot-list a:hover {
    color: #c9a87c;
}

.recommend-list a i, .recent-list a i, .hot-list a i {
    font-size: 11px;
    color: #b0a090;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.recommend-list a .file-name, .recent-list a .file-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.hot-list .hot-count {
    font-size: 11px;
    color: #b0a090;
    margin-left: auto;
    flex-shrink: 0;
}

.empty-history {
    text-align: center;
    color: #b0a090;
    padding: 30px 0;
    font-size: 13px;
}

.empty-history i {
    display: block;
    font-size: 24px;
    margin-bottom: 6px;
    opacity: 0.4;
}

/* ===== 底部 ===== */
.home-footer-nav {
    padding-top: 14px;
    border-top: 1px solid #e8ddd0;
    margin-top: 4px;
    text-align: center;
}

.home-footer-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 20px;
    border: 1px solid #e0d8d0;
    border-radius: 6px;
    color: #6a5a4a;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
}

.home-footer-nav a:hover {
    background: #f0e8e0;
    color: #3d1f00;
    border-color: #c0b0a0;
}

/* ===== 暗色模式 ===== */
body.dark .hero-section {
    background: linear-gradient(145deg, #2a2420 0%, #1e1a16 100%);
    border-color: #3d352e;
}
body.dark .hero-section h1 { color: #e8d5b8; }
body.dark .hero-section .hero-sub { color: #8a7a6a; }
body.dark .hero-section .hero-desc { color: #b0a090; }
body.dark .hero-search { background: #1e1a16; border-color: #3d352e; }
body.dark .hero-search input { color: #d4c8b8; }
body.dark .hero-search input::placeholder { color: #6a5a4a; }
body.dark .stats-bar .stat-item .stat-num { color: #c9a87c; }
body.dark .stats-bar .stat-item .stat-label { color: #8a7a6a; }
body.dark .section-title { color: #e8d5b8; }
body.dark .section-title .more-link { color: #8a7a6a; }
body.dark .section-title .more-link:hover { color: #c9a87c; }
body.dark .category-grid .cat-item { background: #2a2420; border-color: #3d352e; color: #d4c8b8; }
body.dark .category-grid .cat-item:hover { background: #3d352e; border-color: #5a4a3a; }
body.dark .category-grid .cat-item .cat-count { background: #3d352e; color: #8a7a6a; }
body.dark .home-grid .grid-section { background: #2a2420; border-color: #3d352e; }
body.dark .home-grid .grid-section .section-title { border-bottom-color: #3d352e; }
body.dark .recommend-list a, body.dark .recent-list a, body.dark .hot-list a { color: #c0b0a0; }
body.dark .recommend-list a:hover, body.dark .recent-list a:hover, body.dark .hot-list a:hover { color: #c9a87c; }
body.dark .recommend-list li, body.dark .recent-list li, body.dark .hot-list li { border-bottom-color: #3d352e; }
body.dark .hot-list .hot-count { color: #6a5a4a; }
body.dark .home-footer-nav { border-top-color: #3d352e; }
body.dark .home-footer-nav a { border-color: #3d352e; color: #b0a090; }
body.dark .home-footer-nav a:hover { background: #2a2420; color: #e8d5b8; border-color: #5a4a3a; }
body.dark .empty-history { color: #6a5a4a; }

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .home-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .hero-section { padding: 28px 16px 22px; }
    .hero-section h1 { font-size: 26px; letter-spacing: 2px; }
    .hero-section .hero-sub { font-size: 15px; }
    .hero-section .hero-desc { font-size: 13px; }
    
    /* 搜索框保持横向，不折叠 */
    .hero-search {
        flex-direction: row;
        border-radius: 50px;
        max-width: 100%;
    }
    .hero-search input {
        padding: 10px 16px;
        text-align: left;
        font-size: 14px;
        min-width: 60px;
    }
    .hero-search button {
        justify-content: center;
        padding: 10px 18px;
        border-radius: 0 50px 50px 0;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .stats-bar { gap: 20px; }
    .stats-bar .stat-item .stat-num { font-size: 20px; }
    .category-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .home-grid { grid-template-columns: 1fr; gap: 12px; }
    .section-title { font-size: 17px; }
    .home-grid .grid-section .list-wrap { min-height: 200px; }
}
@media (max-width: 480px) {
    .hero-section h1 { font-size: 20px; }
    .hero-section .hero-sub { font-size: 13px; }
    .hero-search input { padding: 8px 12px; font-size: 13px; }
    .hero-search button { padding: 8px 14px; font-size: 12px; }
    .category-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .category-grid .cat-item { padding: 8px 10px; font-size: 12px; }
    .stats-bar .stat-item .stat-num { font-size: 16px; }
    .home-grid .grid-section { padding: 10px 12px 8px; }
    .recommend-list a, .recent-list a, .hot-list a { font-size: 12px; }
    .home-grid .grid-section .list-wrap { min-height: 160px; }
}
@media (max-width: 350px) {
    .category-grid { grid-template-columns: 1fr; }
}