/* ============================================================
   天眼技术社区 - 前台主样式
   设计系统 v2：统一圆角 / 柔和阴影 / 渐变 CTA / 暗色模式
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
    /* 主色：CSDN 蓝 */
    --primary: #25A2F2;
    --primary-600: #1A91E0;
    --primary-700: #1782CC;
    --primary-050: #E8F6FE;
    --primary-100: #D2EEFD;
    --primary-200: #A8DCFB;
    --grad-primary: linear-gradient(#25A2F2, #25A2F2);
    --grad-primary-soft: linear-gradient(#F0F9FF, #E8F6FE);

    /* 语义色 */
    --success: #00a870;
    --success-bg: #e6f7f1;
    --warning: #ed7b2f;
    --warning-bg: #fff4e8;
    --danger: #e34d59;
    --danger-bg: #fdecee;
    --info: #4e6ef2;
    --info-bg: #eef1fd;
    --purple: #7b61ff;
    --gold: #d4a24c;

    /* 中性 */
    --text-1: #262626;
    --text-2: #595959;
    --text-3: #8C8C8C;
    --text-4: #BFBFBF;
    --bg-1: #ffffff;
    --bg-2: #F7F8FA;
    --bg-3: #FAFAFA;
    --bg-4: #F5F5F5;
    --border: #F0F0F0;
    --border-2: #F0F0F0;

    /* 形状 */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 6px;
    --r-lg: 6px;
    --r-xl: 6px;
    --r-full: 999px;

    /* 阴影 */
    --sh-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 4px rgba(0, 0, 0, .04);
    --sh-2: 0 2px 8px rgba(0, 0, 0, .06);
    --sh-3: 0 4px 16px rgba(0, 0, 0, .10);
    --sh-primary: 0 2px 8px rgba(37, 162, 242, .25);

    --header-h: 56px;
    /* 宽屏容器：基线 1200px，随视口阶梯放大，见「3. 布局」区的 min-width 断点 */
    --max-w: 1200px;
    --side-w: 300px;   /* 内容侧栏宽度（栅格化后已不再直接驱动 .col-side） */
    --gap: 20px;       /* 主栏与侧栏间距 */
    --topbar-h: 30px;  /* 顶层黑栏高度 */
    --ease: cubic-bezier(.4, 0, .2, 1);

    /* 历史命名兼容：早期模板里用到的简写变量，统一映射到现行令牌，
       未定义会导致圆角/配色整段失效（出现直角、无色） */
    --radius: var(--r-md);
    --radius-sm: var(--r-sm);
    --radius-lg: var(--r-lg);
    --primary-light: var(--primary-050);
}

html[data-theme="dark"] {
    --primary: #3FB0F5;
    --primary-600: #2EA3EA;
    --primary-700: #1F93D8;
    --primary-050: #14303F;
    --primary-100: #173A4D;
    --primary-200: #1D4A63;
    --grad-primary: linear-gradient(#3FB0F5, #3FB0F5);
    --grad-primary-soft: linear-gradient(135deg, #16222E 0%, #1A2C3A 100%);
    --text-1: #E8EAED;
    --text-2: #B6BCC4;
    --text-3: #8A9099;
    --text-4: #6B7178;
    --bg-1: #1D1F24;   /* 卡片 */
    --bg-2: #17181C;   /* 页面背景 */
    --bg-3: #23262C;
    --bg-4: #2A2D34;
    --border: #2F3238;
    --border-2: #2A2D33;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .3);
    --sh-2: 0 2px 8px rgba(0, 0, 0, .35);
    --sh-3: 0 4px 20px rgba(0, 0, 0, .45);
    --sh-primary: 0 2px 8px rgba(63, 176, 245, .3);
    --success-bg: #10312a;
    --warning-bg: #33240f;
    --danger-bg: #341619;
    --info-bg: #1a2140;
}

/* ---------- 2. 基础重置 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    padding-top: var(--topbar-h);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-1);
    background: var(--bg-2);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--primary); }
img { max-width: 100%; vertical-align: middle; border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.4; }
p { margin: 0 0 12px; }
button, input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
code, pre { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, Monaco, "Courier New", monospace; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--text-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
::-webkit-scrollbar-track { background: transparent; }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0; }
.clearfix::after { content: ''; display: table; clear: both; }

/* ---------- 3. 布局（宽屏优先 + 自适应阶梯） ---------- */
/* 视口阶梯：
   ≥1400px  容器 1360 / 侧栏 320
   ≥1660px  容器 1520 / 侧栏 340
   ≤1100px  侧栏 260 / 间距 16
   ≤1000px  内容侧栏隐藏（左侧导航型侧栏 .col-side-nav 改为置顶通栏）
   ≤768px   双栏纵向堆叠
   ≤640px   隐藏主导航、收紧内边距                                     */
@media (max-width: 1100px) { :root { --side-w: 260px; --gap: 16px; } }

.main { padding: 24px 0 48px; min-height: 62vh; }
.layout-2col { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: start; }
.layout-1col { width: 100%; max-width: 900px; margin: 0 auto; }
.col-main { grid-column: span 9; min-width: 0; }
.col-side { grid-column: span 3; width: auto; min-width: 0; }
/* 左侧导航型侧栏（账号设置 / 绑定 / 私信）：不写死宽度，由栅格自动占前 3 列；
   窄屏不隐藏而是置顶通栏（见下方 ≤1000px 媒体查询） */
.col-side-nav { width: auto; }
.col-side-nav.nav-w240 { width: auto; }
@media (max-width: 1000px) {
    /* 2026 版 CSDN 规范：<992px 侧栏「下沉」到主内容下方，而不是直接隐藏。
       这里不再 display:none，只把左侧导航型侧栏改为通栏置顶。 */
    .col-side.col-side-nav { display: block; width: 100%; margin-bottom: 16px; }
    /* 竖向按钮型导航在窄屏改为横向滑动标签，否则会占掉整屏高度 */
    .col-side.col-side-nav.nav-btnlist .card {
        display: flex; gap: 8px; overflow-x: auto; padding: 10px !important;
        scrollbar-width: none;
    }
    .col-side.col-side-nav.nav-btnlist .card::-webkit-scrollbar { display: none; }
    .col-side.col-side-nav.nav-btnlist .card .btn {
        width: auto; flex-shrink: 0; white-space: nowrap; padding: 6px 14px; font-size: 13px;
        border: 1px solid var(--border) !important; border-radius: var(--r-full) !important;
        background: var(--bg-3) !important;
    }
}
@media (max-width: 640px) {
    .container { padding: 0 12px; }
    .main { padding: 12px 0 30px; }
}
/* 注意：头部 / 导航 / 搜索框 / 卡片等基础规则定义在后面的第 4 节及之后，
   同优先级的响应式覆盖若写在这里会被基础规则反向覆盖而失效，
   因此它们统一放在文件末尾的「响应式收尾」区。 */
/* ---------- 4. 顶部导航 ---------- */
.header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--primary);
    border-bottom: 1px solid var(--primary-600);
}
.header::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: rgba(255, 255, 255, .18);
}
.header .container, .header .header-inner { display: flex; align-items: center; height: var(--header-h); gap: 24px; }
.logo {
    display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700;
    color: #fff; flex-shrink: 0; letter-spacing: -.2px;
}
.logo span { color: #fff; -webkit-text-fill-color: #fff; background: none; -webkit-background-clip: border-box; background-clip: border-box; }
.logo svg { width: 30px; height: 30px; border-radius: 8px; box-shadow: var(--sh-primary); }
.logo-img { height: 32px; max-height: 32px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.logo:hover { color: #fff; }

/* 顶层黑栏 */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    background: #222226; color: #BFBFBF; font-size: 12px; z-index: 1001;
    transition: transform .2s;
}
body.scrolled .topbar { transform: translateY(-100%); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 14px; }
.tb-link { color: #BFBFBF; font-size: 12px; transition: color .2s; }
.tb-link:hover { color: #fff; }
.tb-link-strong { color: #fff; }
.tb-drop { position: relative; }
.tb-drop-menu {
    position: absolute; top: 26px; left: 0; min-width: 140px; background: var(--bg-1);
    border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--sh-3);
    padding: 6px; display: none; z-index: 1002;
}
.tb-drop:hover .tb-drop-menu { display: block; }
.tb-drop-menu a { display: block; padding: 6px 12px; font-size: 13px; color: var(--text-2); border-radius: 4px; }
.tb-drop-menu a:hover { background: var(--bg-3); color: var(--primary); }
.tb-caret {
    display: inline-block; width: 0; height: 0; margin-left: 4px; vertical-align: middle;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; transition: transform .2s;
}
.tb-drop:hover .tb-caret { transform: rotate(180deg); }

.nav { display: flex; gap: 2px; flex: 1; }
.nav a {
    position: relative; padding: 8px 14px; border-radius: 6px;
    color: rgba(255, 255, 255, .88); font-size: 15px; transition: all .2s var(--ease); white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.nav a.active { color: #fff; font-weight: 600; background: rgba(255, 255, 255, .2); }

.header-search { position: relative; width: 280px; margin-left: auto; flex-shrink: 0; }
.header-search input {
    width: 100%; height: 34px; padding: 0 38px 0 14px;
    border: none; border-radius: 6px;
    background: #fff; color: var(--text-1);
    transition: all .2s var(--ease);
}
.header-search input::placeholder { color: var(--text-4); }
.header-search input:focus {
    border-color: transparent; background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .45);
}
.header-search .btn-search {
    position: absolute; right: 5px; top: 5px; width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--text-3); border-radius: 50%;
}
.header-search .btn-search:hover { color: var(--primary); background: var(--primary-050); }
.suggest-box {
    position: absolute; top: 44px; left: 0; right: 0; background: var(--bg-1);
    border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-3);
    max-height: 320px; overflow-y: auto; display: none; z-index: 100; padding: 4px;
}
.suggest-box a { display: block; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; }
.suggest-box a:hover { background: var(--bg-3); }

.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.hr-btn {
    position: relative; display: flex; align-items: center; gap: 4px; color: var(--text-2);
    font-size: 14px; white-space: nowrap; transition: color .18s;
}
.hr-btn:hover { color: var(--primary); }
.btn-write {
    background: var(--grad-primary); color: #fff !important; padding: 7px 16px;
    border-radius: var(--r-full); font-weight: 500; box-shadow: var(--sh-primary);
    transition: all .2s var(--ease);
}
.btn-write:hover { color: #fff !important; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(252, 85, 49, .35); }
.user-menu { position: relative; }
.user-menu .avatar-sm {
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: all .2s;
}
.user-menu:hover .avatar-sm { border-color: var(--primary-200); }
.dropdown {
    position: absolute; right: 0; top: 44px; background: var(--bg-1);
    border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-3);
    min-width: 168px; padding: 6px; display: none; z-index: 100;
}
.user-menu:hover .dropdown { display: block; }
/* 移动端没有 hover，改为点击头像展开（common.js 负责加 .open） */
@media (max-width: 768px) {
    .user-menu.open .dropdown { display: block; }
    .user-menu .avatar-sm { pointer-events: auto; }
}
.dropdown a { display: block; padding: 8px 12px; font-size: 14px; border-radius: var(--r-sm); }
.dropdown a:hover { background: var(--bg-3); color: var(--primary); }
.dropdown .divider { height: 1px; background: var(--border); margin: 6px 4px; }
.badge-dot {
    position: absolute; top: -3px; right: -5px; min-width: 16px; height: 16px;
    background: var(--danger); color: #fff; border-radius: 8px; font-size: 11px;
    line-height: 16px; text-align: center; padding: 0 4px; border: 2px solid var(--bg-1);
}
.theme-toggle {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: rgba(255, 255, 255, .9); font-size: 16px; transition: all .2s;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .15); color: #fff; }

/* ---------- 5. 卡片 / 面板 ---------- */
.card {
    background: var(--bg-1); border-radius: 6px; border: none;
    box-shadow: var(--sh-1); padding: 20px; margin-bottom: 16px;
    transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--sh-3); }
.card-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 16px; font-weight: 600; margin-bottom: 14px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border-2);
}
.card-title::before {
    content: ''; width: 3px; height: 15px; border-radius: 2px;
    background: var(--grad-primary); flex-shrink: 0;
}
/* 标题文字紧跟色条靠左；只有存在「更多」等右侧元素时才把它推到最右。
   注意：文本节点不是元素，:only-child 判断能避免单元素标题被推到右侧 */
.card-title > :last-child:not(:only-child) { margin-left: auto; }
.card-title .more { font-size: 13px; font-weight: 400; color: var(--text-3); }
.card-title .more:hover { color: var(--primary); }
.panel {
    background: var(--bg-1); border-radius: var(--r-lg); box-shadow: var(--sh-1);
    overflow: hidden; margin-bottom: 16px; border: 1px solid var(--border-2);
}
.panel-head {
    padding: 15px 18px; border-bottom: 1px solid var(--border-2);
    display: flex; align-items: center; justify-content: space-between;
}
.panel-head h3 { font-size: 16px; }
.panel-body { padding: 18px; }

/* ---------- 6. 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 8px 18px; border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--bg-1); color: var(--text-1); font-size: 14px;
    transition: all .2s var(--ease);
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary, .btn.primary {
    background: var(--grad-primary); border-color: transparent; color: #fff;
    box-shadow: var(--sh-primary);
}
.btn-primary:hover, .btn.primary:hover {
    color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 162, 242, .32);
}
.btn-danger, .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover, .btn.danger:hover { opacity: .88; color: #fff; }
.btn-lg { padding: 11px 30px; font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
/* 关注/点赞等按钮切换后的「已选中」态（JS 用 classList.add('active')） */
.btn.active {
    background: var(--bg-4); border-color: var(--border); color: var(--text-2);
    box-shadow: none; transform: none;
}
.btn.active:hover { color: var(--text-2); }

.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: var(--r-xs); }
.btn-mini {
    display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px;
    font-size: 12px; border-radius: var(--r-full); border: 1px solid var(--border);
    background: var(--bg-1); color: var(--text-2); transition: all .18s;
}
.btn-mini:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-050); }
.btn-mini.btn-vip, .btn-mini.btn-vip:hover {
    background: linear-gradient(135deg, #ffb347, #ff8c1a); border-color: transparent; color: #fff;
}
.btn-ghost, .ghost { background: transparent; border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-ghost:hover, .ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: #fff; }
.btn-download {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 30px; border-radius: var(--r-full); border: none;
    background: var(--grad-primary); color: #fff; font-size: 15px; font-weight: 500;
    box-shadow: var(--sh-primary); transition: all .22s var(--ease);
}
.btn-download:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(37, 162, 242, .38); }
.btn-follow {
    display: inline-flex; align-items: center; gap: 4px; padding: 6px 18px;
    border-radius: var(--r-full); border: 1px solid var(--primary); color: var(--primary);
    background: transparent; transition: all .2s;
}
.btn-follow:hover, .btn-follow.on { background: var(--primary); color: #fff; }
.block { width: 100%; display: flex; justify-content: center; }

/* ---------- 7. 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 7px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.form-label .req, .form-label i { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-control, .input {
    width: 100%; padding: 9px 13px; border: 1px solid var(--border);
    border-radius: var(--r-sm); background: var(--bg-1); color: var(--text-1);
    transition: all .18s var(--ease);
}
.form-control:focus, .input:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050);
}
.form-control::placeholder, .input::placeholder { color: var(--text-4); }
textarea.form-control { min-height: 100px; resize: vertical; line-height: 1.7; }
select.form-control { cursor: pointer; }
.form-hint, .form-tip { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.checkbox-label, .radio-inline {
    display: inline-flex; align-items: center; gap: 6px; font-size: 14px;
    cursor: pointer; color: var(--text-2);
}
.radio-inline input { accent-color: var(--primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }

.form-box { background: var(--bg-1); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-1); border: 1px solid var(--border-2); }
.form-row { margin-bottom: 18px; }
.form-row > label {
    display: block; margin-bottom: 7px; font-size: 14px; color: var(--text-2); font-weight: 500;
}

/* ---------- 8. 分页 ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 24px 0; flex-wrap: wrap; }
.page-link {
    padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--bg-1); color: var(--text-2); font-size: 14px; transition: all .18s;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.current {
    background: var(--grad-primary); border-color: transparent; color: #fff; font-weight: 500;
    box-shadow: var(--sh-primary);
}
.page-total { color: var(--text-3); font-size: 13px; margin-left: 8px; }
.page-ellipsis { color: var(--text-3); }

/* ---------- 9. 信息流 ---------- */
.feed-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 10px; padding: 0 16px; }
.feed-tabs a { padding: 10px 0; color: var(--text-2); position: relative; font-size: 15px; }
.feed-tabs a.active { color: var(--primary); font-weight: 600; }
.feed-tabs a.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
    background: var(--grad-primary); border-radius: 2px;
}
.feed-list {
    background: var(--bg-1); border-radius: var(--r-lg); box-shadow: var(--sh-1);
    border: 1px solid var(--border-2); overflow: hidden;
}
.feed-item { display: flex; gap: 14px; padding: 20px; border-bottom: 1px solid var(--border-2); transition: transform .2s, box-shadow .2s; }
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { transform: translateY(-1px); box-shadow: var(--sh-3); }
.feed-item .fi-body { flex: 1; min-width: 0; }
.feed-item h3 { font-size: 17px; margin-bottom: 7px; line-height: 1.45; }
.feed-item h3 a:hover { color: var(--primary); }
.feed-item .fi-summary {
    color: var(--text-2); font-size: 14px; margin-bottom: 10px; line-height: 1.65;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feed-item .fi-meta { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 13px; flex-wrap: wrap; }
.feed-item .fi-meta .tag { color: var(--text-3); }
.feed-item .fi-meta .tag:hover { color: var(--primary); }
.feed-cover {
    width: 140px; height: 92px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0;
    background: var(--bg-4);
}
@media (max-width: 640px) { .feed-cover { display: none; } .feed-item { padding: 14px; } }

/* ---------- 10. 轮播 / 分类栏 ---------- */
.slider { position: relative; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; height: 260px; background: var(--bg-4); box-shadow: var(--sh-2); }
.slider-item { position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease); }
.slider-item.active { opacity: 1; }
.slider-item img, .slider-item svg { width: 100%; height: 100%; object-fit: cover; }
.slider-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.slider-dots span { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .55); cursor: pointer; transition: all .25s; }
.slider-dots span.active { background: #fff; width: 22px; }
@media (max-width: 640px) { .slider { height: 160px; } }

.cat-bar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar a {
    padding: 6px 15px; border-radius: var(--r-full); background: var(--bg-1);
    color: var(--text-2); white-space: nowrap; font-size: 14px;
    border: 1px solid var(--border); transition: all .2s var(--ease);
}
.cat-bar a:hover { border-color: var(--primary-200); color: var(--primary); background: var(--primary-050); }
.cat-bar a.active {
    background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--sh-primary);
}

/* ---------- 11. 榜单 / 标签云 ---------- */
.rank-list li { display: flex; gap: 10px; padding: 9px 0; align-items: flex-start; }
.rank-list .rk-no {
    width: 20px; height: 20px; border-radius: var(--r-xs); background: var(--bg-4);
    color: var(--text-3); font-size: 12px; line-height: 20px; text-align: center;
    flex-shrink: 0; margin-top: 2px; font-weight: 600;
}
.rank-list li:nth-child(1) .rk-no { background: linear-gradient(135deg, #FFD24D, #FFB400); color: #fff; }
.rank-list li:nth-child(2) .rk-no { background: linear-gradient(135deg, #D4D8DE, #C0C4CC); color: #fff; }
.rank-list li:nth-child(3) .rk-no { background: linear-gradient(135deg, #F0B860, #E6A23C); color: #fff; }
.rank-list .rk-title { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
.rank-list .rk-title:hover { color: var(--primary); }
.rank-list .rk-num { color: var(--text-3); font-size: 12px; flex-shrink: 0; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    padding: 5px 12px; border-radius: var(--r-full); background: var(--bg-3);
    color: var(--text-2); font-size: 13px; transition: all .2s; border: 1px solid var(--border-2);
}
.tag-cloud a:hover {
    background: var(--grad-primary); color: #fff; border-color: transparent;
    transform: translateY(-1px); box-shadow: var(--sh-primary);
}

/* ---------- 11b. 首页精仿模块（2026 版 CSDN 规范） ---------- */

/* 每日精选（.daily-pick 本身即 .card） */
.dp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dp-item { display: block; position: relative; transition: transform .2s, box-shadow .2s; }
.dp-item:hover { transform: translateY(-1px); }
.dp-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--bg-4); }
.dp-title {
    font-size: 14px; line-height: 1.5; margin-top: 10px; color: var(--text-1);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dp-item:hover .dp-title { color: var(--primary); }
.dp-index {
    position: absolute; top: 8px; left: 8px; min-width: 22px; height: 22px; padding: 0 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff; border-radius: 4px; z-index: 1;
}
.dp-grid > .dp-item:nth-child(1) .dp-index { background: linear-gradient(135deg, #FFD24D, #FFB400); }
.dp-grid > .dp-item:nth-child(2) .dp-index { background: linear-gradient(135deg, #D4D8DE, #C0C4CC); }
.dp-grid > .dp-item:nth-child(3) .dp-index { background: linear-gradient(135deg, #F0B860, #E6A23C); }
.dp-grid > .dp-item:nth-child(n+4) .dp-index { background: var(--text-4); }

/* 技术专区（.cat-entry 本身即 .card） */
.ce-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.ce-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 6px; transition: .2s; }
.ce-item:hover { background: var(--primary-050); }
.ce-icon { width: 44px; height: 44px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--grad-primary-soft); }
.ce-name { font-size: 13px; color: var(--text-2); transition: color .2s; }
.ce-item:hover .ce-name { color: var(--primary); }

/* 信息流增强（配合现有 .feed-item 结构） */
.feed-item .fi-title, .fi-title {
    font-size: 18px; line-height: 1.45; margin-bottom: 7px; color: var(--text-1);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fi-title:hover { color: var(--primary); }
.fi-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* 创作中心入口（.side-create） */
.side-create { background: var(--grad-primary-soft); border-radius: 6px; padding: 18px; }
.side-create .sc-title { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.side-create .sc-desc { font-size: 13px; color: var(--text-3); line-height: 1.6; margin-bottom: 12px; }

/* 广告位（.side-ad） */
.side-ad { position: relative; overflow: hidden; border-radius: 6px; }
.side-ad img, .side-ad > * { width: 100%; border-radius: 6px; display: block; }
.side-ad::after {
    content: '广告'; position: absolute; right: 0; bottom: 0;
    font-size: 11px; line-height: 1; color: #fff; background: rgba(0, 0, 0, .35);
    padding: 3px 6px; border-radius: 4px 0 0 0;
}

/* 作者推荐（复用 .user-item + .btn-follow/.btn-mini，不重造） */
.author-rec .btn-follow, .author-rec .btn-mini { flex-shrink: 0; }

/* ---------- 13b. 文章详情页精仿模块 ---------- */

/* 面包屑 */
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 12px; display: flex; align-items: center; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.bc-sep { margin: 0 6px; color: var(--text-4); }
.bc-cur { color: var(--text-2); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 文章标题 */
.av-title { font-size: 22px; line-height: 1.4; color: var(--text-1); }

/* 文章操作栏 */
.av-actions { display: flex; gap: 12px; justify-content: center; padding: 24px 0; }
.av-act {
    padding: 8px 20px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg-1); color: var(--text-2); font-size: 14px; transition: all .2s var(--ease);
}
.av-act:hover { border-color: var(--primary); color: var(--primary); }
.av-act.active { border-color: var(--primary); color: var(--primary); background: var(--primary-050); }

/* 作者卡片 */
.author-card { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 20px; background: var(--bg-3); border-radius: 6px; }
.ac-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ac-name { font-size: 16px; font-weight: 600; color: var(--text-1); }
.ac-desc { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.ac-stats { margin-top: 6px; }
.ac-stats span { font-size: 13px; color: var(--text-3); margin-right: 16px; }
.author-card .ac-follow { margin-left: auto; flex-shrink: 0; }

/* 相关推荐 */
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rel-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--bg-4); }
.rel-title {
    font-size: 14px; line-height: 1.5; margin-top: 8px; color: var(--text-1);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rel-title:hover { color: var(--primary); }
.rel-meta { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* 评论区（新结构 .cm-*，兼容嵌套二级回复） */
.cm-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cm-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cm-body { flex: 1; min-width: 0; }
.cm-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.cm-text { font-size: 14px; line-height: 1.75; color: var(--text-1); margin: 4px 0 0; }
.cm-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.cm-act { font-size: 12px; color: var(--text-3); cursor: pointer; transition: color .18s; }
.cm-act:hover { color: var(--primary); }
.cm-child { margin-left: 48px; padding-left: 12px; border-left: 2px solid var(--border); margin-top: 12px; background: var(--bg-3); border-radius: 0 6px 6px 0; }

/* 代码块行号（JS 给 .md-code 加 .md-code--ln，每行包 .cl） */
.md-code--ln pre { padding-left: 0; }
.md-code--ln code { counter-reset: cl; display: block; }
.md-code--ln .cl { display: block; counter-increment: cl; padding-left: 46px; position: relative; }
.md-code--ln .cl::before {
    content: counter(cl);
    position: absolute; left: 0; width: 34px; text-align: right;
    color: #5c6370; user-select: none; opacity: .8;
}

/* ---------- 12. 用户条目 ---------- */
.user-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.user-item img { width: 38px; height: 38px; border-radius: 50%; }
.user-item .ui-name { font-size: 14px; font-weight: 500; }
.user-item .ui-desc { font-size: 12px; color: var(--text-3); }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 48px; height: 48px; border-radius: 50%; }

/* ---------- 13. 文章详情 ---------- */
.article-view, .article-detail {
    background: var(--bg-1); border-radius: var(--r-lg); padding: 32px;
    box-shadow: var(--sh-1); border: 1px solid var(--border-2);
}
.article-view h1, .article-detail h1 { font-size: 28px; line-height: 1.4; margin-bottom: 16px; letter-spacing: -.3px; }
@media (max-width: 640px) {
    .article-view, .article-detail { padding: 18px; }
    .article-view h1, .article-detail h1 { font-size: 21px; }
    /* 版权声明：移动端图标与文字上下排列 */
    .article-copyright { flex-direction: column; gap: 8px; padding: 14px 16px; }
}
.article-meta, .ad-meta {
    display: flex; align-items: center; gap: 16px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border-2); color: var(--text-3); font-size: 13px; flex-wrap: wrap;
}
.article-meta .am-author, .ad-head .bd-name { display: flex; align-items: center; gap: 8px; color: var(--text-1); font-weight: 500; }
.article-meta img, .ad-head img { width: 36px; height: 36px; border-radius: 50%; }
.ad-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bd-name { font-weight: 600; color: var(--text-1); }
.bd-time { color: var(--text-3); font-size: 13px; }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.article-tags a {
    padding: 4px 12px; background: var(--primary-050); color: var(--primary);
    border-radius: var(--r-full); font-size: 13px; transition: all .2s;
}
.article-tags a:hover { background: var(--primary); color: #fff; }

.article-content, .ad-content, .bd-content {
    font-size: 14px; line-height: 1.75; color: var(--text-1); margin-top: 10px;
}
.article-content h1, .article-content h2, .article-content h3, .article-content h4,
.ad-content h1, .ad-content h2, .ad-content h3, .bd-content h2, .bd-content h3 {
    margin: 30px 0 14px; line-height: 1.4; scroll-margin-top: 76px;
}
.article-content h1, .ad-content h1, .bd-content h1 { font-size: 22px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.article-content h2, .ad-content h2, .bd-content h2 {
    font-size: 18px; padding-left: 12px; border-left: 3px solid var(--primary);
}
.article-content h3, .ad-content h3, .bd-content h3 { font-size: 16px; }
.article-content h4, .ad-content h4, .bd-content h4 { font-size: 15px; }
.article-content p, .ad-content p, .bd-content p { margin: 0 0 15px; }
.article-content ul, .article-content ol, .ad-content ul, .ad-content ol, .bd-content ul, .bd-content ol {
    margin: 0 0 15px; padding-left: 26px;
}
.article-content ul, .ad-content ul, .bd-content ul { list-style: disc; }
.article-content ol, .ad-content ol, .bd-content ol { list-style: decimal; }
.article-content li, .ad-content li, .bd-content li { margin-bottom: 7px; }
.article-content blockquote, .ad-content blockquote, .bd-content blockquote {
    margin: 0 0 16px; padding: 12px 18px; background: #FAFAFA;
    border-left: 3px solid var(--primary); color: var(--text-2); border-radius: 4px;
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content img, .ad-content img { border-radius: var(--r-md); margin: 10px 0; box-shadow: var(--sh-1); }
.article-content a, .ad-content a, .bd-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-content table, .ad-content table { margin: 0 0 18px; border: 1px solid var(--border); font-size: 14px; border-radius: var(--r-md); overflow: hidden; }
.article-content th, .article-content td, .ad-content th, .ad-content td { border: 1px solid var(--border); padding: 9px 13px; }
.article-content th, .ad-content th { background: var(--bg-3); font-weight: 600; }
.article-content hr, .ad-content hr { border: none; border-top: 1px solid var(--border); margin: 26px 0; }
.article-content strong, .ad-content strong, .bd-content strong { font-weight: 600; color: var(--text-1); }
.md-inline-code {
    padding: 2px 7px; background: var(--primary-050); color: var(--primary);
    border-radius: var(--r-xs); font-size: 14px; border: 1px solid var(--primary-100);
}

/* 代码块 */
.md-code {
    margin: 0 0 18px; border-radius: var(--r-md); overflow: hidden;
    background: #1c1e22; border: 1px solid #2b2e35; box-shadow: var(--sh-2);
}
.md-code__bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px; background: #24272e; color: #9aa0aa; font-size: 12px;
    border-bottom: 1px solid #2f333b;
}
.md-code__bar .dots { display: flex; gap: 5px; }
.md-code__bar .dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.md-code__bar .dots i:nth-child(1) { background: #ff5f57; }
.md-code__bar .dots i:nth-child(2) { background: #febc2e; }
.md-code__bar .dots i:nth-child(3) { background: #28c840; }
.md-code__copy {
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
    color: #c9ced6; padding: 3px 12px; border-radius: var(--r-xs); font-size: 12px; transition: all .18s;
}
.md-code__copy:hover { border-color: var(--primary); color: #fff; background: var(--primary); }
.md-code pre { margin: 0; padding: 15px 16px; overflow-x: auto; }
.md-code code { color: #d8dee9; font-size: 13.5px; line-height: 1.75; white-space: pre; }
.hl-keyword { color: #c792ea; }
.hl-string { color: #c3e88d; }
.hl-comment { color: #6a7891; font-style: italic; }
.hl-number { color: #f78c6c; }
.hl-func { color: #82aaff; }
.md-table { overflow-x: auto; margin-bottom: 18px; }

/* 目录 */
.toc-box { position: sticky; top: 76px; max-height: 72vh; overflow-y: auto; }
.toc-box a {
    display: block; padding: 6px 0 6px 12px; font-size: 13px; color: var(--text-2);
    border-left: 2px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: all .18s;
}
.toc-box a:hover, .toc-box a.active { color: var(--primary); border-left-color: var(--primary); }
.toc-box a.lv3 { padding-left: 26px; font-size: 12.5px; }
.toc-box a.lv4 { padding-left: 40px; font-size: 12.5px; }

/* CC 4.0 BY-SA 版权声明（对标 CSDN 文章底部版权栏） */
.article-copyright {
    display: flex; gap: 14px; align-items: flex-start;
    margin: 28px 0 4px; padding: 16px 18px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-3);
    border-radius: var(--r-md);
    transition: background .22s var(--ease), border-color .22s var(--ease);
}
.article-copyright:hover { border-left-color: var(--primary); }
.copyright-icon {
    flex-shrink: 0; color: var(--text-3); padding-top: 2px; line-height: 0;
    transition: color .22s var(--ease);
}
.article-copyright:hover .copyright-icon { color: var(--primary); }
.copyright-icon svg { display: block; }
.copyright-text {
    flex: 1; min-width: 0;
    font-size: 13px; line-height: 1.85; color: var(--text-3);
}
.copyright-text b { color: var(--text-2); font-weight: 600; }
.copyright-text a {
    color: var(--primary); text-decoration: none; margin-left: 6px; white-space: nowrap;
}
.copyright-text a:hover { text-decoration: underline; }

/* 文章操作栏 */
.article-actions { display: flex; gap: 12px; justify-content: center; padding: 26px 0; flex-wrap: wrap; }
.act-btn {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 12px 22px; border-radius: var(--r-lg); background: var(--bg-3);
    cursor: pointer; transition: all .22s var(--ease); color: var(--text-2);
    font-size: 13px; min-width: 76px; border: 1px solid var(--border-2);
}
.act-btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); color: var(--primary); border-color: var(--primary-200); }
.act-btn.active { background: var(--primary-050); color: var(--primary); border-color: var(--primary-200); }
.act-btn .icon { font-size: 20px; line-height: 1; }

/* ---------- 14. 评论 ---------- */
.comment-box, .comment-form {
    background: var(--bg-1); border-radius: var(--r-lg); padding: 22px;
    box-shadow: var(--sh-1); border: 1px solid var(--border-2); margin-top: 16px;
}
/* 部分页面把 textarea 直接写进 comment-form 没加 .form-control，兜底保证宽度与圆角 */
.comment-form textarea, .comment-box textarea {
    width: 100%; min-height: 90px; padding: 11px 14px; border: 1px solid var(--border);
    border-radius: var(--r-md); background: var(--bg-3); color: var(--text-1);
    resize: vertical; line-height: 1.7; font-family: inherit; font-size: 14px;
}
.comment-form textarea:focus, .comment-box textarea:focus {
    border-color: var(--primary); background: var(--bg-1); outline: none;
    box-shadow: 0 0 0 3px var(--primary-050);
}
.comment-editor { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-editor img { width: 42px; height: 42px; border-radius: 50%; }
.comment-editor textarea {
    flex: 1; min-height: 82px; padding: 11px 14px; border: 1px solid var(--border);
    border-radius: var(--r-md); background: var(--bg-3); color: var(--text-1);
    resize: vertical; transition: all .18s; line-height: 1.7;
}
.comment-editor textarea:focus { border-color: var(--primary); background: var(--bg-1); box-shadow: 0 0 0 3px var(--primary-050); }
.comment-submit { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.comment-submit .captcha-row { margin-right: auto; }
/* 滑动验证码高度较大，独占一行，避免和「发表评论」按钮并排时被拉伸/垂直居中错位 */
.comment-submit .captcha-slide { flex: 0 0 100%; max-width: 320px; margin-right: auto; }

/* ---------- 验证码 ---------- */
.captcha-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.captcha-input {
    width: 110px; height: 42px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--bg-3); color: var(--text-1); font-size: 14px; letter-spacing: 2px;
    transition: all .18s;
}
.captcha-input:focus { border-color: var(--primary); background: var(--bg-1); box-shadow: 0 0 0 3px var(--primary-050); outline: none; }
.captcha-img {
    height: 42px; border: 1px solid var(--border); border-radius: var(--r-md);
    cursor: pointer; background: #fff; display: block;
}
.captcha-img:hover { border-color: var(--primary); }
.comment-form .captcha-row { margin: 10px 0 0; }
.editor-meta-row .captcha-row { margin: 0; }
/* 发文章页等较窄表单：验证码独占一行、上下排列，避免左右两栏被压扁 */
.editor-meta-row.captcha-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.editor-meta-row.captcha-row .captcha-slide {
    width: 100%;
    max-width: 320px;
    margin: 0;
}

/* ---------- 滑动拼图验证码 ---------- */
.captcha-slide { display: block; margin: 10px 0; max-width: 320px; }
.captcha-slide .cs-panel {
    position: relative; width: 100%; border-radius: var(--r-md); overflow: hidden;
    background: var(--bg-3); border: 1px solid var(--border-2);
}
.captcha-slide .cs-canvas { position: relative; width: 100%; height: 160px; }
.captcha-slide .cs-bg { display: block; width: 100%; height: 100%; }
.captcha-slide .cs-block {
    position: absolute; left: 0; top: 0; z-index: 2;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .28);
}
.captcha-slide .cs-loading { padding: 62px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.captcha-slide .cs-tip {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
    padding: 4px 10px; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .45);
}
.captcha-slide .cs-tip:empty { display: none; }
.captcha-slide .cs-tip.ok { background: rgba(0, 168, 112, .88); }
.captcha-slide .cs-tip.err { background: rgba(227, 77, 89, .9); }
.captcha-slide .cs-refresh {
    position: absolute; right: 6px; top: 6px; z-index: 4; width: 28px; height: 28px;
    border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.captcha-slide .cs-refresh:hover { background: rgba(0, 0, 0, .6); }
.captcha-slide .cs-bar {
    position: relative; height: 40px; margin-top: 8px; overflow: hidden;
    border-radius: var(--r-full); background: var(--bg-3); border: 1px solid var(--border-2);
}
.captcha-slide .cs-bar-text {
    display: block; line-height: 38px; text-align: center; font-size: 13px;
    color: var(--text-3); user-select: none;
}
.captcha-slide .cs-btn {
    position: absolute; left: 0; top: 0; z-index: 5; width: 40px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: var(--grad-primary); color: #fff; cursor: grab;
    box-shadow: 0 2px 8px rgba(37, 162, 242, .35);
}
.captcha-slide .cs-btn:active { cursor: grabbing; }
.captcha-slide .cs-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* JS 禁用时的降级：图形验证码 */
.captcha-noscript { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.captcha-slide.ok .cs-bar { background: var(--success-bg); border-color: var(--success); }
.captcha-slide.ok .cs-bar-text { color: var(--success); }
.captcha-slide.ok .cs-btn { background: var(--success); box-shadow: none; cursor: default; }
.captcha-slide.fail .cs-bar { animation: csShake .3s; }
.captcha-slide.fail .cs-btn { background: var(--danger); box-shadow: none; }
@keyframes csShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.comment-list { margin-top: 4px; }
.comment-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border-2); }
.comment-item:last-child { border-bottom: none; }
.comment-item img.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.ci-body { flex: 1; min-width: 0; }
.ci-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.ci-name { font-weight: 600; font-size: 14px; }
.ci-time, .cr-time { color: var(--text-3); font-size: 12px; }
.ci-content { font-size: 14px; line-height: 1.75; margin-bottom: 8px; word-break: break-word; }
.ci-actions { display: flex; gap: 16px; font-size: 13px; color: var(--text-3); }
.ci-actions span { cursor: pointer; transition: color .18s; }
.ci-actions span:hover { color: var(--primary); }
.comment-reply { margin-left: 52px; padding: 10px 0 0; }
.comment-reply .comment-item { border-bottom: none; padding: 8px 0; }
.ci-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cf-bar { display: flex; gap: 10px; align-items: flex-start; }
.cf-tip { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.login-tip {
    background: var(--primary-050); border: 1px dashed var(--primary-200); color: var(--primary);
    padding: 10px 14px; border-radius: var(--r-md); font-size: 13px; text-align: center;
}

/* ---------- 15. 论坛 ---------- */
.board-group {
    background: var(--bg-1); border-radius: var(--r-lg); box-shadow: var(--sh-1);
    margin-bottom: 16px; overflow: hidden; border: 1px solid var(--border-2);
}
.board-group-head {
    padding: 13px 18px; background: var(--bg-3); font-weight: 600;
    border-bottom: 1px solid var(--border-2); display: flex; align-items: center; gap: 9px;
}
.board-group-head .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}
.board-list { display: flex; flex-wrap: wrap; }
.board-card {
    width: 33.33%; padding: 16px 18px; border-right: 1px solid var(--border-2);
    border-bottom: 1px solid var(--border-2); display: flex; gap: 13px; transition: background .2s;
}
.board-card:hover { background: var(--bg-3); }
@media (max-width: 640px) { .board-card { width: 100%; } }
.board-icon {
    width: 44px; height: 44px; border-radius: var(--r-md); display: flex;
    align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0;
    box-shadow: var(--sh-1);
}
.board-name { font-weight: 600; margin-bottom: 3px; font-size: 15px; }
.board-desc { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-stat { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.thread-list { background: var(--bg-1); border-radius: var(--r-lg); box-shadow: var(--sh-1); border: 1px solid var(--border-2); overflow: hidden; }
.thread-item { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border-2); transition: background .2s; }
.thread-item:hover { background: var(--bg-3); }
.thread-item:last-child { border-bottom: none; }
.thread-item img.avatar { width: 38px; height: 38px; border-radius: 50%; }
.ti-body { flex: 1; min-width: 0; }
.ti-title { font-size: 15px; font-weight: 500; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; }
.ti-right { text-align: right; font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.ti-right .num { display: block; font-weight: 600; color: var(--text-2); }

.tag-mini {
    display: inline-block; padding: 1px 7px; border-radius: var(--r-xs); font-size: 12px;
    margin-right: 5px; line-height: 1.6; font-weight: 500;
}
.tag-top { background: var(--danger-bg); color: var(--danger); }
.tag-essence { background: var(--success-bg); color: var(--success); }
.tag-reward { background: var(--warning-bg); color: var(--warning); }
.tag-solved { background: var(--info-bg); color: var(--info); }
.tag-ask { background: #f0edff; color: var(--purple); }
.tag-original { background: var(--primary-050); color: var(--primary); }
.tag-vip { background: linear-gradient(135deg, #ffb347, #ff8c1a); color: #fff; }

/* 帖子详情 */
.post-item { display: flex; gap: 15px; padding: 20px; border-bottom: 1px solid var(--border-2); }
.post-left { width: 74px; flex-shrink: 0; text-align: center; }
.post-left img { width: 48px; height: 48px; border-radius: 50%; }
.post-left .p-name { font-size: 13px; margin-top: 7px; color: var(--text-2); word-break: break-all; }
.post-right { flex: 1; min-width: 0; }
.post-meta { display: flex; gap: 12px; color: var(--text-3); font-size: 12px; margin-bottom: 9px; flex-wrap: wrap; }
.post-content { font-size: 15px; line-height: 1.85; word-break: break-word; }
.post-content p { margin-bottom: 11px; }
.post-content pre {
    background: #1c1e22; color: #d8dee9; padding: 13px 15px;
    border-radius: var(--r-md); overflow-x: auto; border: 1px solid #2b2e35;
}
.post-content img { border-radius: var(--r-md); max-width: 100%; }
.post-content blockquote {
    margin: 0 0 12px; padding: 10px 16px; background: var(--bg-3);
    border-left: 4px solid var(--primary); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2);
}
.post-actions { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--text-3); }
.post-actions span { cursor: pointer; transition: color .18s; }
.post-actions span:hover { color: var(--primary); }
.floor-no { color: var(--text-3); font-size: 12px; }
.post-best {
    border: 1px solid var(--success); border-radius: var(--r-lg);
    background: var(--success-bg); margin: 12px; padding: 16px;
}
@media (max-width: 640px) { .post-left { width: 54px; } .post-item { padding: 14px; gap: 10px; } }

/* ---------- 16. 下载 ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 4px 0; }
.res-card {
    background: var(--bg-1); border-radius: var(--r-lg); padding: 18px;
    box-shadow: var(--sh-1); border: 1px solid var(--border-2);
    transition: all .25s var(--ease); display: flex; flex-direction: column;
}
.res-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--primary-200); }
.res-icon { font-size: 30px; margin-bottom: 12px; }
.res-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; line-height: 1.45; height: 43px; overflow: hidden; }
.res-desc { font-size: 13px; color: var(--text-3); flex: 1; margin-bottom: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.res-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }

/* 下载列表条目 */
.res-item {
    display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border-2);
    transition: background .2s;
}
.res-item:hover { background: var(--bg-3); }
/* 网格里的资源条目按卡片渲染（下载首页把 .res-item 放进 .res-grid），
   否则会变成无背景、无圆角、底部拖一条多余分割线的裸条目 */
.res-grid > .res-item {
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.res-grid > .res-item:hover {
    background: var(--bg-1);
    transform: translateY(-3px);
    box-shadow: var(--sh-3);
    border-color: var(--primary-200);
}
.res-item .res-icon, .ad-head .res-icon {
    width: 52px; height: 52px; border-radius: var(--r-md); display: flex; align-items: center;
    justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
    margin-bottom: 0; letter-spacing: .5px;
    background: linear-gradient(135deg, #8a93a5, #6b7280);
}
.res-item .ext-zip, .res-item .ext-rar, .res-item .ext-7z, .ad-head .ext-zip, .ad-head .ext-rar, .ad-head .ext-7z { background: linear-gradient(135deg, #f9a825, #ef6c00); }
.res-item .ext-pdf, .ad-head .ext-pdf { background: linear-gradient(135deg, #ef5350, #c62828); }
.res-item .ext-doc, .res-item .ext-docx, .ad-head .ext-doc, .ad-head .ext-docx { background: linear-gradient(135deg, #42a5f5, #1565c0); }
.res-item .ext-xls, .res-item .ext-xlsx, .ad-head .ext-xls, .ad-head .ext-xlsx { background: linear-gradient(135deg, #66bb6a, #2e7d32); }
.res-item .ext-ppt, .res-item .ext-pptx, .ad-head .ext-ppt, .ad-head .ext-pptx { background: linear-gradient(135deg, #ff7043, #d84315); }
.res-item .ext-txt, .ad-head .ext-txt { background: linear-gradient(135deg, #90a4ae, #546e7a); }
.res-item .ext-mp4, .res-item .ext-avi, .res-item .ext-mov, .ad-head .ext-mp4, .ad-head .ext-avi, .ad-head .ext-mov { background: linear-gradient(135deg, #7e57c2, #4527a0); }
.res-item .ext-jpg, .res-item .ext-png, .res-item .ext-psd, .ad-head .ext-jpg, .ad-head .ext-png, .ad-head .ext-psd { background: linear-gradient(135deg, #26c6da, #00838f); }
.res-item .ext-exe, .res-item .ext-msi, .ad-head .ext-exe, .ad-head .ext-msi { background: linear-gradient(135deg, #5c6bc0, #283593); }
.res-item .ext-sql, .ad-head .ext-sql { background: linear-gradient(135deg, #ffa726, #e65100); }
.res-item .res-main { flex: 1; min-width: 0; }
.res-item .res-main h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; line-height: 1.45; }
.res-item .res-main h3 a:hover { color: var(--primary); }
.res-item .res-desc { font-size: 13px; color: var(--text-3); margin-bottom: 9px; }
.res-item .res-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; align-items: center; }
.res-price { font-weight: 600; color: var(--primary); }
.res-price.free { color: var(--success); }
.vip-mini {
    display: inline-block; padding: 1px 7px; border-radius: var(--r-xs); font-size: 11px;
    background: linear-gradient(135deg, #ffb347, #ff8c1a); color: #fff; font-weight: 600;
}
.quota-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 18px; margin: 0 0 4px; background: var(--bg-3);
    border-bottom: 1px solid var(--border-2); font-size: 13px; color: var(--text-2); flex-wrap: wrap;
}
.quota-bar b { color: var(--primary); }
.res-detail-box, .res-download-box {
    background: var(--bg-3); border-radius: var(--r-md); padding: 16px 18px; margin: 18px 0;
    border: 1px solid var(--border-2);
}
.res-download-box { text-align: center; padding: 26px 18px; }
.res-info-row { display: flex; gap: 10px; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--border-2); }
.res-info-row:last-child { border-bottom: none; }
.res-info-row > span:first-child { width: 76px; color: var(--text-3); flex-shrink: 0; }
.dl-tip { font-size: 12px; color: var(--text-3); margin-top: 12px; }
.cat-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.cat-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-list li a:hover { color: var(--primary); }
.cat-num { color: var(--text-4); font-size: 12px; background: var(--bg-3); padding: 1px 8px; border-radius: var(--r-full); }

/* ---------- 17. 会员 VIP ---------- */
.vip-page { margin: 0; }
.vip-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(120deg, #2b1a4a 0%, #5b2a6b 42%, #b8365f 100%);
    color: #fff; border-radius: var(--r-xl); padding: 46px 32px; text-align: center;
    margin-bottom: 24px; box-shadow: 0 12px 32px rgba(91, 42, 107, .28);
}
.vip-hero::before {
    content: ''; position: absolute; top: -70px; right: -50px; width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(255, 215, 130, .3), transparent 65%); border-radius: 50%;
}
.vip-hero::after {
    content: ''; position: absolute; bottom: -90px; left: -40px; width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(255, 120, 120, .22), transparent 65%); border-radius: 50%;
}
.vh-inner { position: relative; z-index: 1; }
.vip-hero h1, .vip-hero h2 { font-size: 30px; margin-bottom: 12px; letter-spacing: .5px; font-weight: 700; }
.vip-hero p { font-size: 15px; opacity: .88; margin-bottom: 22px; }
.vh-status {
    display: inline-block; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .28);
    padding: 8px 20px; border-radius: var(--r-full); font-size: 14px; margin-bottom: 18px;
    backdrop-filter: blur(6px);
}
.vh-status b { color: #ffd88a; font-size: 15px; }
.vh-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 11px 32px; margin: 0 6px;
    border-radius: var(--r-full); font-size: 15px; font-weight: 600;
    background: linear-gradient(135deg, #ffd76e, #f5a623); color: #6b3f00;
    box-shadow: 0 6px 18px rgba(245, 166, 35, .4); transition: all .22s var(--ease);
}
.vh-btn:hover { transform: translateY(-2px); color: #6b3f00; box-shadow: 0 10px 24px rgba(245, 166, 35, .5); }
.vh-btn.ghost, .vh-btn.ghost:hover {
    background: rgba(255, 255, 255, .12); color: #fff;
    border: 1px solid rgba(255, 255, 255, .5); box-shadow: none;
}
@media (max-width: 640px) { .vip-hero { padding: 30px 18px; } .vip-hero h1, .vip-hero h2 { font-size: 22px; } }

.vip-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.vip-card, .vip-levels .vip-card {
    --lv-color: #fc5531;
    position: relative; background: var(--bg-1); border-radius: var(--r-lg); padding: 26px 22px;
    box-shadow: var(--sh-1); text-align: center; border: 1.5px solid var(--border-2);
    transition: all .28s var(--ease); display: flex; flex-direction: column;
}
.vip-levels .vip-card:hover { transform: translateY(-5px); box-shadow: var(--sh-3); border-color: var(--lv-color); }
.vip-levels .vip-card.current { border-color: var(--lv-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lv-color) 12%, transparent), var(--sh-2); }
.vip-levels .vip-card.current::after {
    content: '当前等级'; position: absolute; top: 12px; right: -1px;
    background: var(--lv-color); color: #fff; font-size: 11px; padding: 2px 10px;
    border-radius: var(--r-full) 0 0 var(--r-full);
}
.vc-name {
    font-size: 19px; font-weight: 700; margin-bottom: 14px;
    color: var(--lv-color); letter-spacing: .5px;
}
.vc-price { display: flex; align-items: baseline; justify-content: center; gap: 2px; margin-bottom: 4px; }
.vc-price .p-sym { font-size: 17px; font-weight: 600; color: var(--lv-color); }
.vc-price .p-num { font-size: 40px; font-weight: 700; line-height: 1.1; color: var(--text-1); letter-spacing: -1px; }
.vc-price .p-unit { font-size: 14px; color: var(--text-3); }
.vc-sub { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.vc-desc { font-size: 13px; color: var(--text-2); margin-bottom: 16px; line-height: 1.6; }
.vc-rights { text-align: left; margin: 0 0 20px; flex: 1; }
.vc-rights li { padding: 6px 0 6px 22px; font-size: 13.5px; color: var(--text-2); position: relative; }
.vc-rights li::before {
    content: ''; position: absolute; left: 0; top: 10px; width: 14px; height: 14px;
    border-radius: 50%; background: color-mix(in srgb, var(--lv-color) 15%, transparent);
}
.vc-rights li::after {
    content: ''; position: absolute; left: 4px; top: 14px; width: 6px; height: 3px;
    border-left: 1.5px solid var(--lv-color); border-bottom: 1.5px solid var(--lv-color);
    transform: rotate(-45deg);
}
.vc-btn {
    display: block; padding: 11px 0; border-radius: var(--r-full); font-weight: 600; font-size: 15px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--lv-color) 88%, #fff), var(--lv-color));
    color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--lv-color) 35%, transparent);
    transition: all .22s var(--ease);
}
.vc-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px color-mix(in srgb, var(--lv-color) 45%, transparent); }

/* 权益网格 */
.right-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.rg-item {
    background: var(--bg-3); border-radius: var(--r-md); padding: 18px;
    border: 1px solid var(--border-2); transition: all .22s var(--ease);
}
.rg-item:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--primary-200); }
.rg-icon { font-size: 26px; margin-bottom: 10px; line-height: 1; }
.rg-t { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.rg-d { font-size: 13px; color: var(--text-3); line-height: 1.6; }
.right-list { margin: 0 0 16px; }
.right-list li { padding: 6px 0 6px 22px; font-size: 13.5px; color: var(--text-2); position: relative; }
.right-list li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.vip-rights { text-align: left; margin: 16px 0; }
.vip-rights li { padding: 5px 0; font-size: 14px; color: var(--text-2); }
.vip-rights li::before { content: '✓'; color: var(--success); margin-right: 6px; }
.rights-table { width: 100%; font-size: 14px; }
.rights-table th, .rights-table td { border: 1px solid var(--border); padding: 11px; text-align: center; }
.rights-table th { background: var(--bg-3); font-weight: 600; }
.rights-table td:first-child { text-align: left; }
.rights-table-wrap { overflow-x: auto; margin-bottom: 8px; }
.lv-col { font-weight: 600; color: var(--primary); }
.lv { display: inline-block; padding: 1px 8px; border-radius: var(--r-xs); font-size: 12px; font-weight: 600; background: linear-gradient(135deg, #ffb347, #ff8c1a); color: #fff; }
.vip-badge {
    display: inline-block; padding: 2px 9px; border-radius: var(--r-xs); font-size: 11px;
    font-weight: 700; background: linear-gradient(135deg, #ffd76e, #f5a623); color: #6b3f00;
    margin-left: 6px; vertical-align: middle;
}
.vip-card-side { border: 1px solid var(--primary-200); background: var(--grad-primary-soft); }

/* 会员中心 */
.vip-my { margin: 0; }
.vm-head {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    background: linear-gradient(120deg, #2b1a4a 0%, #5b2a6b 42%, #b8365f 100%);
    color: #fff; border-radius: var(--r-xl); padding: 26px 28px; margin-bottom: 18px;
    box-shadow: 0 10px 28px rgba(91, 42, 107, .25);
}
.vm-head img { width: 68px; height: 68px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); }
.vm-info { flex: 1; min-width: 0; }
.vm-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.vm-head .vip-badge { background: linear-gradient(135deg, #ffd76e, #f5a623); }
.vm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; margin-top: 10px; }
.vms-item { background: rgba(255, 255, 255, .14); border-radius: var(--r-md); padding: 10px 14px; backdrop-filter: blur(4px); }
.vms-item b { display: block; font-size: 19px; font-weight: 700; line-height: 1.3; }
.vms-item span { font-size: 12px; opacity: .82; }
.vm-quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.vm-quick a {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 14px; border-radius: var(--r-full); font-size: 13px;
    background: var(--bg-3); border: 1px solid var(--border-2);
    color: var(--text-2); transition: all .18s var(--ease);
}
.vm-quick a:hover { background: var(--primary-050); border-color: var(--primary-200); color: var(--primary); }

/* ---------- 18. 下单 / 支付 ---------- */
.level-picker, .month-picker, .pay-picker, .amount-picker {
    display: grid; gap: 12px; margin-bottom: 18px;
}
.level-picker { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.month-picker, .amount-picker { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.pay-picker { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.lp-item, .mp-item, .pp-item, .ap-item {
    position: relative; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; padding: 14px 10px; cursor: pointer;
    border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--bg-1);
    transition: all .2s var(--ease); text-align: center;
}
.lp-item:hover, .mp-item:hover, .pp-item:hover, .ap-item:hover { border-color: var(--primary-200); background: var(--primary-050); }
/* 模板与 JS 实际输出的是 .active，这里同时兼容 .on 与 .active 两种写法 */
.lp-item.on, .mp-item.on, .pp-item.on, .ap-item.on,
.lp-item.active, .mp-item.active, .pp-item.active, .ap-item.active {
    border-color: var(--primary); background: var(--primary-050);
    box-shadow: 0 0 0 3px var(--primary-050);
}
.lp-item.on::after, .mp-item.on::after, .pp-item.on::after, .ap-item.on::after,
.lp-item.active::after, .mp-item.active::after, .pp-item.active::after, .ap-item.active::after {
    content: '✓'; position: absolute; top: -8px; right: -8px; width: 20px; height: 20px;
    background: var(--primary); color: #fff; border-radius: 50%; font-size: 12px;
    display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-1);
}
.lp-name, .pm-title { font-size: 15px; font-weight: 600; }
.lp-price { font-size: 13px; color: var(--primary); font-weight: 600; }
.mp-item b, .ap-item b { font-size: 17px; color: var(--text-1); }
.mp-item span, .ap-item span { font-size: 12px; color: var(--text-3); }
.order-summary {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px;
    background: var(--bg-3); border: 1px solid var(--border-2); border-radius: var(--r-md);
    padding: 16px 18px; margin: 18px 0; font-size: 14px;
}
.order-summary > b { color: var(--primary); font-size: 20px; }
.order-summary .os-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.order-summary .os-total { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 12px; font-weight: 600; }
.order-summary .os-total b { color: var(--primary); font-size: 20px; }

.pay-page { max-width: 720px; margin: 0 auto; }
.pay-order { background: var(--bg-3); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 18px; border: 1px solid var(--border-2); }
.po-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.po-row span:first-child { color: var(--text-3); }
.po-amount { font-size: 22px; font-weight: 700; color: var(--primary); }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
/* 标题不是支付方式卡片，必须独占一行，否则会挤占网格第一格 */
.pay-methods > .pm-title { grid-column: 1 / -1; margin: 0; font-weight: 600; }
.pm-item {
    display: flex; align-items: center; gap: 10px; padding: 14px; cursor: pointer;
    border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--bg-1);
    transition: all .2s var(--ease);
}
.pm-item input[type=radio] { margin: 0; flex-shrink: 0; accent-color: var(--primary); }
.pm-item:hover { border-color: var(--primary-200); }
.pm-item.on, .pm-item.active { border-color: var(--primary); background: var(--primary-050); box-shadow: 0 0 0 3px var(--primary-050); }
.pm-ico {
    width: 34px; height: 34px; border-radius: var(--r-sm); display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.pm-ico.ali { background: linear-gradient(135deg, #4ea6f5, #1677ff); }
.pm-ico.wx { background: linear-gradient(135deg, #5fd07a, #07c160); }
.pm-ico.bal { background: linear-gradient(135deg, #ffb347, #f5a623); }
.pm-title { font-weight: 600; font-size: 14px; }
.pm-item small { color: var(--text-3); font-size: 12px; }
.pay-qr { margin: 18px 0; }
.pm-item em { font-style: normal; font-size: 12px; color: var(--text-3); margin-left: 4px; }
.pp-item em { font-style: normal; font-size: 12px; color: var(--text-3); margin-left: 2px; }
.qr-box { text-align: center; padding: 20px; background: var(--bg-3); border-radius: var(--r-md); border: 1px dashed var(--border); }
.qr-placeholder {
    width: 168px; height: 168px; margin: 0 auto 14px; border-radius: var(--r-md);
    background: #fff; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); color: var(--text-4); font-size: 13px;
}
.qr-tip { font-size: 13px; color: var(--text-3); }
.pay-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pay-done { text-align: center; padding: 26px 18px; }
.recharge-balance {
    background: var(--grad-primary-soft); border: 1px solid var(--primary-200);
    border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 18px; font-size: 14px;
}
.recharge-balance b { font-size: 22px; color: var(--primary); }

/* ---------- 19. 订单 / 状态 ---------- */
.table-list { width: 100%; font-size: 14px; }
.table-list th {
    background: var(--bg-3); padding: 11px 14px; text-align: left;
    font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table-list td { padding: 12px 14px; border-bottom: 1px solid var(--border-2); }
.table-list tr:hover td { background: var(--bg-3); }
.table-wrap, .rights-table-wrap { overflow-x: auto; }
.st-ok { color: var(--success); font-weight: 500; }
.st-wait { color: var(--warning); font-weight: 500; }
.st-off { color: var(--text-4); }
.td-actions { white-space: nowrap; }
.td-actions a { color: var(--primary); margin-right: 10px; font-size: 13px; }
.td-actions a.danger, .danger { color: var(--danger); }
.gray { color: var(--text-3); }
.green { color: var(--success); }
.red { color: var(--danger); }
.orange { color: var(--warning); }
.small { font-size: 13px; }
.big { font-size: 17px; }
.num { font-weight: 600; color: var(--primary); }

/* 后台样式在前台的复用 */
.a-form-group { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.a-form-label { width: 120px; flex-shrink: 0; text-align: right; padding-top: 8px; color: var(--text-2); font-size: 14px; }
.a-form-input { flex: 1; min-width: 0; }
.a-table { width: 100%; font-size: 14px; }
.a-table th { background: var(--bg-3); padding: 10px 12px; text-align: left; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); }
.a-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-2); }
.a-tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-xs); font-size: 12px; background: var(--info-bg); color: var(--info); }
.a-tag.green { background: var(--success-bg); color: var(--success); }
.a-tag.red { background: var(--danger-bg); color: var(--danger); }
.a-tag.orange { background: var(--warning-bg); color: var(--warning); }
.a-tag.gray { background: var(--bg-4); color: var(--text-3); }
.a-progress { height: 8px; background: var(--bg-4); border-radius: var(--r-full); overflow: hidden; }
.a-progress .ap-bar { height: 100%; background: var(--grad-primary); border-radius: var(--r-full); transition: width .35s var(--ease); }

/* ---------- 20. 动态 Blink ---------- */
.blink-item {
    background: var(--bg-1); border-radius: var(--r-lg); padding: 18px;
    box-shadow: var(--sh-1); border: 1px solid var(--border-2); margin-bottom: 14px;
    transition: box-shadow .22s var(--ease);
}
.blink-item:hover { box-shadow: var(--sh-2); }
.bi-head, .blink-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.bi-head img, .blink-head img { width: 40px; height: 40px; border-radius: 50%; }
.bh-name { font-weight: 600; font-size: 14px; }
.bh-time { font-size: 12px; color: var(--text-3); margin-left: auto; }
.bi-del { margin-left: auto; color: var(--text-4); font-size: 12px; cursor: pointer; }
.bi-del:hover { color: var(--danger); }
.bi-content, .blink-body { font-size: 15px; line-height: 1.8; margin-bottom: 12px; word-break: break-word; }
.bi-content a, .blink-body a { color: var(--info); }
.bi-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.bi-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); cursor: zoom-in; }
.bi-bar, .blink-foot { display: flex; gap: 22px; font-size: 13px; color: var(--text-3); border-top: 1px solid var(--border-2); padding-top: 11px; }
.bi-bar span, .blink-foot span, .bi-bar a, .blink-foot a { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: color .18s; color: inherit; }
.bi-bar span:hover, .blink-foot span:hover, .bi-bar a:hover, .blink-foot a:hover { color: var(--primary); }
.bi-bar span.on, .blink-foot span.on,
.bi-bar a.on, .blink-foot a.on,
.bi-bar a.active, .blink-foot a.active { color: var(--primary); font-weight: 500; }
.bp-bar {
    display: flex; gap: 10px; padding: 12px 16px; background: var(--bg-3);
    border-radius: var(--r-md); margin-bottom: 14px; align-items: center; flex-wrap: wrap;
}
.blink-publisher { background: var(--bg-1); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-1); border: 1px solid var(--border-2); margin-bottom: 16px; }
.blink-detail { font-size: 16px; line-height: 1.85; }

/* 话题 */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tg-item {
    background: var(--bg-1); border-radius: var(--r-lg); padding: 16px 18px;
    box-shadow: var(--sh-1); border: 1px solid var(--border-2);
    transition: all .22s var(--ease);
}
.tg-item:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--primary-200); }
.tg-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.tg-name:hover { color: var(--primary); }
.tg-desc { font-size: 13px; color: var(--text-3); margin-bottom: 10px; line-height: 1.6; }
.tg-num { font-size: 12px; color: var(--text-4); }
.topic-head {
    background: var(--bg-1); border-radius: var(--r-lg); padding: 22px;
    box-shadow: var(--sh-1); border: 1px solid var(--border-2); margin-bottom: 16px; text-align: center;
}
.th-name { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.th-desc { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.th-num { font-size: 13px; color: var(--text-3); }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.topic-list a, .topic-sel {
    padding: 5px 14px; border-radius: var(--r-full); background: var(--bg-1);
    border: 1px solid var(--border); font-size: 13px; color: var(--text-2); transition: all .2s;
}
.topic-list a:hover, .topic-list a.active { background: var(--grad-primary); color: #fff; border-color: transparent; }
.tp-no { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tp-num { font-size: 12px; color: var(--text-3); }
.msg-to { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- 21. 个人空间 ---------- */
.space-header { background: var(--bg-1); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); border: 1px solid var(--border-2); margin-bottom: 16px; }
.space-cover {
    height: 160px;
    background: linear-gradient(120deg, #2b1a4a 0%, #5b2a6b 45%, #b8365f 100%);
    position: relative;
}
.space-cover::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 75% 30%, rgba(255, 215, 130, .28), transparent 55%);
}
.space-info { padding: 0 26px 22px; display: flex; align-items: flex-end; gap: 20px; margin-top: -44px; flex-wrap: wrap; }
.space-avatar { width: 92px; height: 92px; border-radius: 50%; border: 4px solid var(--bg-1); background: var(--bg-1); box-shadow: var(--sh-2); }
.space-detail { flex: 1; padding-top: 48px; min-width: 0; }
.space-detail h2 { font-size: 22px; margin-bottom: 5px; }
.space-sign { color: var(--text-2); font-size: 14px; margin-bottom: 10px; }
.space-stats { display: flex; gap: 26px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.space-stats b { color: var(--text-1); font-size: 17px; margin-right: 3px; }
.space-tabs {
    display: flex; gap: 26px; border-bottom: 1px solid var(--border);
    background: var(--bg-1); padding: 0 26px; border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.space-tabs a { padding: 13px 0; color: var(--text-2); position: relative; }
.space-tabs a.active { color: var(--primary); font-weight: 600; }
.space-tabs a.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--grad-primary); border-radius: 2px; }

/* ---------- 22. 编辑器 ---------- */
.editor-wrap {
    display: flex; flex-direction: column;
    /* 编辑器嵌在 header(60px) + main 上下内边距内，不能再按整屏 100vh 撑高，
       否则页面总高超出一屏、footer 被顶出可视区 */
    height: calc(100vh - var(--header-h) - 62px);
    min-height: 560px;
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-1);
}
.editor-bar { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); background: var(--bg-1); flex-shrink: 0; flex-wrap: wrap; }
.editor-bar input.editor-title {
    flex: 1; font-size: 20px; font-weight: 600; border: none; padding: 7px 0;
    background: transparent; color: var(--text-1);
}
.editor-main { flex: 1; display: flex; min-height: 0; }
.editor-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.editor-pane + .editor-pane { border-left: 1px solid var(--border); }
.editor-pane textarea {
    flex: 1; border: none; padding: 18px 22px; resize: none;
    font-family: "JetBrains Mono", Consolas, Monaco, monospace; font-size: 15px;
    line-height: 1.85; background: var(--bg-1); color: var(--text-1);
}
.md-toolbar { display: flex; gap: 5px; padding: 9px 14px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; background: var(--bg-3); }
.md-toolbar button {
    padding: 4px 11px; border: 1px solid var(--border); background: var(--bg-1);
    border-radius: var(--r-xs); font-size: 13px; color: var(--text-2); transition: all .18s;
}
.md-toolbar button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-050); }
.editor-preview { flex: 1; overflow-y: auto; padding: 18px 22px; }
.editor-meta { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-3); flex-shrink: 0; max-height: 40vh; overflow-y: auto; }
.editor-meta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.editor-meta select, .editor-meta input { padding: 7px 11px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-1); color: var(--text-1); }
.editor-meta input[type=text] { min-width: 0; }
@media (max-width: 768px) {
    /* 窄屏改为上下单栏：编辑区在上、预览在下，不再并排挤压 */
    .editor-wrap { height: auto; min-height: 0; }
    .editor-main { flex-direction: column; }
    .editor-pane + .editor-pane { border-left: none; border-top: 1px solid var(--border); }
    .editor-pane textarea { min-height: 300px; }
    .editor-preview { max-height: 420px; }
    .editor-meta { max-height: none; }
    .editor-meta input[type=text] { width: 100% !important; flex: 1 1 100% !important; }
}

/* ---------- 23. 提示页 / 空状态 / 页脚 ---------- */
.message-page {
    max-width: 480px; margin: 80px auto; background: var(--bg-1);
    border-radius: var(--r-lg); padding: 42px; text-align: center;
    box-shadow: var(--sh-2); border: 1px solid var(--border-2);
}
.message-page .mp-icon { font-size: 50px; margin-bottom: 16px; line-height: 1; }
.message-page .mp-text { font-size: 16px; margin-bottom: 22px; }
.message-page.success .mp-icon { color: var(--success); }
.message-page.error .mp-icon { color: var(--danger); }
.message-page.warning .mp-icon { color: var(--warning); }

.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty .e-icon { font-size: 46px; margin-bottom: 14px; opacity: .45; line-height: 1; }

.footer { background: var(--bg-1); border-top: 1px solid var(--border); padding: 32px 0 24px; margin-top: 8px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; justify-content: center; }
.footer-links a { color: var(--text-2); font-size: 14px; }
.footer-links a:hover { color: var(--primary); }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.fcol h4 { font-size: 14px; color: var(--text-1); margin-bottom: 12px; }
.fcol a { display: block; font-size: 13px; color: var(--text-3); line-height: 2; }
.fcol a:hover { color: var(--primary); }
.footer-copy { color: var(--text-3); font-size: 12px; text-align: center; padding-top: 20px; }

.back-top {
    position: fixed; right: 24px; bottom: 40px; width: 42px; height: 42px;
    background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-md);
    align-items: center; justify-content: center; cursor: pointer;
    box-shadow: var(--sh-2); display: none; z-index: 99; color: var(--text-2);
    transition: all .22s var(--ease);
}
.back-top:hover { color: #fff; border-color: var(--primary); background: var(--primary); transform: translateY(-2px); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-item {
    background: var(--bg-1); border-radius: var(--r-lg); padding: 18px; text-align: center;
    box-shadow: var(--sh-1); border: 1px solid var(--border-2);
}
.stat-item .si-num { font-size: 25px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-item .si-label { font-size: 13px; color: var(--text-3); margin-top: 5px; }

/* 广告位 */
.ad-slot {
    background: var(--bg-3); border: 1px dashed var(--border);
    border-radius: var(--r-md); padding: 14px; text-align: center;
    color: var(--text-4); font-size: 12px; margin-bottom: 16px;
}

/* ---------- 24. 移动端底栏 / 悬浮按钮 ---------- */
.mobile-tabbar {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: var(--bg-1); border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(16, 24, 40, .06);
}
.mobile-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--text-3); font-size: 11px; padding: 3px 0; transition: color .18s;
}
.mobile-tabbar a svg { width: 21px; height: 21px; }
.mobile-tabbar a.on { color: var(--primary); }
.mobile-tabbar.on { display: flex; }
@media (max-width: 768px) {
    .mobile-tabbar { display: flex; }
    .main { padding-bottom: 24px; }
    body { padding-bottom: 56px; }
    /* 上移到悬浮写作按钮（bottom:78px 高 50px）上方，避免两者叠在一起 */
    .back-top { bottom: 142px; }
}
@media (min-width: 769px) { .mobile-tabbar { display: none !important; } }

.fab-write {
    display: none;
    position: fixed; right: 20px; bottom: 78px; z-index: 890;
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--grad-primary); color: #fff;
    align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 162, 242, .42);
    transition: all .22s var(--ease);
}
.fab-write:hover { color: #fff; transform: translateY(-2px) scale(1.04); }
@media (max-width: 768px) { .fab-write { display: flex; } }

/* Toast（common.js 使用） */
.toast-wrap { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 9999; }
.toast {
    background: rgba(26, 28, 31, .94); color: #fff; padding: 10px 22px;
    border-radius: var(--r-full); font-size: 14px; margin-bottom: 10px;
    box-shadow: var(--sh-3); animation: toastIn .25s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   第三方登录
   ============================================================ */
.third-login { margin-top: 22px; }
.third-login .tl-title {
    position: relative; text-align: center; margin-bottom: 16px;
}
.third-login .tl-title::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%;
    height: 1px; background: var(--border-2);
}
.third-login .tl-title span {
    position: relative; background: var(--bg-1); padding: 0 12px;
    font-size: 13px; color: var(--text-3);
}
.third-login .tl-list {
    display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.third-login .tl-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 66px; padding: 10px 4px; border-radius: var(--r-md);
    font-size: 12px; color: var(--text-2);
    border: 1px solid transparent; transition: all .2s var(--ease);
}
.third-login .tl-item:hover {
    background: var(--bg-3); border-color: var(--border); color: var(--text-1);
    transform: translateY(-2px);
}
.third-login .tl-item svg { display: block; border-radius: 50%; }

/* 账号绑定 */
.bind-item {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 16px 4px; border-bottom: 1px solid var(--border-2);
}
.bind-item:last-child { border-bottom: none; }
.bind-item .bi-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bind-item .bi-left svg { border-radius: 50%; flex-shrink: 0; }
.bind-item .bi-name { font-size: 15px; font-weight: 600; color: var(--text-1); }
.bind-item .bi-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.bind-item .bi-right { flex-shrink: 0; }
@media (max-width: 640px) {
    .bind-item { flex-direction: column; align-items: flex-start; }
    .bind-item .bi-right { width: 100%; }
    .bind-item .bi-right .btn { width: 100%; justify-content: center; }
}

/* 弹窗（showModal 使用） */
.modal-mask {
    position: fixed; inset: 0; background: rgba(16, 20, 26, .55);
    display: flex; align-items: center; justify-content: center; z-index: 10000;
    backdrop-filter: blur(3px); animation: fadeIn .18s var(--ease);
}
.modal-box {
    background: var(--bg-1); border-radius: var(--r-lg); width: 520px; max-width: 92vw;
    max-height: 86vh; overflow-y: auto; box-shadow: var(--sh-3);
    animation: modalIn .22s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(-8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   响应式收尾（必须位于文件末尾）
   头部 / 导航 / 搜索框 / 卡片等基础规则都定义在前面的章节里，
   同优先级的媒体查询只有写在它们之后才能真正覆盖生效。
   早期版本把这些规则写在第 3 节，结果被后面的基础规则全部反向覆盖，
   导致窄屏折叠从未生效、移动端出现横向溢出——此处集中管理，避免再犯。
   ============================================================ */

/* ---------- 宽屏增强（≥1200px） ---------- */
@media (min-width: 1200px) {
    .card { padding: 20px; }
    .panel-head { padding: 16px 20px; }
    .panel-body { padding: 20px; }
    .feed-item { padding: 20px 22px; }
    .feed-item h3 { font-size: 18px; }
    .feed-item .fi-summary { margin-bottom: 12px; }
    .feed-cover { width: 168px; height: 108px; }
    .feed-tabs { padding: 0 22px; }
    .slider { height: 300px; }
    .article-view, .article-detail { padding: 40px 48px; }
    .article-view h1, .article-detail h1 { font-size: 30px; }
    .main { padding: 28px 0 56px; }
}
/* ---------- 超宽屏（≥1660px） ---------- */
@media (min-width: 1660px) {
    .feed-cover { width: 190px; height: 120px; }
    .slider { height: 340px; }
}

/* ---------- 1000~1280：主导航压缩，避免与搜索框互相挤压 ---------- */
@media (min-width: 1000px) and (max-width: 1279px) {
    .nav { gap: 0; }
    .nav a { padding: 7px 10px; font-size: 14px; }
}

/* ---------- ≤1000px：收窄搜索框 ---------- */
@media (max-width: 1000px) {
    .header-search { width: 200px; }
}

/* ---------- ≤900px：主导航改为横向滚动，杜绝撑破 header ---------- */
@media (max-width: 900px) {
    .header .container { gap: 12px; }
    .nav { flex: 1 1 0; min-width: 0; gap: 0; overflow-x: auto; scrollbar-width: none; }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { padding: 7px 10px; font-size: 14px; }
    .header-search { width: 170px; }
}

/* ---------- ≤640px：移动端折叠 ---------- */
@media (max-width: 640px) {
    .nav { display: none; }
    .header .container, .header .header-inner { gap: 12px; }
    /* 窄屏只留 LOGO 图标，否则「图标 + 站名 + 搜索 + 按钮」会横向溢出 header */
    .logo { font-size: 0; gap: 0; }
    .logo span { display: none; }
    .logo-img { max-width: 120px; height: 28px; }
    .header-search { width: 150px; }
    .header-search input { height: 34px; padding: 0 32px 0 12px; }
    .header-right { gap: 10px; }
    .hr-btn { font-size: 13px; }
    .btn-write { padding: 6px 12px; font-size: 13px; }
    .theme-toggle { width: 28px; height: 28px; }
    /* 版权栏里的原文链接默认 nowrap，窄屏会撑出横向滚动条 */
    .copyright-text a { white-space: normal; word-break: break-all; }
}
@media (max-width: 380px) {
    .header-search { width: 96px; }
    .header-search input { padding: 0 30px 0 10px; font-size: 13px; }
}

/* ---------- ≤1240px：容器内边距 ---------- */
@media (max-width: 1240px) {
    .container { padding: 0 16px; }
}

/* ---------- ≤991px：双栏折叠为单栏，侧栏下沉到主内容下方 ---------- */
@media (max-width: 991px) {
    /* 侧栏下沉：单列堆叠，侧边栏落到主内容下方（侧栏在 DOM 中排后的页面天然满足） */
    .layout-2col { grid-template-columns: 1fr; }
    .col-main, .col-side { grid-column: 1 / -1; }
    .col-side { display: block; }
}

/* ---------- ≤768px：隐藏顶层黑栏、取消 body 顶部留白（移动端底栏逻辑见上文） ---------- */
@media (max-width: 768px) {
    .topbar { display: none; }
    body { padding-top: 0; }
}

/* ============================================================
   交互支撑样式（配合 common.js 新增的懒加载 / 目录收缩 / 回顶）
   由主代理补齐：JS 会注入 .toc-head 并给图片加 .lazy-img，
   缺少这些规则会导致目录标题栏无样式、图片无淡入效果。
   ============================================================ */

/* 图片懒加载淡入：默认透明，加载完成后 JS 加 .is-loaded 淡入 */
img.lazy-img { opacity: 0; transition: opacity .3s var(--ease); }
img.lazy-img.is-loaded { opacity: 1; }

/* 目录收缩标题栏（common.js 注入到 .toc-box 首位） */
.toc-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 0 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
.toc-head > span { font-size: 14px; font-weight: 600; color: var(--text-1); }
.toc-toggle {
    border: 1px solid var(--border); background: var(--bg-1); color: var(--text-3);
    font-size: 12px; line-height: 1; padding: 3px 9px; border-radius: var(--r-sm);
    transition: all .2s var(--ease);
}
.toc-toggle:hover { color: var(--primary); border-color: var(--primary); }
.toc-box.collapsed .toc-list,
.toc-box.collapsed > a { display: none; }
.toc-box.collapsed { max-height: none; overflow: visible; }

/* 回到顶部：圆形按钮（2026 版 CSDN 风格） */
.back-top { border-radius: 50% !important; }
.back-top.show { display: flex !important; }

/* ============================================================
   第二阶段首页 / 文章详情页 响应式收尾（必须位于文件末尾）
   基础规则已写在正文对应章节，此处仅放媒体查询覆盖，避免被基础规则反向覆盖。
   ============================================================ */

/* 每日精选：窄屏 2 列 → 超窄 1 列 */
@media (max-width: 768px) {
    .dp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .dp-grid { grid-template-columns: 1fr; }
}

/* 技术专区：≤768 三列、≤640 两列 */
@media (max-width: 768px) {
    .ce-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .ce-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 相关推荐：窄屏单列 */
@media (max-width: 640px) {
    .rel-grid { grid-template-columns: 1fr; }
}

/* 面包屑当前项在窄屏放宽省略空间 */
@media (max-width: 640px) {
    .bc-cur { max-width: 100%; }
    .author-card { flex-wrap: wrap; }
    .author-card .ac-follow { margin-left: 0; }
}

/* 未登录评论提示条（文章详情页 .comment-box 内） */
.comment-login {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 16px; margin-bottom: 8px;
    background: var(--bg-3); border: 1px dashed var(--border); border-radius: 6px;
    font-size: 13px; color: var(--text-3); text-align: center;
}
.comment-login a { color: var(--primary); font-weight: 500; }
.comment-login a:hover { text-decoration: underline; }
