/* 全局通用样式 - 适配首页+详情页 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "微软雅黑", "PingFang SC", sans-serif;
}
body {
    background: #f7f8fa;
    color: #333;
}
a {
    text-decoration: none;
    color: inherit;
}
ul, li {
    list-style: none;
}

/* 容器样式（通用） */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部导航样式（header.php通用） */
.header-nav {
    background: #1e1e1e;
    color: #fff;
    height: 44px;
    line-height: 44px;
    font-size: 14px;
}
.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-left a {
    color: #ccc;
    margin-right: 20px;
    transition: color 0.3s;
}
.nav-left a:hover {
    color: #fff;
}
.nav-right .login-btn {
    background: #0078d7;
    padding: 6px 12px;
    border-radius: 4px;
    color: #fff !important;
}

/* 首页搜索框样式 */
.search-box {
    margin: 30px auto;
    text-align: center;
}
.search-box input {
    padding: 10px 15px;
    width: 60%;
    max-width: 600px;
    border: 1px solid #eee;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}
.search-box input:focus {
    border-color: #0078d7;
}

/* 首页资源列表样式 */
.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.resource-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}
.resource-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.resource-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.resource-item div {
    padding: 12px;
}
.resource-item p {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 详情页卡片样式 */
.card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 20px;
}
.card h1 {
    font-size: 24px;
    color: #222;
    margin-bottom: 20px;
    line-height: 1.4;
}
.card img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin: 10px 0;
}
.card p {
    line-height: 1.8;
    color: #666;
    font-size: 15px;
}

/* 按钮样式（通用） */
.layui-btn {
    padding: 0 30px;
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    margin-top: 10px;
    border-radius: 8px !important;
}

/* 底部样式（footer.php通用） */
.footer {
    text-align: center;
    padding: 25px 0;
    color: #999;
    font-size: 12px;
    border-top: 1px solid #eee;
    margin-top: 30px;
}

/* 响应式适配（手机端） */
@media (max-width: 768px) {
    .resource-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .card {
        padding: 20px;
        border-radius: 12px;
    }
    .card h1 {
        font-size: 20px;
    }
    .search-box input {
        width: 90%;
    }
}
@media (max-width: 480px) {
    .resource-list {
        grid-template-columns: 1fr;
    }
    .header-nav {
        height: 40px;
        line-height: 40px;
        font-size: 13px;
    }
    .nav-left a {
        margin-right: 10px;
    }
}