/* Manus Blog - Ghost theme (light editorial monochrome) */
:root {
    --bg: #f8f8f7;
    --surface: #fafafa;
    --text: #1a1a1a;
    --text-2: #4d4d4d;
    --text-3: #737373;
    --line: rgba(0, 0, 0, 0.06);
    --line-strong: rgba(0, 0, 0, 0.12);
    --sans: var(--gh-font-body, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif);
    --serif: var(--gh-font-heading, "Libre Baskerville", "Noto Serif SC", Georgia, "Songti SC", serif);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --container: 1040px;
    --content: 680px;
    --pad: 24px;
    --header-h: 64px;
}

*, *::before, *::after { 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(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; }
p { margin: 0; }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.container { width: 100%; max-width: calc(var(--container) + var(--pad) * 2); margin: 0 auto; padding: 0 var(--pad); }
.dot { margin: 0 6px; color: var(--text-3); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: 500 14px/1 var(--sans); cursor: pointer; border: 0;
    transition: opacity .15s ease, background .15s ease;
}
.btn-pill { background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px; }
.btn-pill:hover { opacity: .85; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(248, 248, 247, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.site-logo { max-height: 28px; width: auto; }
.site-icon { width: 24px; height: 24px; border-radius: 6px; }
.site-title { font-family: var(--serif); font-size: 20px; font-weight: 400; letter-spacing: -0.01em; text-transform: lowercase; color: var(--text); }
.header-nav { display: flex; align-items: center; gap: 28px; }
.primary-nav .nav { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.primary-nav .nav a { font-size: 14px; color: var(--text-2); transition: color .15s; }
.primary-nav .nav a:hover, .primary-nav .nav-current a { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-link { font-size: 14px; color: var(--text-2); }
.header-link:hover { color: var(--text); }
.header-actions .btn-pill { padding: 8px 16px; font-size: 13px; }
.nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle { display: none; cursor: pointer; color: var(--text); padding: 6px; margin-right: -6px; }

/* Page head */
.page-head { padding: 64px 0 40px; }
.page-title { font-family: var(--sans); font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.page-desc { margin-top: 12px; font-size: 16px; color: var(--text-2); max-width: 640px; }
.author-head { text-align: center; }
.author-head .page-desc { margin-left: auto; margin-right: auto; }
.author-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; }
.author-links { margin-top: 12px; display: flex; gap: 16px; justify-content: center; font-size: 14px; color: var(--text-3); }
.author-links a:hover { color: var(--text); }

/* Featured hero */
.featured-post {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center;
    padding-bottom: 56px; margin-bottom: 48px; border-bottom: 1px solid var(--line);
}
.featured-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.featured-post:hover .featured-thumb img { transform: scale(1.02); }
.featured-title { margin-top: 12px; font-family: var(--sans); font-size: 22px; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; }
.featured-title a:hover { opacity: .75; }
.featured-excerpt {
    margin-top: 12px; color: var(--text-2); font-size: 15px; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.featured-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 14px; font-weight: 500; color: var(--text); }
.featured-more:hover { opacity: .7; }

/* Section + tabs */
.post-section { padding-bottom: 80px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.section-title { font-family: var(--sans); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.tag-tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.tag-tab { font-size: 14px; color: var(--text-3); padding: 4px 0; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.tag-tab:hover { color: var(--text); }
.tag-tab.is-active { color: var(--text); border-bottom-color: var(--text); }

/* Grid + cards */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; }
.post-card-link { display: block; }
.post-card-thumb { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card-link:hover .post-card-thumb img { transform: scale(1.03); }
.post-card-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: linear-gradient(135deg, #f1f1ef, #e9e9e6);
    font-family: var(--serif); font-size: 15px; color: var(--text-2); text-align: center; line-height: 1.5;
}
.post-card-placeholder span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-title {
    margin-top: 14px; font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-link:hover .post-card-title { opacity: .75; }
.post-card-meta { margin-top: 6px; font-size: 13px; color: var(--text-3); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 56px; font-size: 14px; color: var(--text-3); }
.pagination a { color: var(--text); padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 999px; }
.pagination a:hover { background: var(--text); color: #fff; }
.pagination .older-posts { margin-left: auto; }

/* Article */
.article { padding-bottom: 64px; }
.article-head { text-align: center; padding-top: 64px; padding-bottom: 40px; max-width: calc(820px + var(--pad) * 2); }
.article-meta { font-size: 14px; color: var(--text-3); }
.article-meta a:hover { color: var(--text); }
.article-title { margin-top: 16px; font-family: var(--serif); font-size: 36px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.article-excerpt { margin-top: 16px; font-family: var(--serif); font-size: 18px; line-height: 1.7; color: var(--text-2); }
.article-authors { margin-top: 16px; font-size: 14px; color: var(--text-2); }
.article-authors a:hover { color: var(--text); }
.article-hero { margin: 0 auto 48px; }
.article-hero img { width: 100%; border-radius: 16px; border: 1px solid var(--line); }
.article-hero figcaption { margin-top: 12px; text-align: center; font-size: 13px; color: var(--text-3); }
.article-foot { max-width: var(--content); margin: 48px auto 0; padding: 24px var(--pad) 0; border-top: 1px solid var(--line); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags .tag-tab { padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; }
.article-comments { max-width: var(--content); margin: 48px auto 0; padding: 0 var(--pad); }
.related { padding-top: 56px; padding-bottom: 80px; border-top: 1px solid var(--line); }
.related .section-title { margin-bottom: 28px; }

/* Content */
.gh-content {
    display: grid;
    grid-template-columns: [full-start] minmax(var(--pad), 1fr) [wide-start] minmax(0, 180px) [main-start] minmax(0, var(--content)) [main-end] minmax(0, 180px) [wide-end] minmax(var(--pad), 1fr) [full-end];
    font-family: var(--serif); font-size: 16px; line-height: 1.7; color: var(--text);
}
.gh-content > * { grid-column: main-start / main-end; }
.gh-content > * + * { margin-top: 1.6em; }
.gh-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.gh-content > .kg-width-full { grid-column: full-start / full-end; }
.gh-content > .kg-width-full img { border-radius: 0; }
.gh-content p, .gh-content li { color: #262626; }
.gh-content h2, .gh-content h3, .gh-content h4 { font-family: var(--serif); font-weight: 700; line-height: 1.4; letter-spacing: -0.005em; }
.gh-content h2 { font-size: 26px; margin-top: 2.2em; }
.gh-content h3 { font-size: 21px; margin-top: 2em; }
.gh-content h4 { font-size: 18px; margin-top: 1.8em; }
.gh-content h2 + *, .gh-content h3 + *, .gh-content h4 + * { margin-top: .8em; }
.gh-content a { text-decoration: underline; text-decoration-color: rgba(0,0,0,.3); text-underline-offset: 3px; }
.gh-content a:hover { text-decoration-color: var(--text); }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li + li { margin-top: .5em; }
.gh-content strong { font-weight: 700; }
.gh-content img { border-radius: 12px; }
.gh-content figure { margin-left: 0; margin-right: 0; }
.gh-content figcaption { margin-top: 10px; font-family: var(--sans); font-size: 13px; color: var(--text-3); text-align: center; }
.gh-content blockquote { margin-left: 0; margin-right: 0; padding-left: 20px; border-left: 2px solid var(--text); font-style: italic; color: var(--text-2); }
.gh-content blockquote.kg-blockquote-alt { border: 0; padding: 0 1em; text-align: center; font-size: 1.25em; }
.gh-content hr { border: 0; height: 1px; background: var(--line-strong); margin: 3em 0; }
.gh-content code { font-family: var(--mono); font-size: .88em; background: rgba(0,0,0,.05); padding: .15em .4em; border-radius: 4px; }
.gh-content pre { font-family: var(--mono); font-size: 14px; line-height: 1.6; background: #1a1a1a; color: #f2f2f2; padding: 20px; border-radius: 12px; overflow-x: auto; }
.gh-content pre code { background: none; padding: 0; font-size: inherit; }
.gh-content table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14px; display: block; overflow-x: auto; }
.gh-content th, .gh-content td { padding: 10px 12px; border-bottom: 1px solid var(--line-strong); text-align: left; }
.gh-content iframe { max-width: 100%; }
.kg-image-card img, .kg-gallery-image img { margin: 0 auto; }
.kg-bookmark-card a { text-decoration: none !important; }
.kg-callout-card { font-family: var(--sans); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); padding: 48px 0 40px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: start; }
.footer-title { font-size: 18px; }
.footer-desc { margin-top: 8px; font-size: 14px; color: var(--text-3); max-width: 420px; }
.footer-nav .nav { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer-nav .nav a { font-size: 14px; color: var(--text-2); }
.footer-nav .nav a:hover { color: var(--text); }
.footer-copy { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.footer-copy a { text-decoration: underline; text-underline-offset: 2px; }

/* Error */
.error-template { background: var(--bg); color: var(--text); font-family: var(--sans); }
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; }
.error-code { font-family: var(--serif); font-size: 96px; line-height: 1; color: var(--text-3); }
.error-details { text-align: left; font-size: 13px; color: var(--text-2); }

/* Responsive */
@media (max-width: 960px) {
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
    .featured-post { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 760px) {
    :root { --pad: 20px; --header-h: 56px; }
    .nav-toggle { display: inline-flex; }
    .header-nav {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        display: none; flex-direction: column; align-items: flex-start; gap: 20px;
        padding: 20px var(--pad) 24px; background: var(--bg); border-bottom: 1px solid var(--line);
    }
    .nav-toggle-input:checked ~ .header-nav { display: flex; }
    .primary-nav .nav { flex-direction: column; align-items: flex-start; gap: 16px; }
    .primary-nav .nav a { font-size: 16px; }
    .page-head { padding: 40px 0 28px; }
    .page-title { font-size: 32px; }
    .article-head { padding-top: 40px; }
    .article-title { font-size: 28px; }
    .article-hero img { border-radius: 12px; }
    .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .post-grid { grid-template-columns: 1fr; gap: 32px; }
}
