/* ============================================================
   墨迹 · 个人博客
   设计基调：纸张质感、衬线标题、深绿点缀
   ============================================================ */

:root {
    --paper: #fbf9f5;
    --paper-2: #f3efe8;
    --card: #ffffff;
    --ink: #1c1b19;
    --ink-soft: #4f4b44;
    --muted: #8a857c;
    --line: #e5dfd5;
    --line-soft: #eee9e1;
    --accent: #2f6f5e;
    --accent-dark: #245a4b;
    --accent-soft: #e6f0ec;
    --danger: #a9473a;
    --danger-soft: #f8ebe8;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(28, 27, 25, .05);
    --shadow: 0 18px 40px -26px rgba(28, 27, 25, .45);
    --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(rgba(28, 27, 25, .035) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .9;
}

img {
    max-width: 100%;
    display: block;
}

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

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

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.35;
    margin: 0;
}

p {
    margin: 0;
}

.container {
    width: min(1080px, calc(100% - 48px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.container-narrow {
    width: min(760px, calc(100% - 48px));
}

/* ---------------- 顶部导航 ---------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(251, 249, 245, .82);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
}

.brand:hover {
    color: var(--ink);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: var(--serif);
    font-size: 20px;
    letter-spacing: 0;
    box-shadow: var(--shadow-sm);
}

.brand-text strong {
    display: block;
    font-family: var(--serif);
    font-size: 19px;
    letter-spacing: .12em;
    line-height: 1.1;
}

.brand-text small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .18em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.site-nav a {
    color: var(--ink-soft);
    padding: 8px 12px;
    border-radius: 999px;
    transition: background .18s ease, color .18s ease;
}

.site-nav a:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.site-nav a.active {
    color: var(--accent);
    font-weight: 600;
}

.site-nav .nav-cta {
    margin-left: 8px;
    background: var(--ink);
    color: #fff;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 500;
}

.site-nav .nav-cta:hover {
    background: var(--accent);
    color: #fff;
}

/* ---------------- 首页 ---------------- */

.hero {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 48px;
    align-items: center;
    padding: 64px 0 52px;
}

.hero-copy .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: .22em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 18px;
}

.eyebrow::before {
    content: "";
    width: 26px;
    height: 1px;
    background: var(--accent);
    opacity: .55;
}

.hero-copy h1 {
    font-size: clamp(30px, 3.6vw, 46px);
    line-height: 1.25;
    margin-bottom: 16px;
}

.hero-copy .lede {
    color: var(--ink-soft);
    font-size: 16px;
    max-width: 36em;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 22px 0 28px;
    color: var(--muted);
    font-size: 13px;
}

.hero-art {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-art .hero-char {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--serif);
    font-size: clamp(70px, 12vw, 130px);
    color: rgba(255, 255, 255, .92);
    letter-spacing: .1em;
    text-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.hero-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0, 0, 0, .16), transparent 55%);
    pointer-events: none;
}

/* ---------------- 按钮 ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    font-family: var(--sans);
    cursor: pointer;
    transition: transform .15s ease, background .18s ease, box-shadow .18s ease;
    background: var(--paper-2);
    color: var(--ink);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(47, 111, 94, .9);
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-soft);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-danger:hover {
    background: #f3dcd7;
    color: var(--danger);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

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

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 8px 0 26px;
    border-top: 1px solid var(--line);
}

.section-head h2 {
    font-size: 24px;
    padding-top: 26px;
}

.section-head .count {
    color: var(--muted);
    font-size: 13px;
    padding-bottom: 4px;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 2px;
}

.search-form input[type="search"] {
    width: 200px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-family: var(--sans);
    font-size: 13px;
    color: var(--ink);
    outline: none;
    transition: border-color .18s ease, width .2s ease;
}

.search-form input[type="search"]:focus {
    border-color: var(--accent);
    width: 240px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    padding-bottom: 56px;
}

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--line);
}

.post-card .thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: block;
}

.post-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.post-card:hover .thumb img {
    transform: scale(1.04);
}

.thumb .thumb-char {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .9);
    font-family: var(--serif);
    font-size: 54px;
    letter-spacing: .08em;
}

.post-card .body {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .02em;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 500;
}

.chip-muted {
    background: var(--paper-2);
    color: var(--muted);
}

.chip-draft {
    background: #fdf1e0;
    color: #a06a20;
}

.post-card h3 {
    font-size: 20px;
    line-height: 1.45;
}

.post-card h3 a {
    color: var(--ink);
}

.post-card h3 a:hover {
    color: var(--accent);
}

.post-card .excerpt {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .footer-row {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

.read-more {
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.read-more::after {
    content: "→";
    transition: transform .2s ease;
}

.post-card:hover .read-more::after {
    transform: translateX(3px);
}

/* ---------------- 空状态 / 提示 ---------------- */

.empty-state {
    grid-column: 1 / -1;
    padding: 72px 24px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--muted);
}

.empty-state strong {
    display: block;
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 6px;
}

.flash-stack {
    display: grid;
    gap: 10px;
    padding-top: 18px;
}

.flash {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid transparent;
}

.flash-success {
    background: var(--accent-soft);
    border-color: #cfe3db;
    color: var(--accent-dark);
}

.flash-error {
    background: var(--danger-soft);
    border-color: #efd3ce;
    color: var(--danger);
}

/* ---------------- 文章详情 ---------------- */

.article-head {
    padding: 66px 0 0;
    text-align: center;
}

.article-head .chip {
    margin-bottom: 20px;
}

.article-head h1 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.3;
    margin-bottom: 22px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    color: var(--muted);
    font-size: 13px;
}

.article-cover {
    margin: 40px 0 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 21 / 9;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body {
    padding: 44px 0 24px;
}

.prose {
    font-size: 17px;
    line-height: 1.95;
    color: #26241f;
}

.prose p {
    margin: 0 0 1.35em;
}

.prose h2 {
    font-size: 24px;
    margin: 2em 0 .8em;
    padding-left: 14px;
    border-left: 3px solid var(--accent);
}

.prose h3 {
    font-size: 19px;
    margin: 1.7em 0 .6em;
    padding-left: 12px;
    border-left: 2px solid rgba(47, 111, 94, .38);
}

.prose h4 {
    font-size: 17px;
    margin: 1.5em 0 .5em;
}

.prose blockquote {
    margin: 1.6em 0;
    padding: 14px 22px;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--accent-dark);
    font-family: var(--serif);
}

.prose ul,
.prose ol {
    margin: 0 0 1.35em;
    padding-left: 1.3em;
}

.prose li {
    margin-bottom: .45em;
}

.prose code {
    font-family: var(--mono);
    font-size: .88em;
    background: var(--paper-2);
    padding: 2px 6px;
    border-radius: 5px;
}

.prose pre {
    background: #1f2a27;
    color: #e8f0ec;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.7;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2.4em auto;
    width: 60%;
}

.article-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

/* ---------------- 评论 ---------------- */

.comments {
    padding: 48px 0 8px;
    border-top: 1px solid var(--line);
    margin-top: 40px;
}

.comments h2 {
    font-size: 20px;
    margin-bottom: 22px;
}

.comment-list {
    display: grid;
    gap: 14px;
    margin-bottom: 34px;
}

.comment {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--muted);
}

.comment-author {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-weight: 600;
}

.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 600;
}

.comment p {
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-line;
}

.comment-form {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 22px;
    display: grid;
    gap: 14px;
}

.comment-form h3 {
    font-size: 16px;
}

.comment-form .row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
}

/* ---------------- 表单控件 ---------------- */

.field {
    display: grid;
    gap: 7px;
}

.field label {
    font-size: 13px;
    color: var(--ink-soft);
    font-weight: 500;
}

.field .hint {
    font-size: 12px;
    color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-family: var(--sans);
    font-size: 14px;
    color: var(--ink);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

textarea {
    line-height: 1.8;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 111, 94, .12);
}

input.invalid,
textarea.invalid {
    border-color: var(--danger);
}

.error-text {
    color: var(--danger);
    font-size: 12px;
}

/* ---------------- 分页 ---------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 72px;
}

.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink-soft);
    font-size: 13px;
}

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

.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.pagination .disabled {
    opacity: .45;
    pointer-events: none;
}

/* ---------------- 关于页 ---------------- */

.about-hero {
    padding: 72px 0 40px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: center;
}

.about-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #7fb0a0);
    color: #fff;
    font-family: var(--serif);
    font-size: 46px;
    box-shadow: var(--shadow);
}

.about-hero h1 {
    font-size: 34px;
    margin-bottom: 14px;
}

.about-hero p {
    color: var(--ink-soft);
    max-width: 40em;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px 0 70px;
}

.info-card {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 24px;
}

.info-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.info-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

/* ---------------- 页脚 ---------------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 34px 0 46px;
    margin-top: 20px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 18px;
}

/* ---------------- 登录页 ---------------- */

body.page-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 40px 80px -60px rgba(28, 27, 25, .6);
}

.auth-aside {
    padding: 52px 44px;
    background: linear-gradient(150deg, #2f6f5e, #1f4a3e);
    color: #eef6f2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
}

.auth-aside .brand-mark {
    background: rgba(255, 255, 255, .16);
}

.auth-aside .brand-text strong,
.auth-aside .brand-text small {
    color: #eef6f2;
}

.auth-aside h2 {
    font-size: 30px;
    line-height: 1.4;
    color: #fff;
}

.auth-aside p {
    margin-top: 14px;
    font-size: 14px;
    opacity: .78;
    line-height: 1.9;
}

.auth-aside .quote {
    font-family: var(--serif);
    font-size: 15px;
    opacity: .85;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

.auth-form {
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.auth-form h3 {
    font-size: 22px;
    margin-bottom: 4px;
}

.auth-form .sub {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

/* ---------------- 后台 ---------------- */

body.page-admin {
    background: var(--paper);
}

.admin-shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 26px 20px;
    background: var(--card);
    border-right: 1px solid var(--line);
}

.admin-sidebar .brand {
    padding: 0 4px;
}

.admin-nav {
    display: grid;
    gap: 4px;
    font-size: 14px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    transition: background .18s ease, color .18s ease;
}

.admin-nav a:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.admin-nav a.active {
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 600;
}

.admin-nav .icon {
    width: 18px;
    display: grid;
    place-items: center;
    opacity: .7;
    font-size: 14px;
}

.admin-sidebar-foot {
    margin-top: auto;
    display: grid;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.admin-sidebar-foot .who {
    font-size: 12px;
    color: var(--muted);
    padding: 0 4px 4px;
}

.admin-main {
    padding: 30px 40px 64px;
    min-width: 0;
}

.admin-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.admin-topbar h1 {
    font-size: 26px;
}

.admin-topbar p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.admin-topbar .actions {
    display: flex;
    gap: 10px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 24px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-head h2 {
    font-size: 17px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 20px 22px;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--accent-soft);
    opacity: .7;
}

.stat-card .label {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .12em;
}

.stat-card .value {
    margin-top: 8px;
    font-family: var(--serif);
    font-size: 32px;
    line-height: 1.1;
    color: var(--ink);
}

.stat-card .value small {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muted);
    margin-left: 4px;
}

.admin-columns {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
}

.mini-list {
    display: grid;
    gap: 2px;
}

.mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 6px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
}

.mini-item:last-child {
    border-bottom: none;
}

.mini-item a {
    color: var(--ink);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.mini-item .meta {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

/* 表格 */

.table-wrap {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 640px;
}

table.data-table thead th {
    text-align: left;
    font-size: 12px;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 500;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: #fcfaf7;
    white-space: nowrap;
}

table.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

table.data-table tbody tr:last-child td {
    border-bottom: none;
}

table.data-table tbody tr:hover {
    background: #fdfbf8;
}

table.data-table .title-cell {
    max-width: 380px;
}

table.data-table .title-cell a {
    color: var(--ink);
    font-weight: 500;
}

table.data-table .title-cell a:hover {
    color: var(--accent);
}

table.data-table .title-cell small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

/* 编辑器 */

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.editor-main {
    display: grid;
    gap: 18px;
}

.editor-side {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 24px;
}

.cover-preview {
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    background: var(--paper-2);
    margin-bottom: 10px;
}

.cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.markdown-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.9;
    background: var(--paper-2);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.markdown-hint code {
    font-family: var(--mono);
    background: #fff;
    padding: 1px 5px;
    border-radius: 4px;
}

/* ---------------- 错误页 ---------------- */

body.page-error {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 24px;
}

.error-card {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 480px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 56px 40px;
    box-shadow: var(--shadow);
}

.error-code {
    font-family: var(--serif);
    font-size: 64px;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 18px;
}

.error-card h1 {
    font-size: 22px;
    margin-bottom: 12px;
}

.error-card p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 26px;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 920px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 0 36px;
    }

    .hero-art {
        order: -1;
        aspect-ratio: 16 / 9;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .about-hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
        justify-items: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        padding: 34px 30px;
        gap: 20px;
    }

    .auth-aside h2 {
        font-size: 22px;
    }

    .auth-aside .quote {
        display: none;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px;
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 14px 20px;
    }

    .admin-sidebar .brand-text small {
        display: none;
    }

    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
        font-size: 13px;
    }

    .admin-nav a {
        padding: 7px 11px;
    }

    .admin-sidebar-foot {
        margin-top: 0;
        display: flex;
        gap: 8px;
        border-top: none;
        padding-top: 0;
    }

    .admin-sidebar-foot .who {
        display: none;
    }

    .admin-main {
        padding: 22px 20px 48px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-columns,
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-side {
        position: static;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-form input[type="search"] {
        width: 100%;
    }

    .search-form input[type="search"]:focus {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .container {
        width: calc(100% - 32px);
    }

    .header-inner {
        height: 64px;
    }

    .brand-text small {
        display: none;
    }

    .site-nav a {
        padding: 7px 9px;
        font-size: 13px;
    }

    .site-nav .nav-cta {
        padding: 8px 14px;
    }

    .article-head {
        padding-top: 40px;
        text-align: left;
    }

    .article-meta {
        justify-content: flex-start;
    }

    .comment-form .row {
        grid-template-columns: 1fr;
    }

    .prose {
        font-size: 16px;
    }
}

/* ---------------- 搜索表单布局加固 ---------------- */

.search-form > input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
}

.search-form > button {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* ---------------- 文件选择控件 ---------------- */

input[type="file"] {
    color: var(--ink-soft);
    font-size: 13px;
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper-2);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 12px;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease;
}

input[type="file"]::file-selector-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------------- 同类文章列表 ---------------- */

.related-list {
    display: grid;
    gap: 2px;
    padding-bottom: 8px;
}

.related-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 16px;
    padding: 16px 10px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink);
    transition: background .18s ease, padding .18s ease;
}

.related-item:hover {
    background: var(--card);
    padding-left: 16px;
    color: var(--ink);
}

.related-date {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .04em;
}

.related-main {
    min-width: 0;
}

.related-main strong {
    display: block;
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-main span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-arrow {
    color: var(--accent);
    font-size: 15px;
    opacity: .55;
    transition: transform .2s ease, opacity .2s ease;
}

.related-item:hover .related-arrow {
    transform: translateX(3px);
    opacity: 1;
}

@media (max-width: 600px) {
    .related-item {
        grid-template-columns: 52px minmax(0, 1fr) 18px;
        gap: 10px;
    }
}

/* ---------------- 稀疏列表与关于页三列 ---------------- */

.post-grid.single {
    grid-template-columns: 1fr;
}

.post-grid.single .post-card {
    flex-direction: row;
    align-items: stretch;
}

.post-grid.single .post-card .thumb {
    flex: 0 0 44%;
    aspect-ratio: 4 / 3;
}

.post-grid.single .post-card .body {
    padding: 30px 34px;
    justify-content: center;
}

.post-grid.single .post-card h3 {
    font-size: 24px;
}

@media (max-width: 760px) {
    .post-grid.single .post-card {
        flex-direction: column;
    }

    .post-grid.single .post-card .thumb {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .post-grid.single .post-card .body {
        padding: 22px 24px 24px;
    }

    .post-grid.single .post-card h3 {
        font-size: 20px;
    }
}

.post-grid.about-posts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 920px) {
    .post-grid.about-posts {
        grid-template-columns: 1fr;
    }
}
