/* ========== 基础变量与重置 ========== */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --accent: #F59E0B;
    --accent-light: #FFFBEB;
    --text: #1E293B;
    --text-light: #64748B;
    --bg: #FFFFFF;
    --bg-light: #F8FAFC;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-lg: 16px;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all 0.3s ease;
    background: transparent;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 10px 0;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo-text {
    color: var(--text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-light);
    transition: color 0.2s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary);
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--primary);
    color: #fff !important;
    border-radius: 8px;
    font-weight: 600 !important;
    transition: background 0.2s, transform 0.2s !important;
}

.btn-nav:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== 导航栏搜索框 ========== */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.nav-search input[type="search"] {
    width: 200px;
    padding: 8px 38px 8px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: all 0.2s;
}

.nav-search input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    width: 230px;
}

.nav-search button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px 6px;
    line-height: 1;
}

.nav-search button:hover {
    opacity: 0.7;
}

/* 搜索结果下拉 */
.search-results {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 1100;
}

.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

.search-item:hover {
    background: var(--primary-light);
}

.search-item-title {
    font-size: 0.9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-item-arrow {
    color: var(--primary);
    font-weight: 700;
}

.search-all {
    display: block;
    text-align: center;
    margin-top: 6px;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    border-top: 1px solid var(--border);
}

.search-loading,
.search-empty {
    padding: 14px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ========== Hero 区域 ========== */
.hero {
    padding: 140px 0 100px;
    background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 50%, #FEF2F2 100%);
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-desc strong {
    color: var(--text);
    font-weight: 700;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-outline {
    border: 2px solid var(--border);
    color: var(--text);
    background: #fff;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.1rem;
    border-radius: 12px;
}

.btn-qq {
    background: #12B7F5;
    color: #fff;
    box-shadow: 0 4px 14px rgba(18, 183, 245, 0.35);
}

.btn-qq:hover {
    background: #0EA5E9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 183, 245, 0.45);
}

.hero-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-tags span {
    color: var(--text-light);
    font-size: 0.9rem;
}

.hero-tags a {
    padding: 4px 14px;
    background: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.hero-tags a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Hero 视觉卡片 */
.hero-visual {
    flex: 0 0 340px;
    position: relative;
    height: 360px;
}

.hero-card {
    position: absolute;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.3s;
}

.hero-card:hover {
    transform: translateY(-4px);
}

.card-emoji {
    font-size: 2rem;
    margin-bottom: 4px;
}

.hero-card strong {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.hero-card small {
    font-size: 0.8rem;
    color: var(--text-light);
}

.hero-card-1 {
    top: 0;
    left: 0;
}

.hero-card-2 {
    top: 20px;
    right: 0;
}

.hero-card-3 {
    bottom: 60px;
    left: 20px;
}

.hero-card-4 {
    bottom: 0;
    right: 30px;
}

/* ========== 区块通用 ========== */
.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* ========== 特色区域 ========== */
.features {
    padding: 100px 0;
    background: var(--bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 36px 28px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-card p {
    font-size: 0.925rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ========== 学习阶段 ========== */
.stages {
    padding: 100px 0;
    background: var(--bg-light);
}

.stages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.stage-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 28px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s;
    gap: 10px;
}

.stage-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    background: var(--primary-light);
}

.stage-emoji {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.stage-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.stage-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

.stage-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: auto;
    transition: gap 0.2s;
}

.stage-card:hover .stage-link {
    text-decoration: underline;
}

/* ========== 数据统计 ========== */
.stats {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.stat-item {
    text-align: center;
    color: #fff;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.85;
}

.stats-live-badge {
    text-align: center;
    margin-top: 32px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
}

/* ========== 热门分类 ========== */
.hot-topics {
    padding: 100px 0;
    background: var(--bg);
}

.topics-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.topic-tag {
    padding: 10px 22px;
    background: var(--bg-light);
    border-radius: 24px;
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.25s;
}

.topic-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* ========== CTA 区域 ========== */
.cta {
    padding: 100px 0;
    background: linear-gradient(135deg, #FEF3C7 0%, #FCE7F3 50%, #E0E7FF 100%);
}

.cta-content {
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
}

.cta-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 36px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ========== 页脚 ========== */
.footer {
    padding: 64px 0 32px;
    background: #1E293B;
    color: #CBD5E1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 16px;
}

.footer-brand .footer-logo .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 4px;
}

.footer-slogan {
    color: var(--accent) !important;
    font-weight: 600 !important;
    margin-top: 8px !important;
}

.footer-col h4 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 0.875rem;
    color: #94A3B8;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid #334155;
    text-align: center;
    font-size: 0.85rem;
    color: #64748B;
}

.footer-bottom p {
    margin-bottom: 4px;
}

.footer-bottom a {
    color: #64748B;
    transition: color 0.2s;
}

.footer-bottom a:hover {
    color: #94A3B8;
}

/* ========== 资料推荐 ========== */
.latest {
    padding: 96px 0;
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(79,70,229,0.06), transparent 60%),
        var(--bg-light);
}

.section-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.16);
    border-color: rgba(79, 70, 229, 0.35);
}

/* 缩略图 */
.post-thumb {
    position: relative;
    width: 100%;
    height: 158px;
    overflow: hidden;
    background:
        linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

.post-thumb::after {
    /* 无图时的装饰纹理 */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.22), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.16), transparent 45%);
}

.post-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    padding: 3px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff5b5b, #ff2d55);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(255, 45, 85, 0.4);
    letter-spacing: 0.5px;
}

.post-thumb img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-thumb img {
    transform: scale(1.06);
}

.post-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    z-index: 1;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
}

.post-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.post-card:hover .post-title {
    color: var(--primary);
}

.post-excerpt {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.65;
    margin-bottom: 14px;
    flex: 1;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: var(--text-light);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.latest-more {
    text-align: center;
    margin-top: 44px;
}

.latest-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
    font-size: 0.95rem;
}

/* 骨架屏 */
.latest-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.skeleton {
    height: 300px;
    border-radius: 18px;
    background: linear-gradient(90deg, #EDEFF5 25%, #F5F6FA 37%, #EDEFF5 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-tags {
        justify-content: center;
    }

    .hero-visual {
        flex: 0 0 auto;
        width: 100%;
        height: 280px;
        max-width: 400px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .latest-grid,
    .latest-skeleton {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 120px 0 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-visual {
        height: 220px;
    }

    .hero-card {
        padding: 14px 18px;
    }

    .hero-card strong {
        font-size: 1.2rem;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        flex-direction: column;
        justify-content: center;
        gap: 24px;
        font-size: 1.2rem;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .features {
        padding: 60px 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .stages {
        padding: 60px 0;
    }

    .stages-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .cta-content h2 {
        font-size: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hot-topics {
        padding: 60px 0;
    }

    .latest {
        padding: 60px 0;
    }

    .latest-grid,
    .latest-skeleton {
        grid-template-columns: 1fr;
    }

    /* 移动端让搜索框常驻顶部 */
    .nav-search {
        order: 3;
        width: 100%;
        margin: 10px 0 0;
    }

    .nav-search input[type="search"] {
        width: 100%;
    }

    .nav-search input[type="search"]:focus {
        width: 100%;
    }

    .search-results {
        width: 100%;
        left: 0;
        right: 0;
    }

    .latest-tab {
        padding: 8px 18px;
        font-size: 0.85rem;
    }
}
