/* XCJ 博客 · 磨砂质感（明暗双主题，与主站一致） */

:root {
    --fg: #1a1a1a;
    --muted: #5b616b;
    --line: rgba(0, 0, 0, 0.08);
    --card-bg: rgba(255, 255, 255, 0.45);
    --card-line: rgba(255, 255, 255, 0.3);
    --soft-bg: rgba(255, 255, 255, 0.35);
    --bg: #eef1f5;
    --card-shadow: 0 12px 40px rgba(31, 41, 55, 0.12);
    --inner-hi: rgba(255, 255, 255, 0.5);
    --accent: #2f6fed;
}

:root[data-theme="dark"] {
    --fg: #eceef2;
    --muted: #9aa3af;
    --line: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(24, 26, 32, 0.55);
    --card-line: rgba(255, 255, 255, 0.12);
    --soft-bg: rgba(255, 255, 255, 0.06);
    --bg: #0e1014;
    --card-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    --inner-hi: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 40px 22px 64px; }

::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }

/* 顶部 */
.site-head { margin-bottom: 34px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-head a.brand { color: var(--fg); text-decoration: none; }
.site-head h1 { font-size: 26px; font-weight: 600; letter-spacing: 0.01em; }
.site-head .desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
.site-nav { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.site-nav a {
    color: var(--muted); text-decoration: none;
    border-bottom: 1px solid transparent; transition: color 0.2s ease, border-color 0.2s ease;
}
.site-nav a:hover { border-bottom-color: var(--fg); color: var(--fg); }

/* 主题切换按钮 */
.theme-toggle {
    flex: none;
    width: 38px; height: 38px;
    border: 1px solid var(--card-line); border-radius: 50%;
    background: var(--soft-bg); color: var(--fg); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { background: var(--card-line); transform: translateY(-1px); }

/* 文章列表 */
.post-item {
    border: 1px solid var(--card-line);
    border-radius: 18px;
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: var(--card-shadow), inset 0 1px 0 var(--inner-hi);
    padding: 22px 24px;
    margin-bottom: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-item:hover { transform: translateY(-2px); }
.post-item h2 { font-size: 19px; font-weight: 600; }
.post-item h2 a { color: var(--fg); text-decoration: none; }
.post-item .meta { color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.post-item .summary { color: var(--muted); font-size: 15px; }

/* 标签 */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
    font-size: 12px; color: var(--muted); background: var(--soft-bg);
    border: 1px solid var(--line);
    border-radius: 999px; padding: 2px 11px; text-decoration: none;
}
.tag:hover { background: var(--card-line); color: var(--fg); }

/* 文章详情 */
.post-title { font-size: 26px; font-weight: 600; line-height: 1.35; }
.post-meta { color: var(--muted); font-size: 13px; margin: 10px 0 26px; }
.post-body { font-size: 16px; }
.post-body h1, .post-body h2, .post-body h3 { margin: 26px 0 12px; line-height: 1.35; }
.post-body h1 { font-size: 23px; }
.post-body h2 { font-size: 20px; }
.post-body h3 { font-size: 17px; }
.post-body p { margin: 14px 0; }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 10px 0; }
.post-body ul, .post-body ol { margin: 14px 0 14px 22px; }
.post-body li { margin: 6px 0; }
.post-body blockquote {
    border-left: 3px solid var(--line); padding: 4px 0 4px 16px;
    color: var(--muted); margin: 16px 0;
}
.post-body pre {
    background: #1f1f1f; color: #eee; border-radius: 12px;
    padding: 16px; overflow-x: auto; margin: 16px 0; font-size: 14px;
}
.post-body code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.post-body p code, .post-body li code {
    background: var(--soft-bg); border: 1px solid var(--line);
    border-radius: 5px; padding: 1px 6px;
}
.post-body pre code { background: transparent; padding: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.post-body a { color: var(--accent); }
.post-body strong { font-weight: 600; }

.back-link { display: inline-block; margin-top: 30px; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.back-link:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* 归档 */
.archive-group { margin-bottom: 24px; }
.archive-group h3 { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.archive-group ul { list-style: none; }
.archive-group li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.archive-group li a { color: var(--fg); text-decoration: none; }
.archive-group li .date { color: var(--muted); font-size: 13px; margin-right: 10px; }

/* 表单（后台） */
.form-card { border: 1px solid var(--card-line); border-radius: 18px; background: var(--card-bg); box-shadow: var(--card-shadow), inset 0 1px 0 var(--inner-hi); padding: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=date], .field textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    font: inherit; background: var(--soft-bg); color: var(--fg);
}
.field textarea { resize: vertical; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.btn {
    display: inline-block; border: 1px solid var(--fg); background: var(--fg); color: var(--bg);
    border-radius: 10px; padding: 9px 18px; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--fg); }
.btn.danger { border-color: #c0392b; background: #c0392b; color: #fff; }
.error { color: #c0392b; font-size: 14px; margin-bottom: 14px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; text-align: left; }
.admin-table .ops { display: flex; gap: 10px; }
.admin-table .ops a, .admin-table .ops button { font-size: 13px; }
.empty { color: var(--muted); font-size: 15px; padding: 30px 0; text-align: center; }

.footer { margin-top: 50px; color: var(--muted); font-size: 12px; text-align: center; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--fg); }
.footer .sep { margin: 0 6px; }
