/* ========== 全局变量与重置 ========== */
:root {
    --primary-color: #0f8b8a;
    --primary-dark: #0b6e6d;
    --primary-light: #e0f2f1;
    --gray-bg: #f8fafc;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --card-hover-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.12);
    --border-radius-sm: 16px;
}

body {
    background-color: var(--gray-bg);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
    color: #1e293b;
    line-height: 1.5;
}

/* ========== 导航栏 ========== */
.layui-header {
    background: rgba(255,255,255,0.96) !important;
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.layui-nav {
    background: transparent !important;
}
.layui-nav .layui-nav-item a {
    color: #334155;
    font-weight: 500;
}
.layui-nav .layui-this a,
.layui-nav .layui-nav-item a:hover {
    color: var(--primary-color);
}
.layui-nav .layui-this:after {
    background-color: var(--primary-color);
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #0f8b8a 0%, #0b6e6d 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.auth-link {
    color: #334155;
    font-weight: 500;
    margin-left: 12px;
    transition: 0.2s;
}
.auth-link:hover {
    color: var(--primary-color);
}

/* ========== 搜索栏 ========== */
.search-section {
    background: white;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 20px;
}
.search-box {
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}
.search-box .layui-input {
    border-radius: 40px 0 0 40px;
    border: 1px solid #e2e8f0;
    border-right: none;
    background-color: #f8fafc;
    height: 44px;
}
.search-box .layui-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15,139,138,0.1);
}
.search-box .layui-btn {
    border-radius: 0 40px 40px 0;
    background-color: var(--primary-color);
    border: none;
    color: white;
    height: 44px;
    line-height: 44px;
    padding: 0 24px;
}
.search-box .layui-btn:hover {
    background-color: var(--primary-dark);
}

/* ========== 面包屑 ========== */
.breadcrumb-demo {
    font-size: 13px;
    margin: 0 0 15px;
    color: #5b6e8c;
}

/* ========== 轮播图 ========== */
.custom-carousel {
    border-radius: 28px;
    box-shadow: var(--card-shadow);
}
.carousel-img {
    height: 380px;
    width: 100%;
    object-fit: cover;
}
@media (max-width: 768px) {
    .carousel-img { height: 200px; }
    .logo-area{display: none;}
}

/* ========== 通用标题 ========== */
.section-title {
    margin: 30px 0 24px 0;
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-weight: 700;
    font-size: 26px;
    background: linear-gradient(120deg, #1e293b, #2d3a4b);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.section-title small {
    font-size: 14px;
    font-weight: 400;
    color: #5b6e8c;
}

/* ========== 热门资源列表样式 ========== */
.hot-list {
    background: white;
    border-radius: 20px;
    border: 1px solid #edf2f7;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.hot-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.2s;
}
.hot-list-item:last-child {
    border-bottom: none;
}
.hot-list-item:hover {
    background-color: #f8fafc;
}
.hot-list-info {
    flex: 3;
    min-width: 200px;
}
.hot-list-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.hot-list-desc {
    font-size: 13px;
    color: #5b6e8c;
    line-height: 1.4;
    margin-right: 15px;
}
.hot-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #5b6e8c;
    margin-top: 6px;
}
.hot-list-stats {
    flex: 1;
    min-width: 180px;
    text-align: right;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-end;
    align-items: center;
}
.hot-list-stats span {
    font-size: 13px;
    color: #5b6e8c;
}
.hot-list-stats .category-badge {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 4px 14px;
    border-radius: 30px;
    font-weight: 500;
}
.hot-res-num {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    border-radius: 30px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
}

/* ========== 卡片样式（最新资源、列表页） ========== */
.resource-card {
    background: white;
    border-radius: var(--border-radius-sm);
    transition: all 0.25s ease;
    border: 1px solid rgba(203, 213, 225, 0.3);
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.resource-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(15,139,138,0.2);
}
.layui-card-body {
    padding: 20px 18px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.resource-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.resource-desc {
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
    margin-bottom: 14px;
    flex: 1;
}
.resource-meta {
    font-size: 12px;
    color: #5b6e8c;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    border-top: 1px solid #f0f2f5;
    padding-top: 12px;
    margin-top: 6px;
    margin-bottom: 12px;
}
.category-tag {
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 30px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    pointer-events: none;
}

/* ========== 列表页侧边栏 ========== */
.sidebar-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid #edf2f7;
}
.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-list li {
    margin-bottom: 12px;
}
.category-list a {
    color: #475569;
    transition: 0.2s;
    display: block;
    padding: 4px 0;
}
.category-list a:hover,
.category-list .active {
    color: var(--primary-color);
    font-weight: 500;
}
.tag-cloud {
    margin-top: 10px;
}
.tag-cloud a {
    background: #f1f5f9;
    border-radius: 30px;
    padding: 5px 14px;
    font-size: 12px;
    color: #2c3e50;
    margin: 0 6px 8px 0;
    display: inline-block;
    transition: 0.2s;
}
.tag-cloud a:hover {
    background: var(--primary-color);
    color: white;
}
.filter-group {
    margin-bottom: 20px;
}
.filter-group label {
    font-weight: 600;
    margin-right: 12px;
}

/* ========== 详情页特有样式 ========== */
.detail-container {
    background: white;
    border-radius: 28px;
    padding: 30px;
    box-shadow: var(--card-shadow);
}
.detail-title {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
}
.info-grid {
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}
.info-item {
    font-size: 14px;
}
.info-label {
    font-weight: 600;
    color: #1e293b;
    width: 100px;
    display: inline-block;
}
.desc-content {
    line-height: 1.8;
    color: #334155;
    margin-bottom: 30px;
}
.download-btn {
    background: linear-gradient(135deg, #0f8b8a, #0b6e6d);
    color: white;
    font-size: 18px;
    padding: 0px 30px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 20px;
}
.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(15,139,138,0.4);
}
.related-title {
    font-size: 22px;
    font-weight: 700;
    margin: 40px 0 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}
.comment-section {
    margin-top: 40px;
    background: #f9fafb;
    border-radius: 24px;
    padding: 20px;
}
.detail-download-btn {
    width: 100%;
    background: linear-gradient(135deg, #0f8b8a, #0b6e6d);
    border: none;
    color: white;
    font-size: 16px;
    padding: 10px 0;
    margin-top: 20px;
    border-radius: 50px;
}
.detail-download-btn:hover {
    background: linear-gradient(135deg, #0b6e6d, #095a59);
}

/* ========== 分类快捷入口 ========== */
.category-entry {
    background: white;
    border-radius: 28px;
    text-align: center;
    padding: 22px 12px;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #edf2f7;
}
.category-entry:hover {
    transform: translateY(-6px);
    border-color: var(--primary-light);
    box-shadow: 0 15px 30px -12px rgba(15,139,138,0.15);
}
.category-entry i {
    font-size: 40px;
    background: linear-gradient(145deg, #0f8b8a, #0b6e6d);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 12px;
}
.category-entry p {
    font-weight: 600;
    margin-top: 8px;
    font-size: 15px;
}

/* ========== 分页 ========== */
.layui-laypage {
    margin: 30px 0;
    text-align: center;
}

/* ========== 底部 ========== */
.footer {
    background: #0f172a;
    margin-top: 70px;
    padding: 40px 0 25px;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    color: #94a3b8;
}
.footer a {
    color: #94a3b8;
}
.footer a:hover {
    color: var(--primary-color);
}
.footer h3, .footer h4 {
    color: #f1f5f9;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .hot-list-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
    .hot-list-stats {
        justify-content: flex-start;
        margin-top: 10px;
        text-align: left;
    }
    .hot-list-title {
        font-size: 16px;
    }
    .section-title {
        font-size: 22px;
    }
    .logo-text {
        font-size: 18px;
    }
    .search-box {
        max-width: 90%;
    }
    .layui-nav .layui-nav-item a {
        padding: 0 10px;
    }
    .auth-link {
        margin-left: 8px;
        font-size: 14px;
    }
    .detail-title {
        font-size: 24px;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .layui-col-space20 > * {
        padding: 0 10px;
    }
    .layui-row.layui-col-space20 {
        margin-left: -10px;
        margin-right: -10px;
    }
}