/* 全局样式 */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #e6f2ff;
    --secondary-color: #6c757d;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white-color: #ffffff;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: #333;
    background-color: #f9f9f9;
    padding-top: 76px; /* 为固定导航栏留出空间 */
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* 白天/夜间模式切换 */
body.dark-mode {
    background-color: #222;
    color: #f0f0f0;
}

body.dark-mode .navbar,
body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode footer {
    background-color: #333 !important;
    color: #f0f0f0;
}

body.dark-mode .navbar-light .navbar-brand,
body.dark-mode .navbar-light .nav-link,
body.dark-mode .card-title,
body.dark-mode footer h5 {
    color: #f0f0f0 !important;
}

body.dark-mode .text-muted {
    color: #adb5bd !important;
}

/* 主题切换开关 */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    z-index: 2;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.fa-sun {
    color: #ffc107;
    font-size: 14px;
}

.fa-moon {
    color: #f0f0f0;
    font-size: 14px;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* 主内容区域 */
.main-content {
    padding: 2rem 0;
}

/* 轮播图样式 */
.carousel {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.banner-img {
    height: 400px;
    background-size: cover;
    background-position: center;
}

/* 区块标题 */
.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 2.5rem 0 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

/* 资源卡片 */
.resource-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 8px;
    overflow: hidden;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-img-top {
    height: 160px;
    object-fit: cover;
}

.price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* 页脚样式 */
footer {
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

footer h5 {
    font-weight: 600;
    color: var(--primary-color);
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    color: var(--primary-color);
}

/* 弹窗样式 */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background-color: var(--light-color);
}

/* 资源列表布局调整 */
.resource-item.col-12 {
    margin-bottom: 1.5rem;
}

.resource-item.col-12 .card {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.resource-item.col-12 .card.flex-row {
    flex-direction: row;
}

.resource-item.col-12 .card-img-top {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px 0 0 8px;
}

.resource-item.col-12 .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.resource-item.col-12 .card-footer {
    background: transparent;
    border-top: none;
    padding: 0 1.25rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 响应式布局 */
.resources-section {
    margin-top: 2rem;
}

.resources-section .section-title {
    margin-bottom: 1.5rem;
}

@media (max-width: 767.98px) {
    .banner-img {
        height: 250px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-img-top {
        height: 140px;
    }
    
    .resource-item.col-12 .card-img-top {
        width: 120px;
        height: 100px;
    }
    
    .resource-item.col-12 .card-body {
        padding: 1rem;
    }
    
    .resource-item.col-12 .card-footer {
        padding: 0 1rem 1rem;
    }
}

/* ==================== 详情页特定样式 ==================== */

/* 资源封面 */
.resource-cover {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* 资源信息卡片 */
.resource-info {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

/* 价格显示 */
.resource-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 标签样式 */
.resource-tags .badge {
    margin-right: 5px;
    padding: 6px 10px;
    font-weight: 500;
}

/* 资源描述 */
.resource-desc {
    line-height: 1.8;
}

/* 购买卡片 */
.purchase-card {
    position: sticky;
    top: 100px;
}

/* 标签页导航 */
.nav-tabs .nav-link {
    border: none;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 1rem 1.5rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    background: transparent;
} 