/* 基础重置与布局 */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}
body { 
    font-family: "Microsoft YaHei", sans-serif; 
    background: #f5f7fa; /* 全局背景（与主内容区同色） */
    color: #34495e; /* 默认文字色（深灰） */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: #3498db; /* 链接蓝色（高对比度） */
    transition: color 0.3s;
}
a:hover {
    color: #2980b9; /* 链接悬停色 */
}

/* 页头（深灰色背景） */
.header {
    background: #2c3e50; /* 深灰色 */
    color: #ffffff; /* 白色文字 */
    padding: 20px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    color: #ffffff; /* logo文字白色 */
}
.logo i {
    margin-right: 10px;
    font-size: 1.6rem;
    color: #ffffff; /* 图标白色 */
}

/* 导航栏（灰色背景） */
.nav {
    display: flex;
    gap: 20px;
}
.nav a {
    color: #ecf0f1; /* 浅灰文字 */
    padding: 8px 16px; /* 增大内边距，更易点击 */
    border-radius: 4px;
    transition: all 0.3s;
    background: #34495e; /* 灰色背景 */
    font-size: 1rem;
}
.nav a:hover {
    color: #ffffff; /* 悬停白色文字 */
    background: #4a6572; /* 悬停稍深灰 */
}

/* 两栏布局容器 */
.front-container { 
    display: flex; 
    max-width: 1400px; 
    margin: 20px auto; 
    gap: 20px; 
    padding: 0 20px;
    flex: 1;
}

/* 左侧导航栏（稍深浅灰，与主内容区区分） */
.sidebar { 
    width: 260px; 
    background: #eef2f7; /* 稍深浅灰（原#f5f7fa）→ 与主内容区区分 */ 
    border-radius: 10px; 
    padding: 20px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    align-self: flex-start;
}
.sidebar-title { 
    font-size: 1.2rem; 
    color: #2c3e50; /* 深灰文字 */
    margin-bottom: 15px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #ddd; /* 浅边框 */
}
.main-cat-list { list-style: none; }
.main-cat-item { margin-bottom: 10px; }
.main-cat-link { 
    display: block; 
    padding: 12px 15px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    color: #2c3e50; /* 深灰文字 */
    border-radius: 6px; 
    transition: all 0.3s; 
    background: #f8f9fa; /* 最浅灰背景（分类项） */
    border: 1px solid #eee;
}
.main-cat-link:hover, 
.main-cat-item.active .main-cat-link { 
    background: #e3f2fd; /* 悬停浅蓝 */
    color: #1976d2; /* 悬停蓝色文字 */
}
.subcat-count { 
    float: right; 
    color: #7f8c8d; /* 浅灰计数 */
    font-weight: normal; 
}

/* 子分类列表（嵌套） */
.sub-cat-list { 
    list-style: none; 
    margin-top: 8px; 
    padding-left: 20px; 
    border-left: 2px solid #e0e0e0;
}
.sub-cat-item { margin-bottom: 6px; }
.sub-cat-link { 
    display: block; 
    padding: 8px 12px; 
    font-size: 0.95rem; 
    color: #34495e; /* 深灰文字 */
    border-radius: 4px; 
    transition: all 0.3s; 
    background: #f8f9fa; /* 最浅灰背景（子分类项） */
    border: 1px solid #eee;
}
.sub-cat-link:hover, 
.sub-cat-item.active .sub-cat-link { 
    background: #f0f7ff; /* 悬停浅蓝 */
    color: #1976d2; /* 悬停蓝色文字 */
}
.content-count { 
    float: right; 
    color: #95a5a6; /* 浅灰计数 */
    font-size: 0.9em;
}

/* 右侧内容区（浅灰背景） */
.content-area { 
    flex: 1; 
    background: #f5f7fa; /* 浅灰蓝 */
    border-radius: 10px; 
    padding: 25px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.panel-title { 
    font-size: 1.3rem; 
    color: #2c3e50; /* 深灰标题 */
    margin-bottom: 20px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #ddd; /* 浅边框 */
}

/* 子分类网格（水平排列，最浅灰卡片） */
.subcat-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px; 
}
.subcat-card { 
    background: #f8f9fa; /* 最浅灰背景 */
    border-radius: 8px; 
    overflow: hidden; 
    transition: transform 0.3s, box-shadow 0.3s; 
    border: 1px solid #eee;
    height: 100%;
}
.subcat-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
}
.subcat-card-link { 
    display: block; 
    padding: 20px; 
    color: #34495e; /* 深灰文字 */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.subcat-card-link h4 { 
    font-size: 1.1rem; 
    margin-bottom: 10px; 
    color: #2c3e50; /* 深灰标题 */
}
.subcat-card-link p { 
    font-size: 0.9rem; 
    color: #7f8c8d; /* 浅灰辅助文字 */
    margin-top: auto;
}

/* 内容列表（水平排列，最浅灰卡片） */
.content-list { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px; 
    list-style: none; 
}
.content-item { 
    margin-bottom: 0; 
    padding: 0; 
    border-radius: 8px; 
    transition: background 0.3s; 
    border: 1px solid #eee;
    background: #f8f9fa; /* 最浅灰背景 */
    height: 100%;
}
.content-item:hover { 
    background: #f5f9ff; /* 悬停浅蓝 */
}
.content-link { 
    display: flex; 
    flex-direction: column;
    height: 100%;
    padding: 20px;
    color: #34495e; /* 深灰文字 */
    position: relative; 
}
.content-link h4 { 
    font-size: 1.1rem; 
    margin-bottom: 8px; 
    color: #2c3e50; /* 深灰标题 */
}
.meta { 
    font-size: 0.9rem; 
    color: #7f8c8d; /* 浅灰辅助文字 */
    margin-top: auto;
}

/* 统计信息样式（媒体计数） */
.media-stats {
    display: inline-block;
    background: #e3f2fd; /* 浅蓝背景 */
    color: #1976d2; /* 蓝色文字 */
    font-size: 0.85rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
}

/* 确保内容区域的图片自动缩放 */
.content-body img {
    max-width: 100%;
    height: auto;
    display: block; /* 防止行内元素导致的布局问题 */
}

/* 确保视频自动缩放 */
.content-body video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 点击查看按钮 */
.view-btn {
    display: inline-block;
    background: #3498db; /* 蓝色按钮 */
    color: white;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 4px;
    margin-top: 10px;
    transition: background 0.3s;
}
.view-btn:hover {
    background: #2980b9; /* 按钮悬停色 */
    color: white;
}

/* 悬停预览动画 */
.hover-preview {
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 内容项悬停效果增强 */
.content-item {
    transition: transform 0.3s, box-shadow 0.3s;
}

.content-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
/* 悬停预览窗口（自适应比例） */
.hover-preview { 
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    width: auto; /* 改为自动宽度 */
    height: auto; /* 改为自动高度 */
    max-width: 80vw; /* 最大宽度为视口的80% */
    max-height: 80vh; /* 最大高度为视口的80% */
    background: #000; 
    border-radius: 10px; 
    overflow: hidden; 
    display: none; 
    z-index: 1000; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    opacity: 0; 
    transition: opacity 0.3s ease; /* 简化过渡效果 */
}

.content-item:hover .hover-preview { 
    display: block; 
    opacity: 1; 
}

/* 预览内容自适应 */
.hover-preview img, 
.hover-preview video { 
    width: auto; /* 自动宽度 */
    height: auto; /* 自动高度 */
    max-width: 100%; /* 不超过容器宽度 */
    max-height: 100%; /* 不超过容器高度 */
    display: block;
    object-fit: contain; /* 保持比例，完整显示 */
    background: #111;
}

/* 欢迎面板 */
.welcome-panel {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa; /* 最浅灰背景 */
    border-radius: 8px;
    color: #2c3e50; /* 深灰文字 */
}
.welcome-panel h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}
.welcome-panel p {
    color: #7f8c8d; /* 浅灰文字 */
    font-size: 1.1rem;
}

/* 页脚（深灰色背景，与页头呼应） */
.footer {
    background: #2c3e50; /* 深灰色（与页头同色） */
    color: rgba(255,255,255,0.7); /* 浅灰文字 */
    padding: 40px 0 20px;
    margin-top: auto;
}
.footer .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}
.footer-section h3 {
    color: white; /* 白色标题 */
    margin-bottom: 20px;
    font-size: 1.3rem;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 12px;
}
.footer-links a {
    color: rgba(255,255,255,0.7); /* 浅灰链接 */
}
.footer-links a:hover {
    color: white; /* 悬停白色 */
}
.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5); /* 更浅灰版权文字 */
}

/* 响应式调整 */
@media (min-width: 1200px) {
    .subcat-grid, 
    .content-list { 
        grid-template-columns: repeat(4, 1fr); /* 大屏4列 */
    }
}
@media (max-width: 768px) {
    .subcat-grid, 
    .content-list { 
        grid-template-columns: repeat(2, 1fr); /* 中屏2列 */
    }
    .hover-preview {
        width: 280px; 
        height: 210px;
    }
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .subcat-grid, 
    .content-list { 
        grid-template-columns: 1fr; /* 小屏1列 */
    }
    .hover-preview {
        width: 250px; 
        height: 187px;
    }
}