:root {
    --container-width: 1160px;
    --layout-gap: clamp(24px, 4vw, 48px);
    --layout-top-space: 25px;
    --post-stack-space: 25px;
    --surface-soft: rgba(240, 248, 255, 0.18);
    --surface-soft-hover: #eef5fb;
    --surface-footer: #eef5fb;
    --border-soft: #d9e5f2;
    --border-strong: #d4e1ee;
    --accent: rgb(67, 135, 193);
    --accent-soft: rgba(67, 135, 193, 0.12);
    --text-main: #444;
    --text-muted: #999;
    --focus-ring: #2f6fb2;
    --radius-sm: 3px;
    --radius-md: 4px;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--text-main);
    font-family: "Droid Serif", Georgia, "Times New Roman", STHeiti, serif;
    font-size: 87.5%;
    line-height: 1.65;
}

main,
article,
aside,
footer,
header,
nav,
section {
    display: block;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

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

a:hover,
a:active {
    color: var(--text-main);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
    width: 100%;
    padding: 5px;
    border: 1px solid #e9e9e9;
    border-radius: 2px;
}

textarea {
    resize: vertical;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

pre,
code {
    background: #f3f3f0;
    font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
    font-size: 0.92857em;
}

code {
    padding: 2px 4px;
    color: #b94a48;
}

pre {
    max-height: 400px;
    overflow: auto;
    margin: 0;
    padding: 0;
    border: 1px solid #ccc;
    white-space: pre-wrap;
}

pre code {
    display: block;
    padding: 3px;
    color: var(--text-main);
}

blockquote {
    margin: 1em 1.5em;
    padding-left: 1.5em;
    border-left: 4px solid #f3f3f0;
}

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

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

.site-header {
    padding-top: 15px;
    border-bottom: 1px solid var(--border-strong);
    background: rgba(93, 150, 199, 0.98);
}

.site-header__inner {
    display: grid;
    gap: 15px 24px;
}

.site-brand {
    min-width: 0;
}

.site-brand__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    max-width: 100%;
    color: #fff;
    font-family: "Microsoft YaHei", sans-serif;
    font-size: 2.5em;
    line-height: 1.1;
    transition: color 0.2s ease;
}

.site-brand__link:hover,
.site-brand__link:active {
    color: rgba(255, 255, 255, 0.92);
}

.site-brand__logo {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    object-fit: contain;
}

.site-brand__text {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.site-brand__description {
    margin: 0.5em 0 0;
    color: rgba(238, 238, 238, 0.85);
    font-style: italic;
}

.site-search {
    min-width: 0;
}

.site-search__form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.12);
}

.site-search__input {
    min-width: 0;
    flex: 1 1 auto;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.96);
}

.site-search__input::placeholder {
    color: #8d98a5;
}

.site-search__input:focus {
    border-color: #3b74b5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.site-search__submit {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 4.25em;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
    color: #2f5f95;
    background: #fff;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.site-search__submit:hover {
    border-color: #fff;
    color: #234b76;
    background: #f2f8ff;
}

.site-search__submit:focus-visible {
    outline-color: rgba(255, 255, 255, 0.85);
}

.site-nav {
    margin-top: 15px;
}

.site-nav__list,
.site-nav__sublist {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.site-nav__item {
    position: relative;
    display: flex;
    margin-right: -1px;
}

.site-nav__link,
.site-nav__sublink {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 20px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text-main);
}

.site-nav__link {
    border-bottom: none;
}

.site-nav__link span,
.site-nav__sublink span {
    min-width: 0;
}

.site-nav__item--has-children > .site-nav__link::after {
    content: "▾";
    color: var(--text-muted);
    font-size: 0.85em;
}

.site-nav__external {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.85em;
}

.site-nav__link:hover,
.site-nav__link--current,
.site-nav__link.current,
.site-nav__sublink:hover,
.site-nav__sublink--current,
.site-nav__sublink.current {
    background: #f3f8fd;
    color: var(--accent);
}

.site-nav__link:focus-visible,
.site-nav__sublink:focus-visible {
    background: #f3f8fd;
}

.site-nav__sublist {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    z-index: 10;
    display: none;
    min-width: 220px;
    box-shadow: 0 14px 28px rgba(67, 135, 193, 0.16);
}

.site-nav__item:hover > .site-nav__sublist,
.site-nav__item:focus-within > .site-nav__sublist {
    display: block;
}

.site-nav__subitem {
    display: block;
}

.site-nav__sublink {
    width: 100%;
    justify-content: space-between;
    min-height: 40px;
    border-top: none;
    padding: 0 14px;
    }

.site-body {
    flex: 1 0 auto;
}

.content-layout {
    display: grid;
    gap: var(--layout-gap);
    padding-top: var(--layout-top-space);
}

.content-main,
.content-sidebar {
    min-width: 0;
}

.content-main--single {
    width: min(100%, 54rem);
}

.content-sidebar {
    overflow-wrap: break-word;
}

.content-panel {
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-left: 3px solid rgba(74, 116, 166, 0.65);
    background: var(--surface-soft);
}

.content-panel--narrow {
    width: min(100%, 42rem);
    margin: 75px auto;
}

.post {
    margin-top: 0;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-left: 3px solid rgba(74, 116, 166, 0.65);
    background: var(--surface-soft);
}

.post + .post {
    margin-top: var(--post-stack-space);
}

.post:hover {
    background: var(--surface-soft-hover);
}

.single:hover,
.related-posts:hover {
    background: var(--surface-soft);
}

.post-title {
    margin: 0.83em 0;
    margin-top: -1px;
    font-size: 1.4em;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin: -0.5em 0 0;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.92857em;
    list-style: none;
}

.post-meta li {
    padding-left: 12px;
    border-left: 1px solid #eee;
}

.post-meta li:first-child {
    padding-left: 0;
    border-left: none;
}

.post-content,
.comment-content {
    line-height: 1.5;
    overflow-wrap: break-word;
}

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

.post-content > *:last-child,
.comment-content > *:last-child {
    margin-bottom: 0;
}

.post:not(.single) > .post-meta + .post-content {
    margin-top: 0.9rem;
}

.post-content img,
.comment-content img,
.post-content video,
.comment-content video {
    max-width: 100%;
}

.post-content h2,
.comment-content h2 {
    font-size: 1.28571em;
}

.post-content hr,
.comment-content hr {
    width: 100px;
    margin: 2em auto;
    border-top-width: 2px;
}

.post-meta a:hover,
.post-content a:hover,
.widget a:hover,
.comment-content a:hover {
    border-bottom-color: transparent;
}

.post-near {
    margin: 30px 0;
    padding: 0;
    color: var(--text-muted);
    list-style: none;
}

.post-near__item {
    margin: 10px 0;
}

.related-posts-title {
    margin: 0 0 12px;
    font-size: 1.2em;
}

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

.related-posts-list li {
    margin: 6px 0;
    line-height: 1.5;
}

.related-posts-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.related-posts-date {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.92857em;
    white-space: nowrap;
}

.archive-title {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--border-soft);
    border-left: 3px solid rgba(74, 116, 166, 0.65);
    background: rgba(240, 248, 255, 0.12);
    color: #6c7d8f;
    font-size: 1em;
    line-height: 1.4;
}

.archive-title + .post {
    margin-top: 14px;
}

.widget {
    margin-bottom: 30px;
}

.widget-title {
    margin: 0 0 12px;
}

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

.widget-list li {
    margin: 0;
    line-height: 1.5;
}

.widget-list li + li {
    margin-top: 10px;
}

.widget-list li ul {
    margin-left: 15px;
}

.widget-list--nested {
    margin-top: 10px;
}

.widget-list__item--social-child a {
    color: var(--text-muted);
}

.widget-link__external {
    margin-left: 0.35rem;
    color: var(--text-muted);
    font-size: 0.85em;
}

.site-footer {
    margin-top: 25px;
    padding: 2em 0;
    border-top: 1px solid var(--border-strong);
    background: var(--surface-footer);
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
}

.error-page {
    text-align: center;
}

.error-page .post-title {
    margin-top: 0;
}

.error-page p {
    margin: 0.75em 0;
}

.error-page .search-form-google {
    display: grid;
    gap: 12px;
    width: min(100%, 24rem);
    margin: 20px auto 0;
}

.error-page .search-form-google p {
    margin: 0;
}

.error-page .search-form-google button {
    width: 100%;
    padding: 0.65em 1em;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: #2f5f95;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
}

@media (min-width: 992px) {
    .site-header__inner {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .site-nav {
        grid-column: 1 / -1;
    }

    .site-search {
        display: block;
    }

    .content-layout {
        grid-template-columns: minmax(0, 8fr) minmax(240px, 3fr);
        align-items: start;
    }

    .content-layout--single {
        grid-template-columns: minmax(0, 1fr);
    }

    .content-layout--single .content-main {
        margin-inline: auto;
    }

    .content-panel--narrow {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    body {
        font-size: 100%;
    }
}

@media (max-width: 768px) {
    .site-header__inner {
        gap: 14px;
    }

    .site-brand {
        order: 1;
    }

    .site-nav {
        order: 2;
        margin-top: 0;
    }

    .site-search {
        order: 3;
        margin-bottom: 0.5rem;
    }

    .site-brand__link {
        justify-content: flex-start;
        font-size: clamp(2rem, 9vw, 2.4rem);
    }

    .site-brand__description {
        text-align: left;
    }

    .site-nav__list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
        border: 1px solid var(--border-strong);
        background: #fff;
    }

    .site-nav__item {
        display: block;
        margin: -1px 0 0 -1px;
    }

    .site-nav__link,
    .site-nav__sublink {
        min-height: 44px;
        padding: 0 14px;
        border: 1px solid var(--border-strong);
        justify-content: space-between;
    }

    .site-nav__link {
        border-bottom: 1px solid var(--border-strong);
    }

    .site-nav__sublist {
        position: static;
        display: block;
        min-width: 0;
        box-shadow: none;
    }

    .site-nav__sublink {
        padding-left: 24px;
        background: #f8fbff;
    }

    .site-search__form {
        margin-top: 0;
    }

    .content-layout {
        gap: 20px;
        padding-top: 18px;
    }

    .post,
    .content-panel {
        padding: 14px;
    }

    .post-title {
        margin: 0 0 0.9rem;
        font-size: 1.55rem;
        line-height: 1.3;
        text-align: left;
    }

    .post-meta {
        justify-content: flex-start;
        margin: 0;
        gap: 8px 10px;
        font-size: 0.95rem;
        text-align: left;
    }

    .post-content,
    .comment-content {
        font-size: 1rem;
        line-height: 1.8;
    }

    .post-content h2,
    .comment-content h2 {
        font-size: 1.35em;
    }

    .archive-title {
        font-size: 1.05rem;
    }

    .related-posts-item {
        flex-wrap: wrap;
        gap: 4px 10px;
    }
}
