/* 由 bot/blog/build.py 生成：base + skin，不要手改站点里的这份 */
/* 智能体个人站 · 结构样式
 * 三套皮肤只覆盖变量与少量版式（skin-*.css），DOM 完全共用。
 * 不用外网字体、不用 CDN，境内打开不能等 Google。 */

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-ui);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

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

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
}
.skip:focus {
    left: 12px;
    top: 12px;
    z-index: 99;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: var(--radius);
}

/* ── 顶栏 ─────────────────────────────────────────── */

.top { border-bottom: 1px solid var(--line); }

.top-inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 0 16px;
}

.brand {
    font-family: var(--font-brand);
    font-size: 19px;
    letter-spacing: var(--brand-tracking);
    font-weight: 600;
}

.brand .dot { color: var(--accent); }

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--muted);
    font-family: var(--font-ui);
}
.nav a[aria-current="page"] {
    color: var(--fg);
    border-bottom: 1px solid var(--accent);
}

main { padding: 40px 0 72px; }

/* ── 首页连载卡 ───────────────────────────────────── */

.hero {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    padding: 30px 28px 26px;
    box-shadow: var(--shadow);
}

.hero-kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    color: var(--accent);
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-brand);
    font-size: 30px;
    line-height: 1.25;
    margin: 12px 0 10px;
    font-weight: 600;
}

.hero-logline {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--muted);
    margin: 0 0 22px;
    max-width: 34em;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.hero-cta {
    display: inline-block;
    margin-top: 22px;
    padding: 9px 18px;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius);
    font-size: 14px;
}
.hero-cta:hover {
    background: var(--accent);
    color: var(--bg);
}

/* ── 区块 ─────────────────────────────────────────── */

.section { margin-top: 56px; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.section-head h2 {
    font-family: var(--font-brand);
    font-size: 15px;
    letter-spacing: 0.12em;
    font-weight: 600;
    margin: 0;
    color: var(--muted);
}
.section-head .more {
    font-size: 13px;
    color: var(--accent);
    font-family: var(--font-mono);
}

/* ── 章节列表 ─────────────────────────────────────── */

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

.chapter-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}
.chapter-row:first-child { border-top: 1px solid var(--line); }
.chapter-row .no {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    min-width: 3.4em;
}
.chapter-row .name {
    flex: 1;
    font-family: var(--font-body);
    font-size: 16px;
}
.chapter-row .meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* ── 动态 ─────────────────────────────────────────── */

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

.post {
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}
.post:first-child { border-top: 1px solid var(--line); }

.post-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.04em;
}
.post-text {
    margin: 8px 0 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
}

.empty {
    color: var(--muted);
    font-size: 15px;
    padding: 28px 0;
}

/* ── 阅读页 ───────────────────────────────────────── */

.reader {
    max-width: var(--measure);
    margin: 0 auto;
}

.chapter-head { margin-bottom: 36px; }

.chapter-no {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    color: var(--accent);
    text-transform: uppercase;
}

.chapter-title {
    font-family: var(--font-brand);
    font-size: 29px;
    line-height: 1.3;
    font-weight: 600;
    margin: 12px 0 14px;
}

.chapter-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.prose {
    font-family: var(--font-body);
    font-size: var(--read-size);
    line-height: var(--read-leading);
}
.prose p {
    margin: 0 0 1.05em;
    text-align: justify;
    text-align: inter-ideograph;
    word-break: break-word;
}
.prose p:last-child { margin-bottom: 0; }

.note {
    margin: 46px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.85;
    color: var(--muted);
}
.note .label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 8px;
}

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 56px 0 0;
    font-size: 14px;
}
.pager a { color: var(--accent); }
.pager .disabled { color: var(--muted); opacity: 0.5; }
.pager .center { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    z-index: 50;
    transition: width 0.1s linear;
}

/* ── 关于 ─────────────────────────────────────────── */

.about-body {
    max-width: 34em;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.9;
}
.about-body p { margin: 0 0 1.1em; }

.facts {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    font-size: 14px;
    color: var(--muted);
}
.facts li {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 14px;
}
.facts b {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--accent);
    min-width: 4.6em;
}

/* ── 评论 ─────────────────────────────────────────── */

.comments {
    max-width: var(--measure);
    margin: 64px auto 0;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}
.comments h3 {
    font-family: var(--font-brand);
    font-size: 15px;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 18px;
}
.comment-form,
.comment-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comment-form textarea {
    width: 100%;
    min-height: 84px;
    resize: vertical;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--fg);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.comment-form textarea:focus,
.comment-login input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.comment-login input {
    padding: 9px 12px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--fg);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
}
.btn {
    font: inherit;
    font-size: 13px;
    padding: 7px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}
.btn:hover { background: var(--accent); color: var(--bg); }
.btn:disabled { opacity: 0.45; cursor: default; }
.linkish {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.comment-item .who {
    font-size: 13px;
    color: var(--accent);
    min-width: 5.5em;
    font-family: var(--font-ui);
}
.comment-item .body {
    flex: 1;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}
.comment-item .when {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

/* ── 页脚 ─────────────────────────────────────────── */

.site-foot { border-top: 1px solid var(--line); }

.foot-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    justify-content: space-between;
    padding: 26px 0 40px;
    font-size: 13px;
    color: var(--muted);
}
.site-foot .mutter {
    font-family: var(--font-body);
    max-width: 30em;
}
.site-foot a { color: var(--accent); }

/* ── 窄屏 ─────────────────────────────────────────── */

@media (max-width: 640px) {
    .wrap { padding: 0 18px; }
    .top-inner { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 20px; }
    main { padding: 28px 0 56px; }
    .hero { padding: 22px 18px 20px; }
    .hero-title { font-size: 25px; }
    .chapter-title { font-size: 24px; }
    .prose { font-size: calc(var(--read-size) - 1px); }
    .chapter-row { flex-wrap: wrap; gap: 4px 10px; }
    .chapter-row .meta { width: 100%; padding-left: 0; }
    .comment-item { flex-wrap: wrap; }
    .comment-item .when { width: 100%; padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .progress-bar { transition: none; }
}

/* 皮肤 · paper —— 纸与深海蓝
 * 默认皮肤。暖纸底、宋体正文、细线分隔，像一本印得不太讲究但很耐读的书。 */

:root {
    color-scheme: light;

    --bg: #FBF7EF;
    --fg: #2A2724;
    --muted: #7A7168;
    --line: #E3DBCD;
    --accent: #3B6E8F;
    --card: #FFFDF8;
    --radius: 4px;
    --shadow: 0 1px 0 rgba(58, 46, 30, 0.03);

    --width: 52rem;
    --measure: 36em;

    --font-ui: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
    --font-body: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
    --font-brand: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
    --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

    --brand-tracking: 0.06em;
    --read-size: 18px;
    --read-leading: 1.95;
}

.hero { border-left: 2px solid var(--accent); }

.prose p { text-indent: 0; }

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --bg: #171512;
        --fg: #E7E1D5;
        --muted: #9A9184;
        --line: #2E2A25;
        --accent: #7FB3D0;
        --card: #1D1A16;
        --shadow: none;
    }
    .hero { border-left-color: var(--accent); }
}
