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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --text-color: #1f2937;
    --text-muted: #1e3a5f;
    --bg-color: #ffffff;
    --border-color: #e5e7eb;
    --code-bg: #f3f4f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* 导航栏 */
header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* 主内容区 */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== 首页 Hero 寰宇动效 ========== */
.hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #0f172a 0%, #1e3a5f 35%, #1e40af 70%, #0f172a 100%);
    background-size: 200% 200%;
    animation: gradientShift 14s ease infinite;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-cursor-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    left: 0;
    top: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, rgba(147,197,253,0.12) 35%, transparent 70%);
    filter: blur(28px);
    will-change: transform;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(59, 130, 246, 0.2) 0%, transparent 55%);
    animation: fadeIn 1.5s ease-out;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    animation: float 20s ease-in-out infinite;
}

.hero-shape-1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.hero-shape-2 {
    width: 300px;
    height: 300px;
    background: #60a5fa;
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
    opacity: 0.15;
}

.hero-shape-3 {
    width: 200px;
    height: 200px;
    background: #93c5fd;
    top: 40%;
    left: 20%;
    animation-delay: -14s;
    opacity: 0.18;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 640px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-greeting {
    font-size: 1.25rem;
    color: #93c5fd;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.hero-desc {
    font-size: 1.125rem;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.hero-tagline {
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.hero-ai {
    color: #93c5fd;
    font-weight: 700;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(147,197,253,0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

.hero-cta {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff !important;
    text-decoration: none;
    border-radius: 9999px;
    font-weight: 600;
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.5);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1s forwards;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.6);
}

/* 最新文章区块 */
.posts-section {
    padding: 4rem 2rem;
}

.posts-section .section-title {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.2s forwards;
}

.posts-section .posts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.posts-section .post-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.posts-section .post-card:nth-child(1) { animation-delay: 0.1s; }
.posts-section .post-card:nth-child(2) { animation-delay: 0.2s; }
.posts-section .post-card:nth-child(3) { animation-delay: 0.3s; }
.posts-section .post-card:nth-child(4) { animation-delay: 0.4s; }
.posts-section .post-card:nth-child(5) { animation-delay: 0.5s; }
.posts-section .post-card:nth-child(n+6) { animation-delay: 0.6s; }

/* 文章卡片 */
.posts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: box-shadow 0.3s;
}

.post-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-card h2 {
    margin-bottom: 0.5rem;
}

.post-card h2 a {
    text-decoration: none;
    color: var(--text-color);
}

.post-card h2 a:hover {
    color: var(--primary-color);
}

.post-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--code-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.summary {
    color: #6b7280;
    margin-top: 0.5rem;
}

/* 文章内容 */
.post {
    max-width: 800px;
    margin: 0 auto;
}

.post header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.post .content {
    line-height: 1.8;
}

.post .content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.post .content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.post .content p {
    margin-bottom: 1rem;
}

.post .content ul,
.post .content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.post .content li {
    margin-bottom: 0.5rem;
}

.post .content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

.post .content code {
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
}

.post .content pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.post .content pre code {
    background-color: transparent;
    padding: 0;
}

.post .content a {
    color: var(--primary-color);
    text-decoration: none;
}

.post .content a:hover {
    text-decoration: underline;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: #6b7280;
    font-size: 0.875rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    main {
        padding: 0 1rem;
    }

    .post h1 {
        font-size: 2rem;
    }
}

/* 文章图片样式 */
.post .content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post .content img.article-image {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post .content figure {
    margin: 2rem 0;
    text-align: center;
}

.post .content figure img {
    margin-bottom: 0.5rem;
}

.post .content figure figcaption {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}



