/* ============================================================
   public/assets/style.css — 全站样式（参考 zxki.cn 风格 v4）
   设计语言：紫罗兰主色 #6c6cee · 浅灰底 · 白卡片 · 细边框 ·
             轻微阴影 · 毛玻璃吸顶导航 · 4 列图文网格
   断点：电脑 ≥1200 ／ 平板 1024·900 ／ 手机 768·600 ／ 小屏 480
   ============================================================ */

/* ── 设计变量 ── */
:root {
    --theme: #6c6cee;
    --theme-sub: #648ff5;
    --theme-dark: #5a5ae0;
    --theme-soft: rgba(108, 108, 238, .1);
    --theme-grad: linear-gradient(135deg, #7d7df3 0%, #6c6cee 55%, #5a5ae0 100%);
    --bg: #f5f6f7;
    --surface: #fff;
    --text: #333;
    --text-2: #4e5358;
    --muted: #777;
    --muted-2: #999;
    --border: #ebebef;
    --border-2: rgba(119, 119, 119, .16);
    --danger: #e03131;
    --danger-soft: #fff3f3;
    --success: #2f9e44;
    --radius: 8px;
    --radius-sm: 5px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .07);
    --shadow-hover: 0 10px 26px -8px rgba(31, 45, 61, .18);
    --header-h: 62px;
    --max: 1200px;
}

/* ── 基础 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
.home-wrap { max-width: var(--max); margin: 0 auto; }
a { color: var(--theme); text-decoration: none; transition: color .2s ease, opacity .2s ease; }
a:hover { color: var(--theme-dark); text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--theme); color: #fff; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; width: 100%; }

/* ============================================================
   吸顶导航（毛玻璃 · 桌面横向 / 手机右侧抽屉）
   ============================================================ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid var(--border);
    transition: box-shadow .25s ease;
}
/* 毛玻璃放在伪元素上：.site-header 自身不加 backdrop-filter，
   否则会成为 fixed 子元素（手机抽屉/遮罩）的包含块 */
.site-header::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: rgba(255, 255, 255, .84);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    pointer-events: none;
}
.site-header.scrolled { box-shadow: 0 8px 26px -16px rgba(31, 45, 61, .32); }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }

.logo {
    font-size: 19px; font-weight: 800; letter-spacing: .01em;
    color: var(--theme); white-space: nowrap; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 9px;
}
.logo::before {
    content: ""; width: 26px; height: 26px; border-radius: 8px;
    background: var(--theme-grad);
    box-shadow: 0 4px 12px rgba(108, 108, 238, .35);
}
.logo:hover { opacity: .88; }

/* ── 导航主体 ── */
.nav { display: flex; align-items: center; margin-left: auto; min-width: 0; }
.nav-head { display: none; }
.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-link, .nav-group-label {
    position: relative;
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-2); text-decoration: none;
    padding: 8px 13px; font-size: 14.5px; font-weight: 500;
    border-radius: var(--radius-sm); white-space: nowrap;
    line-height: 1.4;
    transition: color .18s ease, background .18s ease;
}
.nav-link:hover, .nav-group-label:hover { color: var(--theme); background: var(--theme-soft); }
.nav-link.active { color: var(--theme); background: var(--theme-soft); font-weight: 600; }
.nav-link.active::after {
    content: ""; position: absolute; left: 50%; bottom: 2px;
    width: 14px; height: 2px; margin-left: -7px;
    border-radius: 2px; background: var(--theme);
}

.user-box {
    display: inline-flex; align-items: center; gap: 8px; margin-left: 10px;
    padding: 4px 12px 4px 4px !important;
    background: #f5f5fa; border: 1px solid var(--border);
    border-radius: 999px; white-space: nowrap; line-height: 1.25;
}
.user-box:hover { background: var(--theme-soft); border-color: rgba(108, 108, 238, .3); }
.user-avatar {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    background: var(--theme-grad); color: #fff;
    font-size: 13px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.user-meta { display: flex; flex-direction: column; }
.user-meta b { font-size: 12.5px; font-weight: 600; color: var(--text-2); max-width: 108px; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 10.5px; color: var(--muted-2); }

/* ── 头像：导航用户胶囊 / 文章作者 / 评论 ── */
.user-avatar-img { object-fit: cover; display: block; }
.meta-author { display: inline-flex; align-items: center; gap: 6px; }
.meta-avatar {
    width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
    object-fit: cover; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; background: var(--theme-grad);
}
.comment-avatar {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    object-fit: cover; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff; background: var(--theme-grad);
}

/* 汉堡按钮（手机端） */
.nav-toggle {
    display: none; margin-left: auto;
    width: 38px; height: 38px; border: 1px solid var(--border);
    background: #f7f7fb; border-radius: 9px;
    cursor: pointer; padding: 10px 9px; flex-direction: column; justify-content: space-between;
    transition: background .18s, border-color .18s;
}
.nav-toggle:hover { background: var(--theme-soft); border-color: rgba(108, 108, 238, .3); }
.nav-toggle span {
    display: block; height: 2px; width: 100%;
    background: var(--text-2); border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 关闭按钮（抽屉内） */
.nav-close {
    width: 32px; height: 32px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f5f5fa; border: 1px solid var(--border); border-radius: 50%;
    color: var(--text-2); cursor: pointer; transition: all .18s;
}
.nav-close:hover { background: var(--theme-soft); color: var(--theme); border-color: rgba(108, 108, 238, .3); }

/* ── 导航分类下拉（桌面 hover） ── */
.nav-group { position: relative; }
.nav-caret { display: inline-flex; font-style: normal; opacity: .55; transition: transform .2s ease; }
.nav-caret svg { display: block; }
.nav-group:hover .nav-group-label,
.nav-group:focus-within .nav-group-label { color: var(--theme); background: var(--theme-soft); }
.nav-group:hover .nav-caret { transform: rotate(180deg); }
.nav-drop {
    position: absolute; top: calc(100% + 8px); left: 50%;
    min-width: 176px; padding: 7px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 18px 40px -18px rgba(31, 45, 61, .34);
    z-index: 99;
    opacity: 0; visibility: hidden; transform: translate(-50%, -6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav-drop::before { /* 顶部小三角 */
    content: ""; position: absolute; top: -5px; left: 50%; margin-left: -5px;
    width: 9px; height: 9px; background: #fff;
    border-left: 1px solid var(--border); border-top: 1px solid var(--border);
    transform: rotate(45deg); border-radius: 2px 0 0 0;
}
.nav-group:hover .nav-drop,
.nav-group:focus-within .nav-drop,
.nav-group.open .nav-drop { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nav-drop a {
    display: block; padding: 9px 12px; border-radius: 7px;
    font-size: 13.5px; color: var(--text-2); white-space: nowrap;
    transition: background .16s, color .16s, padding-left .16s;
}
.nav-drop a:hover { background: var(--theme-soft); color: var(--theme); padding-left: 16px; }

/* ── Header 搜索框（胶囊 + 图标按钮） ── */
.nav-search {
    display: flex; align-items: center;
    margin-left: 14px; padding: 3px 3px 3px 14px;
    background: #f4f5f9; border: 1px solid var(--border);
    border-radius: 999px; width: 208px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.nav-search:focus-within {
    border-color: rgba(108, 108, 238, .55); background: #fff;
    box-shadow: 0 0 0 3px var(--theme-soft);
}
.nav-search input[type="text"] {
    flex: 1; min-width: 0; border: none; background: transparent;
    font-size: 13px; color: var(--text); outline: none; padding: 6px 0;
}
.nav-search input[type="text"]::placeholder { color: var(--muted-2); }
.nav-search button {
    flex-shrink: 0; width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--theme-grad); color: #fff; border: none; border-radius: 50%;
    cursor: pointer; transition: opacity .2s, transform .2s;
}
.nav-search button:hover { transform: scale(1.06); opacity: .95; }

/* ── 手机抽屉遮罩 / 抽屉页脚（桌面隐藏） ── */
.nav-mask { display: none; }
.nav-foot { display: none; }

/* ============================================================
   Hero 首屏（渐变 + 山水插画 + 居中搜索）
   ============================================================ */
.hero {
    position: relative; overflow: hidden;
    min-height: 300px;
    margin: -22px calc(50% - 50vw) 0;
    background: linear-gradient(180deg, #eef0ff 0%, #f3f1fb 45%, #f5f6f7 100%);
    border-bottom: 1px solid var(--border);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; pointer-events: none; }
.hero-inner {
    position: relative; z-index: 1;
    max-width: 780px; margin: 0 auto; padding: 62px 16px 72px;
    text-align: center;
}
.hero-title { font-size: 31px; font-weight: 800; letter-spacing: .01em; color: #2c2c46; margin-bottom: 10px; }
.hero-sub { font-size: 14px; color: #6b6b85; margin-bottom: 22px; }
.hero-search {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border-radius: 12px; padding: 7px 7px 7px 18px;
    box-shadow: 0 14px 34px -14px rgba(76, 76, 158, .35);
    border: 1px solid rgba(255, 255, 255, .8);
}
.hero-search input[type="text"] {
    flex: 1; min-width: 0; border: none; outline: none; background: none;
    font-size: 15px; color: var(--text); padding: 8px 0;
}
.hero-search input[type="text"]::placeholder { color: #a0a0b5; }
.hero-search button {
    flex-shrink: 0; background: var(--theme-grad); color: #fff; border: none;
    border-radius: 9px; padding: 11px 30px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: opacity .2s, transform .2s;
}
.hero-search button:hover { opacity: .92; transform: translateY(-1px); }
.hot-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.hot-words a {
    font-size: 12.5px; color: #5c5c7a; background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(108, 108, 238, .16);
    padding: 4px 12px; border-radius: 999px; transition: all .2s;
}
.hot-words a:hover { background: var(--theme); color: #fff; border-color: var(--theme); }
.hero-stats { margin-top: 16px; font-size: 12.5px; color: #83839c; }
.hero-stats b { color: var(--theme); font-weight: 600; }

/* ============================================================
   版块标题
   ============================================================ */
.section { margin: 28px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.section-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 19px; font-weight: 700; color: #2c2c46; letter-spacing: .01em;
}
.section-title::before {
    content: ""; width: 4px; height: 18px; border-radius: 4px;
    background: var(--theme-grad);
}
.section-more { font-size: 13px; color: var(--muted-2); white-space: nowrap; }
.section-more:hover { color: var(--theme); }

/* ============================================================
   文章卡片网格
   ============================================================ */
.post-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.post-card {
    display: flex; flex-direction: column;
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(108, 108, 238, .3); }
.post-thumb {
    position: relative; display: block; aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #eceafd, #e6efff);
    overflow: hidden;
}
.post-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; z-index: 1; }
.post-card:hover .post-thumb img { transform: scale(1.04); }
/* 无封面时的占位：大号首字 + 渐变 */
.thumb-ph {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 44px; font-weight: 800; color: #fff; letter-spacing: .02em;
    text-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
.post-cat {
    position: absolute; left: 9px; bottom: 9px; z-index: 2;
    display: inline-flex; align-items: center; gap: 4px;
    max-width: calc(100% - 18px);
    background: rgba(255, 255, 255, .94); color: var(--theme);
    font-size: 11.5px; font-weight: 600; line-height: 1;
    padding: 6px 10px; border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-body { display: flex; flex-direction: column; flex: 1; padding: 13px 14px 12px; }
.post-title {
    font-size: 15px; font-weight: 600; line-height: 1.5; color: #2c2c46;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 45px; margin-bottom: 6px;
}
.post-title:hover { color: var(--theme); }
.post-excerpt {
    font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta {
    margin-top: auto; display: flex; align-items: center; justify-content: space-between;
    gap: 8px; font-size: 11.5px; color: var(--muted-2);
}
.post-meta i, .post-meta svg { vertical-align: -2px; margin-right: 3px; }
.post-meta .meta-l { display: flex; align-items: center; gap: 10px; }
.post-meta .meta-r { white-space: nowrap; }

/* 空状态 */
.empty-box {
    background: var(--surface); border: 1px dashed var(--border-2);
    border-radius: var(--radius); padding: 44px 20px; text-align: center; color: var(--muted);
}

/* ============================================================
   分类专区（渐变头 + 文章排行列表）
   ============================================================ */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cat-block {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
    transition: box-shadow .25s ease;
}
.cat-block:hover { box-shadow: var(--shadow-hover); }
.cat-block-head {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 18px 20px; color: #fff;
    background: linear-gradient(120deg, #7d7df3, #9a8cf7);
}
.cat-block:nth-child(2n) .cat-block-head { background: linear-gradient(120deg, #4fa8f7, #7d7df3); }
.cat-block:nth-child(3n) .cat-block-head { background: linear-gradient(120deg, #f093a3, #b08cf5); }
.cat-block:nth-child(4n) .cat-block-head { background: linear-gradient(120deg, #48c6b8, #4fa8f7); }
.cat-block-head::after {
    content: ""; position: absolute; right: -30px; top: -40px;
    width: 130px; height: 130px; border-radius: 50%;
    background: rgba(255, 255, 255, .14);
}
.cat-block-head h3 { font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.cat-block-head .cat-count { font-size: 12px; opacity: .9; }
.cat-block-body { padding: 6px 8px 10px; }
.cat-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-2); font-size: 13.5px; transition: background .2s, color .2s;
}
.cat-row:hover { background: #f6f6fb; color: var(--theme); }
.cat-idx {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 5px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    background: #f0f0f7; color: var(--muted-2);
}
.cat-row:nth-child(1) .cat-idx { background: var(--theme); color: #fff; }
.cat-row:nth-child(2) .cat-idx { background: #8b8bff; color: #fff; }
.cat-row:nth-child(3) .cat-idx { background: #a6a6ff; color: #fff; }
.cat-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row-views { flex-shrink: 0; font-size: 11.5px; color: var(--muted-2); }
.cat-block-more { display: block; text-align: center; font-size: 12.5px; padding: 8px 0 6px; color: var(--muted-2); }
.cat-block-more:hover { color: var(--theme); }

/* ============================================================
   卡片与正文（后台 / 详情页通用）
   ============================================================ */
main { padding: 22px 16px 34px; min-height: 40vh; }
.card {
    background: var(--surface); border-radius: var(--radius);
    padding: 24px; border: 1px solid var(--border);
    box-shadow: var(--shadow); margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow .2s ease;
}
.card:hover { box-shadow: 0 4px 18px -8px rgba(31, 45, 61, .14); }
.card h1 { font-size: 22px; margin-bottom: 12px; letter-spacing: -.01em; color: #2c2c46; }
.card h2 { font-size: 17px; margin-bottom: 12px; letter-spacing: -.01em; color: #2c2c46; }
.card h3 { font-size: 15px; margin-bottom: 10px; color: #2c2c46; }

/* 入场动画（main.js 配合） */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th {
    font-size: 12px; font-weight: 600; letter-spacing: .04em;
    color: var(--muted); background: #f7f8fa;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px; text-align: left; white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.table tr:hover td { background: #fafafd; }
.table tr:last-child td { border-bottom: none; }
.table td a { font-weight: 500; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.table form { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.table code { word-break: break-all; font-size: 12px; background: #f6f7fa; padding: 2px 6px; border-radius: 4px; }

/* 按钮 */
.btn {
    display: inline-block; background: var(--theme); color: #fff; border: none;
    padding: 9px 22px; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 14px; font-weight: 500; text-decoration: none; line-height: 1.6;
    box-shadow: 0 2px 8px rgba(108, 108, 238, .22);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover { background: var(--theme-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(108, 108, 238, .28); }
.btn:active { transform: none; }
.btn-ghost { background: #fff; color: var(--theme); border: 1px solid var(--theme); box-shadow: none; }
.btn-ghost:hover { background: var(--theme-soft); box-shadow: none; }
.btn-danger { background: var(--danger); box-shadow: none; }
.btn-danger:hover { background: #c92a2a; }
.btn-block { width: 100%; margin-top: 8px; text-align: center; }

/* ── 后台管理菜单磁贴 ── */
.admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 16px 0 4px;
}
.admin-menu-item {
    display: flex; align-items: center; justify-content: center;
    padding: 15px 8px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-weight: 600; font-size: 15px;
    color: var(--text-2); background: var(--surface);
    transition: all .2s ease;
}
.admin-menu-item:hover {
    border-color: var(--theme); color: var(--theme);
    background: var(--theme-soft);
    transform: translateY(-2px); box-shadow: var(--shadow);
}
.admin-back { font-size: 13px; color: var(--muted); }

/* ── 文章横向列表（旧布局兼容）── */
.article-list { margin: 6px 0 12px; }
.article-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
}
.article-item:last-child { border-bottom: none; }
.article-item-main { flex: 1; min-width: 0; }
.article-item-title {
    display: inline; max-width: 100%;
    font-weight: 600; font-size: 15px; color: var(--text-2);
    overflow-wrap: break-word;
}
.article-item-title:hover { color: var(--theme); }
.article-item-meta {
    display: flex; flex-wrap: wrap; gap: 4px 14px;
    margin: 5px 0 0; font-size: 12.5px; color: var(--muted-2);
}
.article-item-meta span { white-space: nowrap; }
.article-item-edit { flex-shrink: 0; font-size: 13px; color: var(--theme); padding: 4px 6px; }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 14px; margin-bottom: 5px; color: var(--text-2); font-weight: 500; }
.form-row input {
    width: 100%; padding: 10px 14px; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fafbfc; outline: none; color: var(--text);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-row input:focus { border-color: var(--theme); background: #fff; box-shadow: 0 0 0 3px var(--theme-soft); }
textarea {
    width: 100%; padding: 10px 14px; font-size: 14px; outline: none; resize: vertical;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fafbfc; font-family: inherit; color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
textarea:focus { border-color: var(--theme); background: #fff; box-shadow: 0 0 0 3px var(--theme-soft); }
select {
    width: 100%; padding: 10px 14px; font-size: 14px; outline: none; background: #fafbfc;
    border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
select:focus { border-color: var(--theme); background: #fff; }

/* 提示条 */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #ffd6d6; }

/* ============================================================
   登录 / 注册 / 消息页
   ============================================================ */
.auth-page {
    min-height: 100vh; padding: 16px;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(800px 420px at 12% 0%, #e9e9ff 0%, transparent 62%),
        radial-gradient(700px 380px at 92% 100%, #e6f0ff 0%, transparent 58%),
        var(--bg);
}
.auth-box {
    background: var(--surface); border-radius: 12px; padding: 32px 28px;
    width: 100%; max-width: 380px;
    border: 1px solid var(--border); box-shadow: 0 18px 44px -18px rgba(31, 45, 61, .22);
}
.auth-box h1 { font-size: 20px; margin-bottom: 20px; text-align: center; color: #2c2c46; }
.auth-tip { margin-top: 14px; font-size: 13px; color: var(--muted-2); text-align: center; }
.auth-help {
    margin-top: 12px; padding: 9px 12px; text-align: center;
    font-size: 12.5px; line-height: 1.6; color: var(--muted);
    background: #f7f7fb; border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.auth-wechat { margin-top: 18px; text-align: center; }

.message-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(800px 400px at 80% 0%, #e9e9ff 0%, transparent 60%),
        var(--bg);
}
.message-box {
    background: var(--surface); border-radius: 12px; padding: 40px 44px;
    text-align: center; border: 1px solid var(--border);
    box-shadow: 0 18px 44px -18px rgba(31, 45, 61, .22);
    width: min(92%, 420px);
}
.message-success h2 { color: var(--success); }
.message-error h2 { color: var(--danger); }
.message-box p { margin-top: 10px; }
.jump-tip { font-size: 13px; color: var(--muted-2); }

/* ============================================================
   文章详情 / 评论 / 互动
   ============================================================ */
.article-main { max-width: 920px; margin-left: auto; margin-right: auto; }
.article-main .article-content { max-width: 100%; }
.article-head { border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 6px; }
.article-head h1 { font-size: 26px; line-height: 1.45; margin-bottom: 10px; color: #24243a; }
.article-head .meta { font-size: 13px; color: var(--muted-2); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.article-content { margin-top: 18px; overflow-wrap: break-word; word-break: break-word; }
.article-content p { margin-bottom: 14px; font-size: 15.5px; line-height: 1.85; color: #3c3c4e; }
.article-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.article-content h2 { font-size: 19px; margin: 24px 0 12px; }
.article-content h3 { font-size: 16px; margin: 20px 0 10px; }
.meta { margin: 6px 0 4px; font-size: 13px; }
.badge-draft {
    background: #fff4e6; color: #e8590c; border: 1px solid #ffd8a8;
    border-radius: 999px; padding: 2px 10px; font-size: 12px; margin-left: 8px;
}
.comment { border-bottom: 1px solid var(--border); padding: 14px 0; }
.comment:last-child { border-bottom: none; }
.comment-head { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-head strong { color: #2c2c46; }
.comment-head .muted { margin-left: 0; }
.comment-body { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.del-link { color: var(--danger); font-size: 12px; }

/* 筛选标签 */
.filter-box { margin: 10px 0; }
.chip {
    display: inline-block; background: #f2f3f7; color: var(--text-2);
    padding: 5px 14px; border-radius: 999px; font-size: 13px;
    margin: 3px 6px 3px 0;
    border: 1px solid transparent;
    transition: all .2s ease;
}
.chip:hover { background: var(--theme-soft); color: var(--theme); }
.chip-active { background: var(--theme); color: #fff; border-color: var(--theme); }
.chip-active:hover { background: var(--theme-dark); color: #fff; }

/* 个人中心选项卡 */
.user-tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    gap: 4px; margin: 12px 0 16px; border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}
.user-tabs a {
    flex-shrink: 0; padding: 9px 18px;
    color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    border-radius: 6px 6px 0 0;
}
.user-tabs a:hover { background: var(--theme-soft); color: var(--theme); }
.user-tabs a.active { color: var(--theme); border-bottom-color: var(--theme); font-weight: 600; }

/* ── 个人中心：资料卡 ── */
.profile-head {
    display: flex; align-items: center; gap: 18px;
    padding-bottom: 16px; flex-wrap: wrap;
}
.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
    background: var(--theme-grad); color: #fff; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; line-height: 1;
    box-shadow: 0 6px 18px -8px rgba(108, 108, 238, .65);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-main { flex: 1 1 240px; min-width: 0; }
.profile-head > .btn { margin-left: auto; flex-shrink: 0; }
.profile-main h1 { font-size: 20px; font-weight: 700; line-height: 1.35; margin-bottom: 3px; }
.profile-sub { font-size: 12.5px; color: var(--muted-2); }
.profile-bio { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; }
.profile-stats a { font-size: 13px; color: var(--muted); }
.profile-stats a:hover { color: var(--theme); }
.profile-stats b { color: var(--text); font-weight: 700; font-size: 14px; margin-right: 3px; }
.profile-section {
    margin: 0; padding: 22px 0 4px;
    border: none; border-top: 1px solid var(--border);
    border-radius: 0; box-shadow: none; background: transparent; overflow: visible;
}
.profile-section h2 { font-size: 16px; margin-bottom: 14px; }
.profile-section form { max-width: 560px; }
.form-hint { font-size: 12px; color: var(--muted-2); margin-top: 6px; line-height: 1.6; }
.avatar-edit { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.avatar-edit-preview {
    width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: var(--theme-grad); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; line-height: 1;
}
.avatar-edit-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit-actions { flex: 1 1 240px; min-width: 0; }
.avatar-edit-actions input[type="file"] {
    border: none; background: none; padding: 0; width: 100%;
    font-size: 13px; color: var(--muted); box-shadow: none !important;
}
.checkbox-line { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.checkbox-line input { width: auto; margin: 0; }

/* 侧边栏（备用模板） */
.sidebar .card h3 { font-size: 15px; margin-bottom: 10px; }
.sidebar form { display: flex; gap: 6px; }
.sidebar input[type="search"] {
    flex: 1; min-width: 0; padding: 9px 12px; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; background: #fafbfc;
}
.sidebar input[type="search"]:focus { border-color: var(--theme); background: #fff; box-shadow: 0 0 0 3px var(--theme-soft); }
.cat-link {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 10px; margin: 2px 0; border-radius: var(--radius-sm);
    color: var(--text-2); font-size: 14px;
}
.cat-link:hover { background: var(--theme-soft); color: var(--theme); }

/* ============================================================
   分页（胶囊按钮）
   ============================================================ */
.pager {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 8px; margin: 26px 0 6px;
}
.pager a, .pager strong {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 11px;
    background: #fff; border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-2); font-size: 13.5px; font-weight: 400;
    transition: all .2s ease;
}
.pager a:hover { border-color: var(--theme); color: var(--theme); }
.pager strong { background: var(--theme); border-color: var(--theme); color: #fff; font-weight: 600; }
.pager .pager-info { border: none; background: none; color: var(--muted-2); font-size: 13px; }
.muted { color: var(--muted); font-size: 14px; }

/* 文章详情底部返回 */
.back-link { display: inline-block; margin-top: 4px; font-size: 13.5px; color: var(--muted-2); }
.back-link:hover { color: var(--theme); }

/* ============================================================
   页脚（浅色）
   ============================================================ */
.site-footer {
    background: #fff; color: var(--muted-2);
    border-top: 1px solid var(--border);
    padding: 26px 0; text-align: center; font-size: 13px;
    margin-top: 10px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--theme); }
.footer-nav {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 14px 56px; text-align: left; margin-bottom: 20px;
}
.footer-nav-col { min-width: 100px; }
.footer-nav-title {
    margin: 0 0 8px; font-weight: 600; color: var(--text-2);
    font-size: 13px; letter-spacing: .04em;
}
.footer-nav-col a { display: block; margin: 5px 0; color: var(--muted-2); font-size: 13px; }
.footer-nav-col a:hover { color: var(--theme); }

/* ── 返回顶部（main.js 动态创建）── */
.to-top {
    position: fixed; right: 20px; bottom: 24px; z-index: 90;
    width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%;
    background: #fff; color: var(--theme); font-size: 17px;
    cursor: pointer; box-shadow: 0 6px 18px -6px rgba(31, 45, 61, .25);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .25s, transform .25s, visibility .25s, background .2s, color .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--theme); color: #fff; }

/* ============================================================
   响应式
   ============================================================ */

/* 小屏笔记本（≤1200px） */
@media (max-width: 1200px) {
    .post-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 平板横屏（≤1024px） */
@media (max-width: 1024px) {
    .nav-link, .nav-group-label { padding: 7px 9px; }
    .nav-search { width: 170px; }
    .hero-title { font-size: 26px; }
    .hero-inner { padding: 44px 16px 38px; }
}

/* 平板竖屏 / 大屏手机（≤900px） */
@media (max-width: 900px) {
    .header-inner { gap: 10px; }
    .post-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .cat-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 23px; }
    .hero-sub { font-size: 13px; }
    .section { margin: 22px 0; }
    .section-title { font-size: 17px; }
}

/* 平板竖屏（769~900px）：横向导航瘦身，避免挤压 */
@media (max-width: 900px) and (min-width: 769px) {
    .nav-link, .nav-group-label { padding: 7px 9px; font-size: 13.5px; }
    .nav-search { width: 152px; margin-left: 8px; padding-left: 11px; }
    .nav-search input[type="text"] { font-size: 12.5px; }
    .user-meta small { display: none; }
    .user-box { padding: 3px 10px 3px 3px !important; }
    .user-meta b { max-width: 72px; }
}

/* 手机（≤768px）：右侧滑出抽屉菜单 */
@media (max-width: 768px) {
    :root { --header-h: 56px; }
    .header-inner { flex-wrap: nowrap; min-height: 56px; gap: 10px; }
    .logo { font-size: 17px; gap: 8px; }
    .logo::before { width: 23px; height: 23px; border-radius: 7px; }
    .nav-toggle { display: inline-flex; flex-shrink: 0; }

    /* 抽屉本体：从右侧滑入，占满屏高 */
    .nav {
        position: fixed; top: 0; right: 0; bottom: 0; left: auto;
        margin: 0; padding: 0;
        width: min(330px, 86vw);
        display: flex; flex-direction: column; align-items: stretch;
        background: #fff;
        border-left: 1px solid var(--border);
        box-shadow: -20px 0 50px -24px rgba(24, 24, 44, .45);
        transform: translateX(102%);
        transition: transform .3s cubic-bezier(.32, .72, 0, 1);
        z-index: 120;
        overflow: hidden;
    }
    .nav.open { transform: none; }

    .nav-head {
        display: flex; align-items: center; justify-content: space-between;
        padding: 13px 16px; border-bottom: 1px solid var(--border);
        flex-shrink: 0; order: 0;
    }
    .nav-head-title { font-size: 15px; font-weight: 700; color: var(--text); }

    .nav-links {
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 8px 12px 10px; order: 2;
        flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .nav-links > .nav-link, .nav-links > .nav-group { width: 100%; }
    .nav-link {
        display: flex; align-items: center; width: 100%;
        padding: 12px 14px; font-size: 15px; border-radius: 9px;
    }
    .nav-link.active::after {
        left: 4px; top: 50%; bottom: auto;
        width: 3px; height: 16px; margin: -8px 0 0; border-radius: 3px;
    }
    .nav-group { margin: 0; }
    .nav-group-label {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; padding: 12px 14px; font-size: 15px; border-radius: 9px;
    }
    .nav-group.open .nav-group-label { background: var(--theme-soft); color: var(--theme); }
    .nav-drop {
        position: static; display: none;
        opacity: 1; visibility: visible; transform: none;
        min-width: 0; margin: 2px 0 6px 14px; padding: 2px 0 2px 12px;
        background: transparent; border: none; border-left: 1px dashed rgba(119, 119, 119, .28);
        border-radius: 0; box-shadow: none;
    }
    .nav-drop::before { display: none; }
    .nav-group.open .nav-drop { display: block; }
    .nav-drop a { padding: 10px 12px; font-size: 14px; border-radius: 8px; white-space: normal; }
    .nav-drop a:hover { padding-left: 12px; }
    .nav-group.open .nav-caret { transform: rotate(180deg); }

    .nav-search {
        width: auto; margin: 12px 16px 4px; padding: 4px 4px 4px 16px;
        background: #f4f5f9; flex-shrink: 0; order: 1;
    }
    .nav-search input[type="text"] { font-size: 15px; padding: 7px 0; }
    .nav-search button { width: 34px; height: 34px; }

    .user-box {
        width: auto; margin: 0 16px 12px; order: 3;
        padding: 10px 14px 10px 10px !important;
        background: #f7f7fb; border-radius: 12px; flex-shrink: 0;
    }
    .user-avatar { width: 32px; height: 32px; font-size: 14px; }
    .user-meta b { font-size: 13.5px; max-width: none; }
    .user-meta small { font-size: 11px; }

    /* 抽屉页脚 */
    .nav-foot {
        display: flex; align-items: center; justify-content: space-between;
        order: 4; flex-shrink: 0;
        margin-top: auto; padding: 12px 18px 16px;
        border-top: 1px solid var(--border);
        font-size: 12px; color: var(--muted-2);
    }
    .nav-foot a { color: var(--muted-2); }
    .nav-foot a:hover { color: var(--theme); }

    /* 遮罩 */
    .nav-mask {
        display: block; position: fixed; inset: 0; z-index: 110;
        background: rgba(20, 20, 34, .42);
        -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
        opacity: 0; visibility: hidden;
        transition: opacity .3s ease, visibility .3s;
    }
    .nav-mask.show { opacity: 1; visibility: visible; }
    body.nav-open { overflow: hidden; }

    /* Hero 手机上收窄 */
    .hero-inner { padding: 32px 14px 28px; }
    .hero-title { font-size: 20px; }
    .hero-sub { font-size: 12.5px; margin-bottom: 16px; }
    .hero-search { padding: 5px 5px 5px 14px; border-radius: 10px; }
    .hero-search input[type="text"] { font-size: 16px; }
    .hero-search button { padding: 9px 18px; font-size: 13px; }
    .hot-words { gap: 6px; }
    .hero-stats { font-size: 11.5px; }
    main { padding: 16px 12px 26px; }
    .article-head h1 { font-size: 21px; }
    .post-title { font-size: 14px; min-height: 42px; }
}

/* 手机（≤600px）细节 */
@media (max-width: 600px) {
    .post-grid { gap: 12px; }
    .card { padding: 16px; margin-bottom: 14px; }
    .card h1 { font-size: 19px; }
    .card h2 { font-size: 16px; }
    .btn { padding: 10px 20px; font-size: 15px; }
    .btn-block { display: block; }
    .form-row input, select, textarea,
    .sidebar input[type="search"] { font-size: 16px; }
    .chip { padding: 6px 13px; font-size: 13px; }
    .auth-box { padding: 24px 18px; }
    .message-box { padding: 28px 20px; }
    .comment-head .del-link { margin-left: 0; }
    .filter-box { line-height: 2; }
    .table th, .table td { padding: 9px 10px; font-size: 13px; }
    .table .btn-ghost { padding: 6px 10px; font-size: 13px; }
    /* 个人中心：手机上资料卡按钮换行、选项卡收紧 */
    .profile-head { gap: 12px; }
    .profile-head > .btn { width: 100%; margin-left: 0; text-align: center; }
    .profile-avatar { width: 60px; height: 60px; font-size: 24px; }
    .profile-main h1 { font-size: 18px; }
    .user-tabs a { padding: 9px 12px; font-size: 13px; }
    .site-footer { padding: 20px 0; }
    .admin-menu { grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0 2px; }
    .admin-menu-item { padding: 12px 6px; font-size: 14px; }
    .post-body { padding: 11px 12px 10px; }
    .post-cat { font-size: 11px; padding: 5px 9px; }
    .cat-block-head { padding: 15px 16px; }
    .cat-block-head h3 { font-size: 16px; }
    .cat-row { font-size: 13px; padding: 8px 10px; }
}

/* 小屏手机（≤520px）：文章卡片改单列，避免标题挤压 */
@media (max-width: 520px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-thumb { aspect-ratio: 16 / 9; }
}

/* 小屏手机（≤480px） */
@media (max-width: 480px) {
    .logo { font-size: 16px; }
    .hero-title { font-size: 18px; }
    .section-title { font-size: 16px; }
    .footer-nav { gap: 10px 30px; }
    .card form[style*="inline-block"] { display: block !important; margin: 0 0 10px !important; }
    .card form[style*="inline-block"] .btn { width: 100%; }
}

/* 无动画偏好 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .card, .btn, .to-top, .nav-toggle span, .post-card, .post-thumb img { transition: none; }
}
