/* uniblog 样式：单栏、留白、无装饰。
   配色沿用原站 blogsquare 主题的观感（蓝 #0389ff 强调 / 灰 #e9e9e9 分隔），
   字体优先系统字体栈，中文回落到 PingFang / 微软雅黑，不引入任何外部字体。 */

:root {
    --text: #333333;
    --text-strong: #1a1a1a;
    --muted: #8e99a9;
    --accent: #0389ff;
    --border: #e9e9e9;
    --bg-soft: #f7f9fb;
    --content-width: 720px;
    /* 主栏 720 + 侧栏 260 + 间距 48：页头、正文、页脚共用同一容器，
       站名才会和文章标题左对齐 */
    --layout-width: 1028px;
    --footer-bg: #222222;
    --footer-border: #333333;
    --footer-text: rgba(255, 255, 255, 0.6);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #ffffff;
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    font-size: 17px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: var(--layout-width);
    margin: 0 auto;
    padding: 0 20px;
}

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

a:hover {
    text-decoration: underline;
}

::selection {
    background: #d8ecff;
}

/* ---------- 页头 ---------- */

.site-header {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    /* 站点名后面紧跟导航（与旧站一致），不要把导航推到右侧 */
    justify-content: flex-start;
    gap: 8px 24px;
}

.site-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-strong);
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
}

.site-header nav a {
    font-size: 15px;
    color: var(--muted);
}

.site-header nav a:hover {
    color: var(--accent);
}

/* ---------- 正文区 ---------- */

.content {
    padding: 32px 0 48px;
}

/* ---------- 主栏 + 侧栏 ---------- */

.layout {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.layout-main {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar {
    flex: 0 0 260px;
    font-size: 15px;
}

.widget {
    margin: 0 0 28px;
}

.widget-title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-strong);
}

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

.widget-list > li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}

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

.widget-list a {
    color: var(--text);
}

.widget-list a:hover {
    color: var(--accent);
    text-decoration: none;
}

.widget-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.widget-tags > li {
    padding: 0;
    border-bottom: 0;
}

.widget-tags a {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-soft);
    border-radius: 3px;
    font-size: 14px;
    color: #555555;
}

.widget-search {
    display: flex;
    gap: 8px;
}

.widget-search input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
}

.widget-search button {
    flex: 0 0 auto;
    padding: 7px 14px;
    border: 0;
    border-radius: 3px;
    background: var(--accent);
    font-size: 14px;
    font-family: inherit;
    color: #ffffff;
    cursor: pointer;
}

.widget-search button:hover {
    background: #0270d2;
}

h1 {
    font-size: 28px;
    line-height: 1.4;
    margin: 0 0 12px;
    color: var(--text-strong);
}

h2 {
    font-size: 21px;
    line-height: 1.5;
    margin: 32px 0 12px;
    color: var(--text-strong);
}

h3 {
    font-size: 18px;
    margin: 24px 0 8px;
    color: var(--text-strong);
}

p {
    margin: 0 0 18px;
}

.meta {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--muted);
}

.intro {
    margin: 0 0 24px;
    font-size: 17px;
    color: #555555;
}

.body p {
    margin: 0 0 18px;
}

.body ul,
.body ol {
    margin: 0 0 18px;
    padding-left: 24px;
}

.body blockquote {
    margin: 0 0 18px;
    padding: 2px 0 2px 16px;
    border-left: 3px solid var(--border);
    color: #555555;
}

.body img,
.featured {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.featured {
    margin: 0 0 24px;
}

pre,
.block-code {
    margin: 0 0 20px;
    padding: 14px 16px;
    overflow-x: auto;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.7;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.92em;
}

p code {
    padding: 2px 5px;
    background: var(--bg-soft);
    border-radius: 3px;
}

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

th,
td {
    padding: 8px 10px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

thead th {
    background: var(--bg-soft);
    font-weight: 600;
}

/* ---------- 文章列表 ---------- */

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

.post-list > li {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.post-list > li:first-child {
    padding-top: 8px;
}

.post-list h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.post-list h2 a {
    color: var(--text-strong);
}

.post-list h2 a:hover {
    color: var(--accent);
    text-decoration: none;
}

.post-list .meta {
    margin: 0;
}

.filters {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--muted);
}

.categories {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin: 0;
    padding: 0;
    font-size: 15px;
}

.terms {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.terms a {
    margin-right: 14px;
    color: var(--muted);
}

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

.pagination {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    font-size: 14px;
    color: var(--muted);
}

/* ---------- 页脚：黑底白字，站名 + 备案号 ---------- */

.site-footer {
    /* 与原站 #site-bottom 一致：#222 底、白色 60% 文字、13px、上下 20px */
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    padding: 20px 0;
    font-size: 13px;
    color: var(--footer-text);
    text-align: center;
}

.site-footer p {
    margin: 4px 0;
}

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

.site-footer a:hover {
    color: var(--accent);
}

/* ---------- 回到顶部 ---------- */

.back-to-top {
    /* 与原站 #back-top 一致：右下角 15px、30×30 方块、主题蓝，hover 转橙 */
    position: fixed;
    right: 15px;
    bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.back-to-top:hover {
    background: #ff9900;
}

.back-to-top[hidden] {
    display: none;
}

/* ---------- 小屏 ---------- */

/* 侧栏挤不下就堆到正文下面 */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
        gap: 32px;
    }

    .sidebar {
        flex: 1 1 auto;
        width: 100%;
        padding-top: 24px;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 24px;
    }

    .site-header .wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-header nav {
        gap: 0 14px;
    }
}
