/**
 * 中国风险投资网 - 公共样式表
 * 统一页面风格，包含通用组件样式
 */

/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 
                 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* 防止横向滚动 */
    width: 100%;
}

html {
    overflow-x: hidden; /* 防止横向滚动 */
    width: 100%;
}

/* ========== 头部导航 ========== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.header .container {
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 0.8;
}

/* 汉堡菜单按钮 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    margin-left: auto; /* 确保居右 */
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    border-radius: 2px;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

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

    width: 100%;
}

.content-left {
    flex: 1;
    min-width: 0;
    overflow-x: hidden; /* 防止内容溢出 */
}

.sidebar-right {
    width: 300px;
    flex-shrink: 0;
}

/* ========== 筛选区域 ========== */
.filter-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: hidden;
    width: 100%;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.filter-group {
    margin-bottom: 15px;
    width: 100%;
}

.filter-label {
    display: inline-block;
    min-width: 100px;
    font-weight: 500;
    color: #666;
}

.filter-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    width: auto;
    max-width: 100%;
}

.filter-tag {
    padding: 6px 16px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    border: 2px solid transparent;
    text-decoration: none;
}

.filter-tag:hover {
    background: #e0e0e0;
}

.filter-tag.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* ========== 搜索框 ========== */
.search-box {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-btn {
    padding: 10px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.3s;
}

.search-btn:hover {
    opacity: 0.9;
}

/* ========== 卡片列表（通用）========== */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    height: 160px;
    overflow: hidden;
}

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

.card-image-container {
    width: 240px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-subtitle {
    font-size: 14px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #999;
}

/* ========== 标签和徽章 ========== */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.tag {
    padding: 3px 10px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.badges {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge-auth {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-online {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-primary {
    background: #e8eaf6;
    color: #3f51b5;
}

.badge-secondary {
    background: #f5f5f5;
    color: #666;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.page-btn {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.page-btn:hover {
    background: #f5f5f5;
}

.page-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 分页：桌面端和移动端切换 */
.pagination-mobile {
    display: none;
}

.pagination-desktop {
    display: flex;
}

/* 分页响应式 */
@media (max-width: 768px) {
    .pagination-desktop {
        display: none;
    }
    
    .pagination-mobile {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin: 20px 0;
    }
    
    .pagination {
        gap: 5px;
        margin: 20px 0;
        flex-wrap: wrap;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 40px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pagination-mobile {
        gap: 4px;
        margin: 15px 0;
    }
    
    .pagination {
        gap: 4px;
        margin: 15px 0;
    }
    
    .page-btn {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 36px;
    }
}

/* ========== 广告区域 ========== */
.ad-block {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ad-title {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
    text-align: center;
}

.ad-content {
    overflow: hidden;
    border-radius: 4px;
}

.ad-banner {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.ad-link {
    display: block;
    text-decoration: none;
}

.ad-desktop {
    display: block;
}

.ad-mobile {
    display: none;
}

.ad-inline {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ad-mobile-only {
    display: none;
}

.ad-inline .ad-title {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    text-align: center;
}

/* ========== 空状态 ========== */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .sidebar-right {
        width: 250px;
    }
    
    .ad-desktop {
        display: block;
    }
    
    .ad-mobile {
        display: none;
    }
    
    .ad-mobile-only {
        display: none;
    }
}

@media (max-width: 768px) {
    /* 汉堡菜单显示，居右对齐 */
    .header-content {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .header h1 {
        flex: 0 0 auto;
    }
    
    .hamburger {
        display: flex;
        margin-left: auto;
    }
    
    .header-nav {
        position: absolute;
        top: calc(100% + 5px);
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 1000;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
    
    .header-nav.active {
        max-height: 300px;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    
    .nav-link {
        margin: 0;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-link:hover {
        background: rgba(255,255,255,0.1);
        opacity: 1;
    }
    
    /* 布局调整 */
    .container {
        flex-direction: column;
        padding: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .header .container {
        padding: 0 15px;
    }
    
    /* 右侧广告栏隐藏 */
    .sidebar-right {
        display: none !important;
    }
    
    /* 内容区宽度调整 */
    .content-left {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    /* 筛选区域调整 */
    .filter-section {
        padding: 15px;
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .filter-label {
        display: block;
        min-width: auto;
        margin-bottom: 8px;
    }
    
    .filter-tags {
        display: flex;
        width: 100%;
    }
    
    /* 卡片调整 */
    .card {
        height: auto;
        min-height: 160px;
        width: 100%;
        max-width: 100%;
    }
    
    .card-image-container {
        width: 180px;
        flex-shrink: 0;
    }
    
    /* 大屏广告隐藏 */
    .ad-desktop {
        display: none !important;
    }
    
    .ad-mobile {
        display: none !important;
    }
    
    /* 移动端内联广告显示 */
    .ad-mobile-only {
        display: block !important;
    }
    
    .ad-block {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 16px;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .container {
        padding: 8px;
    }
    
    .filter-section {
        padding: 12px;
        margin: 8px 0;
    }
    
    .filter-tag {
        padding: 5px 12px;
        font-size: 13px;
    }
    
    .card {
        flex-direction: column;
        height: auto;
        width: 100%;
    }
    
    .card-image-container {
        width: 100%;
        height: 200px;
    }
    
    .filter-label {
        display: block;
        margin-bottom: 8px;
        width: 100%;
    }
    
    .filter-tags {
        display: flex;
        width: 100%;
    }
}


