:root {
    --width: 1040px;
    --font-scale: 1.1rem;
    --header-h: 62px;
    --read-width: 820px;
    --background-color: #F2EFE9;
    --heading-color: #26221C;
    --text-color: #26221C;
    --link-color: #26221C;
    --visited-color: #26221C;
    --code-background-color: #E7E1D5;
    --code-color: #26221C;
    --blockquote-color: #26221C;
    --gray-color: #8A8378;
    --footer-bg: #38302A;
    --footer-text: #E8E2D6;
    --accent: #C97B4A;
    --border-soft: rgba(122, 110, 94, 0.28);
}


@media (prefers-color-scheme: dark) {
    :root {
        --font-scale: 1.1rem;
        --background-color: #211D18;
        --heading-color: #E8E2D6;
        --text-color: #E8E2D6;
        --link-color: #E8E2D6;
        --visited-color: #E8E2D6;
        --code-background-color: #2C2721;
        --code-color: #E8E2D6;
        --blockquote-color: #E8E2D6;
        --gray-color: #9C948A;
        --footer-bg: #171310;
        --footer-text: #D8D1C4;
        --accent: #D08A5C;
        --border-soft: rgba(220, 210, 195, 0.16);
    }
}

body {
    font-size: var(--font-scale);
    margin: auto;
    max-width: var(--width);
    box-sizing: border-box;
    padding: 0 48px;
    text-align: left;
    background-color: var(--background-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.7;
    font-weight: 400;
    color: var(--text-color);
    font-family: sans-serif;
    height: 100%;
    word-break: break-all;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

time {
    font-family: consolas, monospace;
    font-style: normal;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading-color);
    display: inherit;
}

a {
    color: var(--link-color);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

a:hover,
nav .current {
    color: var(--gray-color);
    text-decoration: underline;
}

nav a {
    margin-right: 8px;
}

/* ===== 顶部居中导航（Scout 风） ===== */
.site-header {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: var(--header-h);
    padding: 0;
}

.site-nav {
    text-align: center;
}

.site-nav a {
    font-size: 0.9em;
    margin: 0 14px;
    color: var(--gray-color);
    letter-spacing: 0.02em;
}

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

.site-nav a.current {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}

article a {
    text-decoration: underline;
}

strong,
b {
    color: var(--heading-color);
}

pre {
    padding: 5px 12px;
    overflow: auto;
    max-height: 400px;
}

hr {
    border: 0;
    border-top: 1px solid;
}

article hr {
    border: 0;
    border-top: 1px dashed;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 0.3rem;
}

time,
.intro {
    color: var(--gray-color);
}

pre,
code {
    font-size: 0.9em;
    font-family: sans-serif;
    background-color: var(--code-background-color);
    color: var(--code-color);
    border-radius: 0.3rem;
}

code {
    padding: 2px 3px;
}

pre code {
    padding: 3px 0px;
}

blockquote {
    border-left: 5px solid var(--heading-color);
    padding: 10px 15px;
    margin: 10px 0;
    font-weight: bold;
    color: var(--blockquote-color);
    background-color: var(--code-background-color);
    border-radius: 0.3rem;
}

blockquote footer {
    text-align: right;
    font-size: 0.9em;
    color: var(--gray-color);
}

header,
footer {
    padding: 10px 0;
}

.title h1,
.title h2 {
    font-size: clamp(2em, 8.5vw, 3.5em);
}

.title:hover {
    text-decoration: none;
}

main {
    margin-top: 50px;
    flex: 1;
    box-sizing: border-box;
}

/* 文章 / 独立页的正文阅读宽度，避免整行过长 */
.post-main {
    max-width: var(--read-width);
}

/* 仅屏幕阅读器可见 */
.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;
}

nav a {
    font-size: 1.2em;
}

ul.posts {
    list-style-type: none;
    padding: unset;
}

ul.posts li {
    display: flex;
    margin: 3px 0;
}

ul.posts li span {
    flex: 0 0 115px;
}

ul.posts li a:visited {
    color: var(--visited-color);
}

.tags {
    margin-top: 30px;
    color: var(--gray-color);
}

.tags a {
    color: var(--gray-color);
    margin: 0 5px 0 2px;
}

/* ===== 区块小标签（Scout 式） ===== */
.section-label {
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray-color);
    margin: 0 0 18px;
}

/* ===== 首页双屏：公告区（首屏，居中构图） + 最新文章 ===== */
.home-main {
    margin-top: 0;
}

.home-hero {
    min-height: calc(100vh - var(--header-h));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 0 4rem;
}

.hero-icon {
    margin-bottom: 1.8rem;
    color: var(--heading-color);
}

.hero-icon svg {
    width: 58px;
    height: 58px;
}

.hero-title {
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin: 0 0 1.5rem;
}

.hero-notice {
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.02em;
    line-height: 1.95;
    color: var(--gray-color);
}

.hero-notice p {
    margin: 0 0 0.6em;
}

.hero-notice p:last-child {
    margin-bottom: 0;
}

.hero-notice a {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hero-link {
    display: inline-block;
    margin-top: 2.4rem;
    font-size: 0.95em;
    color: var(--text-color);
    border-bottom: none;
}

.hero-link .arrow {
    display: inline-block;
    color: var(--accent);
    transition: transform 0.2s ease;
}

.hero-link:hover {
    color: var(--gray-color);
    text-decoration: none;
}

.hero-link:hover .arrow {
    transform: translateX(5px);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-link .arrow {
        transition: none;
        transform: none;
    }
}

/* ===== 最新文章区（第二屏） ===== */
.home-latest {
    padding-top: 1rem;
    scroll-margin-top: 20px;
}

.post-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.post-item a {
    flex: 1;
    position: relative;
    padding-left: 0;
    transition: padding-left 0.18s ease;
}

.post-item a::before {
    content: "↳";
    position: absolute;
    left: 0;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.post-item a:hover {
    padding-left: 1.4em;
    color: var(--heading-color);
}

.post-item a:hover::before {
    opacity: 1;
}

.post-item time {
    margin-left: 10px;
    white-space: nowrap;
    font-size: 0.85em;
}

footer,
footer a {
    letter-spacing: 0;
    line-height: 2;
    color: var(--gray-color);
    text-decoration: none;
    font-size: 13px;
}

/* ===== 文章归档页（年份/月份分组） ===== */
.archive-intro {
    color: var(--gray-color);
    margin-bottom: 8px;
}

.archive-year {
    font-size: 1.4em;
    font-weight: 600;
    margin: 2.4em 0 0.6em;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.archive-count {
    font-size: 0.45em;
    font-weight: 400;
    color: var(--gray-color);
    letter-spacing: 0.05em;
}

.archive-mon {
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin: 1.8em 0 8px;
}

article .post-item a {
    text-decoration: none;
}

/* ===== 深棕页脚条（全宽 breakout） ===== */
.site-footer {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: 80px;
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 24px 0;
    text-align: center;
}

.site-footer,
.site-footer a {
    color: var(--footer-text);
    font-size: 13px;
    line-height: 2;
    text-decoration: none;
    letter-spacing: 0;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

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

@media (max-width:768px) {
    :root {
        --header-h: 56px;
    }

    body {
        padding: 0px 20px;
    }

    .site-nav a {
        margin: 0 10px;
    }

    .home-hero {
        padding: 1rem 0 4rem;
    }

    .hero-icon svg {
        width: 50px;
        height: 50px;
    }

    .hero-notice {
        font-size: 1em;
        line-height: 1.9;
    }
}

@media (min-width:769px) {
    body {
        padding: 0 48px;
    }
}

.post-pagination ol {
    list-style: none;
    display: inline-flex;
    padding: 0;
}

.post-pagination .page-numbers,
.post-pagination ol a {
    width: 35px;
    height: 35px;
    line-height: 35px;
    margin-right: 8px;
    display: inline-block;
    text-align: center;
    border-radius: 4px;
}

.post-pagination .pagination a:hover,
.post-pagination .pagination .current,
.post-pagination ol a:hover,
.post-pagination ol .current a {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-decoration: none;
}

.post-pagination .page-numbers,
.post-pagination ol a {
    background: var(--code-background-color);
    color: var(--gray-color);
}

.post-pagination {
    margin: 80px 0 50px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th,
td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-soft);
}

th {
    position: sticky;
    top: 0;
    z-index: 10;
}

@media (max-width:600px) {

    th,
    td {
        display: block;
        width: 100%;
    }

    th {
        position: static;
    }

    tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 10px;
    }
}