:root {
    color-scheme: dark;
    --bg: #0d1117;
    --bg-elevated: #161b22;
    --bg-subtle: #1c2128;
    --border: #30363d;
    --border-muted: #21262d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --text-subtle: #6e7681;
    --blue: #58a6ff;
    --blue-strong: #2f81f7;
    --green: #3fb950;
    --purple: #bc8cff;
    --orange: #d29922;
    --shadow: 0 12px 32px rgba(1, 4, 9, 0.38);
    --radius: 8px;
    --container: 1080px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(88, 166, 255, 0.28);
}

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

a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

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

.container {
    width: min(calc(100% - 48px), var(--container));
    margin: 0 auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    border-bottom: 1px solid var(--border-muted);
    background: rgba(13, 17, 23, 0.88);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-bar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 650;
    letter-spacing: -0.015em;
    white-space: nowrap;
}

.brand:hover {
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--green);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    box-shadow: inset 0 0 12px rgba(63, 185, 80, 0.08);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav a {
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

.site-nav a:hover {
    background: var(--bg-subtle);
    color: var(--text);
    text-decoration: none;
}

.menu-toggle {
    display: none;
    width: 38px;
    height: 34px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    cursor: pointer;
}

.menu-toggle span:not(.sr-only) {
    display: block;
    height: 2px;
    margin: 3px 0;
    border-radius: 2px;
    background: var(--text-muted);
}

.main-content {
    flex: 1;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: center;
    gap: 72px;
    min-height: 530px;
    padding: 88px 0 82px;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.12);
    vertical-align: 1px;
}

.hero h1 {
    max-width: 680px;
    margin: 0;
    color: var(--text);
    font-size: clamp(42px, 6vw, 70px);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 1.06;
}

.accent-text {
    color: var(--blue);
}

.hero-description {
    max-width: 520px;
    margin: 26px 0 0;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: 160ms ease;
}

.button:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.button-primary {
    background: var(--blue-strong);
    color: #fff;
    box-shadow: 0 4px 12px rgba(47, 129, 247, 0.22);
}

.button-primary:hover {
    background: #4493f8;
    color: #fff;
}

.button-secondary {
    border-color: var(--border);
    background: var(--bg-elevated);
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.terminal-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    transform: rotate(1.2deg);
}

.terminal-topbar {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

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

.window-dot-red { background: #ff7b72; }
.window-dot-yellow { background: #d29922; }
.window-dot-green { background: #3fb950; }

.terminal-title {
    margin-left: 8px;
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.terminal-body {
    padding: 28px 26px 32px;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.75;
}

.terminal-body p {
    margin: 0 0 8px;
}

.syntax-muted { color: var(--text-subtle); }
.syntax-green { color: var(--green); }
.terminal-output { color: var(--text); }
.terminal-output-soft { color: var(--purple); }
.terminal-cursor { color: var(--green); animation: blink 1.1s steps(2, start) infinite; }

@keyframes blink {
    50% { opacity: 0; }
}

.posts-section {
    padding: 16px 0 100px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-heading .eyebrow {
    margin-bottom: 7px;
}

.section-heading h2,
.listing-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    letter-spacing: -0.035em;
}

.section-count {
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.post-list {
    display: grid;
    gap: 12px;
}

.post-card {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.post-card:hover {
    border-color: #484f58;
    background: #1b222c;
    transform: translateY(-2px);
}

.post-card-content {
    min-width: 0;
    padding: 23px 24px 22px;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.post-meta a {
    color: var(--text-muted);
}

.post-card h3 {
    margin: 10px 0 7px;
    font-size: 20px;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.post-card h3 a {
    color: var(--text);
}

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

.post-card p {
    max-width: 740px;
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.post-card-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 64px;
    border-left: 1px solid var(--border-muted);
    color: var(--text-subtle);
    font-size: 22px;
    transition: color 160ms ease, background 160ms ease;
}

.post-card-arrow:hover {
    background: rgba(88, 166, 255, 0.08);
    color: var(--blue);
    text-decoration: none;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 15px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: 999px;
    background: rgba(88, 166, 255, 0.08);
    color: var(--blue);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.tag:hover {
    border-color: rgba(88, 166, 255, 0.55);
    background: rgba(88, 166, 255, 0.15);
    color: #79c0ff;
    text-decoration: none;
}

.empty-state {
    padding: 56px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    display: block;
    margin-bottom: 10px;
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 28px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
}

.pagination-link {
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 13px;
}

.pagination-link:hover {
    border-color: var(--text-muted);
    color: var(--text);
    text-decoration: none;
}

.pagination-disabled {
    opacity: 0.45;
}

.pagination-status {
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.article-view {
    padding: 72px 0 100px;
}

.article-header {
    max-width: 820px;
    margin-bottom: 54px;
}

.back-link {
    display: inline-block;
    margin-bottom: 42px;
    color: var(--text-muted);
    font-size: 14px;
}

.back-link:hover {
    color: var(--blue);
}

.article-meta {
    margin-bottom: 14px;
}

.article-header h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(36px, 5vw, 58px);
    letter-spacing: -0.05em;
    line-height: 1.12;
}

.article-lead {
    margin: 22px 0 0;
    color: var(--text-muted);
    font-size: 19px;
    line-height: 1.7;
}

.article-byline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 13px;
}

.article-byline strong {
    color: var(--text);
}

.author-avatar {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #238636, #1f6feb);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) 170px;
    align-items: start;
    justify-content: space-between;
    gap: 60px;
}

.article-content {
    min-width: 0;
    color: #c9d1d9;
    font-size: 17px;
    line-height: 1.8;
}

.article-content > :first-child {
    margin-top: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 1.8em 0 0.65em;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.025em;
}

.article-content h1 { font-size: 2em; }
.article-content h2 { font-size: 1.55em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border-muted); }
.article-content h3 { font-size: 1.25em; }
.article-content h4 { font-size: 1.05em; }

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content table,
.article-content pre {
    margin: 1.15em 0;
}

.article-content a {
    color: var(--blue);
    text-decoration: underline;
    text-decoration-color: rgba(88, 166, 255, 0.45);
    text-underline-offset: 3px;
}

.article-content a:hover {
    text-decoration-color: currentColor;
}

.article-content strong {
    color: var(--text);
}

.article-content blockquote {
    margin-left: 0;
    padding: 2px 0 2px 20px;
    border-left: 3px solid var(--border);
    color: var(--text-muted);
}

.article-content ul,
.article-content ol {
    padding-left: 1.5em;
}

.article-content li + li {
    margin-top: 0.4em;
}

.article-content code {
    padding: 0.2em 0.4em;
    border: 1px solid var(--border-muted);
    border-radius: 5px;
    background: var(--bg-subtle);
    color: #ff7b72;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86em;
}

.article-content pre {
    overflow-x: auto;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #090d12;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
    line-height: 1.65;
}

.article-content pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: #c9d1d9;
    font-size: 0.86em;
}

.article-content hr {
    margin: 2.5em 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.article-content img {
    display: block;
    margin: 2em auto;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.article-content table {
    display: block;
    overflow-x: auto;
    width: 100%;
    border-collapse: collapse;
}

.article-content th,
.article-content td {
    padding: 8px 13px;
    border: 1px solid var(--border);
    text-align: left;
}

.article-content th {
    background: var(--bg-subtle);
    color: var(--text);
}

.article-aside {
    position: sticky;
    top: 92px;
    color: var(--text-muted);
    font-size: 13px;
}

.aside-block {
    margin-bottom: 26px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.aside-label {
    margin: 0 0 7px;
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
}

.tag-list-column {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-top: 0;
}

.page-view {
    max-width: 850px;
    margin: 0 auto;
}

.listing-page {
    padding: 72px 0 100px;
}

.listing-header {
    margin-bottom: 38px;
}

.listing-header .eyebrow {
    margin-bottom: 12px;
}

.listing-header p:last-child {
    margin: 12px 0 0;
    color: var(--text-muted);
}

.archive-list {
    border-top: 1px solid var(--border);
}

.archive-item {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 20px;
    min-height: 62px;
    border-bottom: 1px solid var(--border-muted);
    color: var(--text);
}

.archive-item:hover {
    color: var(--blue);
    text-decoration: none;
}

.archive-item time {
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.archive-arrow {
    color: var(--text-subtle);
    text-align: right;
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.index-card {
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text);
}

.index-card:hover {
    border-color: var(--blue);
    color: var(--text);
    text-decoration: none;
    transform: translateY(-2px);
}

.index-card-label {
    margin-bottom: auto;
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
}

.index-card strong {
    margin: 22px 0 6px;
    font-size: 19px;
}

.index-card > span:last-child {
    color: var(--text-muted);
    font-size: 12px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--blue);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.tag-cloud-item:hover {
    border-color: var(--blue);
    background: var(--bg-subtle);
    text-decoration: none;
}

.tag-cloud-item small {
    color: var(--text-subtle);
    font-size: 11px;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-muted);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 72px;
    color: var(--text-muted);
    font-size: 12px;
}

.footer-inner p {
    margin: 0;
}

.footer-inner a {
    color: var(--text);
}

.footer-muted {
    color: var(--text-subtle);
}

@media (max-width: 800px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 48px;
        min-height: 0;
        padding: 68px 0 70px;
    }

    .terminal-card {
        max-width: 560px;
        width: 100%;
        margin: 0 auto;
    }

    .article-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .article-aside {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 28px;
    }

    .aside-block {
        margin: 0;
    }

    .index-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .container {
        width: min(calc(100% - 32px), var(--container));
    }

    .site-header {
        position: relative;
    }

    .nav-bar {
        min-height: 58px;
    }

    .menu-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 58px;
        right: 16px;
        left: 16px;
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-elevated);
        box-shadow: var(--shadow);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding: 10px 12px;
    }

    .hero {
        padding: 54px 0 62px;
    }

    .hero h1 {
        font-size: clamp(38px, 12vw, 54px);
    }

    .hero-description {
        font-size: 16px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
        gap: 6px;
    }

    .post-card-content {
        padding: 19px 16px 18px;
    }

    .post-card-arrow {
        flex-basis: 45px;
    }

    .article-view,
    .listing-page {
        padding: 48px 0 72px;
    }

    .back-link {
        margin-bottom: 30px;
    }

    .article-header {
        margin-bottom: 40px;
    }

    .article-content {
        font-size: 16px;
    }

    .archive-item {
        grid-template-columns: 92px minmax(0, 1fr) 18px;
        gap: 10px;
        font-size: 14px;
    }

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

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        min-height: 96px;
    }
}
