/* ==========================================================================
   青木文摘 - 前台样式（淡绿主题 / 响应式 / 支持暗色模式）
   ========================================================================== */

:root {
    --brand: #4c9a6a;
    --brand-dark: #3d7d55;
    --brand-light: #eef6f0;
    --brand-soft: #dcecdf;

    --text: #1f2933;
    --text-2: #5c6b7a;
    --text-3: #93a1ae;

    --bg: #f7f9f7;
    --card: #ffffff;
    --border: #e7ece8;
    --border-strong: #d6ded8;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(31, 41, 51, .04), 0 4px 16px rgba(31, 41, 51, .04);
    --shadow-hover: 0 2px 8px rgba(31, 41, 51, .06), 0 12px 28px rgba(31, 41, 51, .08);

    --max-width: 1180px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html[data-theme="dark"] {
    --brand: #5fbb81;
    --brand-dark: #4c9a6a;
    --brand-light: #1e2a23;
    --brand-soft: #24352b;

    --text: #e6ebef;
    --text-2: #a4b0ba;
    --text-3: #78838d;

    --bg: #131619;
    --card: #1b1f23;
    --border: #2a3036;
    --border-strong: #363d44;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 8px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background .2s ease, color .2s ease;
}

a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }

/* ---------- 顶部导航 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 用 min-height 而不是 height：导航在窄屏会换行，写死高度会把第二行挤出去 */
    min-height: 64px;
    height: auto;
    padding: 6px 20px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .3px;
    flex-shrink: 0;
}

.logo .mark {
    height: 40px;
    border-radius: 9px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
}

.logo img.mark { object-fit: cover; }

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    /* 放不下就换行，不要横向滚动 */
    flex-wrap: wrap;
    /* ⚠️ 必须是 visible（这一条的由来）：
       overflow 只要取了非 visible 的值（哪怕只写 overflow-x: auto），
       就会把绝对定位的 `.nav-item .sub` 下拉面板**整块裁掉**，
       表现是「一级栏目 hover 了，但子栏目一个都出不来」——
       而且是静默的，控制台没有任何报错，DOM 里节点也确确实实在。
       原来这里是 overflow-x: auto（想给窄屏兜底），代价就是下拉菜单永久失效。 */
    overflow: visible;
}

.nav a {
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    color: var(--text-2);
    white-space: nowrap;
}
.nav a:hover { background: var(--brand-light); color: var(--brand-dark); }
.nav a.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 500; }

.nav-item { position: relative; }
.nav-item .sub {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all .18s ease;
    /* 面板要盖在 sticky 页头之上，否则会藏进 header 的层叠里 */
    z-index: 60;
}
/* 展开态停在 translateY(0)（不是 4px）：留空隙的话，鼠标从一级项往下移的
   途中会经过一条「既不在父项、也不在面板」的真空带，hover 断开 → 面板一闪即收。 */
.nav-item:hover .sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-item .sub a { display: block; }
/* 双保险：面板上方 10px 铺一块透明接收区，鼠标斜着进来也不会丢 hover */
.nav-item .sub::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}
.nav-item:hover > a { background: var(--brand-light); color: var(--brand-dark); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: all .15s ease;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

.search-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    height: 36px;
    width: 190px;
    transition: border-color .15s ease;
}
.search-mini:focus-within { border-color: var(--brand); }
.search-mini input {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    width: 100%;
    font-family: var(--font);
}

/* ---------- 主体布局 ---------- */
.main { padding: 28px 0 56px; }

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 20px;
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-title .bar {
    display: inline-block;
    width: 3px;
    height: 15px;
    background: var(--brand);
    border-radius: 2px;
    margin-right: 9px;
    vertical-align: -2px;
}

/* ---------- Hero / 轮播 ---------- */
.hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 22px;
    border: 1px solid var(--border);
    background: var(--card);
}

.hero-slide {
    display: none;
    min-height: 210px;
    background: linear-gradient(120deg, var(--brand-light), var(--card) 65%);
    flex-direction: column;
    justify-content: center;
}
.hero-slide.active { display: flex; }

.hero-slide p { margin: 0 0 18px; color: var(--text-2); font-size: 15px; max-width: 620px; }

.hero-dots { position: absolute; right: 20px; bottom: 16px; display: flex; gap: 6px;z-index:1; }
.hero-dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--border-strong); cursor: pointer; transition: all .2s ease;
}
.hero-dots span.active { background: var(--brand); width: 18px; border-radius: 4px; }

/* ---------- 文章卡片 ---------- */
.post-list { display: flex; flex-direction: column; gap: 16px; }

.post {
    display: flex;
    gap: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all .2s ease;
}
.post:hover { box-shadow: var(--shadow-hover); border-color: var(--brand-soft); transform: translateY(-2px); }

.post-cover {
    width: 200px;
    height: 128px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--brand-light);
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover.placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--brand); font-size: 26px; font-weight: 600;
    background: linear-gradient(135deg, var(--brand-light), var(--brand-soft));
}

.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.post-title {
    font-size: 17.5px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-excerpt {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-3);
    margin-top: auto;
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

.tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12.5px;
    background: var(--brand-light);
    color: var(--brand-dark);
    transition: all .15s ease;
}
.tag:hover { background: var(--brand); color: #fff; }

.badge-top {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 5px;
    font-size: 12px;
    background: #fdf0e3;
    color: #b4671c;
    font-weight: 500;
}
html[data-theme="dark"] .badge-top { background: #3a2a15; color: #e0a45c; }

.badge-rec {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 5px;
    font-size: 12px;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 500;
}

/* ---------- 推荐区（网格） ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.mini-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: all .2s ease;
}
.mini-card:hover { border-color: var(--brand-soft); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.mini-card h3 {
    margin: 0 0 8px;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mini-card p {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 侧边栏 ---------- */
.sidebar .card { padding: 20px; }

.side-list li {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
    align-items: baseline;
}
.side-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.side-list .num {
    width: 19px; height: 19px; flex-shrink: 0;
    border-radius: 6px;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 11.5px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.side-list li:nth-child(1) .num { background: #e8503a; color: #fff; }
.side-list li:nth-child(2) .num { background: #ed8b2e; color: #fff; }
.side-list li:nth-child(3) .num { background: #e5b32a; color: #fff; }
.side-list .txt {
    flex: 1; min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 13px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-2);
}
.tag-cloud a:hover { background: var(--brand-light); border-color: var(--brand-soft); color: var(--brand-dark); }
.tag-cloud .count { font-size: 11px; opacity: .6; margin-left: 3px; }

.comment-mini li { padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.comment-mini li:last-child { border-bottom: 0; }
.comment-mini .who { color: var(--brand-dark); font-weight: 500; }
.comment-mini .what {
    color: var(--text-2);
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 文章详情 ---------- */
.article-head { margin-bottom: 26px; }
.article-head h1 { font-size: 30px; font-weight: 600; line-height: 1.45; margin: 0 0 16px; }
.article-meta {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    font-size: 13.5px; color: var(--text-3);
}
.article-meta .author { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.article-meta .author img { width: 28px; height: 28px; border-radius: 50%; }

.article-body {
    font-size: 16px;
    line-height: 1.95;
    color: var(--text);
    word-wrap: break-word;
}
.article-body h2 {
    font-size: 21px; font-weight: 600; margin: 34px 0 14px;
    padding-left: 12px; border-left: 4px solid var(--brand); line-height: 1.5;
}
.article-body h3 { font-size: 18px; font-weight: 600; margin: 26px 0 12px; }
.article-body p { margin: 0 0 17px; }
.article-body ul, .article-body ol { margin: 0 0 17px; padding-left: 24px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 7px; }
.article-body blockquote {
    margin: 0 0 17px;
    padding: 12px 18px;
    border-left: 3px solid var(--brand);
    background: var(--brand-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-2);
}
.article-body img { border-radius: var(--radius); margin: 8px 0; }
.article-body a { color: var(--brand-dark); border-bottom: 1px solid var(--brand-soft); }
.article-body code {
    font-family: var(--mono);
    font-size: .88em;
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: 2px 6px;
    border-radius: 5px;
}
.article-body pre {
    background: #1e2429;
    color: #dfe6ea;
    padding: 16px 18px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.7;
}
.article-body pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }
.article-body table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14.5px; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.article-body th { background: var(--brand-light); font-weight: 600; }

.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0; }

.article-actions {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 22px 0; margin: 26px 0 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.like-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 26px;
    border-radius: 30px;
    border: 1px solid var(--border-strong);
    background: var(--card);
    color: var(--text-2);
    font-size: 14.5px;
    font-family: var(--font);
    cursor: pointer;
    transition: all .18s ease;
}
.like-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.like-btn.liked { background: var(--brand); border-color: var(--brand); color: #fff; }

.neighbor {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px; margin-top: 20px;
}
.neighbor a {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    font-size: 14px;
    transition: all .18s ease;
}
.neighbor a:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.neighbor .label { font-size: 12.5px; color: var(--text-3); display: block; margin-bottom: 5px; }
.neighbor .title {
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden; font-weight: 500;
}
.neighbor .next { text-align: right; }

/* ---------- 评论 ---------- */
.comment-head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.comment-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.comment-head .count { color: var(--brand); font-size: 15px; }

.comment-form { margin-bottom: 28px; }
.comment-form .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }

.input, .textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    font-size: 14px;
    color: var(--text);
    font-family: var(--font);
    outline: 0;
    transition: border-color .15s ease, background .15s ease;
}
.input:focus, .textarea:focus { border-color: var(--brand); background: var(--card); }
.textarea { min-height: 104px; resize: vertical; line-height: 1.7; }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
/* 验证码是滑动拼图时，让验证码块竖排占位，提交按钮靠右下对齐 */
.form-foot.has-slider { align-items: flex-end; }
.form-foot.has-slider .captcha-box { flex-direction: column; align-items: flex-start; gap: 6px; }
.captcha-box { display: flex; align-items: center; gap: 9px; }
.captcha-box img {
    height: 38px; border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid var(--border); background: var(--card);
}
.captcha-box .input { width: 110px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--brand);
    color: #fff;
    font-size: 14.5px;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s ease;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: var(--card); border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--card); }

.form-tip { font-size: 12.5px; color: var(--text-3); }

.comment-list { display: flex; flex-direction: column; gap: 4px; }

.comment {
    display: flex; gap: 13px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: 0; }
.comment .avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.comment .body { flex: 1; min-width: 0; }
.comment .top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; flex-wrap: wrap; }
.comment .name { font-weight: 500; font-size: 14.5px; }
.comment .time { font-size: 12.5px; color: var(--text-3); }
/* IP 归属地：脱敏 IP + 「来自XX的网友」。
   刻意做得比时间更淡 —— 它是补充信息，不该跟昵称抢视线。 */
.comment .from { font-size: 12.5px; color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; }
.comment .from .ip { font-family: ui-monospace, Menlo, Consolas, monospace; }
.comment .from .region { opacity: .82; }
.comment .admin-tag {
    font-size: 11.5px; padding: 1px 7px; border-radius: 4px;
    background: var(--brand); color: #fff;
}
.comment .reply-to { font-size: 12.5px; color: var(--text-3); }
.comment .content { font-size: 14.5px; line-height: 1.75; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.comment .ops { display: flex; align-items: center; gap: 16px; margin-top: 9px; font-size: 13px; color: var(--text-3); }
.comment .ops button {
    border: 0; background: none; color: inherit; cursor: pointer;
    font-size: 13px; font-family: var(--font); padding: 0;
    display: inline-flex; align-items: center; gap: 5px;
}
.comment .ops button:hover { color: var(--brand); }
.comment .ops button.on { color: var(--brand); }

.comment-children {
    margin-top: 14px;
    padding-left: 16px;
    border-left: 2px solid var(--brand-light);
    display: flex; flex-direction: column; gap: 14px;
}
.comment-children .comment { padding: 0; border-bottom: 0; }
.comment-children .avatar { width: 32px; height: 32px; }

.reply-box { margin-top: 12px; }
.reply-box .textarea { min-height: 74px; }

.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-3);
    font-size: 14px;
}
.empty .icon { font-size: 32px; margin-bottom: 10px; opacity: .5; }

/* ---------- 面包屑 / 页头 ---------- */
.crumb { font-size: 13.5px; color: var(--text-3); margin-bottom: 16px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.crumb a:hover { color: var(--brand); }

.page-head {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 24px;
    margin-bottom: 20px;
}
.page-head h1 { margin: 0 0 8px; font-size: 24px; font-weight: 600; }
.page-head p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- 搜索筛选 ---------- */
.filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter .input, .filter select {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: 0;
}
.filter select { cursor: pointer; }
.filter .input { width: auto; min-width: 180px; }

/* ---------- 页脚 ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--card);
    padding: 34px 0 28px;
    margin-top: 20px;
}
.footer-grid { display: grid; grid-template-columns:1fr 1fr; gap: 30px; margin-bottom: 26px; }
.footer-grid h4 { font-size: 14.5px; font-weight: 600; margin: 0 0 14px; }
.footer-grid p { font-size: 13.5px; color: var(--text-2); margin: 0; line-height: 1.8; }
.footer-grid ul li { margin: 5px;display: inline-block;}
.footer-grid ul a { font-size: 13.5px; color: var(--text-2); }
.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-3);
}

.to-top {
    position: fixed;
    /* 紧贴 .wrap 右边：把按钮**左边缘**放在「容器右边缘 + 12px」处，
       所以右偏移要减掉自身宽度（42px）。
       .wrap 是 max-width:1180px + margin:auto，左右边缘在 50% ± (--max-width/2)，
       于是 right = 50% - --max-width/2 - 12px - 42px。
       外面套 max(16px, …) 是窄屏兜底：视口不够宽时退回贴屏幕右边，
       不跑到屏幕外面去。整个过程是纯 CSS 计算，缩放窗口自动跟随。 */
    right: max(16px, calc(50% - var(--max-width) / 2 - 12px - 42px));
    bottom: 30px;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--card); border: 1px solid var(--border);
    color: var(--text-2); display: none;
    align-items: center; justify-content: center;
    cursor: pointer; box-shadow: var(--shadow); z-index: 40;
}
.to-top.show { display: flex; }
.to-top:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
    .layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .wrap { padding: 0 15px; }
    .site-header .inner { min-height: 58px; padding: 6px 15px; gap: 12px; }
    .search-mini { display: none; }
    /* 窄屏不再让导航横向滚动（那会裁掉下拉菜单），改为换行 + 收紧间距 */
    .nav { gap: 2px; }
    .nav a { padding: 6px 9px; font-size: 13.5px; }
    .main { padding: 18px 0 40px; }
    .hero-slide { padding: 26px 22px; min-height: 170px; }
    .hero-slide h1 { font-size: 21px; }
    .post { flex-direction: column; padding: 16px; gap: 12px; }
    .post-cover { width: 100%; height: 172px; }
    .post-title { font-size: 16.5px; }
    .grid-2 { grid-template-columns: 1fr; }
    .card { padding: 18px; border-radius: var(--radius); }
    .article-head h1 { font-size: 23px; }
    .article-body { font-size: 15.5px; line-height: 1.85; }
    .neighbor { grid-template-columns: 1fr; }
    .comment-form .row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    .to-top { right: 16px; bottom: 20px; }
}

/* ==========================================================================
   小门户版式（首页 / 顶栏 / 焦点区 / 分类板块 / 榜单）
   说明：本区块只做「新增 + 覆盖」，不改动上面的既有规则，
        所以详情页、分类页那些老版式不受影响。
   ========================================================================== */

/* ---------- 顶栏 ---------- */
.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-3);
}
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; height: 34px;
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.tb-right { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.tb-right a { color: var(--text-3); }
.tb-right a:hover { color: var(--brand); }
.tb-right .tb-admin { color: var(--brand); }
.tb-right .tb-user { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.tb-right .tb-user img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.tb-right .tb-user:hover { color: var(--brand); }

/* ---------- 焦点区 ---------- */
.focus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    margin-bottom: 22px;
    align-items: stretch;
}

.focus .hero {
    margin-bottom: 0;
    flex:1;
    border-radius: var(--radius-lg);
    position: relative;
    display: flex;
    box-shadow: var(--shadow);
}
#sec-latest{width: 100%;}.tuiimg {
    width: 100%;
}
.hero-slide {
    position: relative;
    display: none;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
    background-size: cover;
    background-position: center;
}
.hero-inner img {
    width: 100%;
    height: 250px;
}
.hero-text {
    padding: 10px 20px;
    width: 100%;
    position: absolute;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.5);
}
.hero-slide.active { display: flex; }

/* 左侧压一层暗角，保证白字在任何配色上都够清晰 */
.hero-slide::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(100deg, rgba(15, 26, 20, .34), rgba(15, 26, 20, .04) 62%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 520px; }
.hero-slide h1 { font-size: 16px;margin: 0;  line-height: 1.4; color: #fff;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; }
.hero-slide p { margin: 0 0 18px; font-size: 14.5px; color: rgba(255, 255, 255, .88); max-width: 460px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}


/* 右侧头条 */
.focus-side {
    display: flex; flex-direction: column; min-height: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px 12px;
    box-shadow: var(--shadow);
}
.focus-side-head {
    margin: 20px 0;display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.focus-side-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.focus-side-head a { font-size: 12.5px; color: var(--text-3); }
.focus-side-head a:hover { color: var(--brand); }

.headline-list { flex: 1; min-height: 0; overflow: hidden; }
.headline-list li { border-bottom: 1px dashed var(--border); }
.headline-list li:last-child { border-bottom: 0; }
.headline-list a { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; }
.headline-list .hnum {
    flex-shrink: 0; margin-top: 2px;
    width: 18px; height: 18px; border-radius: 5px;
    display: grid; place-items: center;
    font-size: 11.5px; font-style: normal;
    background: var(--bg); color: var(--text-3);
}
.headline-list .hnum.hot { background: var(--brand); color: #fff; }
.headline-list .htxt {
    font-size: 14px; line-height: 1.55;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.headline-list a:hover .htxt { color: var(--brand); }

/* ---------- 主列 / 面板 ---------- */
.col-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px 20px;
    box-shadow: var(--shadow);
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding-bottom: 12px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.panel-head h3 {
    margin: 0; font-size: 16.5px; font-weight: 600;
    display: flex; align-items: center; gap: 9px;
}
.panel-head .bar {
    display: inline-block; width: 4px; height: 16px;
    border-radius: 2px; background: var(--brand);
}
.panel-head .more { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.panel-head .more:hover { color: var(--brand); }

/* ---------- 渐变封面（没有配图时用，零请求） ---------- */
.cover {
    display: block; position: relative; overflow: hidden;
    border-radius: var(--radius);
    background-size: cover; background-position: center;
}
.cover em {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 20px 11px 8px;
    font-style: normal; font-size: 12px; letter-spacing: .5px;
    color: #fff; text-align: left;
    background: linear-gradient(to top, rgba(12, 22, 16, .42), rgba(12, 22, 16, 0));
}

/* ---------- 编辑推荐 ---------- */
.reco-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.reco-card {
    display: block; overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .18s ease;
}
.reco-card:hover { border-color: var(--brand-soft); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.reco-card .cover { height: 106px; border-radius: 0; }
.reco-card h4 {
    margin: 12px 14px 6px; font-size: 15px; font-weight: 600; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.reco-card:hover h4 { color: var(--brand); }
.reco-card p {
    margin: 0 14px 14px; font-size: 13px; line-height: 1.6; color: var(--text-3);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 分类板块 ---------- */
.sec-body { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: 22px; }
.sec-lead { display: block; }
.sec-lead .cover { height: 150px; margin-bottom: 11px; }
.sec-lead h4 {
    margin: 0 0 7px; font-size: 16px; font-weight: 600; line-height: 1.45;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
}
.sec-lead:hover h4 { color: var(--brand); }
.sec-lead p {
    margin: 0 0 9px; font-size: 13px; line-height: 1.65; color: var(--text-3);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sec-meta { font-size: 12.5px; color: var(--text-3); }

.sec-list li {
    display: flex; align-items: center; gap: 14px;
    padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.sec-list li:last-child { border-bottom: 0; }
.sec-list a {
    flex: 1; min-width: 0; font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sec-list .t { flex-shrink: 0; font-size: 12.5px; color: var(--text-3); }
.sec-list li:hover a { color: var(--brand); }

/* ---------- 侧栏榜单 ---------- */
.rank-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.rank-list li:last-child { border-bottom: 0; }
.rank-list .rk {
    flex-shrink: 0;
    width: 18px; height: 18px; border-radius: 5px;
    display: grid; place-items: center;
    font-size: 11.5px;
    background: var(--bg); color: var(--text-3);
}
.rank-list .rk.top { background: var(--brand); color: #fff; }
.rank-list a {
    flex: 1; min-width: 0; font-size: 13.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-list .rv { flex-shrink: 0; font-size: 12px; color: var(--text-3); }

/* 侧栏卡片：统一白底（原来 .sidebar .card 是透明，门户感更强） */
.sidebar .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.sidebar { display: flex; flex-direction: column; }

/* ---------- 首页最新发布：封面用渐变块 ---------- */
.post-list .post-cover {
    width: 152px;
    height: 98px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background-size: cover;
    background-position: center;
}
.post-list .post-cover em {
    font-style: normal; font-size: 26px; font-weight: 500;
    color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}

/* ---------- 门户版式的响应式 ---------- */
@media (max-width: 1000px) {
    .focus { grid-template-columns: minmax(0, 1fr); }
    .sec-body { grid-template-columns: minmax(0, 1fr); }
    .sec-lead .cover { height: 176px; }
}

@media (max-width: 720px) {
    .topbar-inner { height: auto; padding: 7px 0; flex-wrap: wrap; }
    .tb-sub, .tb-dot { display: none; }
    .hero-slide { padding: 26px 22px; min-height: 200px; }
    .hero-slide h1 { font-size: 21px; }
    .reco-grid { grid-template-columns: minmax(0, 1fr); }
    .panel { padding: 16px; border-radius: var(--radius); }
    .headline-list a { padding: 8px 0; }
    .post-list .post-cover { width: 100%; height: 168px; }
}

/* ---------- 分类板块：只有一篇内容时的单栏排布 ---------- */
.sec-body.solo { grid-template-columns: minmax(0, 1fr); }
.sec-body.solo .sec-lead {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.sec-body.solo .sec-lead .cover { height: 172px; margin-bottom: 0; }
.sec-body.solo .sec-lead h4 { font-size: 17px; }
.sec-body.solo .sec-lead p { -webkit-line-clamp: 3; }

/* ---------- 封面装饰：两个半透明圆，纯 CSS，零请求 ---------- */
.cover::before,
.cover::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    z-index: 1;
}
.cover::before {
    right: -20px; top: -20px;
    width: 78px; height: 78px;
    background: rgba(255, 255, 255, .13);
}
.cover::after {
    left: -16px; bottom: -26px;
    width: 62px; height: 62px;
    background: rgba(255, 255, 255, .09);
}
.cover em { z-index: 2; }

/* 最新发布的封面再收一点，列表更紧凑 */
.post-list .post-cover { width: 138px; height: 92px; }

/* ==========================================================================
   广告位
   每个广告都带 .ad-flag「广告」角标（可识别，符合《广告法》要求）。
   数据来自 AdService：全站一次查询 + 内存分组，缓存命中时 0 次数据库查询。
   ========================================================================== */
.ad-slot { margin-bottom: 18px; }
.ad-slot-header { margin: 14px auto 0; }
.ad-slot-index-top { margin: -4px 0 20px; }
.ad-slot-article-top { margin: 0 0 20px; }
.ad-slot-article-bottom { margin: 24px 0 4px; }
.ad-slot-sidebar { display: flex; flex-direction: column; gap: 12px; }

.ad-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* ---- 文字广告 ---- */
.ad-txt {
    display: block;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #f3f8f4 0%, #eef4fa 100%);
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.65;
}
html[data-theme="dark"] .ad-txt {
    background: linear-gradient(135deg, #1c2620 0%, #1a222b 100%);
}
.ad-txt a { color: var(--text); text-decoration: none; }
.ad-txt a:hover { color: var(--brand-dark); }

/* ---- 图片广告 ---- */
.ad-img { display: block; line-height: 0; text-align: center; background: var(--card); }
.ad-img img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius-sm);
}

.ad-slot-sidebar .ad-txt { padding: 10px 12px; font-size: 13px; }

/* ---- 「广告」角标 ---- */
.ad-flag {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(31, 41, 51, .4);
    color: #fff;
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: .5px;
    pointer-events: none;
}

/* ---- 漂浮广告（可拖动 / 可关闭） ---- */
.ad-floats { position: relative; z-index: 60; }

.ad-float {
    position: fixed;
    z-index: 60;
    max-width: 250px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 10px 34px rgba(24, 34, 44, .18);
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.6;
    cursor: grab;
    touch-action: none;
    transition: box-shadow .2s ease;
}
.ad-float.dragging { cursor: grabbing; box-shadow: 0 18px 46px rgba(24, 34, 44, .28); }
.ad-float a { color: var(--text); text-decoration: none; }
.ad-float a:hover { color: var(--brand-dark); }
.ad-float img { display: block; max-width: 100%; border-radius: 8px; }

.ad-float-left   { left: 16px;  top: 50%; transform: translateY(-50%); }
.ad-float-right  { right: 16px; top: 50%; transform: translateY(-50%); }
.ad-float-bottom { right: 16px; bottom: 28px; }

.ad-float-close {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 20px;
    height: 20px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #9aa7b4;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity .18s ease, background .18s ease;
}
.ad-float:hover .ad-float-close { opacity: 1; }
.ad-float-close:hover { background: #c0453c; }

@media (max-width: 900px) {
    /* 小屏左右漂浮会挡住正文，只保留右下角 */
    .ad-float-left, .ad-float-right { display: none; }
    .ad-float { max-width: 190px; font-size: 12.5px; }
}

/* ==========================================================================
   通用原子类（前台多处复用，之前散落在各视图里没有定义）
   ========================================================================== */
.small { font-size: 12.5px; }
.up   { color: #c0453c; }          /* 加分（红涨绿跌的另一场景，这里只是「正向」提示色） */
.down { color: var(--brand); }

/* ---- 徽标 ---- */
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.7;
    white-space: nowrap;
}
.badge-green { background: var(--brand-soft); color: var(--brand-dark); }
.badge-amber { background: #fdf3e2; color: #a9711a; }
.badge-gray  { background: #eef1f3; color: var(--text-3); }
html[data-theme="dark"] .badge-green { background: #24352b; color: #7fca9c; }
html[data-theme="dark"] .badge-amber { background: #33280f; color: #e0a45c; }
html[data-theme="dark"] .badge-gray  { background: #262c32; color: var(--text-3); }

/* ---- 链接式按钮 ---- */
.btn-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-size: 13.5px;
    font-family: var(--font);
    cursor: pointer;
}
.btn-link:hover { color: var(--brand-dark); text-decoration: underline; }
.btn-link.danger { color: #c0453c; }
.btn-link.danger:hover { color: #9c3229; }

.btn-block { width: 100%; }
.btn.is-loading { opacity: .7; pointer-events: none; }

/* ---- 提示条 ---- */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.7;
    margin-bottom: 16px;
}
.alert-error { background: #fdeceb; color: #a83228; border: 1px solid #f6d2ce; }
.alert-ok    { background: var(--brand-light); color: var(--brand-dark); border: 1px solid var(--brand-soft); }
html[data-theme="dark"] .alert-error { background: #33201d; color: #e78b81; border-color: #4a2c28; }
html[data-theme="dark"] .alert-ok    { background: #1e2a23; color: #7fca9c; border-color: #2c4437; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
table.list td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: var(--brand-light); }
.ops { display: flex; gap: 10px; align-items: center; }

/* ---- 空状态 ---- */
.empty-tip { padding: 30px 0; text-align: center; color: var(--text-3); font-size: 14px; }
.empty-tip a { color: var(--brand); }

/* ==========================================================================
   表单（登录 / 注册 / 投稿共用）
   ========================================================================== */
.form-row { margin-bottom: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.label {
    display: block;
    margin-bottom: 6px;
    font-size: 13.5px;
    color: var(--text-2);
    font-weight: 500;
}
.label .req { color: #c0453c; font-style: normal; }
select.input { appearance: none; background-image: none; cursor: pointer; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.counter { margin-top: 6px; text-align: right; font-size: 12.5px; color: var(--text-3); }

.cap-inline { display: flex; gap: 10px; align-items: center; }
.cap-inline img {
    width: 132px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
}

/* ==========================================================================
   用户中心
   ========================================================================== */
.user-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.user-nav { position: sticky; top: 16px; }

.un-card {
    padding: 20px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    text-align: center;
    margin-bottom: 14px;
}
.un-avatar { width: 68px; height: 68px; margin: 0 auto 10px; }
.un-avatar img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-soft);
}
.un-name { font-size: 15.5px; font-weight: 600; }
.un-account { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.un-points { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.un-points b { color: var(--brand-dark); font-size: 17px; }

.un-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    overflow: hidden;
}
.un-menu a {
    display: block;
    padding: 11px 18px;
    font-size: 14px;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
}
.un-menu a:last-child { border-bottom: 0; }
.un-menu a:hover { background: var(--brand-light); color: var(--brand-dark); }
.un-menu a.active {
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand);
}
.un-menu a.highlight { color: var(--brand); font-weight: 600; }
.un-menu a.muted { color: var(--text-3); }

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

/* ---- 概览数字 ---- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.stat {
    padding: 16px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    text-align: center;
}
.stat b { display: block; font-size: 20px; color: var(--brand-dark); }
.stat span { font-size: 12.5px; color: var(--text-3); }

/* ---- 紧凑列表 ---- */
.mini-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { color: var(--text); }
.mini-list a:hover { color: var(--brand); }
.mini-list .meta { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* ---- 我的评论 ---- */
.my-comments li {
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
}
.my-comments li:last-child { border-bottom: 0; }
.mc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mc-article { font-size: 13.5px; color: var(--text-2); }
.mc-article:hover { color: var(--brand); }
.mc-top .meta { margin-left: auto; font-size: 12.5px; color: var(--text-3); }
.mc-content { margin: 8px 0 6px; font-size: 14.5px; color: var(--text); line-height: 1.75; }
.mc-foot { font-size: 12.5px; }

.point-balance { font-size: 13px; font-weight: 400; color: var(--text-3); }
.point-balance b { color: var(--brand-dark); font-size: 16px; }
.point-rules { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); line-height: 1.9; }

/* ==========================================================================
   登录 / 注册
   ========================================================================== */
.auth-box {
    max-width: 420px;
    margin: 34px auto 60px;
    padding: 30px 28px 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
}
.auth-box h1 { margin: 0 0 6px; font-size: 21px; }
.auth-sub { margin: 0 0 22px; font-size: 13.5px; color: var(--text-3); }
.auth-foot {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13.5px;
    color: var(--text-3);
}
.auth-foot a { color: var(--brand); }
.auth-foot .dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 8px;
    border-radius: 50%;
    background: var(--border-strong);
    vertical-align: middle;
}

/* ==========================================================================
   投稿表单
   ========================================================================== */
.publish-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.publish-tips {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    background: var(--brand-light);
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--text-2);
}
.publish-tips p { margin: 0; }
.publish-tips p + p { margin-top: 4px; }

.cover-input { display: grid; grid-template-columns: minmax(0, 1fr) 108px; gap: 12px; align-items: start; }
.cover-preview {
    display: grid;
    place-items: center;
    width: 108px;
    height: 68px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    overflow: hidden;
    font-size: 12.5px;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   文章访问权限
   ========================================================================== */
.article-locked {
    position: relative;
    max-height: 220px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}

.access-gate {
    margin: 22px 0 4px;
    padding: 26px 22px;
    border: 1px solid var(--brand-soft);
    border-radius: var(--radius-lg);
    background: var(--brand-light);
    text-align: center;
}
.access-gate .ag-icon { font-size: 30px; line-height: 1; color: var(--brand); }
.access-gate .ag-title { margin: 10px 0 6px; font-size: 16.5px; font-weight: 600; }
.access-gate .ag-desc { margin: 0 0 16px; font-size: 13.5px; color: var(--text-2); line-height: 1.8; }
.access-gate .ag-desc b { color: var(--brand-dark); }
.access-gate .ag-tip { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.access-gate .ag-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.access-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
    vertical-align: 2px;
}
.access-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 2px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font-size: 14.5px;
}
.access-download:hover { background: var(--brand-dark); color: #fff; }

/* ---- 窄屏 ---- */
@media (max-width: 860px) {
    .user-layout { grid-template-columns: minmax(0, 1fr); }
    .user-nav { position: static; }
    .un-card { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; }
    .un-avatar { margin: 0; width: 50px; height: 50px; }
    .un-avatar img { width: 50px; height: 50px; }
    .un-points { margin-top: 0; margin-left: auto; }
    .un-menu { display: flex; flex-wrap: wrap; }
    .un-menu a { border-bottom: 0; border-right: 1px solid var(--border); padding: 10px 14px; }
    .un-menu a.active { box-shadow: inset 0 -2px 0 var(--brand); }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .form-row-2 { grid-template-columns: minmax(0, 1fr); }
    .cover-input { grid-template-columns: minmax(0, 1fr) 84px; }
    .cover-preview { width: 84px; height: 56px; }
}

/* ==========================================================================
   文章页 · 下载地址（一篇文章可挂多条）
   ========================================================================== */
.download-box {
    margin: 22px 0 6px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--brand-light);
}
.download-box .dl-head {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 12px; font-size: 15.5px; font-weight: 600;
}
.download-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.dl-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.dl-item:hover { border-color: var(--brand); transform: translateX(2px); }
.dl-item .dl-icon {
    flex: 0 0 22px;
    width: 22px; height: 22px; line-height: 22px; text-align: center;
    border-radius: 50%;
    background: var(--brand); color: #fff; font-size: 13px;
}
.dl-item .dl-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-item .dl-go { font-size: 12.5px; color: var(--brand-dark); }
.dl-tip { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }

/* 评论：已登录时的身份提示条 */
.comment-ident {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-2);
    margin-bottom: 10px;
}
.comment-ident .avatar { width: 26px; height: 26px; border-radius: 50%; }
.comment-ident b { color: var(--brand-dark); }

/* ==========================================================================
   投稿表单 · 富文本编辑器 + 多条下载地址
   ========================================================================== */
.editor-wrap {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--card);
}
.editor-toolbar { border-bottom: 1px solid var(--border); }
#pub-editor { height: 380px; overflow-y: auto; }
@media (max-width: 640px) {
    #pub-editor { height: 280px; }
}

.dl-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.dl-row > .input { margin-bottom: 0; }
@media (max-width: 640px) {
    .dl-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   悬浮快捷导航 + 最新发布紧凑列表（本区块只做「新增 + 覆盖」，不动上面既有规则）
   ========================================================================== */

/* ---------- 首页右侧悬浮分类导航 ----------
   右边缘钉在 .wrap 右边缘 + 12px（与 .to-top 同一套算法）。
   视口不足 1380px 就整个隐藏 —— 这一条是刻意的：
   它宽 84px，若在窄屏硬贴着屏幕右边，就会压到正文/侧栏上，
   而「悬浮按钮挡住内容」比「看不到悬浮按钮」糟糕得多。
   判据：0.5*W + 590 + 12 + 84 ≤ W  →  W ≥ 1372。 */
.cat-rail {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: max(16px, calc(50% - var(--max-width) / 2 - 12px - 84px));
    width: 84px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    box-shadow: var(--shadow);
    z-index: 45;
}

.cat-rail .rail-item {
    display: block;
    padding: 7px 6px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    line-height: 1.35;
    text-align: center;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s ease, color .15s ease;
}
.cat-rail .rail-item:hover { background: var(--brand-light); color: var(--brand-dark); }
/* 「最新发布」是首项，稍微突出一点（它也是页面上最大的板块） */
.cat-rail .rail-item:first-child{
    font-weight: 600;
    color: var(--brand-dark);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding-bottom: 9px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--border);
}

/* 子分类缩进一级，视觉上跟父栏目分组 */
.cat-rail .rail-sub { font-size: 12px; padding: 5px 4px 5px 10px; color: var(--text-3); }
/* 当前所在板块（由 main.js 的滚动监听点亮）。放在 :first-child 之后，
   同特异性下后者生效，保证「最新发布」被选中时也是实心高亮。 */
.cat-rail .rail-item.on,
.cat-rail .rail-item:first-child.on {
    background: var(--brand);
    color: #fff;
    border-bottom-color: transparent;
}

@media (max-width: 1379px) {
    .cat-rail { display: none; }
}

/* ---------- 最新发布：紧凑列表 ----------
   每条：文章栏目 / 30x30 封面 / 标题 / 发布时间（当天红色） */
.latest-list { display: flex; flex-wrap: wrap;}

.latest-item {
    width: 50%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-bottom: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    transition: background .15s ease;
}
.latest-item:last-child { border-bottom: 0; }
.latest-item:hover { background: var(--brand-light); }

.latest-cat {
    flex-shrink: 0;
    width: 66px;
    padding: 2px 0;
    border-radius: 20px;
    font-size: 12px;
    text-align: center;
    background: var(--brand-light);
    color: var(--brand-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.latest-cat:hover { color: var(--brand-dark); background: var(--brand-soft); }

.latest-cover {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
}
.latest-cover img { width: 30px; height: 30px; object-fit: cover; display: block; }
/* 没封面时的渐变占位块（背景色由行内 style 给，见模板） */
.latest-ph {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.latest-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.latest-title a { color: var(--text); }
.latest-title a:hover { color: var(--brand); }
.latest-title .badge-top,
.latest-title .badge-rec,
.latest-title .badge-ad { margin-right: 4px; }

.latest-time {
    flex-shrink: 0;
    font-size: 12.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
/* 当天发布 → 红色。暗色主题下换成亮一档的红，否则在深底上发闷 */
.latest-time.today { color: #d9483f; font-weight: 600; }
html[data-theme="dark"] .latest-time.today { color: #ff8078; }

/* 广告文章的角标（列表里一眼能看出这条是推广） */
.badge-ad {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    background: #fdeaea;
    color: #c0392b;
}
html[data-theme="dark"] .badge-ad { background: #3a1f1c; color: #e88b7f; }

@media (max-width: 720px) {
    .latest-cat { width: 60px; font-size: 11px; }
    .latest-item { gap: 8px; padding: 8px 2px; }
}
