/* ========================================
   ConnectBook - 首页样式
   设计：深浅搭配，层次分明
   ======================================== */

/* Hero 区域 - 深色渐变背景 */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #ffffff;
    padding: 80px 0 72px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section .section-title {
    color: #ffffff;
    margin-bottom: 32px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* 精选文章网格 */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.featured-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.featured-image {
    height: 200px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-content {
    padding: 20px;
}

.featured-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #ffffff;
}

.featured-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-line-orient: vertical;
    overflow: hidden;
}

.featured-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

/* 内容区 - 浅色背景 */
.main-content {
    background: #ffffff;
    padding: 40px 0 60px;
}

/* 内容网格 */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

.main-column {
    min-width: 0;
}

/* 分类区块 */
.category-section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 20px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 3px solid #0f172a;
    display: inline-block;
    color: #0f172a;
    font-weight: 600;
}

.section-title a {
    color: inherit;
    text-decoration: none;
}

.section-title a:hover {
    color: #4f46e5;
}

/* 文章列表 */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
    transform: translateX(3px);
}

.post-card a {
    color: inherit;
    text-decoration: none;
}

.post-card h3 {
    font-size: 17px;
    margin-bottom: 8px;
    color: #0f172a;
    line-height: 1.4;
}

.post-card p {
    color: #475569;
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-line-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
    flex-wrap: wrap;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: box-shadow 0.2s ease;
}

.sidebar-widget:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.sidebar-widget h3 {
    font-size: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

/* 热门文章列表 */
.trending-list {
    list-style: none;
}

.trending-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.trending-list li:last-child {
    border-bottom: none;
}

.trending-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.trending-list li:nth-child(1) .trending-rank { background: #4f46e5; }
.trending-list li:nth-child(2) .trending-rank { background: #6366f1; }
.trending-list li:nth-child(3) .trending-rank { background: #818cf8; }

.trending-list a {
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
}

.trending-list a:hover {
    color: #4f46e5;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: #f1f5f9;
    color: #334155;
    border-radius: 9999px;
    font-size: 13px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.tag:hover {
    background: #0f172a;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* 问答小部件 - 深色卡片 */
.qa-widget {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border: none;
}

.qa-widget h3 {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.qa-widget p {
    margin-bottom: 16px;
    opacity: 0.85;
    color: #e2e8f0;
}

.qa-widget .btn-primary {
    background: #ffffff;
    color: #0f172a;
    border: none;
    font-weight: 600;
}

.qa-widget .btn-primary:hover {
    background: #f8fafc;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* 页脚 - 深色 */
.footer {
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 28px 0;
    text-align: center;
    color: #94a3b8;
}

/* 响应式 */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 56px 0 48px;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .post-meta {
        flex-direction: column;
        gap: 6px;
    }

    .post-card {
        padding: 18px;
    }
}

/* ========================================
   首页 A 区：Hero 双栏布局与轮播
   ======================================== */

.hero-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 40px;
    align-items: stretch;
}

.hero-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
}

.hero-carousel {
    position: relative;
}

.carousel-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-slides {
    position: relative;
    min-height: 285px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

/* 轮播内文章大卡片 */
.featured-card-large {
    height: 100%;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
}

.featured-card-large a {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.featured-image-large {
    height: 220px;
    overflow: hidden;
}

.featured-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-card-large:hover .featured-image-large img {
    transform: scale(1.05);
}

.featured-content-large {
    padding: 24px;
}

.featured-content-large h3 {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.4;
}

.featured-excerpt {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
}

/* 轮播控制 */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0 20px;
}

.carousel-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dots .dot.active {
    background: #6366f1;
    transform: scale(1.25);
}

/* Hero 侧边栏 */
.hero-sidebar {
    display: flex;
    flex-direction: column;
}

.about-widget {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 21px;
    height: 100%;
    backdrop-filter: blur(8px);
}

.about-widget p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.8;
    margin: 16px 0 24px;
}

.site-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   首页 B 区：内容宫格（Bento Grid）
   ======================================== */

.grid-section {
    padding: 56px 0;
    background: #f8fafc;
}

.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: #6366f1;
    color: #4f46e5;
}

.filter-btn.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

/* 宫格：桌面 3 列，平板 2 列，手机 1 列 */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 8px;
}

.bento-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.bento-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.bento-image {
    height: 180px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.bento-card:hover .bento-image img {
    transform: scale(1.05);
}

/* 默认缩略图 - 无图片时的占位样式 */
.bento-image-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.default-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    height: 100%;
}

.default-thumbnail .default-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.default-thumbnail .default-text {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bento-content h3 {
    font-size: 17px;
    color: #0f172a;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-content p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #94a3b8;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* 快讯/短想法卡片 */
.quick-post-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.quick-post-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-post-card-link:hover .quick-post-card {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.quick-post-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.quick-post-type {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef2ff;
    color: #4f46e5;
}

.quick-post-type.type-news {
    background: #eff6ff;
    color: #2563eb;
}

.quick-post-type.type-thought {
    background: #ecfdf5;
    color: #059669;
}

.quick-post-type.type-tip {
    background: #fff7ed;
    color: #ea580c;
}

.quick-post-thumbnail {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    max-height: 200px;
}

.quick-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.quick-post-content {
    color: #334155;
    font-size: 14px;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

.quick-post-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #94a3b8;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* 徽标 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-pinned {
    background: #fef3c7;
    color: #b45309;
}

.badge-featured {
    background: #fce7f3;
    color: #be185d;
}

/* 空状态 */
.empty-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.bento-link .empty-state {
    margin: 20px;
}

/* 轮播内快讯卡片（深色环境） */
.featured-quick-post {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    height: 100%;
}

.featured-quick-post .quick-post-content {
    color: rgba(255, 255, 255, 0.85);
    -webkit-line-clamp: 8;
}

.featured-quick-post .quick-post-meta {
    color: rgba(255, 255, 255, 0.55);
    border-top-color: rgba(255, 255, 255, 0.12);
}

/* ========================================
   首页 D 区：猜你想读
   ======================================== */

.discovery-section {
    padding: 56px 0 72px;
    background: #ffffff;
}

.recommended-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 8px;
}

.recommended-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recommended-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.recommended-card a {
    display: block;
    padding: 22px;
    color: inherit;
    text-decoration: none;
}

.recommended-card h4 {
    font-size: 16px;
    color: #0f172a;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-card p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-meta {
    font-size: 12px;
    color: #94a3b8;
}

/* ========================================
   分类详情页头部（列表样式沿用 .posts-list/.post-card）
   ======================================== */

.category-header {
    text-align: center;
    padding: 48px 0;
}

.category-header h1 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.category-header p {
    color: var(--color-text-muted);
    font-size: var(--font-size-lg);
}

/* ========================================
   分类列表页
   ======================================== */

.page-header {
    text-align: center;
    padding: 48px 0 32px;
}

.page-header h1 {
    font-size: 2.2rem;
    color: #0f172a;
    margin-bottom: 12px;
}

.page-header p {
    color: #94a3b8;
    font-size: 16px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding-bottom: 40px;
}

.category-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 26px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    border-color: #c7d2fe;
}

.category-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: #eef2ff;
    border-radius: 14px;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.category-info h3 {
    font-size: 17px;
    color: #0f172a;
    margin-bottom: 6px;
}

.category-info p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-count {
    font-size: 12px;
    color: #4f46e5;
    font-weight: 600;
}

/* ========================================
   首页/分类页响应式
   ======================================== */

@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .recommended-posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .recommended-posts {
        grid-template-columns: 1fr;
    }

    .carousel-slides {
        min-height: 0;
    }
}

