/*
Theme Name: Jiangyong
Theme URI: https://www.jiangyong.space
Description: 浅灰卡片式个人博客主题，双栏布局，支持深色模式、目录与代码复制。
Author: yonjion
Version: 1.0.0
License: MIT
*/

:root {
    --bg: #f3f4f6;
    --bg-soft: #eef0f3;
    --card: #ffffff;
    --text: #1f2937;
    --text-soft: #4b5563;
    --muted: #7b8494;
    --accent: #5b7c9d;
    --accent-strong: #46647f;
    --accent-soft: #edf2f7;
    --border: #e6e8ec;
    --border-strong: #d8dce2;
    --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 30px rgba(17, 24, 39, .045);
    --shadow-hover: 0 2px 4px rgba(17, 24, 39, .05), 0 14px 36px rgba(17, 24, 39, .08);
    --radius: 6px;
    --container: 1280px;
    --sidebar: 300px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
    --bg: #14171b;
    --bg-soft: #191d22;
    --card: #1c2127;
    --text: #e6e9ee;
    --text-soft: #c3c9d2;
    --muted: #939ca9;
    --accent: #8fb0cf;
    --accent-strong: #a9c4dd;
    --accent-soft: #232d38;
    --border: #2a3038;
    --border-strong: #363e48;
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 30px rgba(0, 0, 0, .22);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--accent-strong); }

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

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
}

.icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(12px);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    flex-shrink: 0;
}

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

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0;
}

.brand-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1.1px;
}

.brand-logo { max-height: 34px; width: auto; }

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 380px;
    height: 38px;
    padding: 0 6px 0 12px;
    margin: 0 0 0 auto;
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--muted);
    transition: border-color .18s ease, background .18s ease;
}

.search-form:focus-within {
    background: var(--card);
    border-color: var(--border-strong);
}

.search-form .icon { flex-shrink: 0; }

.search-form input {
    flex: 1;
    min-width: 0;
    height: 34px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 13.5px;
    font-family: inherit;
}

.search-form input::placeholder { color: var(--muted); }

.search-submit {
    height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: 4px;
    background: var(--card);
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--border);
}

.search-submit:hover { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-btn:hover { background: var(--bg-soft); color: var(--text); }

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

.menu-toggle { display: none; }

.main-nav { border-top: 1px solid var(--border); }

.nav-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 48px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar { display: none; }

.nav-link {
    position: relative;
    padding: 6px 12px;
    color: var(--text-soft);
    font-size: 13.5px;
    white-space: nowrap;
    border-radius: 4px;
}

.nav-link:hover { color: var(--text); background: var(--bg-soft); }

.nav-link.active { color: var(--accent); font-weight: 600; }

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -13px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* ---------- Layout ---------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
    gap: 26px;
    align-items: start;
    padding-top: 30px;
    padding-bottom: 52px;
}

.main-col { min-width: 0; }

.sidebar { min-width: 0; position: sticky; top: 138px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Section head ---------- */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 0 2px;
}

.section-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .02em; }

.section-desc { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.view-switch {
    display: inline-flex;
    padding: 3px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.view-btn {
    padding: 5px 12px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
}

.view-btn.active { background: var(--accent); color: #fff; }

/* ---------- Post list ---------- */
.post-list { display: flex; flex-direction: column; gap: 14px; }

.post-card {
    order: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.post-card:hover { box-shadow: var(--shadow-hover); border-color: var(--border-strong); }

.post-card.is-sticky { order: -1; }

.post-card-inner {
    display: flex;
    align-items: stretch;
    gap: 24px;
    padding: 22px 24px;
}

.post-card-main { flex: 1; min-width: 0; }

.post-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 12px;
}

.badge-sticky {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 3px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
}

.post-category { color: var(--muted); }

.post-category:hover { color: var(--accent); }

.post-card-title {
    margin: 0;
    font-size: 18.5px;
    line-height: 1.5;
    font-weight: 650;
    letter-spacing: .005em;
}

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

.post-card-title a:hover { color: var(--accent); }

.post-excerpt {
    margin: 8px 0 12px;
    color: var(--text-soft);
    font-size: 13.8px;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

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

.post-meta a:hover { color: var(--accent); }

.post-meta time { margin-left: 4ch; }

.dot { color: var(--border-strong); }

.post-thumb {
    flex-shrink: 0;
    width: 196px;
    height: 124px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-soft);
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.post-card:hover .post-thumb img { transform: scale(1.03); }

.mode-compact .post-card-inner { padding: 18px 22px; gap: 18px; }
.mode-compact .post-thumb { display: none; }
.mode-compact .post-card-title { font-size: 17px; }
.mode-compact .post-excerpt { margin: 6px 0 9px; -webkit-line-clamp: 1; }

.empty-card {
    padding: 48px 24px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-card h2 { margin: 0 0 6px; font-size: 18px; }
.empty-card p { margin: 0; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination-wrap { margin-top: 22px; }

.page-navigator {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-navigator li { display: inline-flex; }

.page-navigator li a,
.page-navigator li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card);
    color: var(--text-soft);
    font-size: 12.5px;
    box-shadow: var(--shadow);
}

.page-navigator li a:hover { border-color: var(--accent); color: var(--accent); }

.page-navigator li.current a,
.page-navigator li.current span {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---------- Sidebar widgets ---------- */
.widget {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.widget-title {
    position: relative;
    margin: 0 0 14px;
    padding-left: 11px;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: .02em;
}

.widget-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
}

.author-card { text-align: center; padding: 24px 20px 20px; }

.author-avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 3px solid var(--card);
    box-shadow: 0 0 0 1px var(--border);
}

.author-avatar-fallback { color: var(--accent); font-size: 28px; font-weight: 700; }

.author-avatar.small { width: 46px; height: 46px; font-size: 18px; }

.author-name { margin: 12px 0 4px; font-size: 16px; }

.author-name.small { margin: 0 0 2px; font-size: 14px; text-align: left; }

.author-bio { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }

.author-bio.small { font-size: 12px; text-align: left; }

.compact-author { display: flex; align-items: center; gap: 12px; text-align: left; }

.author-social {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}

.category-list, .archive-list { list-style: none; margin: 0; padding: 0; }

.category-list li a,
.archive-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    color: var(--text-soft);
    font-size: 13px;
    border-bottom: 1px dashed var(--border);
}

.category-list li:last-child a,
.archive-list li:last-child a { border-bottom: 0; }

.category-list li a:hover, .archive-list li a:hover { color: var(--accent); }

.category-list .cat-level-1 { padding-left: 14px; }
.category-list .cat-level-2 { padding-left: 28px; }

.count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 19px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 11px;
}

.recent-list { list-style: none; margin: 0; padding: 0; counter-reset: recent; }

.recent-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
}

.recent-list li:last-child { border-bottom: 0; }

.recent-list li::before {
    counter-increment: recent;
    content: counter(recent);
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    border-radius: 3px;
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 10px;
    text-align: center;
    line-height: 17px;
}

.recent-list a {
    flex: 1;
    color: var(--text-soft);
    font-size: 12.8px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-list a:hover { color: var(--accent); }

.recent-list time { flex-shrink: 0; color: var(--muted); font-size: 11px; }

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

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-soft);
    color: var(--text-soft);
    font-size: 12px;
}

.tag-item span { color: var(--muted); font-size: 10.5px; }

.tag-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.muted { color: var(--muted); }

/* ---------- Article ---------- */
.article-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px 40px 30px;
}

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

.article-title {
    margin: 6px 0 12px;
    font-size: 29px;
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: .005em;
}

.article-meta { font-size: 12.5px; }

.article-cover {
    margin: 0 0 26px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--bg-soft);
}

.article-cover img { display: block; width: 100%; }

.post-content { font-size: 15.5px; line-height: 1.95; color: var(--text-soft); }

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

.post-content h2 {
    margin: 2em 0 .8em;
    padding-bottom: .4em;
    border-bottom: 1px solid var(--border);
    font-size: 21px;
    line-height: 1.5;
    color: var(--text);
    scroll-margin-top: 120px;
}

.post-content h3 {
    margin: 1.7em 0 .6em;
    font-size: 17.5px;
    color: var(--text);
    scroll-margin-top: 120px;
}

.post-content h4 {
    margin: 1.4em 0 .5em;
    font-size: 15.5px;
    color: var(--text);
}

.post-content p { margin: 0 0 1.15em; }

.post-content a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

.post-content ul, .post-content ol { padding-left: 1.5em; margin: 0 0 1.2em; }

.post-content li { margin: .35em 0; }

.post-content blockquote {
    margin: 1.4em 0;
    padding: 12px 18px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 4px 4px 0;
    color: var(--text-soft);
}

.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content img { border-radius: 5px; margin: 1em 0; }

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

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: 13.5px;
    line-height: 1.6;
    background: var(--card);
}

.post-content th, .post-content td {
    padding: 9px 12px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.post-content th { background: var(--bg-soft); color: var(--text); font-weight: 600; }

.post-content code {
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--bg-soft);
    color: var(--accent-strong);
    font-family: var(--mono);
    font-size: .88em;
}

.post-content pre {
    position: relative;
    margin: 1.4em 0;
    padding: 0;
    border-radius: 6px;
    background: #1e242c;
    overflow: hidden;
}

.post-content pre code {
    display: block;
    padding: 18px 20px;
    overflow-x: auto;
    background: transparent;
    color: #d7dde5;
    font-size: 13px;
    line-height: 1.7;
}

.code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #171c23;
    border-bottom: 1px solid #2b333d;
    color: #8e9aa8;
    font-size: 11.5px;
    font-family: var(--mono);
}

.code-copy {
    padding: 2px 8px;
    border: 1px solid #39424e;
    border-radius: 3px;
    background: transparent;
    color: #aab6c4;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}

.code-copy:hover { color: #fff; border-color: #566273; }

.article-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }

.article-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; }

.article-tags .label { color: var(--muted); }

.article-tags a {
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--bg-soft);
    color: var(--text-soft);
    font-size: 12px;
}

.article-tags a:hover { background: var(--accent-soft); color: var(--accent); }

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}

.post-nav-item {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-soft);
    font-size: 12.5px;
    line-height: 1.6;
}

.post-nav-item.next { text-align: right; }

.post-nav-item a { color: var(--text-soft); }

.post-nav-item a:hover { color: var(--accent); }

/* ---------- TOC ---------- */
.toc-widget { position: sticky; top: 138px; }

.toc { font-size: 12.8px; max-height: calc(100vh - 240px); overflow: auto; }

.toc ul { list-style: none; margin: 0; padding: 0; }

.toc li { margin: 2px 0; }

.toc a {
    display: block;
    padding: 4px 8px;
    border-left: 2px solid transparent;
    color: var(--muted);
    line-height: 1.55;
}

.toc a:hover { color: var(--text); background: var(--bg-soft); }

.toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }

.toc .toc-sub { padding-left: 12px; }

/* ---------- Archive / 404 ---------- */
.archive-head { padding: 24px 28px; margin-bottom: 16px; }

.archive-label { color: var(--accent); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

.archive-title { margin: 4px 0 2px; font-size: 24px; }

.archive-desc { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.archive-page { padding: 28px 30px; }

.archive-year { margin-bottom: 22px; }

.archive-year-title { margin: 0 0 8px; font-size: 17px; color: var(--accent); }

.archive-posts { list-style: none; margin: 0; padding: 0; }

.archive-posts li {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 13.5px;
}

.archive-posts time { color: var(--muted); font-size: 12px; flex-shrink: 0; }

.archive-posts a { color: var(--text-soft); }

.archive-posts a:hover { color: var(--accent); }

.error-card {
    padding: 70px 30px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-code { font-size: 74px; font-weight: 800; line-height: 1; color: var(--accent); opacity: .25; letter-spacing: .04em; }

.error-card h1 { margin: 10px 0 6px; font-size: 22px; }

.error-card p { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }

.search-form.inline { margin: 0 auto 18px; max-width: 360px; background: var(--bg-soft); }

.back-home { font-size: 13px; }

/* ---------- Comments ---------- */
.comments-card {
    margin-top: 20px;
    padding: 26px 34px 30px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.comments-title { margin: 0 0 18px; font-size: 18px; }

.comments-title .count { background: var(--accent-soft); color: var(--accent); }

.comment-list { list-style: none; margin: 0; padding: 0; }

.comment-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }

.comment-item:last-child { border-bottom: 0; }

.comment-avatar img { border-radius: 50%; }

.comment-body { flex: 1; min-width: 0; }

.comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12.5px; }

.comment-author { font-weight: 600; color: var(--text); }

.comment-meta time { color: var(--muted); font-size: 11.5px; }

.comment-reply a { color: var(--muted); font-size: 11.5px; }

.comment-content { margin-top: 6px; font-size: 13.5px; line-height: 1.75; color: var(--text-soft); }

.comment-content p:last-child { margin-bottom: 0; }

.no-comments, .comments-closed { color: var(--muted); font-size: 13px; }

.comment-respond { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }

.respond-title { margin: 0 0 14px; font-size: 16px; }

.cancel-reply { font-size: 12px; }

.comment-form .form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.comment-form label { display: block; margin-bottom: 12px; }

.comment-form label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-soft);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
}

.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); background: var(--card); }

.comment-form textarea { resize: vertical; min-height: 110px; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 18px;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.btn-primary:hover { background: var(--accent-strong); }

.logged-in { font-size: 12.5px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 10px; border-top: 1px solid var(--border); background: var(--card); }

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

.footer-meta { display: flex; align-items: center; gap: 16px; }

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

.back-to-top {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--muted);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.back-to-top.show { display: inline-flex; }

.back-to-top:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    :root { --sidebar: 280px; }
    .article-card { padding: 30px 30px 26px; }
}

@media (max-width: 960px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-side { grid-template-columns: 1fr; }
    .toc-widget { position: static; }
    .header-top { gap: 16px; }
    .search-form { max-width: none; }
}

@media (max-width: 720px) {
    .container { padding: 0 16px; }
    .header-top { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; gap: 10px; }
    .brand { order: 1; }
    .header-actions { order: 2; margin-left: auto; }
    .search-form { order: 3; width: 100%; max-width: none; margin: 0; }
    .menu-toggle { display: inline-flex; }
    .main-nav { display: none; }
    .main-nav.open { display: block; }
    .nav-inner { height: auto; padding: 8px 0; flex-wrap: wrap; }
    .nav-link { padding: 6px 10px; }
    .nav-link.active::after { display: none; }
    .layout { padding-top: 18px; gap: 18px; }
    .section-title { font-size: 18px; }
    .post-card-inner { padding: 18px; gap: 14px; }
    .post-thumb { width: 112px; height: 84px; }
    .post-card-title { font-size: 16.5px; }
    .post-excerpt { font-size: 13px; }
    .article-card { padding: 22px 18px 20px; }
    .article-title { font-size: 22px; }
    .post-content { font-size: 15px; }
    .post-content table { display: block; overflow-x: auto; }
    .comments-card { padding: 20px 18px; }
    .comment-form .form-row { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-item.next { text-align: left; }
    .footer-inner { justify-content: center; text-align: center; }
    .back-to-top { right: 16px; bottom: 16px; }
}

@media (max-width: 480px) {
    .post-thumb { width: 92px; height: 70px; }
    .post-meta { font-size: 11px; }
    .article-title { font-size: 20px; }
}

/* ---------- Long-form report blocks ---------- */
.post-content .table-wrap { margin: 1.4em 0; overflow-x: auto; }
.post-content .table-wrap table { margin: 0; min-width: 560px; }
.post-content .report-figure { margin: 1.6em 0; }
.post-content .report-figure img { width: 100%; margin: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-soft); }

.report-flow { margin: 1.6em 0; padding: 18px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; }
.flow-step { padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 5px; box-shadow: 0 1px 2px rgba(17,24,39,.03); }
.flow-title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.flow-desc { margin-top: 3px; color: var(--muted); font-size: 12.3px; line-height: 1.65; }
.flow-arrow { display: flex; align-items: center; gap: 8px; padding: 5px 0 5px 20px; color: var(--accent); font-size: 11.5px; }
.flow-arrow::before { content: "↓"; font-size: 14px; line-height: 1; }

.report-model { margin: 1.6em 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.model-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); }
.model-row + .model-row { border-top: 1px solid var(--border); }
.model-name { padding: 12px 16px; background: var(--bg-soft); font-size: 13px; font-weight: 650; color: var(--text); }
.model-desc { padding: 12px 16px; font-size: 13px; color: var(--muted); }

.report-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 1.6em 0; }
.report-card { padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-soft); }
.card-name { font-size: 14px; font-weight: 650; color: var(--text); }
.card-sub { margin-top: 2px; font-size: 11.5px; color: var(--accent); }
.card-desc { margin-top: 8px; font-size: 12.3px; line-height: 1.65; color: var(--muted); }

.report-platform { margin: 1.6em 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.platform-head { padding: 16px 18px; background: var(--accent-soft); border-bottom: 1px solid var(--border); }
.platform-title { font-size: 15px; font-weight: 650; color: var(--text); }
.platform-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.platform-mod { padding: 14px 16px; background: var(--card); }
.mod-name { font-size: 13px; font-weight: 650; color: var(--text); }
.mod-desc { margin-top: 3px; font-size: 11.8px; line-height: 1.6; color: var(--muted); }

@media (max-width: 720px) {
    .report-cards, .platform-grid { grid-template-columns: 1fr; }
    .model-row { grid-template-columns: 110px minmax(0, 1fr); }
    .report-flow { padding: 12px; }
}
