/* ==========================================================
   知识库系统 · 全局样式（前台 + 后台）
   ========================================================== */

:root {
    --pri: #2563eb;
    --pri-600: #1d4ed8;
    --pri-700: #1e40af;
    --pri-50: #eff6ff;
    --pri-100: #dbeafe;
    --violet: #7c3aed;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --line: #e5e9f2;
    --line-2: #eef2f7;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --ok: #059669;
    --warn: #d97706;
    --err: #dc2626;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 10px 30px -18px rgba(15, 23, 42, .28);
    --shadow-lg: 0 24px 60px -30px rgba(15, 23, 42, .35);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    /* 吸底布局：内容不足一屏时，页脚始终压在窗口最底部 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* 主体撑满剩余空间，把页脚推到最底部 */
main.kb-main { flex: 1 0 auto; }

a { color: var(--pri); text-decoration: none; }
a:hover { color: var(--pri-600); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.35; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
mark { background: #fff3bf; color: #7c2d12; padding: 0 2px; border-radius: 3px; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.nav {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 66px;
    /* 关键：Bootstrap 的 .nav 自带 flex-wrap:wrap，会让右侧用户区折到第二行，
       导航栏高度固定 66px 时折行内容会压到页面横幅上，这里强制单行 */
    flex-wrap: nowrap;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 17px;
    color: var(--ink);
    letter-spacing: -.2px;
    flex: 0 0 auto;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--pri), var(--violet));
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .7);
}

.logo-mark svg { width: 19px; height: 19px; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 2px; min-width: 0; }

.nav-links a {
    padding: 8px 11px;
    border-radius: 9px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: .16s;
}

.nav-links a:hover { background: var(--pri-50); color: var(--pri-600); }
.nav-links a.active { background: var(--pri-50); color: var(--pri-600); font-weight: 600; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* 顶栏用户区：头像 + 姓名，水平居中排列，窄屏时只留头像 */
.nav-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-user-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }

/* 仅在移动端抽屉里出现的入口（管理后台 / 退出 / 登录 / 注册） */
.nav-mobile-only { display: none !important; }

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    content: "";
    display: block;
    width: 17px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    position: relative;
}

.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--pri);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .18s;
    line-height: 1.5;
    white-space: nowrap;
}

.btn:hover { background: var(--pri-600); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 20px -12px rgba(37, 99, 235, .8); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }

.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #f8fafc; color: var(--ink); box-shadow: var(--shadow-sm); }

.btn-soft { background: var(--pri-50); color: var(--pri-600); }
.btn-soft:hover { background: var(--pri-100); color: var(--pri-700); }

.btn-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: var(--err); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.input, .select, .textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    transition: .16s;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--pri);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.field { margin-bottom: 16px; }
.field > label, .form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
/* 表单里的「勾选框」类字段：外观与 .input / .select 完全一致，便于和旁边的控件对齐 */
.field > label.check-box {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 0;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--ink);
    cursor: pointer;
    transition: .16s;
}
.field > label.check-box:hover { border-color: #c7d5ee; background: #f4f8ff; }
.field > label.check-box input { width: 16px; height: 16px; flex: none; margin: 0; accent-color: var(--pri); }
.field > label.check-box > span { min-width: 0; }
.field > label.check-box .hint { display: inline; margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--muted); }
.field .hint { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
/* 同一行内字段标签高度不一致时，让输入框底对齐，避免参差不齐 */
.grid-2 > .field, .grid-3 > .field, .grid-4 > .field { display: flex; flex-direction: column; }
.grid-2 > .field > .input, .grid-2 > .field > .select, .grid-2 > .field > .textarea,
.grid-3 > .field > .input, .grid-3 > .field > .select, .grid-3 > .field > .textarea,
.grid-4 > .field > .input, .grid-4 > .field > .select, .grid-4 > .field > .textarea { margin-top: auto; }

/* ---------------- 首页 Hero ---------------- */
.hero {
    position: relative;
    padding: 62px 0 74px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 46%, #4f46e5 100%);
    color: #fff;
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 68%);
    top: -220px; right: -120px;
}

.hero::after {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(124, 58, 237, .38), transparent 70%);
    bottom: -240px; left: -100px;
}

.hero-inner { position: relative; z-index: 2; text-align: center; }

/* 蓝色渐变横幅里的标题必须反白：compat.css 给 h1~h6 统一上了深色，需要显式覆盖 */
.hero h1, .hero h2, .hero h3 { color: #fff; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .24);
    font-size: 12.5px;
    letter-spacing: .4px;
    margin-bottom: 18px;
    color: #e0e7ff;
}

.hero h1 {
    font-size: 40px;
    line-height: 1.25;
    letter-spacing: -.5px;
    margin-bottom: 12px;
    font-weight: 800;
}

.hero p { color: rgba(255, 255, 255, .82); font-size: 15.5px; }

.search-panel {
    margin: 30px auto 0;
    max-width: 860px;
    background: #fff;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 30px 60px -30px rgba(8, 15, 40, .6);
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.search-panel .field-inline { flex: 1 1 60%; display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.search-panel .field-inline svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.search-panel input[type="search"],
.search-panel input[type="text"] {
    border: 0;
    flex: 1;
    padding: 12px 0;
    font-size: 15px;
    outline: none;
    background: transparent;
    color: var(--ink);
    min-width: 0;
}

.search-panel .select-wrap { flex: 0 0 172px; border-left: 1px solid var(--line); padding-left: 8px; }
.search-panel .select { border: 0; box-shadow: none; background-color: transparent; }

.search-panel .btn { flex: 0 0 auto; padding: 12px 24px; border-radius: 12px; }

.hero-tags { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center; }
.hero-tags span { display: inline-flex; align-items: center; color: rgba(255, 255, 255, .6); font-size: 12.5px; line-height: 1.5; }
.hero-tags a {
    display: inline-flex;
    align-items: center;
    color: #e0e7ff;
    font-size: 12.5px;
    line-height: 1.5;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    transition: .16s;
}
.hero-tags a:hover { background: rgba(255, 255, 255, .24); color: #fff; }

/* ---------------- 统计卡 ---------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: -34px;
    position: relative;
    z-index: 5;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--pri-50);
    color: var(--pri);
    flex: 0 0 auto;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.violet { background: #f5f3ff; color: var(--violet); }
.stat-icon.green { background: #ecfdf5; color: var(--ok); }
.stat-icon.amber { background: #fffbeb; color: var(--warn); }

.stat-value { font-size: 23px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--muted); }

/* ---------------- 区块 ---------------- */
.section { padding: 46px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: 22px; }
.section-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.section-head .more { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }

.layout-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.layout-side { display: grid; gap: 18px; position: sticky; top: 86px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.panel-head h3 { font-size: 15px; }
.panel-body { padding: 16px 20px; }
.panel-body.tight { padding: 10px 12px; }

/* ---------------- 文档卡片 ---------------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 16px; }

.doc-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: .2s;
    position: relative;
    overflow: hidden;
}

.doc-card::after {
    content: "";
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: linear-gradient(var(--pri), var(--violet));
    opacity: 0;
    transition: .2s;
}

.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d8e2f3; }
.doc-card:hover::after { opacity: 1; }

.doc-card-top { display: flex; align-items: center; gap: 10px; }

.file-badge {
    width: 40px; height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .3px;
    color: #fff;
    flex: 0 0 auto;
    text-transform: uppercase;
    /* 兜底底色：即使类名未命中，也不会出现“白字白底 → 图标看不见”的情况 */
    background: linear-gradient(140deg, #8b5cf6, #6d28d9);
}

.file-badge.doc, .file-badge.word { background: linear-gradient(140deg, #3b82f6, #1d4ed8); }
.file-badge.xls, .file-badge.excel { background: linear-gradient(140deg, #10b981, #047857); }
.file-badge.ppt { background: linear-gradient(140deg, #f59e0b, #d97706); }
.file-badge.pdf { background: linear-gradient(140deg, #ef4444, #b91c1c); }
.file-badge.txt { background: linear-gradient(140deg, #64748b, #334155); }
.file-badge.other { background: linear-gradient(140deg, #8b5cf6, #6d28d9); }

.doc-title {
    font-size: 15px;
    font-weight: 650;
    color: var(--ink);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.doc-title:hover { color: var(--pri-600); }

.doc-excerpt {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.8;
}
.tag.blue { background: var(--pri-50); color: var(--pri-600); }
.tag.violet { background: #f5f3ff; color: #6d28d9; }
.tag.green { background: #ecfdf5; color: #047857; }
.tag.amber { background: #fffbeb; color: #b45309; }
.tag.gray { background: #f1f5f9; color: #475569; }

.dot { width: 3px; height: 3px; border-radius: 50%; background: #cbd5e1; }

/* ---------------- 列表 / 检索结果 ---------------- */
.result-list { display: flex; flex-direction: column; gap: 14px; }

.result-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: .18s;
    display: flex;
    gap: 16px;
}
.result-item:hover { border-color: #cfdcf2; box-shadow: var(--shadow); }

.result-body { flex: 1; min-width: 0; }
.result-title { font-size: 16px; font-weight: 650; line-height: 1.5; margin-bottom: 6px; display: block; color: var(--ink); }
.result-title:hover { color: var(--pri-600); }
.result-snippet { font-size: 13.5px; color: var(--muted); line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.result-snippet mark { font-weight: 600; }
.result-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }

.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 600;
}

/* ---------------- 筛选侧栏 ---------------- */
.filter-group { padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.filter-group:last-child { border-bottom: 0; }
.filter-group h4 { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .4px; margin-bottom: 10px; }
.filter-list { display: flex; flex-direction: column; gap: 2px; }

.filter-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text);
    transition: .14s;
}
.filter-list a:hover { background: #f8fafc; color: var(--pri-600); }
.filter-list a.active { background: var(--pri-50); color: var(--pri-600); font-weight: 600; }
.filter-list .count { font-size: 11.5px; color: var(--muted); background: #f1f5f9; padding: 1px 7px; border-radius: 999px; }
.filter-list a.active .count { background: #dbeafe; color: var(--pri-700); }

/* 组织筛选里的子栏目（车间）行 */
.filter-list a.is-sub { position: relative; padding-left: 27px; font-size: 12.8px; color: #46586f; }
.filter-list a.is-sub::before { content: "└"; position: absolute; left: 12px; color: #c3cede; }
.filter-list .org-note { margin: 8px 0 2px; padding: 0 10px; font-size: 11.5px; color: var(--muted); }

/* 组织筛选：部门可折叠（箭头负责展开，部门名仍是筛选链接） */
.filter-list .fl-org-head { display: flex; align-items: center; }
.filter-list .fl-caret-spacer { flex: 0 0 auto; width: 20px; height: 1px; }
.filter-list .fl-caret {
    flex: 0 0 auto; width: 20px; height: 30px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: none; border-radius: 6px; color: #94a3b8;
    cursor: pointer; transition: background .14s, color .14s;
}
.filter-list .fl-caret:hover { background: #f1f5f9; color: var(--pri-600); }
.filter-list .fl-caret:focus-visible { outline: 2px solid var(--pri); outline-offset: -2px; }
.filter-list .fl-caret svg { width: 13px; height: 13px; transition: transform .18s ease; }
.filter-list .fl-caret[aria-expanded="true"] svg { transform: rotate(90deg); color: var(--pri); }
.filter-list .fl-org-head > a { flex: 1 1 auto; min-width: 0; }
.filter-list .fl-org-head > a > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-list .org-kids { display: flex; flex-direction: column; gap: 2px; margin: 0 0 3px 7px; padding-left: 0; border-left: 1px dashed #e2e9f3; }
.filter-list .org-kids[hidden] { display: none; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13px;
    color: var(--text);
    transition: .16s;
}
.chip:hover { border-color: #c3d3ee; color: var(--pri-600); }
.chip.active { background: var(--pri); border-color: var(--pri); color: #fff; }
.chip .count { font-size: 11px; opacity: .75; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.pager-item {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 13.5px;
    transition: .15s;
}
.pager-item:hover { border-color: var(--pri); color: var(--pri); }
.pager-item.is-active { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.pager-gap { color: var(--muted); padding: 0 4px; }
.pager-total { margin-left: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------------- 详情页 ---------------- */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 20px 0 0; flex-wrap: wrap; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--pri); }

.detail-head { padding: 18px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.detail-head h1 { font-size: 26px; line-height: 1.4; margin-bottom: 12px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.detail-meta span { display: inline-flex; align-items: center; gap: 5px; }

.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.content-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 28px;
    font-size: 14.5px;
    line-height: 2;
    color: var(--text);
    max-height: 620px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.content-box.expanded { max-height: none; }

/* 正文里的表格（Excel 文档）：按行列铺开，和原表对得上 */
.content-box.is-sheet { white-space: normal; line-height: 1.6; padding: 16px 18px; }
.content-sheet-wrap { max-width: 100%; overflow-x: auto; }
.content-sheet { border-collapse: collapse; font-size: 13px; color: var(--text); }
.content-sheet td { border: 1px solid #e2e8f0; padding: 4px 9px; white-space: nowrap; }
.content-sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
.content-sheet tr:nth-child(even) td { background: #fbfdff; }
.content-sheet-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

.info-list { display: grid; gap: 10px; font-size: 13.5px; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; }
.info-list dt { color: var(--muted); flex: 0 0 auto; }
.info-list dd { margin: 0; text-align: right; color: var(--ink); word-break: break-all; }

/* ---------------- 文件对比 ---------------- */
.tabs { display: flex; gap: 6px; background: #eef2f8; padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
    padding: 8px 18px;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: .16s;
    white-space: nowrap;
    flex: 0 0 auto;
}
.tabs .active { background: #fff; color: var(--pri-600); box-shadow: var(--shadow-sm); }

.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 34px 20px;
    text-align: center;
    background: #fbfdff;
    transition: .18s;
    cursor: pointer;
    min-height: 232px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--pri); background: var(--pri-50); }
.dropzone .dz-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; background: var(--pri-50); color: var(--pri); display: grid; place-items: center; }
.dropzone h4 { font-size: 15px; margin-bottom: 6px; }
.dropzone p { font-size: 12.5px; color: var(--muted); }
.dropzone .dz-tip { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.dropzone .dz-count { margin-top: 12px; color: var(--pri); font-weight: 600; word-break: break-all; }

/* ---------------- 上传队列 ---------------- */
[hidden] { display: none !important; }
.btn:disabled, .mini-btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover, .mini-btn:disabled:hover { transform: none; box-shadow: none; }
.upl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 0 2px; }
.upl-toolbar .small { color: var(--muted); }

.upl-list {
    margin-top: 10px;
    max-height: 330px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px;
    background: #fbfcff;
}

.upl-item { display: flex; align-items: center; gap: 11px; padding: 10px 10px; border-radius: 10px; transition: background .15s; }
.upl-item + .upl-item { border-top: 1px solid var(--line-2); }
.upl-item:hover { background: #fff; }
.upl-item .file-badge { width: 34px; height: 34px; font-size: 9.5px; border-radius: 9px; }
.upl-main { flex: 1 1 auto; min-width: 0; }
.upl-line { display: flex; align-items: baseline; gap: 8px; }
.upl-name { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl-state { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }
.upl-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl-bar { height: 4px; border-radius: 999px; background: #eef2f7; margin-top: 7px; overflow: hidden; }
.upl-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width .18s ease; }

.upl-item[data-state="wait"] .upl-bar,
.upl-item[data-state="bad"] .upl-bar { display: none; }
.upl-item[data-state="fail"] .upl-bar i { background: linear-gradient(90deg, #f87171, #dc2626); }
.upl-item[data-state="done"] .upl-bar i { background: linear-gradient(90deg, #34d399, #059669); }

.upl-item[data-state="up"] .upl-state { color: var(--pri); font-weight: 600; }
.upl-item[data-state="done"] .upl-state { color: var(--ok); font-weight: 600; }
.upl-item[data-state="fail"] .upl-state,
.upl-item[data-state="fail"] .upl-meta { color: var(--err); font-weight: 600; }
.upl-item[data-state="bad"] .upl-state,
.upl-item[data-state="bad"] .upl-meta { color: var(--warn); font-weight: 600; }

/* 失败原因可能较长，允许折行完整显示 */
.upl-item[data-state="fail"] .upl-meta,
.upl-item[data-state="bad"] .upl-meta {
    white-space: normal;
    line-height: 1.5;
    overflow: visible;
    overflow-wrap: anywhere;
    margin-top: 3px;
}

.upl-del {
    flex: 0 0 auto;
    width: 24px; height: 24px;
    display: grid; place-items: center;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.upl-del:hover { background: #fef2f2; border-color: #fecaca; color: var(--err); }
.upl-link { flex: 0 0 auto; font-size: 12.5px; font-weight: 600; }

.sim-bar { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; min-width: 90px; }
.sim-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #16a34a); }
.sim-bar.warn i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.sim-bar.low i { background: linear-gradient(90deg, #94a3b8, #64748b); }

.diff-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.diff-row:last-child { border-bottom: 0; }
.diff-flag { flex: 0 0 62px; }
.diff-flag span { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.flag-same { background: #ecfdf5; color: #047857; }
.flag-new { background: #fff7ed; color: #c2410c; }

/* ---------------- 提示 ---------------- */
.flash-stack { position: fixed; top: 80px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    animation: slideIn .3s ease;
}
.flash-success { border-left: 3px solid var(--ok); }
.flash-error { border-left: 3px solid var(--err); }
.flash-warn { border-left: 3px solid var(--warn); }
.flash-info { border-left: 3px solid var(--pri); }
.flash-close { margin-left: auto; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.alert { padding: 13px 16px; border-radius: 12px; font-size: 13.5px; border: 1px solid; margin-bottom: 16px; }
.alert-info { background: var(--pri-50); border-color: #c7ddff; color: #1e40af; }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty svg { width: 78px; height: 78px; opacity: .35; margin-bottom: 14px; }
.empty h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13.5px; }

/* ---------------- 页脚 ---------------- */
.site-footer {
    margin-top: 48px;
    background: #0b1220;
    color: #94a3b8;
    padding: 20px 0;
    font-size: 13px;
}
/* 页脚只保留版权 + 备案一行，登录与游客完全一致 */
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #64748b; font-size: 12.5px; }
/* 页脚备案行：公安备案 / ICP / 版本号，可点击核验 */
.fb-legal { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 2px; }
.fb-legal .fb-item { display: inline-flex; align-items: center; gap: 4px; color: #64748b; padding: 0; line-height: 1.6; }
.fb-legal a.fb-item:hover, .fb-legal a.fb-item:focus-visible { color: #e2e8f0; text-decoration: underline; text-underline-offset: 3px; }
.fb-legal .fb-ico { width: 13px; height: 13px; flex: 0 0 auto; opacity: .85; }
.fb-legal .fb-dot { font-style: normal; color: #475569; margin: 0 7px; }
/* 窄屏备案行会折行，分隔圆点会孤零零留在行尾，改用纯间距分隔 */
@media (max-width: 767px) {
    .fb-legal { gap: 5px 14px; justify-content: center; }
    .fb-legal .fb-dot { display: none; }
}

/* ==========================================================
   后台管理
   ========================================================== */
.admin-body { background: #f4f6fb; }

.admin-shell { display: flex; min-height: 100dvh; }

.admin-side {
    width: 186px;
    flex: 0 0 186px;
    background: linear-gradient(180deg, #0b1220, #111c33 60%, #0d1729);
    color: #cbd5e1;
    padding: 20px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
}

.admin-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; color: #fff; font-weight: 700; font-size: 15.5px; }
.admin-brand .logo-mark { width: 32px; height: 32px; border-radius: 9px; }
.admin-brand small { display: block; font-size: 11px; color: #64748b; font-weight: 400; letter-spacing: .5px; }

/* ---- 侧边栏折叠（收起为图标条）---- */
.admin-side { transition: width .2s ease, flex-basis .2s ease, padding .2s ease; }
.admin-brand .brand-text { min-width: 0; overflow: hidden; white-space: nowrap; }
.side-link .side-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (min-width: 901px) {
    html.side-collapsed .admin-side {
        width: 60px;
        flex: 0 0 60px;
        padding: 18px 8px 22px;
        overflow-x: hidden;
    }
    html.side-collapsed .admin-brand { justify-content: center; padding: 4px 0 18px; }
    html.side-collapsed .admin-brand .brand-text { display: none; }
    html.side-collapsed .side-label {
        height: 1px;
        padding: 0;
        margin: 11px 9px 9px;
        background: rgba(255, 255, 255, .09);
        font-size: 0;
        overflow: hidden;
    }
    html.side-collapsed .side-link { justify-content: center; padding: 11px 0; gap: 0; }
    html.side-collapsed .side-link .side-text { display: none; }
    html.side-collapsed .side-link svg { width: 18px; height: 18px; opacity: .85; }
    html.side-collapsed .side-link .badge-num { display: none; }
    html.side-collapsed .side-foot { display: none; }
}

.side-label { font-size: 10.5px; letter-spacing: 1.2px; color: #475569; padding: 14px 12px 8px; font-weight: 700; text-transform: uppercase; }

.side-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #b6c2d6;
    font-size: 13.8px;
    transition: .16s;
}
.side-link svg { width: 17px; height: 17px; opacity: .8; flex: 0 0 auto; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active { background: linear-gradient(100deg, rgba(37, 99, 235, .95), rgba(79, 70, 229, .85)); color: #fff; box-shadow: 0 10px 22px -14px rgba(37, 99, 235, .9); }
.side-link.active svg { opacity: 1; }
.side-link .badge-num { margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, .14); padding: 1px 7px; border-radius: 999px; }

.side-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 11.5px; color: #475569; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-top {
    height: 64px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.admin-top h1 { font-size: 16px; font-weight: 700; }
.admin-top .spacer { margin-left: auto; }
/* 后台顶栏的折叠按钮在所有宽度下都显示（前台顶栏的仍是移动端专用） */
.admin-top .nav-toggle { display: inline-flex; flex: 0 0 auto; transition: .16s; }
.admin-top .nav-toggle:hover { border-color: #c7d2fe; background: var(--pri-50); }
.admin-top .nav-toggle:hover span,
.admin-top .nav-toggle:hover span::before,
.admin-top .nav-toggle:hover span::after { background: var(--pri); }
@media (min-width: 901px) {
    html.side-collapsed .admin-top .nav-toggle { background: #eef2ff; border-color: #c7d2fe; }
    html.side-collapsed .admin-top .nav-toggle span,
    html.side-collapsed .admin-top .nav-toggle span::before,
    html.side-collapsed .admin-top .nav-toggle span::after { background: var(--pri); }
}

.top-user { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(140deg, var(--pri), var(--violet)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }

.admin-content { padding: 24px; flex: 1; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; }
.page-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 工具栏里嵌表单（如操作日志的搜索 + 清空）时，表单本身也要参与居中对齐 */
.page-head .actions > form { display: flex; align-items: center; gap: 8px; margin: 0; }

/* 操作日志工具条：搜索框、搜索、清空日志三者同高同一水平线 */
.logs-search .input { width: 220px; height: 36px; padding: 0 12px; font-size: 13.5px; }
.logs-tools .btn { height: 36px; padding: 0 15px; }
@media (max-width: 640px) {
    .logs-tools { width: 100%; }
    .logs-search { flex: 1 1 auto; }
    .logs-search .input { width: 100%; }
}

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { padding: 15px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.kpi .kpi-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi .kpi-value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .spark { position: absolute; right: 14px; bottom: 12px; opacity: .16; }
.kpi .spark svg { width: 44px; height: 44px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
    text-align: left;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:hover td { background: #fbfdff; }
table.data td.actions-cell { white-space: nowrap; }
table.data .t-title { font-weight: 600; color: var(--ink); }
table.data .t-sub { font-size: 12px; color: var(--muted); }

.mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 12.5px;
    cursor: pointer;
    transition: .15s;
}
.mini-btn:hover { border-color: var(--pri); color: var(--pri); }
.mini-btn.danger:hover { border-color: #fca5a5; color: var(--err); background: #fef2f2; }

.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); background: #fbfdff; flex-wrap: wrap; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 150px; }
.filter-bar .input { min-width: 210px; }

.login-wrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(900px 500px at 12% 0%, #dbeafe, transparent 60%), radial-gradient(800px 500px at 100% 100%, #ede9fe, transparent 55%), #eef2f9;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 34px 32px 28px;
    box-shadow: 0 30px 70px -34px rgba(15, 23, 42, .45);
}
.login-card .logo { justify-content: center; margin-bottom: 6px; }
.login-card h2 { text-align: center; font-size: 19px; margin: 14px 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    margin-top: 8px;
    font-size: 13px;
    background: #fbfdff;
}

.progress { height: 6px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--pri); transition: width .3s; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar-chart .bar i { width: 100%; max-width: 34px; background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: 6px 6px 3px 3px; min-height: 4px; transition: .3s; }
.bar-chart .bar span { font-size: 11px; color: var(--muted); }
.bar-chart .bar em { font-size: 11px; color: var(--text); font-style: normal; }

/* ---------------- 响应式 ---------------- */
/* 中等宽度：顶栏放不下完整菜单，用户名先收成头像，避免挤压 */
@media (max-width: 1240px) {
    .nav-user-name { display: none; }
}

/* 导航改为抽屉（比内容区断点更早，避免横向挤压） */
@media (max-width: 1020px) {
    .nav-links {
        position: absolute;
        top: 66px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        flex-direction: column;
        align-items: stretch;
        padding: 10px 14px 16px;
        gap: 2px;
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: inline-flex; }
    .nav-links .nav-mobile-only { display: block !important; }
    .nav-links .nav-mobile-only[href*="logout"] { color: var(--muted); margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
}

@media (max-width: 1080px) {
    .layout-main { grid-template-columns: minmax(0, 1fr); }
    .layout-side { position: static; grid-template-columns: 1fr 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .hero { padding: 46px 0 66px; }
    .hero h1 { font-size: 28px; }
    .search-panel { flex-wrap: wrap; border-radius: 16px; }
    .search-panel .field-inline { flex: 1 1 100%; }
    .search-panel .select-wrap { flex: 1 1 40%; border-left: 0; border-top: 1px solid var(--line); padding: 4px 8px 0; }
    .search-panel .btn { flex: 1 1 40%; }
    .stats { grid-template-columns: 1fr 1fr; }

    .admin-side {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .4);
    }
    .admin-side.open { transform: none; }
    .admin-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 99; display: none; }
    .admin-overlay.show { display: block; }
    .admin-content { padding: 16px; }
    .admin-top { padding: 0 12px; gap: 8px; }
    .admin-top h1 { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .admin-top .top-user span:not(.avatar) { display: none; }
    .admin-top .top-user { padding: 3px; border: 0; }
    table.data { min-width: 660px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .detail-head h1 { font-size: 21px; }
    .content-box { padding: 18px; }
}

@media (max-width: 620px) {
    .container { padding: 0 16px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -26px; }
    .stat-card { padding: 13px 14px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; border-radius: 11px; }
    .stat-icon svg { width: 18px; height: 18px; }
    .stat-value { font-size: 19px; }
    .stat-label { font-size: 11.5px; }
    .doc-grid { grid-template-columns: 1fr; }
    .layout-side { grid-template-columns: 1fr; }
    .hero h1 { font-size: 23px; }
    .hero p { font-size: 13.5px; }
    .section { padding: 32px 0; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi .kpi-value { font-size: 21px; }
    .result-item { padding: 14px 15px; gap: 12px; }
    .flash-stack { left: 14px; right: 14px; top: 76px; max-width: none; }
    .login-card { padding: 26px 20px; }
    .filter-bar .input, .filter-bar .select { min-width: 0; flex: 1 1 100%; }
    .page-head { flex-direction: column; align-items: stretch; }
    /* 手机上顶栏空间有限：隐藏文字型入口，收进抽屉菜单，避免与 logo 挤压重叠 */
    .nav-right .nav-admin-btn,
    .nav-right .nav-logout-btn,
    .nav-right .nav-register-btn,
    .nav-right .nav-user-name { display: none !important; }
    .nav-links .nav-mobile-only { display: block !important; }
    .nav-links .nav-mobile-only[href*="logout"] { color: var(--muted); margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
}

/* ==========================================================
   统一视觉：把合并自「文档查阅系统」的页面收敛到知识库风格
   ========================================================== */

/* ---------------- 登录 / 注册 ---------------- */
.auth-card {
    border: 0;
    border-radius: 22px;
    box-shadow: 0 30px 70px -36px rgba(15, 23, 42, .45);
    overflow: hidden;
}
.auth-card .card-body { padding: 34px 32px 28px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .logo-mark {
    width: 48px; height: 48px; border-radius: 14px;
    margin: 0 auto 14px;
    box-shadow: 0 12px 24px -12px rgba(37, 99, 235, .85);
}
.auth-head .logo-mark svg { width: 25px; height: 25px; }
.auth-title { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
.auth-sub { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.auth-card .form-label { font-size: 13px; }
.auth-card .form-control { height: 46px; border-radius: 11px; }
.auth-card .btn { height: 46px; border-radius: 11px; font-size: 15px; }
.auth-card .btn-primary { box-shadow: 0 16px 28px -18px rgba(37, 99, 235, .95); }
.auth-card hr { margin: 18px 0; border-color: var(--line-2); }
.auth-card .auth-foot { text-align: center; margin-top: 16px; font-size: 13px; }

/* ---------------- 文档详情：渐变标题卡 ---------------- */
.doc-head {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 26px 26px 22px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 54%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 22px 46px -30px rgba(30, 58, 138, .8);
}
.doc-head::after {
    content: "";
    position: absolute;
    width: 380px; height: 380px;
    right: -140px; top: -210px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .2), transparent 68%);
    pointer-events: none;
}
.doc-head > * { position: relative; z-index: 2; }
.doc-head h1 {
    font-size: 23px;
    line-height: 1.45;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -.2px;
}
.doc-head .doc-type {
    background: rgba(255, 255, 255, .2) !important;
    border: 1px solid rgba(255, 255, 255, .32);
    backdrop-filter: blur(6px);
    vertical-align: middle;
}
.doc-head .badge {
    background: rgba(255, 255, 255, .2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, .3);
}
.doc-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 12px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .78);
}
.doc-head-meta span { display: inline-flex; align-items: center; gap: 5px; }
.doc-head-meta b { font-weight: 500; color: rgba(255, 255, 255, .58); }
/* 由 IMA 知识库转入的文档，在标题栏给个来源标识 */
.doc-head-meta .ima-origin {
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    padding: 1px 10px;
    color: #fff;
}
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.doc-actions .btn {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .26);
    color: #fff;
    backdrop-filter: blur(4px);
}
.doc-actions .btn:hover {
    background: rgba(255, 255, 255, .24);
    border-color: rgba(255, 255, 255, .4);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: none;
}
.doc-actions .btn-primary {
    background: #fff;
    border-color: #fff;
    color: #1d4ed8;
    font-weight: 700;
    box-shadow: 0 12px 24px -16px rgba(2, 6, 23, .9);
}
.doc-actions .btn-primary:hover { background: #eff6ff; border-color: #eff6ff; color: #1e40af; }
.doc-actions .btn.disabled, .doc-actions .btn:disabled { opacity: .55; color: #fff; }

/* 次要操作容器：桌面端融进按钮行（display:contents 不改变原有排布），
   手机端默认收起，由「更多」按钮展开 —— 见 mobile.css */
.doc-actions-extra { display: contents; }
.doc-actions .doc-more-btn { display: none; }
.doc-actions .doc-more-btn .act-ico { margin-right: 4px; }

/* 侧栏信息：用描述列表替代表格，去掉"数据表"感 */
.info-list.board { gap: 0; }
.info-list.board > div {
    padding: 9px 0;
    border-bottom: 1px dashed var(--line-2);
    font-size: 13px;
    align-items: baseline;
}
.info-list.board > div:last-child { border-bottom: 0; }
.info-list.board dt { color: var(--muted); }
.info-list.board dd { color: var(--ink); font-weight: 600; }

/* ---------------- 上传页：原生文件框美化 ---------------- */
input[type="file"].form-control,
input[type="file"].input { padding: 5px 10px; height: auto; display: flex; align-items: center; }
input[type="file"].form-control::file-selector-button,
input[type="file"].input::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 0;
    border-radius: 9px;
    background: var(--pri-50);
    color: var(--pri-600);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: .16s;
}
input[type="file"].form-control::file-selector-button:hover,
input[type="file"].input::file-selector-button:hover { background: var(--pri-100); color: var(--pri-700); }

/* ---------------- 文件对比：页头与内容衔接 ---------------- */
.compare-hero { padding: 40px 0 58px; }
.compare-hero h2 { font-size: 27px; color: #fff; }
.compare-hero p { color: rgba(255, 255, 255, .82); font-size: 14px; margin-top: 8px; max-width: 720px; }
.compare-body { margin-top: -34px; position: relative; z-index: 3; }

@media (max-width: 900px) {
    .doc-head { padding: 20px 18px 18px; }
    .doc-head h1 { font-size: 19px; }
    .auth-card .card-body { padding: 26px 20px 22px; }
    .compare-hero { padding: 30px 0 50px; }
    .compare-hero h2 { font-size: 22px; }
}

/* ==========================================================
   v2.0.9 · 文件智能对比页重构
   ========================================================== */
.cmp-hero { padding: 40px 0 62px; }
.cmp-hero-inner { display: flex; align-items: center; gap: 34px; }
.cmp-hero-copy { flex: 1 1 auto; min-width: 0; }
.cmp-badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 13px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
    color: #e0e7ff; font-size: 12px; font-weight: 600; letter-spacing: .5px;
}
.cmp-badge svg { width: 13px; height: 13px; }
.cmp-hero h1 { font-size: 31px; color: #fff; margin: 14px 0 10px; letter-spacing: -.5px; font-weight: 800; }
.cmp-hero h1 em { font-style: normal; color: #c7d2fe; }
.cmp-hero-copy > p { color: rgba(255, 255, 255, .84); font-size: 14px; max-width: 640px; }
.cmp-hero-tags { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; }
.cmp-hero-tags span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .8); }
.cmp-hero-tags svg { width: 14px; height: 14px; color: #a5b4fc; flex: 0 0 auto; }

.cmp-hero-card {
    flex: 0 0 292px; padding: 16px 18px 18px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 16px;
    backdrop-filter: blur(6px);
}
.cmp-hero-card h4 {
    font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px;
    color: rgba(224, 231, 255, .85); text-transform: uppercase; margin-bottom: 13px;
}
.cmp-flow { display: grid; gap: 13px; }
.cmp-flow li { display: flex; gap: 10px; align-items: flex-start; }
.cmp-flow i {
    width: 21px; height: 21px; flex: 0 0 auto; margin-top: 1px;
    border-radius: 7px; background: rgba(255, 255, 255, .2); color: #fff;
    font-style: normal; font-size: 11.5px; font-weight: 800;
    display: grid; place-items: center;
}
.cmp-flow b { display: block; font-size: 13px; color: #fff; font-weight: 600; line-height: 1.45; }
.cmp-flow span { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .68); line-height: 1.5; }

.cmp-body { margin-top: -32px; position: relative; z-index: 3; }

/* ---- 提交卡片 ---- */
.cmp-panel { overflow: hidden; }
.cmp-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 17px 22px 15px; border-bottom: 1px solid var(--line-2);
    background: linear-gradient(180deg, #fbfdff, #fff);
}
.cmp-panel-head h3 { font-size: 16px; }
.cmp-panel-head .tag { white-space: nowrap; flex: 0 0 auto; }
.cmp-panel-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.cmp-panel-body { padding: 20px 22px 22px; }
.cmp-panel .alert { margin-bottom: 16px; }

.cmp-target {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 11px 14px; margin-bottom: 16px;
    background: var(--pri-50); border: 1px solid #dbe7fb; border-radius: 12px;
    font-size: 13px; color: #1e40af;
}
.cmp-target > svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--pri); }
.cmp-target b { color: #1e3a8a; }
.cmp-target .cmp-target-act { margin-left: auto; font-size: 12.5px; font-weight: 600; white-space: nowrap; }

.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.cmp-col { display: flex; flex-direction: column; min-width: 0; }
.cmp-col-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.cmp-num {
    width: 22px; height: 22px; flex: 0 0 auto; border-radius: 8px;
    background: var(--pri-50); color: var(--pri-600);
    font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.cmp-col-head b { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.cmp-col-head .tag { margin-left: auto; font-size: 11px; padding: 2px 8px; }

.cmp-dz { flex: 1; min-height: 0; padding: 22px 18px 20px; border-radius: 14px; border-width: 1.5px; }
.cmp-dz .dz-icon {
    width: 48px; height: 48px; margin-bottom: 12px; border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff, #e0e7ff); color: var(--pri-600);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08);
}
.cmp-dz .dz-icon svg { width: 24px; height: 24px; }
.cmp-dz h4 { font-size: 14.5px; }
.cmp-dz .cmp-dz-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cmp-exts { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 13px; }
.cmp-exts span {
    font-size: 10px; font-weight: 700; letter-spacing: .4px;
    color: #64748b; background: #f1f5f9; border: 1px solid #e8eef7;
    border-radius: 6px; padding: 2px 6px;
}
.cmp-file {
    margin-top: 14px; max-width: 100%; word-break: break-all;
    font-size: 12.5px; color: var(--muted);
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    background: #f4f7fc; border: 1px solid #e8eef7;
}
.cmp-file svg { width: 13px; height: 13px; flex: 0 0 auto; opacity: .7; }

.cmp-col-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: auto; padding-top: 9px; min-height: 19px; font-size: 12px; color: #94a3b8;
}
.cmp-col-foot b { color: var(--pri-600); font-weight: 700; }
.cmp-col-foot a { font-size: 12px; color: var(--muted); }
.cmp-col-foot a:hover { color: var(--pri); }

.cmp-ta-wrap { flex: 1; display: flex; min-height: 0; }
.cmp-ta {
    flex: 1; height: 100%; min-height: 190px; border-radius: 14px;
    background: #fbfdff; padding: 14px 15px; line-height: 1.8;
}
.cmp-ta:hover { border-color: #c7d7ee; }

.cmp-scope {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-top: 16px; padding: 11px 14px;
    border: 1px solid var(--line-2); border-radius: 12px; background: #f8fafd;
}
.cmp-scope-label {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: var(--text);
    padding-right: 14px; border-right: 1px solid var(--line);
}
.cmp-scope-label svg { width: 15px; height: 15px; color: var(--pri); }
.cmp-scope-fields { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.cmp-scope-item {
    display: flex; align-items: center; gap: 6px; flex: 1 1 190px; min-width: 0;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2px 4px 2px 11px;
    transition: .16s;
}
.cmp-scope-item:focus-within { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.cmp-scope-item > span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cmp-scope-item .select {
    flex: 1; min-width: 0; min-height: 32px; border: 0; box-shadow: none;
    background-color: transparent; padding: 6px 28px 6px 2px; font-size: 13px;
}
.cmp-scope-item .select:focus { box-shadow: none; }
.cmp-scope-tip { font-size: 12px; color: #94a3b8; }

.cmp-actions {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line);
}
.cmp-actions .btn { padding: 11px 28px; border-radius: 11px; font-size: 14.5px; }
.cmp-actions-tip {
    display: flex; align-items: flex-start; gap: 7px; flex: 1; min-width: 200px;
    font-size: 12.5px; color: var(--muted); line-height: 1.65;
}
.cmp-actions-tip svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 3px; color: #94a3b8; }

/* ---- 结果 ---- */
.cmp-result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 26px 0 14px; }
.cmp-result-head h2 { font-size: 19px; }
.cmp-result-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.cmp-result-top { display: flex; align-items: center; gap: 24px; padding: 22px 22px 18px; flex-wrap: wrap; }
.cmp-gauge { position: relative; width: 116px; height: 116px; flex: 0 0 auto; }
.cmp-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cmp-gauge circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.cmp-gauge .cmp-gauge-track { stroke: #eef2f7; }
.cmp-gauge .cmp-gauge-val { stroke: #10b981; transition: stroke-dashoffset .8s cubic-bezier(.22,1,.36,1); }
.cmp-gauge.is-mid .cmp-gauge-val { stroke: #f59e0b; }
.cmp-gauge.is-low .cmp-gauge-val { stroke: #94a3b8; }
.cmp-gauge-num {
    position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center;
    font-size: 27px; font-weight: 800; letter-spacing: -1.2px; color: #047857;
    padding-top: 44px;
}
.cmp-gauge.is-mid .cmp-gauge-num { color: #b45309; }
.cmp-gauge.is-low .cmp-gauge-num { color: #475569; }
.cmp-gauge-num span { font-size: 12px; font-weight: 700; margin-left: 1px; letter-spacing: 0; opacity: .7; }

.cmp-result-info { flex: 1; min-width: 220px; }
.cmp-result-info h3 { font-size: 16px; margin-bottom: 6px; line-height: 1.5; }
.cmp-result-info h3 a { color: var(--ink); }
.cmp-result-info h3 a:hover { color: var(--pri); }
.cmp-result-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.cmp-result-meta span { display: inline-flex; align-items: center; gap: 5px; }
.cmp-result-meta svg { width: 13px; height: 13px; color: #94a3b8; }
.cmp-result-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.cmp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 22px 20px; }
.cmp-stat {
    position: relative; padding: 14px 16px 13px 18px;
    border: 1px solid var(--line-2); border-radius: 12px; background: #f8fafd;
    overflow: hidden;
}
.cmp-stat::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: #93c5fd;
}
.cmp-stat:nth-child(1)::before { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.cmp-stat:nth-child(2)::before { background: linear-gradient(180deg, #34d399, #059669); }
.cmp-stat:nth-child(3)::before { background: linear-gradient(180deg, #fbbf24, #d97706); }
.cmp-stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -.6px; color: #1e293b; }
.cmp-stat b.ok { color: #047857; }
.cmp-stat b.warn { color: #c2410c; }
.cmp-stat span { font-size: 12px; color: var(--muted); }

.cmp-kw { padding: 0 22px 18px; }
.cmp-kw-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-kw-list .tag { font-size: 12.5px; padding: 4px 10px; }
.cmp-kw-list .tag small { opacity: .6; font-weight: 600; }

.cmp-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.cmp-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.cmp-legend .dot-same { background: #10b981; }
.cmp-legend .dot-new { background: #f59e0b; }

.cmp-diff { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 470px; background: #fff; }
.cmp-diff .diff-row { padding: 11px 15px; border-bottom: 1px solid var(--line-2); }
.cmp-diff .diff-row:hover { background: #f8fafd; }
.cmp-diff .diff-row.is-new { background: #fffdf8; }
.cmp-diff .diff-row.is-new:hover { background: #fff9ef; }
.cmp-diff .diff-flag span { display: inline-flex; align-items: center; gap: 4px; }
.cmp-sim-cell { display: flex; align-items: center; gap: 10px; min-width: 148px; }
.cmp-sim-cell .sim-bar { flex: 1; min-width: 76px; }
.cmp-sim-cell b { width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.cmp-sim-cell b.hi { color: #047857; }
.cmp-sim-cell b.mid { color: #b45309; }
.cmp-sim-cell b.lo { color: #64748b; }
.cmp-diff .diff-score { font-variant-numeric: tabular-nums; font-size: 12px; color: #94a3b8; min-width: 38px; text-align: right; }

.cmp-rank {
    width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
    font-size: 12.5px; font-weight: 800; color: #64748b; background: #f1f5f9;
}
.cmp-rank.r1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 5px 12px -6px rgba(245, 158, 11, .9); }
.cmp-rank.r2 { background: linear-gradient(135deg, #a8b6c8, #7b8ba1); color: #fff; }
.cmp-rank.r3 { background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; }

.cmp-empty { text-align: center; padding: 34px 20px; }
.cmp-empty svg { width: 40px; height: 40px; color: #cbd5e1; margin: 0 auto 10px; }
.cmp-empty p { font-size: 13px; color: var(--muted); }

/* ---- 说明 ---- */
.cmp-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cmp-how-card {
    position: relative; padding: 16px 16px 15px;
    border: 1px solid var(--line-2); border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff, #fff);
    transition: .18s;
}
.cmp-how-card:hover { border-color: #cfe0f8; box-shadow: 0 12px 26px -22px rgba(15, 23, 42, .5); }
.cmp-how-card i {
    width: 30px; height: 30px; border-radius: 10px; margin-bottom: 10px;
    background: var(--pri-50); color: var(--pri-600);
    display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px;
}
.cmp-how-card b { display: block; font-size: 13.5px; margin-bottom: 5px; }
.cmp-how-card p { font-size: 12.5px; color: var(--muted); line-height: 1.75; }

@media (max-width: 1000px) {
    .cmp-hero-card { flex-basis: 250px; }
}

@media (max-width: 1100px) {
    .cmp-exts { gap: 4px; }
    .cmp-exts span { font-size: 9.5px; padding: 2px 5px; letter-spacing: .2px; }
}

@media (max-width: 900px) {
    .cmp-hero { padding: 28px 0 50px; }
    .cmp-hero-inner { display: block; }
    .cmp-hero-card { display: none; }
    .cmp-hero h1 { font-size: 24px; }
    .cmp-hero-copy > p { font-size: 13.5px; }
    .cmp-hero-tags { gap: 6px 14px; margin-top: 13px; }
    .cmp-body { margin-top: -26px; }
    .cmp-panel-head, .cmp-panel-body { padding-left: 16px; padding-right: 16px; }
    .cmp-grid { grid-template-columns: 1fr; gap: 16px; }
    .cmp-scope { align-items: stretch; }
    .cmp-scope-fields { flex: 1 1 100%; }
    .cmp-actions .btn { flex: 1 1 100%; justify-content: center; }
    .cmp-result-top { gap: 18px; padding: 18px 16px 14px; }
    .cmp-stats { grid-template-columns: 1fr; padding: 0 16px 16px; }
    .cmp-kw { padding: 0 16px 16px; }
    .cmp-how { grid-template-columns: 1fr; }
    .cmp-gauge { width: 92px; height: 92px; }
    .cmp-gauge-num { font-size: 22px; padding-top: 34px; }
    .cmp-how-card { padding: 14px; }
    .cmp-panel-head .tag { display: none; }
}
.cmp-file.has-file { color: var(--pri-600); font-weight: 600; }
.cmp-file.has-file svg { opacity: 1; }

@media (max-width: 600px) {
    .cmp-result-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .cmp-result-top { flex-direction: column; align-items: flex-start; gap: 14px; }
    .cmp-gauge { width: 84px; height: 84px; }
    .cmp-gauge-num { font-size: 21px; padding-top: 30px; }
    .cmp-result-info h3 { font-size: 15px; }
    .cmp-diff .diff-flag { flex: 0 0 54px; }
    .cmp-diff .diff-row { font-size: 13px; }
}

/* ==========================================================
   首页视觉升级（v2.2.0）
   ========================================================== */

.hm-hero {
    padding: 72px 0 92px;
    background:
        radial-gradient(1100px 480px at 12% -18%, rgba(99, 102, 241, .55), transparent 62%),
        linear-gradient(135deg, #0d2456 0%, #1d4ed8 44%, #4f46e5 100%);
}

.hm-hero-mesh {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 34%, #000 24%, transparent 76%);
    mask-image: radial-gradient(ellipse 70% 62% at 50% 34%, #000 24%, transparent 76%);
    pointer-events: none;
}

.hm-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.hm-orb-a {
    width: 300px; height: 300px;
    right: 6%; top: -110px;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 66%);
}

.hm-orb-b {
    width: 380px; height: 380px;
    left: -120px; bottom: -220px;
    background: radial-gradient(circle, rgba(192, 132, 252, .38), transparent 68%);
}

.hm-hero-inner { position: relative; z-index: 2; }

.hm-badge {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .26);
    backdrop-filter: blur(8px);
    padding: 7px 16px;
    font-size: 12.5px;
    gap: 9px;
    margin-bottom: 20px;
}

.hm-badge-dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
}

.hm-pulse {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, .7);
    animation: hm-pulse 2.4s infinite;
}

@keyframes hm-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .65); }
    70%  { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hm-title {
    font-size: 44px;
    line-height: 1.22;
    letter-spacing: -1.2px;
    font-weight: 800;
    margin-bottom: 14px;
    text-shadow: 0 14px 40px rgba(6, 18, 54, .28);
}

.hm-title-accent {
    background: linear-gradient(96deg, #ffffff 8%, #c9d9ff 52%, #e6d6ff 96%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hm-sub {
    color: rgba(255, 255, 255, .78);
    font-size: 15.5px;
    letter-spacing: .3px;
}

.hm-search {
    margin-top: 30px;
    max-width: 900px;
    border-radius: 20px;
    padding: 9px;
    box-shadow: 0 34px 70px -34px rgba(3, 10, 36, .85), 0 0 0 1px rgba(255, 255, 255, .18) inset;
}

.hm-search:focus-within {
    box-shadow: 0 34px 70px -30px rgba(3, 10, 36, .9), 0 0 0 3px rgba(199, 210, 254, .45);
}

.hm-search .btn.hm-search-btn {
    padding: 0 26px;
    border-radius: 14px;
    gap: 8px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 12px 26px -14px rgba(37, 99, 235, .95);
}

.hm-search .btn.hm-search-btn svg { width: 17px; height: 17px; }
.hm-search .btn.hm-search-btn:hover { filter: brightness(1.06); }

.hm-tags { margin-top: 18px; gap: 9px; }
.hm-tags a { padding: 5px 13px; backdrop-filter: blur(6px); }
/* 窄屏放不下 4-5 个胶囊时，让「热门搜索：」独占一行，避免最后一个胶囊单独掉行 */
@media (max-width: 560px) {
    .hero-tags span { flex: 0 0 100%; justify-content: center; margin-bottom: 2px; }
    .hm-tags { gap: 8px 7px; margin-top: 14px; }
    .hm-tags a { padding: 4px 11px; font-size: 12px; }
}

/* 统计卡 */
.hm-stats {
    margin-top: -46px;
    gap: 14px;
}

.hm-stat {
    border-radius: 18px;
    padding: 17px 18px;
    border-color: rgba(226, 232, 240, .9);
    box-shadow: 0 20px 44px -30px rgba(15, 23, 42, .5);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.hm-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 52px -26px rgba(15, 23, 42, .38);
    border-color: #d6e3f8;
}

.hm-stat .stat-icon {
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    box-shadow: 0 8px 18px -12px rgba(37, 99, 235, .8);
}

/* 功能入口 */
.hm-features { padding: 26px 0 0; }

.hm-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.hm-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    min-width: 0;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.hm-feature:hover {
    transform: translateY(-3px);
    border-color: #cfdffa;
    box-shadow: var(--shadow);
    color: var(--ink);
}

.hm-feature-static { cursor: default; }
.hm-feature-static:hover { transform: none; box-shadow: none; border-color: var(--line); }

.hm-feature-ico {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.hm-feature-ico svg { width: 20px; height: 20px; }
.hm-feature-ico.blue { background: #eff6ff; color: #2563eb; }
.hm-feature-ico.violet { background: #f5f3ff; color: #7c3aed; }
.hm-feature-ico.teal { background: #ecfeff; color: #0891b2; }
.hm-feature-ico.amber { background: #fffbeb; color: #d97706; }

.hm-feature-body { min-width: 0; display: flex; flex-direction: column; }
.hm-feature-body b { font-size: 14px; line-height: 1.4; }
.hm-feature-body small {
    color: var(--muted);
    font-size: 11.8px;
    line-height: 1.5;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-feature-arrow {
    margin-left: auto;
    color: #cbd5e1;
    font-size: 15px;
    transition: transform .2s ease, color .2s ease;
}

.hm-feature:hover .hm-feature-arrow { transform: translateX(3px); color: var(--pri); }

.hm-feature-src {
    border-color: #fde8b8;
    background: linear-gradient(135deg, #fffdf6, #fff);
}

.hm-feature-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #059669;
    white-space: nowrap;
}

.hm-feature-badge.muted { background: #f1f5f9; color: #94a3b8; }

/* 正文区块 */
.hm-section { padding: 36px 0 56px; }

.hm-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: var(--pri);
    margin-bottom: 7px;
    text-transform: uppercase;
}

.section-head h2 { letter-spacing: -.5px; }

/* 侧栏列表 */
.hm-hot {
    display: flex;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 9px;
    align-items: flex-start;
    transition: background .16s;
}

.hm-hot:hover { background: #f8fafc; }
.hm-hot-no { flex: 0 0 20px; font-weight: 800; font-size: 12px; color: #94a3b8; }
.hm-hot-no.top { color: var(--pri); }
.hm-hot-body { font-size: 13px; color: var(--text); line-height: 1.6; min-width: 0; }
.hm-hot-body small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.hm-dept {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 13.5px;
    color: var(--text);
    transition: background .16s;
}

.hm-dept:hover { background: #f8fafc; }
.hm-dept .count {
    font-size: 11.5px;
    color: var(--muted);
    background: #f1f5f9;
    padding: 1px 7px;
    border-radius: 999px;
}

/* 组织树：部门是总栏目，车间是缩进的子栏目 */
.org-row { display: flex; align-items: center; gap: 6px; }
.org-row .hm-dept { flex: 1; min-width: 0; gap: 8px; }
.org-row:not(.is-sub) .hm-dept { font-weight: 500; }
.org-row .org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-kids { margin: 0 0 3px 13px; padding-left: 3px; border-left: 1px dashed #e2e9f3; }
.org-row.is-sub .hm-dept { padding: 6px 10px 6px 14px; font-size: 12.8px; color: #46586f; }
.org-row.is-sub .org-name::before { content: "└"; margin-right: 6px; color: #c3cede; }
.org-row.is-sub .count { background: #f6f8fb; }
.org-row.is-sub .kb-qr-btn { width: 30px; height: 30px; border-radius: 8px; }
.org-row.is-sub .kb-qr-btn svg { width: 16px; height: 16px; }
.org-note { margin: 9px 0 3px; padding: 0 10px; font-size: 11.5px; color: var(--muted); }
.org-note::before { content: ""; display: block; border-top: 1px dashed #e2e9f3; margin-bottom: 8px; }

/* 部门可折叠：默认收起，点一下展开该部门下的车间 */
.org-row.is-parent { gap: 4px; }
.org-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 8px 9px 5px;
    border: 0;
    border-radius: 9px;
    background: none;
    font: inherit;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: background .16s;
}
.org-toggle:hover { background: #f8fafc; }
.org-toggle:focus-visible { outline: 2px solid var(--pri); outline-offset: -2px; }
.org-toggle .org-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-caret { width: 14px; height: 14px; flex: none; color: #94a3b8; transition: transform .18s ease, color .18s ease; }
.org-toggle[aria-expanded="true"] .org-caret { transform: rotate(90deg); color: var(--pri); }
.org-kids-n { flex: none; font-size: 10.5px; line-height: 16px; color: #94a3b8; background: #f1f5f9; padding: 0 6px; border-radius: 999px; }
.org-toggle[aria-expanded="true"] .org-kids-n { background: #e0edff; color: var(--pri-700); }
.org-count {
    flex: none;
    font-size: 11.5px;
    color: var(--muted);
    background: #f1f5f9;
    padding: 1px 7px;
    border-radius: 999px;
    text-decoration: none;
    transition: background .16s, color .16s;
}
.org-count:hover { background: #dbeafe; color: var(--pri-700); }
.org-kids[hidden] { display: none; }

/* 文档来源面板 */
.hm-source-panel { border-color: #fde8b8; }
.hm-source-panel .panel-head { border-bottom-color: #fef3c7; }

.hm-src-row { display: flex; align-items: center; gap: 11px; padding: 8px 2px; }
.hm-src-row b { display: block; font-size: 13px; line-height: 1.5; }
.hm-src-row small { color: var(--muted); font-size: 11.8px; }

.hm-src-ico {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.hm-src-ico svg { width: 17px; height: 17px; }
.hm-src-ico.blue { background: #eff6ff; color: #2563eb; }
.hm-src-ico.amber { background: #fffbeb; color: #d97706; }

.hm-src-more {
    display: block;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed #f1e3bd;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pri);
}

@media (max-width: 1080px) {
    .hm-feature-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .hm-hero { padding: 52px 0 74px; }
    .hm-title { font-size: 30px; letter-spacing: -.6px; }
    .hm-sub { font-size: 14px; }
    .hm-stats { margin-top: -38px; }
}

@media (max-width: 620px) {
    .hm-hero { padding: 40px 0 62px; }
    .hm-title { font-size: 25px; letter-spacing: -.4px; line-height: 1.28; }
    .hm-badge { font-size: 11.5px; padding: 6px 12px; }
    .hm-sub { font-size: 13px; }
    .hm-search { margin-top: 22px; border-radius: 16px; padding: 8px; }
    .hm-stats { margin-top: -30px; }
    .hm-feature-grid { grid-template-columns: 1fr; gap: 10px; }
    .hm-feature { padding: 12px 14px; }
    .hm-feature-body small { white-space: normal; }
    .hm-section { padding: 28px 0 42px; }
}

.hm-feature-arrow svg { width: 16px; height: 16px; display: block; }

@media (max-width: 620px) {
    .hm-search input[type="search"] { font-size: 14px; }
}

/* ==========================================================
   系统设置 · 卡片分组 + 弹窗编辑（sc-*）
   ========================================================== */
.sc-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.sc-tip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.sc-tip svg { width: 15px; height: 15px; flex: none; }
.sc-filter { position: relative; }
.sc-filter svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.sc-filter input {
    width: 300px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
    padding: 0 12px 0 34px; font-size: 13.5px; font-family: inherit;
    background: #fff; color: var(--ink); outline: none; transition: .16s ease;
}
.sc-filter input::placeholder { color: #94a3b8; }
.sc-filter input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

.sc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.sc-card {
    position: relative; display: flex; flex-direction: column;
    text-align: left; font-family: inherit; color: inherit;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 18px 18px 14px; cursor: pointer;
    box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.sc-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--sc-a) 30%, var(--line));
    box-shadow: 0 20px 38px -28px rgba(15, 23, 42, .45);
}
.sc-card:focus-visible { outline: 2px solid var(--sc-a); outline-offset: 2px; }
.sc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sc-ico {
    width: 42px; height: 42px; border-radius: 12px; flex: none;
    display: grid; place-items: center;
    background: var(--sc-a-soft, #f1f5f9); color: var(--sc-a, var(--pri));
}
.sc-ico svg { width: 21px; height: 21px; }
.sc-chip {
    font-size: 11.5px; font-weight: 600; line-height: 1.6;
    padding: 2px 9px; border-radius: 999px;
    background: #f1f5f9; color: var(--muted); white-space: nowrap;
}
.sc-chip.on { background: #ecfdf5; color: #047857; }
.sc-title { display: block; font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 12px 0 3px; }
.sc-desc { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.62; min-height: 40px; }
.sc-prev { display: block; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 9px; }
.sc-prev-row { display: block; }
.sc-prev-row + .sc-prev-row { margin-top: 7px; }
.sc-prev-row i {
    display: block; font-style: normal; font-size: 11.5px; line-height: 1.45; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-prev-row b {
    display: block; font-size: 12.5px; font-weight: 600; line-height: 1.55; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-prev-empty { display: block; font-size: 12.5px; line-height: 1.95; color: #94a3b8; }
.sc-foot {
    display: flex; align-items: center; gap: 6px;
    margin-top: auto; padding-top: 12px;
    font-size: 12px; color: var(--muted);
}
.sc-foot em {
    margin-left: auto; font-style: normal; font-weight: 600;
    color: var(--sc-a, var(--pri)); display: inline-flex; align-items: center; gap: 4px;
}
.sc-foot em svg { width: 14px; height: 14px; transition: transform .18s ease; }
.sc-card:hover .sc-foot em svg { transform: translateX(3px); }

.sc-none {
    margin-top: 16px; padding: 34px 20px; text-align: center;
    font-size: 13.5px; color: var(--muted);
    background: #fff; border: 1px dashed var(--line); border-radius: 14px;
}

/* 弹窗 */
.sc-form { width: 100%; margin: 0; }
.sc-modal .modal-content { border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); }
.sc-modal .modal-header {
    align-items: flex-start; gap: 12px; padding: 18px 22px 16px;
    border-bottom: 1px solid var(--line-2);
}
.sc-modal .modal-header .sc-ico { width: 38px; height: 38px; border-radius: 11px; }
.sc-modal .modal-header .sc-ico svg { width: 19px; height: 19px; }
.sc-mh { flex: 1; min-width: 0; }
.sc-modal h5, .sc-modal .modal-title { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.5; }
.sc-mh-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.sc-modal .modal-header .btn-close { margin: 2px 0 0; flex: none; }
.sc-modal .modal-body { padding: 20px 22px 6px; max-height: min(66vh, 620px); overflow: auto; }
.sc-modal .modal-footer {
    padding: 14px 22px; border-top: 1px solid var(--line-2);
    gap: 8px; align-items: center; flex-wrap: wrap;
}
.sc-save-tip { margin-right: auto; font-size: 12px; color: var(--muted); }
.sc-modal .field { margin-bottom: 16px; }
.sc-modal .field.is-wide, .sc-field.is-wide { grid-column: 1 / -1; }

/* 开关 */
.field > label.sc-switch, .sc-switch {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fbfcfe; cursor: pointer; margin: 0; font-weight: 400;
    transition: border-color .16s ease, background .16s ease;
}
.sc-switch:hover { border-color: #cbd5e1; background: #f8fafc; }
.sc-switch-text { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.55; }
.sc-switch-text em {
    display: block; font-style: normal; font-weight: 400;
    font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5;
}
.sc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sc-track {
    flex: none; width: 40px; height: 22px; border-radius: 999px;
    background: #cbd5e1; position: relative; transition: background .2s ease;
}
.sc-knob {
    position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .28); transition: left .2s ease;
}
.sc-switch input:checked + .sc-track { background: var(--sc-a, var(--pri)); }
.sc-switch input:checked + .sc-track .sc-knob { left: 21px; }
.sc-switch input:focus-visible + .sc-track { box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }

/* 颜色选择 */
.sc-color { display: flex; align-items: center; gap: 10px; }
.sc-color input[type=color] { width: 78px; height: 42px; padding: 4px; border-radius: 10px; cursor: pointer; }
.sc-color .mono { font-size: 12.5px; color: var(--muted); }

/* 信息类弹窗 */
.sc-info { display: grid; gap: 0; margin: 0; font-size: 13.5px; }
.sc-info > div {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    padding: 9px 0; border-bottom: 1px dashed var(--line-2);
}
.sc-info > div:last-child { border-bottom: 0; }
.sc-info dt { color: var(--muted); flex: none; }
.sc-info dd { margin: 0; font-weight: 600; color: var(--text); text-align: right; word-break: break-all; }
.sc-sec { font-size: 13.5px; line-height: 1.85; color: var(--text); }
.sc-sec li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.sc-sec li:last-child { border-bottom: 0; }
.sc-sec .n {
    flex: none; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%;
    background: #fef2f2; color: #b91c1c; font-size: 11.5px; font-weight: 700;
    display: grid; place-items: center;
}

@media (max-width: 1280px) {
    .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .sc-grid { grid-template-columns: 1fr; gap: 12px; }
    .sc-filter { flex: 1 1 100%; }
    .sc-filter input { width: 100%; }
    .sc-desc { min-height: 0; }
    .sc-modal .modal-body { padding: 16px 16px 4px; max-height: 70vh; }
    .sc-modal .modal-header, .sc-modal .modal-footer { padding-left: 16px; padding-right: 16px; }
    .sc-save-tip { display: none; }
}

/* 尊重系统「减少动效」偏好：卡片与弹窗不做过渡 */
@media (prefers-reduced-motion: reduce) {
    .sc-card, .sc-card .sc-foot em svg { transition: none; }
    .modal.fade, .modal.fade .modal-dialog { transition: none !important; }
}

/* ==========================================================
   v2.2.2 后台侧边导航 + 移动端体验优化
   ========================================================== */

/* ---------- 侧边栏：背景、滚动条、图标块 ---------- */
.admin-side {
    background:
        radial-gradient(760px 320px at 8% -6%, rgba(37, 99, 235, .30), transparent 62%),
        radial-gradient(520px 300px at 100% 100%, rgba(124, 58, 237, .18), transparent 60%),
        linear-gradient(180deg, #0a1120, #0f1b30 55%, #0b1526);
    padding: 16px 9px 20px;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.admin-side::-webkit-scrollbar { width: 6px; }
.admin-side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 99px; }
.admin-side::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); }
.admin-side::-webkit-scrollbar-track { background: transparent; }

.admin-brand { padding: 3px 7px 12px; gap: 9px; font-size: 14px; letter-spacing: .2px; }
.admin-brand .logo-mark { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 10px 20px -12px rgba(37, 99, 235, .95); }
.admin-brand small { color: #64748b; font-size: 9px; letter-spacing: 1.1px; margin-top: 2px; }

.side-label {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 8px 4px; font-size: 9.5px; letter-spacing: 1.2px; color: #55677f;
}
.side-label::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .10), transparent);
}

.side-link {
    position: relative;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 13px;
    color: #aebbd0;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.side-link svg {
    width: 16px; height: 16px; padding: 4px; box-sizing: content-box;
    border-radius: 9px; background: rgba(255, 255, 255, .05);
    opacity: .92; flex: 0 0 auto;
    transition: background .16s ease, opacity .16s ease;
}
.side-link:hover { background: rgba(255, 255, 255, .055); color: #fff; transform: translateX(2px); }
.side-link:hover svg { background: rgba(255, 255, 255, .11); opacity: 1; }
.side-link.active {
    background: linear-gradient(100deg, rgba(37, 99, 235, .98), rgba(99, 102, 241, .9));
    color: #fff;
    box-shadow: 0 14px 26px -18px rgba(37, 99, 235, .95);
    transform: none;
}
.side-link.active svg { background: rgba(255, 255, 255, .18); opacity: 1; }
.side-link.active::before {
    content: ""; position: absolute; left: -6px; top: 50%;
    width: 3px; height: 18px; border-radius: 0 3px 3px 0;
    background: #fff; opacity: .9; transform: translateY(-50%);
}
.side-foot { padding: 12px 8px 0; font-size: 10.5px; line-height: 1.65; color: #475569; }

/* 收起态：图标居中、隐藏指示条的多余空间 */
@media (min-width: 901px) {
    html.side-collapsed .admin-side { padding: 16px 7px 20px; }
    html.side-collapsed .side-link { padding: 7px 0; gap: 0; }
    html.side-collapsed .side-link:hover { transform: none; }
    html.side-collapsed .side-link.active::before { left: -4px; }
    html.side-collapsed .side-label { margin: 10px 8px 8px; }
}

/* 抽屉关闭按钮：仅窄屏显示 */
.side-close { display: none; }

/* ---------- 移动端底部标签栏 ---------- */
.admin-tabbar { display: none; }

/* ---------- 窄屏（≤900px）---------- */
@media (max-width: 900px) {
    .admin-top { height: 58px; padding: 0 12px; gap: 8px; }
    .admin-content { padding: 14px 14px calc(78px + env(safe-area-inset-bottom)); }

    /* 抽屉：更宽一点、贴边圆角、带关闭按钮 */
    .admin-side {
        width: min(74vw, 272px);
        flex: 0 0 auto;
        border-radius: 0 18px 18px 0;
        padding: 16px 12px calc(20px + env(safe-area-inset-bottom));
        box-shadow: 0 30px 70px -30px rgba(2, 6, 23, .8);
        overscroll-behavior: contain;
    }
    .admin-side.open { transform: none; }
    .side-close {
        display: grid; place-items: center;
        position: absolute; top: 14px; right: 12px;
        width: 32px; height: 32px; border: 0; border-radius: 9px;
        background: rgba(255, 255, 255, .08); color: #cbd5e1; cursor: pointer;
    }
    .side-close svg { width: 16px; height: 16px; }
    .side-close:hover { background: rgba(255, 255, 255, .16); color: #fff; }

    /* 抽屉里的链接更好点：更高行高、字号略大 */
    .side-link { padding: 10px 10px; font-size: 14px; }
    .side-link svg { width: 19px; height: 19px; }
    .side-label { padding: 14px 8px 6px; }
    .side-foot { font-size: 11.5px; }

    /* 底部标签栏 */
    .admin-tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .95);
        -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
        border-top: 1px solid var(--line);
        box-shadow: 0 -12px 26px -22px rgba(15, 23, 42, .5);
    }
    .admin-tab {
        display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 4px 2px 2px; border: 0; background: none;
        font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.3;
        color: var(--muted); text-decoration: none; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .admin-tab .tab-ico {
        display: grid; place-items: center;
        min-width: 46px; height: 26px; padding: 0 10px; border-radius: 999px;
        transition: background .16s ease, color .16s ease;
    }
    .admin-tab .tab-ico svg { width: 19px; height: 19px; }
    .admin-tab:active .tab-ico { background: #eef2ff; }
    .admin-tab.active { color: var(--pri); }
    .admin-tab.active .tab-ico { background: var(--pri-50); }
    .admin-tab[data-side-toggle] { color: var(--muted); }

    /* 抽屉打开时锁滚动 */
    body.drawer-open { overflow: hidden; }

    /* 列表页筛选：两列栅格，搜索框整行（提高优先级，覆盖页面内的行内样式） */
    .admin-content .filter-bar {
        display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; width: 100%;
    }
    .admin-content .filter-bar .input,
    .admin-content .filter-bar .select { min-width: 0; width: 100%; flex: none; }
    .admin-content .filter-bar > .input { grid-column: 1 / -1; }
    .admin-content .filter-bar > .select:last-of-type { grid-column: 1 / -1; }
    .admin-content .filter-bar .mini-btn { min-height: 40px; justify-content: center; }
    /* 带标题的筛选块（阅读记录页 .f-item 结构） */
    .admin-content .filter-bar > .f-item { min-width: 0; }
    .admin-content .filter-bar .f-item .select,
    .admin-content .filter-bar .f-item .input { width: 100%; min-width: 0; }
    .admin-content .filter-bar .f-item label { font-size: 12px; }
    .bulk-bar { padding: 12px 14px; gap: 8px; }
}

/* ---------- 更窄（≤620px）---------- */
@media (max-width: 620px) {
    .admin-top h1 { font-size: 15px; }
    .admin-top .btn-sm { padding: 7px 12px; }
    .page-head { margin-bottom: 14px; }
    .page-head h2 { font-size: 18px; }
    .page-head p { font-size: 12.5px; line-height: 1.65; }
    .card { border-radius: 14px; }
    .card-head { padding: 13px 14px; }
    .card-body { padding: 14px; }
    .field { margin-bottom: 13px; }
    .btn { padding: 10px 16px; }
    .btn-sm { padding: 8px 12px; font-size: 12.5px; }
    .table-wrap { margin: 0 -14px -14px; padding: 0 14px 4px; }
    table.data th, table.data td { padding: 11px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .side-link, .side-link svg, .admin-tab .tab-ico, .admin-side { transition: none !important; }
}

/* 抽屉打开时淡出底部标签栏，避免两层导航同时出现 */
@media (max-width: 900px) {
    .admin-tabbar { transition: opacity .18s ease; }
    body.drawer-open .admin-tabbar { opacity: 0; pointer-events: none; }
}

/* 当前项指示条收到胶囊内侧，避免贴视口边缘像滚动条 */
.side-link.active::before {
    left: 5px; width: 3px; height: 16px; border-radius: 3px; opacity: .75;
}
@media (min-width: 901px) {
    html.side-collapsed .side-link.active::before { display: none; }
}
/* 手机端遮罩再深一点，突出抽屉层次 */
@media (max-width: 900px) {
    .admin-overlay.show { background: rgba(2, 6, 23, .62); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
}

/* ==========================================================
   v2.3.0 首页布局自定义（后台编辑器 hl-* + 前台排序）
   ========================================================== */

/* ---------- 后台编辑器 ---------- */
.hl-group-label {
    font-size: 11.5px; font-weight: 700; letter-spacing: 1.1px;
    color: var(--muted); margin-bottom: 9px;
}
.hl-toggles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.hl-toggle {
    display: flex; align-items: center; gap: 10px; margin: 0;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
    background: #fbfcfe; cursor: pointer; font-weight: 400;
    transition: border-color .16s ease, background .16s ease;
}
.hl-toggle:hover { border-color: #cbd5e1; background: #f8fafc; }
.hl-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.hl-tg-body { flex: 1; min-width: 0; }
.hl-tg-body b { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5; }
.hl-tg-body em {
    display: block; font-style: normal; font-size: 11.5px; color: var(--muted);
    line-height: 1.5; margin-top: 2px;
}
.hl-toggle input:not(:checked) ~ .hl-tg-body { opacity: .62; }
.hl-toggle .sc-track { flex: none; }
.hl-toggle input:checked ~ .sc-track { background: var(--sc-a, var(--pri)); }
.hl-toggle input:checked ~ .sc-track .sc-knob { left: 21px; }
.hl-toggle input:focus-visible ~ .sc-track { box-shadow: 0 0 0 3px rgba(79, 70, 229, .25); }

.hl-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.hl-zone { min-width: 0; }
.hl-zone-head {
    display: flex; align-items: baseline; gap: 8px;
    margin-bottom: 8px; padding-bottom: 7px; border-bottom: 1px dashed var(--line);
}
.hl-zone-head b { font-size: 13px; font-weight: 700; color: var(--text); }
.hl-zone-head small { font-size: 11.5px; color: var(--muted); }

.hl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hl-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 9px 8px 11px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.hl-item:hover { border-color: #cbd5e1; box-shadow: 0 8px 18px -16px rgba(15, 23, 42, .55); }
.hl-item.is-off { background: #f8fafc; border-style: dashed; }
.hl-check { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin: 0; cursor: pointer; font-weight: 400; }
.hl-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.hl-box {
    flex: none; width: 18px; height: 18px; border-radius: 5px;
    border: 1.5px solid #cbd5e1; background: #fff; display: grid; place-items: center;
    transition: background .14s ease, border-color .14s ease;
}
.hl-box svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.hl-check input:checked + .hl-box { background: var(--sc-a, var(--pri)); border-color: var(--sc-a, var(--pri)); }
.hl-check input:checked + .hl-box svg { opacity: 1; }
.hl-check input:focus-visible + .hl-box { box-shadow: 0 0 0 3px rgba(79, 70, 229, .22); }
.hl-txt { min-width: 0; }
.hl-txt b { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5; }
.hl-txt em {
    display: block; font-style: normal; font-size: 11.5px; color: var(--muted);
    line-height: 1.45; margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hl-item.is-off .hl-txt b { color: #94a3b8; }
.hl-move { display: flex; gap: 3px; flex: none; }
.hl-btn {
    width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 7px;
    background: #fff; color: var(--muted); display: grid; place-items: center; cursor: pointer;
    transition: color .14s ease, border-color .14s ease, background .14s ease;
}
.hl-btn svg { width: 13px; height: 13px; }
.hl-btn:hover:not(:disabled) { color: var(--sc-a, var(--pri)); border-color: currentColor; background: #f8fafc; }
.hl-btn:disabled { opacity: .3; cursor: not-allowed; }

.hl-opts {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
    margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line);
}

@media (max-width: 860px) {
    .hl-toggles { grid-template-columns: 1fr; }
    .hl-cols { grid-template-columns: 1fr; }
    .hl-opts { grid-template-columns: 1fr; }
    .hl-txt em { white-space: normal; }
}

/* ---------- 前台：侧栏位置与区块间距 ---------- */
.layout-main.side-left { grid-template-columns: 300px minmax(0, 1fr); }
.layout-main.side-left > .layout-side { order: -1; }
.layout-main.no-side { grid-template-columns: minmax(0, 1fr); }
.layout-main.no-side > div { max-width: 100%; }

.hm-block + .hm-block { margin-top: 42px; }
.hm-block > .section-head:first-child { margin-top: 0; }

@media (max-width: 1080px) {
    .layout-main.side-left { grid-template-columns: minmax(0, 1fr); }
    .layout-main.side-left > .layout-side { order: 0; }
}

/* 隐藏首屏时，统计条不再负边距上移 */
.hm-stats-flat { margin-top: 26px; }

/* ==========================================================
   v2.3.1 后台菜单自定义编辑器（nv-*）
   ========================================================== */
.nv-tip {
    display: flex; gap: 8px; align-items: flex-start;
    font-size: 12.5px; color: var(--muted); line-height: 1.65;
    background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
    padding: 9px 11px; margin-bottom: 12px;
}
.nv-tip svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.nv-groups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nv-group {
    border: 1px solid var(--line); border-radius: 12px;
    padding: 10px 12px 6px; background: #fff;
    transition: border-color .16s ease, background .16s ease;
}
.nv-group:hover { border-color: #cbd5e1; }
.nv-group.is-off { background: #f8fafc; border-style: dashed; }

.nv-head { display: flex; align-items: center; gap: 8px; }
.nv-gname { flex: 1; min-width: 0; display: block; }
.nv-gname input { height: 34px; font-size: 13px; font-weight: 600; }
.nv-group.is-off .nv-gname input { color: #94a3b8; }
.nv-count { flex: none; font-size: 11.5px; color: var(--muted); min-width: 36px; text-align: right; }

.nv-switch { position: relative; flex: none; display: flex; align-items: center; margin: 0; cursor: pointer; }
.nv-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.nv-track {
    display: block; width: 34px; height: 19px; border-radius: 999px;
    background: #cbd5e1; position: relative; transition: background .18s ease;
}
.nv-knob {
    position: absolute; left: 2.5px; top: 2.5px; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .28); transition: left .18s ease;
}
.nv-switch input:checked + .nv-track { background: var(--sc-a, var(--pri)); }
.nv-switch input:checked + .nv-track .nv-knob { left: 17.5px; }
.nv-switch input:focus-visible + .nv-track { box-shadow: 0 0 0 3px rgba(13, 148, 136, .25); }

.nv-list {
    list-style: none; margin: 9px 0 0; padding: 8px 0 2px;
    border-top: 1px dashed var(--line);
    display: flex; flex-direction: column; gap: 4px;
}
.nv-item {
    display: flex; align-items: center; gap: 7px;
    padding: 3px 4px; border-radius: 8px;
    transition: background .14s ease;
}
.nv-item:hover { background: #f8fafc; }
.nv-item .hl-check { flex: none; gap: 7px; }
.nv-ico {
    flex: none; width: 24px; height: 24px; border-radius: 6px;
    background: #f1f5f9; color: #64748b; display: grid; place-items: center;
}
.nv-ico svg { width: 14px; height: 14px; }
.nv-item .nv-name { flex: 1; min-width: 0; height: 32px; font-size: 13px; }
.nv-item.is-off .nv-ico { opacity: .5; }
.nv-item.is-off .nv-name::placeholder { color: #b8c4d4; }

.nv-note { margin: 12px 0 0; font-size: 12px; color: #94a3b8; line-height: 1.7; }

@media (max-width: 620px) {
    .nv-item .hl-move .hl-btn { width: 24px; height: 24px; }
    .nv-count { display: none; }
    .nv-group { padding: 9px 9px 4px; }
}

/* 侧栏菜单被全部隐藏时的兜底提示 */
.side-empty {
    margin: 8px 2px 0; padding: 12px;
    border: 1px dashed rgba(255, 255, 255, .16); border-radius: 10px;
    font-size: 12px; color: #94a3b8; line-height: 1.75;
}
.side-empty a { color: #cbd5e1; text-decoration: underline; }
.side-empty a:hover { color: #fff; }

/* 菜单编辑器弹窗：内容更长，放宽可视高度并压缩行距 */
.nv-modal .modal-body { max-height: min(72vh, 760px); }
.nv-modal .nv-item { padding: 2px 4px; }
@media (max-width: 620px) {
    .nv-modal .modal-body { max-height: 72vh; }
}

/* ---------- 检索页：IMA 知识库联动结果（后台开启后出现） ---------- */
.ima-hit-panel { padding: 16px 18px 14px; }
.ima-hit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ima-hit-head h3 { font-size: 14.5px; color: var(--ink); margin: 0; }
.ima-hit-err { color: #dc2626; }
.ima-hit-list { display: grid; gap: 2px; }
.ima-hit-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ima-hit-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.ima-hit-title { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.6; }
.ima-hit-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.ima-hit-hl { margin-top: 5px; font-size: 12.5px; color: #64748b; line-height: 1.75; }

/* ---------- 远程文档（IMA 远程引用）：正文阅读器 ---------- */
.doc-head-meta .remote-origin { background: rgba(255, 255, 255, .1); border-style: dashed; }
.remote-reader { padding: 18px 20px 26px; background: #fff; }
.remote-tip {
    display: block; margin-bottom: 16px; padding: 10px 12px;
    border: 1px dashed #c7d2fe; border-radius: 10px;
    background: #f5f7ff; color: #475569; font-size: 12.5px; line-height: 1.8;
}
.remote-tip b { color: #4338ca; margin-right: 6px; }
.remote-body { font-size: 14.5px; line-height: 1.95; color: #1f2937; max-width: 900px; }
.remote-body p { margin: 0 0 12px; word-break: break-word; }
.remote-body p:last-child { margin-bottom: 0; }
@media (max-width: 620px) {
    .remote-reader { padding: 14px 14px 20px; }
    .remote-body { font-size: 14px; line-height: 1.85; }
}

/* 详情页外层不带 .container，row 的负边距会在窄屏挤出 2px 横向滚动 */
.doc-detail-row { margin-left: 0; margin-right: 0; }

/* ---------- IMA 阅读：原格式 / 正文切换（ima_view.php 与远程文档详情共用） ---------- */
.ima-tabs { display: flex; gap: 6px; padding: 12px 20px 0; }
.ima-tab {
    appearance: none; border: 1px solid var(--line, #e5e7eb); background: #fff;
    color: #475569; font-size: 13px; line-height: 1; padding: 8px 14px;
    border-radius: 9px; cursor: pointer; transition: .15s;
}
.ima-tab:hover:not([disabled]) { border-color: #c7d2fe; color: #4338ca; }
.ima-tab.on { background: #4338ca; border-color: #4338ca; color: #fff; }
.ima-tab[disabled] { opacity: .45; cursor: not-allowed; }
.ima-pane[hidden] { display: none !important; }
.ima-pane-doc { height: 100%; min-height: 0; }
.ima-img-wrap { display: flex; align-items: center; justify-content: center; height: 100%; padding: 16px; overflow: auto; background: #f8fafc; }
.ima-img-wrap img { max-width: 100%; height: auto; box-shadow: 0 2px 10px rgba(15,23,42,.12); }

/* 远程文档详情：预览框内是「标签条 + 原格式 / 正文」两段 */
.preview-frame--rmt { display: flex; flex-direction: column; }
.preview-frame--rmt .ima-tabs { padding: 10px 14px 0; flex: 0 0 auto; }
.preview-frame--rmt .ima-pane-doc { flex: 1 1 auto; min-height: 0; position: relative; }
.preview-frame--rmt .ima-pane-doc > .doc-viewer,
.preview-frame--rmt .ima-pane-doc > .office-preview { height: 100%; }
.preview-frame--rmt .ima-pane[data-ima-pane="text"] { flex: 1 1 auto; min-height: 0; overflow: auto; }

@media (max-width: 620px) {
    .ima-tabs { padding: 10px 14px 0; }
    .ima-tab { padding: 7px 12px; font-size: 12.5px; }
    .preview-frame--rmt .ima-tabs { padding: 8px 10px 0; }
}

/* ==========================================================
   v2.9.3 · 检索 / 查阅页表单结构
   桌面端：关键词 + 文件编号 + 组织 + 类别 + IMA + 检索 仍在同一行
   手机端：只留「关键词 + 检索 + 筛选」，其余收进折叠面板（见 mobile.css）
   ========================================================== */
.search-page { padding-top: 24px; }

.search-form {
    padding: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.sf-kw {
    order: 1;
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    min-width: 0;
}
.sf-kw input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 14.5px;
    color: var(--ink);
}
.sf-kw input::placeholder { color: #94a3b8; }

/* 筛选字段在桌面端融回表单同一行：display:contents 让子项直接参与外层 flex 排布 */
.search-form .sf-more { display: contents; }
.search-form .sf-more > * { order: 2; }
.search-form .sf-more > input[name="doc_no"] { width: 130px; padding: 10px 12px; }
/* 文件编号是文本框，不该带下拉箭头 */
.search-form .sf-more > input.select {
    background-image: none;
    padding-right: 12px;
}
.search-form .sf-more > select[name="org"] { width: 150px; }
.search-form .sf-more > select[name="cat"] { width: 130px; }
.search-form .sf-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 4px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.sf-submit { order: 3; flex: 0 0 auto; }

/* 仅手机端使用：折叠开关、补充筛选项、重置/应用、排序下拉 */
.search-form .sf-toggle { order: 4; display: none; }
.search-form .sf-toggle svg { width: 15px; height: 15px; flex: 0 0 auto; }
.sf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 1px;
    border-radius: 999px;
    background: var(--pri);
    color: #fff;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
}
.sf-m-only, .sf-actions, .sf-sort { display: none; }

/* 结果卡按钮区 */
.result-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ==========================================================
   v2.9.6 文档详情：阅读区加宽加高 + 板块无缝衔接
   ========================================================== */

/* 详情页容器放宽：≥1200px 屏幕时阅读区多出约 120px 横向空间 */
@media (min-width: 1200px) {
    .page-doc_detail .kb-main > .container { max-width: 1400px; }
}

/* 标题卡收紧：把高度让给正文，阅读区能多出 30~40px */
@media (min-width: 992px) {
    .page-doc_detail .doc-head { padding: 19px 24px 16px; margin-bottom: 14px; }
    .page-doc_detail .doc-head h1 { font-size: 21px; line-height: 1.4; }
    .page-doc_detail .doc-head-meta { margin-top: 9px; gap: 5px 16px; font-size: 12px; }
    .page-doc_detail .doc-actions { margin-top: 12px; }
}

/* 右栏「文档信息」跟随滚动：正文很长时右栏不会先到底、左下留一大片空白 */
@media (min-width: 992px) {
    .page-doc_detail .doc-detail-row > .col-lg-3 {
        position: sticky;
        top: 82px;
        align-self: start;
        max-height: calc(100dvh - 100px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        padding-right: 2px;
    }
    .page-doc_detail .doc-detail-row > .col-lg-3::-webkit-scrollbar { width: 5px; }
    .page-doc_detail .doc-detail-row > .col-lg-3::-webkit-scrollbar-thumb {
        background: #d8e0ec; border-radius: 99px;
    }
}

/* 阅读器与下方评论卡紧贴，中间不再空出一段 */
.page-doc_detail .preview-frame {
    /* 高度 ≈ 视口高 − 顶部固定栏(66px)，往下滚一点正文就能占满整屏；比原来的 76vh 高约 150px
       第一行 76vh 是不支持 dvh 的老浏览器兜底 */
    height: 76vh;
    height: clamp(640px, calc(100dvh - 64px), 1300px);
    margin-bottom: 0;
}
.page-doc_detail .preview-frame.pf-fullscreen { height: 100dvh; }
.page-doc_detail .preview-frame--slide { height: auto; min-height: 0; }
.page-doc_detail #comments { margin-top: 16px !important; }
.page-doc_detail #comments > .card-header { border-bottom-color: var(--line-2); }
