/* ============================================
   码迹 — 个人知识分享博客
   Design System: Bento Attio Flat Modern
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-warm: #FAFAF7;
    --bg-white: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --navy: #003B5C;
    --navy-light: rgba(0, 59, 92, 0.08);
    --green: #0E4D3C;
    --green-light: rgba(14, 77, 60, 0.08);
    --brown: #7D5A2F;
    --brown-light: rgba(125, 90, 47, 0.08);
    --footer-bg: #1A1A1A;
    --border-light: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 3px rgba(10, 15, 25, 0.04);
    --shadow-md: 0 4px 12px rgba(10, 15, 25, 0.06);
    --shadow-lg: 0 8px 24px rgba(10, 15, 25, 0.08);
    
    /* Typography */
    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Layout */
    --page-width: 1440px;
    --content-width: 1200px;
    --side-padding: 120px;
    --radius: 12px;
    --radius-sm: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-warm);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* === Header === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-white);
    box-shadow: 0 1px 3px rgba(10, 15, 25, 0.05);
    height: 72px;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 var(--side-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    transition: color 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--navy);
}

.nav-link.active {
    color: var(--navy);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--bg-warm);
}

.btn-primary {
    background: var(--navy);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: #005580;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-ghost {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

/* === Hero === */
.hero {
    background: var(--bg-warm);
    padding: 80px 0;
}

.hero-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 var(--side-padding);
    display: flex;
    align-items: center;
    gap: 64px;
}

.hero-left {
    flex: 1;
}

.hero-label {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--navy);
    display: block;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    gap: 12px;
}

.hero-right {
    flex: 0 0 480px;
}

/* === Code Editor === */
.code-editor {
    background: #1E1E2E;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.code-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #181825;
    gap: 12px;
}

.code-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ED8796; }
.dot-yellow { background: #EED49F; }
.dot-green { background: #A6DA95; }

.code-filename {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #6C7086;
    margin-left: 8px;
}

.code-body {
    padding: 20px 24px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.7;
    overflow-x: auto;
}

.code-body code {
    color: #CDD6F4;
}

.c-comment { color: #6C7086; font-style: italic; }
.c-keyword { color: #CBA6F7; }
.c-class { color: #F9E2AF; }
.c-func { color: #89B4FA; }
.c-string { color: #A6E3A1; }
.c-built { color: #F38BA8; }

/* === Section Common === */
.section-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 80px var(--side-padding);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--navy);
    display: block;
    margin-bottom: 8px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.section-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--navy);
    transition: opacity 0.2s;
}

.section-link:hover {
    opacity: 0.7;
}

/* === Categories Bento Grid === */
.categories {
    background: var(--bg-white);
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
}

.bento-card {
    background: var(--bg-warm);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.2s;
    border: 1px solid var(--border-light);
}

.bento-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.bento-large {
    grid-row: span 2;
    min-height: 292px;
    display: flex;
    flex-direction: column;
}

.bento-small {
    min-height: 134px;
}

.bento-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.bento-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.bento-small .bento-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
}

.bento-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.bento-small .bento-title {
    font-size: 17px;
}

.bento-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.bento-small .bento-desc {
    font-size: 13px;
    margin-bottom: 0;
}

.bento-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bento-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.bento-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 100px;
}

/* === Featured Articles === */
.featured {
    background: var(--bg-warm);
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.featured-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.3s, transform 0.2s;
}

.featured-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.featured-cover {
    height: 200px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 16px;
}

.featured-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 100px;
}

.featured-content {
    padding: 24px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.meta-dot {
    color: var(--text-tertiary);
}

.featured-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.featured-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.read-more {
    font-size: 14px;
    font-weight: 500;
    color: var(--navy);
    transition: opacity 0.2s;
}

.read-more:hover {
    opacity: 0.7;
}

/* === Latest Articles === */
.latest {
    background: var(--bg-white);
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.latest-card {
    background: var(--bg-warm);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.3s, transform 0.2s;
    cursor: pointer;
}

.latest-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.latest-cover {
    height: 140px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 12px;
}

.latest-cat {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: 100px;
}

.latest-info {
    padding: 16px 20px 20px;
}

.latest-date {
    font-size: 12px;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 8px;
}

.latest-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.latest-read {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* === About Author === */
.about {
    background: var(--bg-warm);
}

.about-inner {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.about-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #003B5C, #0E4D3C);
}

.avatar-text {
    position: relative;
    font-size: 48px;
    font-weight: 700;
    color: #FFFFFF;
}

.about-content {
    flex: 1;
}

.about-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.about-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.about-title {
    font-size: 15px;
    color: var(--text-secondary);
}

.about-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.stat {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-bio {
    font-size: 15px;
    color: #444444;
    line-height: 1.8;
    margin-bottom: 16px;
    max-width: 800px;
}

.about-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.about-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--navy);
    background: var(--navy-light);
    padding: 4px 12px;
    border-radius: 100px;
}

.about-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.social-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--navy);
    transition: opacity 0.2s;
}

.social-link:hover {
    opacity: 0.7;
}

/* === Footer === */
.footer {
    background: var(--footer-bg);
    padding: 64px 0 48px;
}

.footer-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 var(--side-padding);
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 48px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-logo {
    font-size: 22px;
    font-weight: 700;
    color: #FAFAF7;
}

.footer-desc {
    font-size: 14px;
    color: #888888;
}

.footer-links {
    display: flex;
    gap: 64px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col-title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: #FAFAF7;
    margin-bottom: 4px;
}

.footer-col a {
    font-size: 14px;
    color: #888888;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #FAFAF7;
}

.footer-bottom {
    border-top: 1px solid #2A2A2A;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-size: 13px;
    color: #666666;
}

.footer-powered {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #666666;
}

/* === Responsive === */
@media (max-width: 1024px) {
    :root {
        --side-padding: 40px;
    }
    
    .hero-inner {
        flex-direction: column;
    }
    
    .hero-right {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .bento-large {
        grid-row: span 1;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .latest-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav {
        display: none;
    }
}

@media (max-width: 640px) {
    :root {
        --side-padding: 20px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .latest-grid {
        grid-template-columns: 1fr;
    }
    
    .about-inner {
        flex-direction: column;
    }
    
    .footer-links {
        gap: 32px;
        flex-wrap: wrap;
    }
    
    .about-stats {
        flex-wrap: wrap;
        gap: 16px;
    }
}
