:root {
    /* 深色极简风 - 增加层次感 */
    --bg-primary: #08080a;
    --bg-secondary: #0f0f12;
    --bg-card: #131318;
    --bg-card-hover: #1a1a20;
    --text-primary: #f5f2eb;
    --text-secondary: #9a9589;
    --accent-blue: #4a9eff;
    --accent-purple: #a855f7;
    --accent-gold: #f59e0b;
    --border: rgba(245, 242, 235, 0.08);
    --border-hover: rgba(245, 242, 235, 0.15);
}

/* 日间模式 */
[data-theme="light"] {
    --bg-primary: #fafaf9;
    --bg-secondary: #f5f5f4;
    --bg-card: #ffffff;
    --bg-card-hover: #f9f9f8;
    --text-primary: #1c1917;
    --text-secondary: #78716c;
    --accent-blue: #2563eb;
    --accent-purple: #9333ea;
    --accent-gold: #d97706;
    --border: rgba(28, 25, 23, 0.12);
    --border-hover: rgba(28, 25, 23, 0.2);
}

/* 主题切换按钮 */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-1px);
}

/* 深色模式下按钮更明显 */
:root .theme-toggle {
    border-color: rgba(245, 242, 235, 0.15);
}

/* 日间模式下按钮更明显 */
[data-theme="light"] .theme-toggle {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

/* 主题切换按钮图标显示 - 根据按钮的 data-mode 显示对应图标 */
.theme-toggle[data-mode="light"] .sun-icon { display: block; }
.theme-toggle[data-mode="light"] .moon-icon { display: none; }

.theme-toggle[data-mode="dark"] .moon-icon { display: block; }
.theme-toggle[data-mode="dark"] .sun-icon { display: none; }

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

html {
    /* scroll-behavior: smooth;  移除以提升性能 */
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

/* 添加微妙的纹理效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.01) 2px,
            rgba(255, 255, 255, 0.01) 4px
        );
    opacity: 0.5;
}

/* 日间模式纹理效果 - 移除条纹 */
[data-theme="light"] body::before {
    display: none;
}

/* Animated background mesh - 深色极简 + 丰富层次 */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    opacity: 1;
    background:
        /* Hero 区域顶部的蓝色光晕（极淡） */
        radial-gradient(ellipse at 50% 30%, rgba(74, 158, 255, 0.06) 0%, transparent 50%),
        /* 右上角紫色光晕 */
        radial-gradient(ellipse at 85% 20%, rgba(168, 85, 247, 0.04) 0%, transparent 45%),
        /* 底部微妙的渐变过渡 */
        radial-gradient(ellipse at 50% 100%, rgba(20, 20, 25, 0.12) 0%, transparent 40%),
        /* 左下角金色光晕 */
        radial-gradient(ellipse at 15% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 40%),
        /* 基础深色渐变 */
        linear-gradient(to bottom, #08080a 0%, #0c0c0f 50%, #101014 100%);
}

/* 日间模式背景 */
[data-theme="light"] .bg-mesh {
    background:
        /* 顶部柔和蓝色光晕 */
        radial-gradient(ellipse at 50% 30%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
        /* 右上角紫色光晕 */
        radial-gradient(ellipse at 85% 20%, rgba(147, 51, 234, 0.05) 0%, transparent 45%),
        /* 底部柔和渐变 */
        radial-gradient(ellipse at 50% 100%, rgba(244, 244, 245, 0.8) 0%, transparent 40%),
        /* 左下角金色光晕 */
        radial-gradient(ellipse at 15% 80%, rgba(217, 119, 6, 0.04) 0%, transparent 40%),
        /* 基础浅色渐变 */
        linear-gradient(to bottom, #fafaf9 0%, #f5f5f4 50%, #f0f0ef 100%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
    position: relative;
    z-index: 1;
}

/* Logo in footer */
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 16px;
    transition: opacity 0.3s ease;
}

.footer-logo:hover {
    opacity: 0.8;
}

.footer-logo-icon {
    width: 32px;
    height: 32px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    flex-shrink: 0;
}

.footer-logo-icon .pixel {
    border-radius: 3px;
}

.footer-logo-icon .pixel:nth-child(1) { background: #4a9eff; }
.footer-logo-icon .pixel:nth-child(2) { background: #6b7eff; }
.footer-logo-icon .pixel:nth-child(3) { background: #8b5cf7; }
.footer-logo-icon .pixel:nth-child(4) { background: #a855f7; }

.footer-logo-text {
    font-family: 'Fraunces', serif;
    font-size: 24px;
    font-weight: 600;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.hero .container {
    text-align: center;
    position: relative;
    z-index: 3;
}

.hero-avatar {
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out both;
}

.hero-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(245, 242, 235, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(74, 158, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-avatar img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(74, 158, 255, 0.5);
}

/* Background Image - 作为备用黑色背景 */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: -2;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
        rgba(8, 8, 10, 0.65) 0%,
        rgba(8, 8, 10, 0.5) 50%,
        rgba(16, 16, 20, 0.8) 100%);
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(245, 242, 235, 0.06);
    border: 1px solid rgba(245, 242, 235, 0.12);
    border-radius: 100px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out;
    box-shadow:
        0 0 20px rgba(34, 197, 94, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px #22c55e;
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 12px #22c55e;
    }
}

.hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(48px, 7vw, 88px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 30px;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease-out 0.1s both;
    color: #f5f2eb;
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 50%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    color: #9a9589;
}

/* Articles Grid */
.articles-section {
    padding: 50px 0 120px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(245, 242, 235, 0.06);
    flex-wrap: wrap;
    gap: 20px;
}

.section-title {
    font-family: 'Fraunces', serif;
    font-size: 36px;
    font-weight: 600;
    line-height: 1;
    transition: color 0.3s ease;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    transition: color 0.3s ease;
}

.count-highlight {
    font-family: 'Space Mono', monospace;
    color: var(--accent-blue);
    font-weight: 600;
}

.section-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 搜索框样式 */
.search-container {
    margin-bottom: 0;
    display: flex;
}

.search-box {
    position: relative;
}

.search-input {
    width: 280px;
    padding: 10px 40px 10px 16px;
    font-size: 14px;
    font-family: 'Source Serif 4', Georgia, serif;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
    will-change: width;
}

.search-input::placeholder {
    color: var(--text-secondary);
    font-size: 13px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
    width: 320px;
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.section-subtitle .count-highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    /* 性能优化：告诉浏览器这些元素是独立的 */
    contain: layout style paint;
}

/* Article Card */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    will-change: transform;
    backface-visibility: hidden;
}

.article-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--card-accent, var(--accent-blue));
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-card:hover {
    border-color: var(--card-accent, var(--accent-blue));
    background: var(--bg-card-hover);
}

.article-card:hover::after {
    width: 100%;
}

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

.card-category {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    background: rgba(74, 158, 255, 0.08);
    border-radius: 4px;
    color: var(--card-accent, var(--accent-blue));
    transition: color 0.2s ease;
    font-weight: 500;
}

/* 日间模式分类标签 */
[data-theme="light"] .card-category {
    background: rgba(37, 99, 235, 0.1);
}

.card-meta {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.card-title {
    font-family: 'Fraunces', serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 14px;
    transition: color 0.2s ease;
    /* 限制最多显示两行，多余的省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 固定高度确保一致性 */
    min-height: 2.6em;
    max-height: 2.6em;
}

.article-card:hover .card-title {
    color: var(--card-accent, var(--accent-blue));
}

.card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.card-tag {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(15, 15, 18, 0.5);
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

/* 日间模式标签样式 */
[data-theme="light"] .card-tag {
    background: rgba(0, 0, 0, 0.06);
    border: none;
}

.card-footer {
    display: none;
}

.read-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.article-card:hover .read-link {
    color: var(--card-accent, var(--accent-blue));
}

.read-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.article-card:hover .read-arrow {
    transform: translateX(3px);
}

.card-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Load More Button */
.load-more-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
    padding-bottom: 20px;
}

.load-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
    margin: 0 auto;
    padding: 14px 36px;
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(19, 19, 24, 0.8) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.4s ease;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* 顶部渐变线 */
.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-gold));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.4s ease;
}

.load-more-btn:hover {
    border-color: var(--border-hover);
    background: linear-gradient(145deg, var(--bg-card-hover) 0%, rgba(26, 26, 32, 0.9) 100%);
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(74, 158, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.load-more-btn:hover::before {
    transform: scaleX(1);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn .arrow-icon {
    font-size: 12px;
    transition: all 0.3s ease;
    color: var(--accent-blue);
}

.load-more-btn:hover .arrow-icon {
    transform: translateY(2px);
    color: var(--accent-purple);
}

.hidden-card {
    display: none;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 50px;
}

.pagination-btn {
    min-width: 40px;
    padding: 8px 16px;
    font-size: 14px;
    font-family: 'Space Mono', monospace;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--bg-primary);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 16px;
    text-align: center;
}

/* 搜索结果提示 */
.search-results-info {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 15px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Card Variants */
.card-ai {
    --card-accent: var(--accent-blue);
}

.card-future {
    --card-accent: var(--accent-purple);
}

.card-finance {
    --card-accent: var(--accent-gold);
}

.card-tech {
    --card-accent: #06b6d4;
}

/* Footer */
footer {
    background: linear-gradient(to top, #0c0c0f 0%, #0f0f12 100%);
    padding: 60px 0 40px;
    border-top: 1px solid var(--border);
}

/* 日间模式 Footer */
[data-theme="light"] footer {
    background: linear-gradient(to top, #f0f0ef 0%, #f5f5f4 100%);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.footer-brand h2 {
    font-family: 'Fraunces', serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 400px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(245, 242, 235, 0.04);
    border: 1px solid rgba(245, 242, 235, 0.08);
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.social-link:hover {
    background: rgba(245, 242, 235, 0.08);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}

/* 日间模式社交链接 */
[data-theme="light"] .social-link {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .social-link:hover {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.social-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    display: block;
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(245, 242, 235, 0.06);
    text-align: center;
}

/* 日间模式 Footer 底部分隔线 */
[data-theme="light"] .footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-bottom p {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Hide Scrollbar */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        padding: 0 40px;
    }

    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 25px;
    }

    .hero {
        padding: 120px 0 80px;
    }

    .hero-avatar img {
        width: 100px;
        height: 100px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .section-title {
        font-size: 28px;
    }

    .search-input {
        width: 100%;
    }

    .search-input:focus {
        width: 100%;
    }

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

    .article-card {
        padding: 28px;
    }

    .card-title {
        font-size: 22px;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-brand p {
        max-width: 100%;
    }

    .social-links {
        justify-content: center;
    }
}
