/* main.css */
/* ========================================
   ConnectBook - 全局样式
   设计：深浅搭配，层次分明
   ======================================== */

/* 重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #4338ca;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   导航栏 - 深色背景
   ======================================== */
.navbar {
    background-color: #0f172a;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.logo:hover {
    color: #e2e8f0;
}

/* 图片 LOGO（后台"基本设置"上传后启用） */
.logo .logo-image {
    display: block;
    height: 36px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-menu a {
    color: #cbd5e1;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    font-size: 15px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #ffffff;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4f46e5;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #ffffff;
    transition: 0.3s;
}

/* ========================================
   按钮
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background-color: #0f172a;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #f8fafc;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 14px;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    color: white;
}

/* 导航栏认证按钮 */
.nav-menu .nav-auth-btn {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-menu .nav-auth-btn.login {
    background-color: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-menu .nav-auth-btn.login:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-menu .nav-auth-btn.register {
    background-color: #3b82f6;
    color: #ffffff;
    border: 1px solid #3b82f6;
}

.nav-menu .nav-auth-btn.register:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* ========================================
   卡片
   ======================================== */
.card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* ========================================
   表单
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ========================================
   警告框
   ======================================== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #ecfdf5;
    color: #155724;
    border: 1px solid #a7f3d0;
}

/* ========================================
   分页
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
}

.pagination a.active,
.pagination a:hover {
    background-color: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

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

.footer p {
    font-size: 14px;
}

/* ========================================
   工具类
   ======================================== */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #0f172a;
        flex-direction: column;
        padding: 16px;
        gap: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 12px 16px;
        width: 100%;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: 0 16px;
    }
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 32px 0;
    margin-top: 64px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.footer .container p {
    margin: 0;
    line-height: 1.8;
}

.footer .beian-info {
    margin-top: 8px;
    color: #9ca3af;
}

.footer .beian-info a {
    color: #9ca3af;
    text-decoration: underline;
}

.footer .beian-info a:hover {
    color: #6b7280;
}

/* theme.css */
:root {
    /* ========================================
       现代化配色系统
       ======================================== */
    
    /* 主色调 - 深蓝紫渐变系 */
    --color-primary: #4F46E5;
    --color-primary-light: #6366F1;
    --color-primary-dark: #3730A3;
    --color-primary-soft: #EEF2FF;
    
    /* 辅助色 - 温暖珊瑚色 */
    --color-secondary: #F97316;
    --color-secondary-light: #FB923C;
    --color-secondary-dark: #EA580C;
    --color-secondary-soft: #FFF7ED;
    
    /* 中性色 */
    --color-text: #1F2937;
    --color-text-light: #4B5563;
    --color-text-muted: #9CA3AF;
    --color-text-inverse: #FFFFFF;
    
    /* 背景色 */
    --color-background: #FFFFFF;
    --color-background-alt: #F9FAFB;
    --color-background-warm: #FEF3F2;
    
    /* 边框色 */
    --color-border: #E5E7EB;
    --color-border-light: #F3F4F6;
    --color-border-focus: #4F46E5;
    
    /* 功能色 */
    --color-success: #10B981;
    --color-success-soft: #D1FAE5;
    --color-warning: #F59E0B;
    --color-warning-soft: #FEF3C7;
    --color-error: #EF4444;
    --color-error-soft: #FEE2E2;
    --color-info: #3B82F6;
    --color-info-soft: #DBEAFE;
    
    /* ========================================
       字体系统
       ======================================== */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    --font-family-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;
    --font-size-3xl: 48px;
    
    /* ========================================
       间距系统
       ======================================== */
    --spacing-1: 4px;
    --spacing-2: 8px;
    --spacing-3: 12px;
    --spacing-4: 16px;
    --spacing-5: 20px;
    --spacing-6: 24px;
    --spacing-8: 32px;
    --spacing-10: 40px;
    --spacing-12: 48px;
    --spacing-16: 64px;
    
    /* ========================================
       圆角系统
       ======================================== */
    --border-radius-sm: 6px;
    --border-radius: 10px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;
    
    /* ========================================
       阴影系统
       ======================================== */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    
    /* ========================================
       过渡系统
       ======================================== */
    --transition-fast: 150ms ease;
    --transition: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* ========================================
       布局系统
       ======================================== */
    --navbar-height: 72px;
    --sidebar-width: 260px;
    --container-max: 1200px;
    --container-narrow: 800px;
    --container-wide: 1400px;
}

/* ========================================
   深色主题
   ======================================== */
[data-theme="dark"] {
    --color-primary: #6366F1;
    --color-primary-light: #818CF8;
    --color-primary-dark: #4F46E5;
    --color-primary-soft: #1E1B4B;
    
    --color-secondary: #FB923C;
    --color-secondary-light: #FDBA74;
    --color-secondary-dark: #F97316;
    --color-secondary-soft: #431407;
    
    --color-text: #F3F4F6;
    --color-text-light: #D1D5DB;
    --color-text-muted: #9CA3AF;
    --color-text-inverse: #1F2937;
    
    --color-background: #0F172A;
    --color-background-alt: #1E293B;
    --color-background-warm: #2A1A15;
    
    --color-border: #374151;
    --color-border-light: #1F2937;
    --color-border-focus: #6366F1;
    
    --color-success: #34D399;
    --color-success-soft: #064E3B;
    --color-warning: #FBBF24;
    --color-warning-soft: #78350F;
    --color-error: #F87171;
    --color-error-soft: #7F1D1D;
    --color-info: #60A5FA;
    --color-info-soft: #1E3A8A;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ========================================
   全局微调
   ======================================== */
::selection {
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
}

:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--spacing-6) 0;
}

/* home.css */
/* ========================================
   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;
    }
}


