/* ==========================================================================
   nbblog 基础样式（前台 + 后台），浅色 / 深色双模式
   ========================================================================== */

:root {
    --bg: #f5f7fa;
    --bg-soft: #eef1f6;
    --card: #ffffff;
    --border: #e3e8ef;
    --text: #1b2333;
    --muted: #6b7688;
    --accent: #3366ff;
    --accent-weak: #e8eeff;
    --ok: #12a150;
    --err: #e5484d;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-mode="dark"] {
    --bg: #0e131b;
    --bg-soft: #151c26;
    --card: #161e29;
    --border: #263142;
    --text: #e6ebf2;
    --muted: #8b98ac;
    --accent: #5b8cff;
    --accent-weak: #1c2b4a;
    --ok: #2fbf71;
    --err: #ff6b6f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
    html[data-mode="auto"] {
        --bg: #0e131b;
        --bg-soft: #151c26;
        --card: #161e29;
        --border: #263142;
        --text: #e6ebf2;
        --muted: #8b98ac;
        --accent: #5b8cff;
        --accent-weak: #1c2b4a;
        --ok: #2fbf71;
        --err: #ff6b6f;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: var(--mono);
    font-size: .88em;
    background: var(--bg-soft);
    border-radius: 6px;
    padding: 2px 6px;
}

h1, h2, h3 { line-height: 1.35; margin: 0 0 12px; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.muted { color: var(--muted); }

/* ---------------------------------------------------------------- 头部 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #7aa2ff);
    color: #fff;
    font-weight: 700;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text small { color: var(--muted); font-weight: 400; font-size: 12px; }
.brand-sm .brand-mark { width: 30px; height: 30px; }

.site-nav, .admin-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
}

.nav-link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--accent-weak); color: var(--accent); }

.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
}

.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- 主体 */
main.container { padding-top: 32px; padding-bottom: 48px; }

.hero { padding: 24px 0 32px; }
.hero h1 { font-size: 34px; letter-spacing: -.5px; margin-bottom: 8px; }
.hero-sub { color: var(--muted); margin: 0; font-size: 16px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.card h2 { margin-top: 4px; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.badge-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

.checklist, .steps { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.checklist li, .steps li { margin-bottom: 6px; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 22px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.stat-hint { color: var(--muted); font-size: 12px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-err { background: var(--err); }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------------------------------------------------------------- 按钮与表单 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: .16s ease;
}

.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.06); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }

.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: .16s ease;
}

.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }

.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.alert-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }

/* ---------------------------------------------------------------- 登录 */
.login-wrap { display: grid; place-items: center; min-height: 70vh; }
.login-card { width: 100%; max-width: 400px; padding: 30px; }
.login-title { font-size: 22px; margin-bottom: 4px; }
.login-tip { font-size: 13px; margin: 0 0 22px; }

/* ---------------------------------------------------------------- 后台 */
.admin-body { background: var(--bg-soft); }

.admin-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-nav { flex: 1; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }

.admin-main { padding: 26px 0 60px; }
.admin-main .container { max-width: 1160px; }

.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: 2px; }

/* ---------------------------------------------------------------- 错误页 */
.error-body { display: grid; place-items: center; min-height: 100vh; }
.error-wrap { text-align: center; padding: 40px 20px; }
.error-code {
    font-size: 96px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -4px;
    background: linear-gradient(135deg, var(--accent), #9db8ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.error-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }

/* ---------------------------------------------------------------- 页脚 */
.site-footer { border-top: 1px solid var(--border); padding: 22px 0 40px; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-meta { display: flex; gap: 14px; }

@media (max-width: 640px) {
    .hero h1 { font-size: 26px; }
    .admin-header-inner { flex-wrap: wrap; gap: 10px; }
    .admin-nav { order: 3; width: 100%; overflow-x: auto; }
    .header-inner { height: 58px; }
}

/* ==========================================================================
   内容列表与详情（M1）
   ========================================================================== */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 22px;
    align-items: start;
}

.layout-main { min-width: 0; }
.layout-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 28px; margin-bottom: 4px; }
.page-head p { margin: 0; }

/* tabs */
.tabs { display: flex; gap: 8px; margin-top: 18px; }
.tab {
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
    background: var(--card);
}
.tab:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 卡片列表 */
.post-list { display: flex; flex-direction: column; gap: 16px; }

.post-card {
    display: flex;
    gap: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.post-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

.post-card__cover {
    flex: 0 0 168px;
    height: 116px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-soft);
}
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-card__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.post-card__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.post-card__meta time { font-size: 12px; }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}
a.chip:hover { background: var(--accent-weak); color: var(--accent); text-decoration: none; }
.chip-type { background: var(--accent-weak); color: var(--accent); }
.chip-top { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }

.post-card__title { font-size: 19px; margin: 0; line-height: 1.45; }
.post-card__title a { color: var(--text); }
.post-card__title a:hover { color: var(--accent); text-decoration: none; }

.post-card__excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__foot { display: flex; gap: 14px; font-size: 12px; margin-top: auto; }

.empty { text-align: center; padding: 40px 24px; }
.empty h2 { margin-bottom: 6px; }
.empty p { margin: 0 0 16px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pager__link {
    min-width: 34px;
    height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--card);
    color: var(--muted);
    font-size: 13px;
}
.pager__link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pager__link.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager__link.is-disabled { opacity: .45; cursor: not-allowed; }
.pager__gap { color: var(--muted); }

/* 侧栏 */
.profile-card { text-align: center; }
.profile-avatar {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #7aa2ff);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}
.profile-name { margin: 0 0 6px; font-size: 16px; }
.profile-desc { margin: 0; font-size: 13px; }
.profile-links { display: flex; gap: 12px; justify-content: center; margin-top: 12px; font-size: 13px; }

.side-search { padding: 12px; }
.side-search .input { background: var(--bg); }

.side-stats { display: flex; justify-content: space-around; padding: 16px 10px; text-align: center; }
.stat-cell { display: flex; flex-direction: column; gap: 2px; }
.stat-cell strong { font-size: 18px; }
.stat-cell span { color: var(--muted); font-size: 12px; }

.side-block h3, .toc h3, .related h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
}
.side-list li:last-child { border-bottom: 0; }
.side-list a { color: var(--text); }
.side-list a:hover { color: var(--accent); text-decoration: none; }
.side-more { display: inline-block; margin-top: 10px; font-size: 13px; }

.topic-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* 正文排版 */
.article { padding: 30px 34px; }
.article-title { font-size: 30px; line-height: 1.35; margin: 10px 0 12px; letter-spacing: -.4px; }
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.article-cover { width: 100%; border-radius: 12px; margin-top: 18px; display: block; }

.prose { font-size: 16px; line-height: 1.85; color: var(--text); }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.6em 0 .7em; line-height: 1.4; scroll-margin-top: 84px; }
.prose h1 { font-size: 26px; }
.prose h2 { font-size: 22px; }
.prose h3 { font-size: 18px; }
.prose h4 { font-size: 16px; }
.prose p { margin: 0 0 1.1em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
    margin: 1.2em 0;
    padding: 10px 18px;
    border-left: 3px solid var(--accent);
    background: var(--bg-soft);
    border-radius: 0 10px 10px 0;
    color: var(--muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: .9em;
}
.prose pre.code-block {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0 0 1.2em;
    font-size: 13.5px;
    line-height: 1.7;
}
.prose pre.code-block code { background: none; padding: 0; font-size: inherit; }
.prose img { max-width: 100%; border-radius: 10px; display: block; margin: 1.2em auto; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose .table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-soft); font-weight: 600; }

.article-foot { margin-top: 30px; border-top: 1px solid var(--border); padding-top: 18px; }
.article-nav { display: flex; gap: 14px; }
.article-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
}
.article-nav__item:hover { border-color: var(--accent); text-decoration: none; }
.article-nav__item--next { text-align: right; }
.article-nav__item .muted { font-size: 12px; }

.toc ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.toc__item { padding: 3px 0; }
.toc__item a { color: var(--muted); }
.toc__item a:hover { color: var(--accent); text-decoration: none; }
.toc__item--h3 { padding-left: 14px; font-size: 13px; }

.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.related-list li:last-child { border-bottom: 0; }
.related-list a { color: var(--text); }
.related-list a:hover { color: var(--accent); text-decoration: none; }

.share-list { display: flex; gap: 8px; }

.archive-group { margin-bottom: 16px; }
.archive-year { font-size: 18px; display: flex; align-items: baseline; gap: 10px; }
.archive-year .muted { font-size: 12px; }

.search-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.search-bar .input { flex: 1; }

.layout-article { grid-template-columns: minmax(0, 1fr) 260px; }

@media (max-width: 900px) {
    .layout, .layout-article { grid-template-columns: 1fr; }
    .layout-side { position: static; order: 2; }
    .post-card__cover { flex-basis: 120px; height: 92px; }
    .article { padding: 22px 18px; }
    .article-title { font-size: 24px; }
}

/* 主题选项：关闭侧栏 */
.no-sidebar .layout,
.no-sidebar .layout-article { grid-template-columns: minmax(0, 1fr); }
.no-sidebar .layout-side { display: none; }

/* ==========================================================================
   账号页 / 评论 / 个人中心（M1 收尾）
   ========================================================================== */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

/* 登录注册 */
.auth-body { background: var(--bg-soft); }
.auth-wrap {
    max-width: 420px;
    margin: 0 auto;
    padding: 8vh 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: var(--text);
    font-size: 18px;
}
.auth-brand:hover { text-decoration: none; }
.auth-card { padding: 28px; }
.auth-title { font-size: 22px; margin-bottom: 4px; }
.auth-tip { font-size: 13px; margin: 0 0 20px; }
.auth-switch { margin: 16px 0 0; font-size: 13px; text-align: center; }
.auth-foot { text-align: center; font-size: 13px; }
.validation-ok { color: var(--ok); font-size: 12px; }

/* 评论 */
.comments { margin-top: 18px; }
.comments-title { font-size: 16px; margin-bottom: 16px; }
.comments-empty { font-size: 14px; }
.comment-list, .comment-replies { list-style: none; margin: 0; padding: 0; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.comment:last-child { border-bottom: 0; }
.comment-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--bg-soft);
    color: var(--accent);
    font-weight: 600;
    overflow: hidden;
}
.comment-avatar.is-sm { flex-basis: 30px; width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.comment-name { color: var(--text); font-weight: 600; }
.comment-head time { font-size: 12px; }
.comment-body { font-size: 14px; margin: 6px 0 4px; word-break: break-word; }
.comment-actions { font-size: 13px; }
.comment-replies { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border); }

.link-btn {
    border: 0;
    background: none;
    color: var(--accent);
    font-size: 13px;
    padding: 0;
    cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.comment-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.comment-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.comment-submit { display: flex; align-items: center; gap: 12px; }
.comment-submit .muted { font-size: 12px; }
.comment-as { font-size: 13px; margin-bottom: 12px; }
.reply-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    background: var(--bg-soft);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* 个人中心 */
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.my-comments { list-style: none; margin: 0; padding: 0; }
.my-comments li { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.my-comments li:last-child { border-bottom: 0; }
.my-comments__head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.my-comments__head .muted { font-size: 12px; }
.my-comments__body { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
    .grid-2, .grid-3, .comment-fields { grid-template-columns: 1fr; }
}

/* ==========================================================================
   后台管理（M2）
   ========================================================================== */

.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.05); }
.link-danger { color: var(--err); }

.page-head--row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.tabs-sm { margin-bottom: 14px; }
.tabs-sm .tab { padding: 4px 12px; font-size: 13px; }
.tab-count {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    opacity: .75;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.toolbar .input { width: auto; min-width: 150px; padding: 8px 11px; font-size: 14px; }
.toolbar input[type="search"] { flex: 1; min-width: 200px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; background: var(--bg-soft); white-space: nowrap; }
.table tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.table .num { text-align: right; width: 70px; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions > * { margin-left: 8px; }
.cell-main a { color: var(--text); font-weight: 500; }
.cell-main a:hover { color: var(--accent); text-decoration: none; }
.cell-sub { font-size: 12px; margin-top: 2px; }
.empty-row { padding: 30px 0; text-align: center; }

.inline-form { display: inline; }

.status {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--bg-soft);
    color: var(--muted);
}
.status-publish { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.status-draft   { background: var(--bg-soft); color: var(--muted); }
.status-pending { background: color-mix(in srgb, #f5a524 18%, transparent); color: #b7791f; }
.status-private { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.status-trash   { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.status-approved { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.status-spam    { background: color-mix(in srgb, #8b98ac 18%, transparent); color: var(--muted); }

.admin-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}
.comment-text { font-size: 13px; line-height: 1.6; word-break: break-word; }

.nav-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--err);
    color: #fff;
    font-size: 11px;
    line-height: 17px;
}

/* 设置页 */
.setting-group { margin-bottom: 16px; }
.setting-head { margin-bottom: 12px; }
.setting-head h2 { font-size: 16px; margin-bottom: 2px; }
.setting-head p { margin: 0; font-size: 13px; }
.setting-item {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
    align-items: start;
}
.setting-item:last-child { border-bottom: 0; }
.setting-label { font-size: 14px; padding-top: 8px; }
.setting-label small { display: block; font-size: 12px; font-weight: 400; }
.setting-control .input { max-width: 560px; }
.setting-control .check { margin: 8px 0; }
.setting-actions { display: flex; align-items: center; gap: 14px; }

@media (max-width: 820px) {
    .admin-split { grid-template-columns: 1fr; }
    .setting-item { grid-template-columns: 1fr; gap: 6px; }
    .setting-label { padding-top: 0; }
}

/* 编辑页 */
.edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}
.edit-side { display: flex; flex-direction: column; gap: 16px; }
.edit-side .card { padding: 18px; }
.side-title { font-size: 14px; color: var(--muted); margin: 0 0 14px; font-weight: 600; }

.input-lg { font-size: 18px; font-weight: 600; padding: 12px 14px; }
.code-input {
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.75;
    min-height: 420px;
    resize: vertical;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13px; }

/* 站内对话框 */
.ui-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(10, 14, 22, .45);
    backdrop-filter: blur(2px);
    display: grid;
    place-items: center;
    padding: 20px;
    animation: ui-fade .12s ease;
}
.ui-dialog {
    width: 100%;
    max-width: 380px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    padding: 22px;
    animation: ui-pop .14s ease;
}
.ui-dialog__title { font-size: 16px; margin: 0 0 8px; }
.ui-dialog__text {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    white-space: pre-line;
    word-break: break-word;
}
.ui-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }

@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-pop  { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 900px) {
    .edit-layout { grid-template-columns: 1fr; }
    .page-head--row { flex-direction: column; }
}
