/* 兰台 · 移动优先 H5 样式（简洁古典雅致，主色朱砂赭 #9A3412） */
:root {
    --brand: #9A3412;
    --brand-dark: #7c290e;
    --brand-light: #c0562c;
    --bg: #f7f4f0;
    --card: #ffffff;
    --text: #2b2622;
    --muted: #8a8079;
    --line: #e7e0d8;
    --danger: #b3261e;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px rgba(43, 38, 34, .05), 0 1px 1px rgba(43, 38, 34, .03);
    --shadow-hover: 0 6px 18px rgba(43, 38, 34, .09);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

/* 顶栏 */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, #a73912 0%, var(--brand) 100%);
    color: #fff;
    padding: 12px 16px 0;
    box-shadow: 0 2px 10px rgba(43, 38, 34, .10);
}
.brand { font-size: 20px; font-weight: 600; letter-spacing: 2px; }
/* 顶栏导航：flex 默认会把 tab 压窄，中文便在标签内部任意断行
   （手机上出现过「快速记」被拆成「快速/记」、活动下划线错位）。
   故：标签内禁止折行 + 空间不足时整项换行。 */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 12px;
}
.tab {
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    padding: 8px 2px;
    border-bottom: 2px solid transparent;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease;
}
.tab.active { color: #fff; font-weight: 600; border-bottom-color: #fff; }
/* 窄屏：管理员有 5 个 tab（含「用户管理」），收紧间距尽量保持一行 */
@media (max-width: 380px) {
    .tabs { gap: 4px 12px; }
    .tab { font-size: 14px; }
}

/* 页面容器 */
.page { padding: 16px; max-width: 680px; margin: 0 auto; }
.toolbar { margin-bottom: 14px; }

/* 按钮：无图标、纯文字、长按钮 */
.btn {
    display: inline-block;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-block { display: block; width: 100%; }
.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(154, 52, 18, .22);
}
.btn-primary:active { background: var(--brand-dark); }
.btn-plain { border-color: transparent; background: transparent; color: var(--muted); }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.btn-danger { color: var(--danger); border-color: #f0d3d1; }

/* 标签树 */
.tree { display: flex; flex-direction: column; gap: 10px; }
.node.depth-1 { padding-left: 14px; border-left: 2px solid var(--line); }
.node.depth-2 { padding-left: 14px; border-left: 2px solid var(--line); margin-left: 14px; }
.node.depth-3 { padding-left: 14px; border-left: 2px solid var(--line); margin-left: 28px; }
/* 卡片上的归属路径：缩进在手机上几乎看不出层级，明确写出来更清楚 */
.node-path {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .2px;
    margin-bottom: 6px;
    word-break: break-all;
}
/* 表单/工具栏里的小段说明文字 */
.form-hint { line-height: 1.7; margin: 10px 0 0; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.card.is-disabled { opacity: .6; }

.card-head { display: flex; align-items: center; gap: 8px; }
/* min-width: 0 + 断行规则：标题里可能有超长不可断串（本地文件路径 / 长 URL），
   不加这两条时 flex 子项会按 min-content 撑开，把同一行的其它元素挤扁（2026-09-22 ✗）。 */
.card-head .name {
    font-size: 16px;
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* 角标永远不被压缩（它是 nowrap 的，压了会溢出 ✗） */
.card-head .badge { flex: 0 0 auto; }
.card-head .ver { font-size: 12px; color: var(--muted); }

.badge {
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.badge.on { color: #1b7a3d; border-color: #bfe3cd; background: #f0faf3; }
.badge.off { color: var(--muted); background: #f3f1ee; }

.desc {
    color: #5f574f;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 8px;
    /* 摘要里也会出现长路径 / 长 URL（实测有 file:///C:/Users/…pdf ✗）⇒ 同样要允许任意断行 */
    overflow-wrap: anywhere;
    word-break: break-word;
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.empty { color: var(--muted); text-align: center; margin-top: 40px; }

/* 底部抽屉编辑面板 */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card);
    border-radius: 16px 16px 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    max-height: 88vh;
    overflow-y: auto;
}
.sheet-panel h2 { margin: 0 0 14px; font-size: 18px; }

.field { display: block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.field input, .field textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 12px;
    font-size: 16px;
    color: var(--text);
    background: #fdfcfb;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); }

.err { color: var(--danger); font-size: 14px; margin: 4px 0 12px; }

/* 待入库与通用列表 */
.list { display: flex; flex-direction: column; gap: 12px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
/* 创建时间（待入库 / 知识库卡片）：等宽数字让秒位不跳动，弱化色彩不抢标题 */
.time {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .2px;
}
/* 「建议新增标签」做成软胶囊，便于一眼看到 */
.hint {
    font-size: 13px;
    color: var(--brand);
    background: #f8f1ea;
    border: 1px dashed #ecdccd;
    border-radius: 999px;
    padding: 3px 10px;
}
.muted { color: var(--muted); font-size: 14px; }
/* 快速记：附加文档那一行（按钮 + 文件名 + 移除 ✗）
   —— 与内容框紧贴，表达"文字和文件是一条"✗；文件名可能很长（中文+路径 ✗）⇒ 允许断行 + 压缩 */
.doc-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.doc-pick .muted { min-width: 0; overflow-wrap: anywhere; }
.toolbar-inline { display: flex; align-items: center; justify-content: space-between; }

.badge.warn { color: #9a6b12; border-color: #e8d5a8; background: #fdf6e6; }
.badge.bad { color: var(--danger); border-color: #f0d3d1; background: #fdf1f0; }

/* 轻提示 */
.toast {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--line);
    background: #fff;
}
.toast.ok { color: #1b7a3d; border-color: #bfe3cd; background: #f0faf3; }
.toast.bad { color: var(--danger); border-color: #f0d3d1; background: #fdf1f0; }

.small { font-size: 13px; }

/* 筛选栏与标签 chips */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select {
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
}
.filters .grow { flex: 1 1 160px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
    display: inline-flex;   /* 名称与胶囊内操作分列两侧：按钮不再跟在文字后面被读成标签名的一部分 */
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 8px 4px 10px;
    border-radius: 999px;
    background: #f6efe9;
    color: var(--brand);
    border: 1px solid #eddfd4;
    font-variant-numeric: tabular-nums;
}
.chip b { font-weight: 600; }
.chip-name { white-space: nowrap; }
.chip-acts { display: inline-flex; align-items: center; gap: 4px; }
/* 标签分组（AI 判定 / 待裁决 / 人工添加）：分组标题让来源一眼可分 */
.tag-group { margin-top: 12px; }
.tag-group:first-of-type { margin-top: 0; }
.tag-group-label { display: inline-block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
/* 分组计数：一眼知道这组有几个 */
.tag-group-count {
    display: inline-block;
    margin-left: 5px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    font-size: 11px;
    line-height: 16px;
    vertical-align: 1px;
}
.tag-hint { margin: 0 0 4px; }
/* 待裁决组：整组描边 + 一句人话指引 ⇒「这里需要你定夺、该点哪儿」一眼可见。
   语义差异只用底色/边框表达（沿用既有设计约定，不引入新色系）。 */
.tag-group.is-pending {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fffdf7;
    border: 1px solid #f0dcb4;
}
.tag-group.is-pending .tag-group-label { color: #8a5d0a; font-weight: 600; }
.tag-group-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.65; color: #8a5d0a; }
/* 胶囊内的操作（确认 / 剔除）：做成**看得见的小按钮**。
   原来是 0 背景、65% 透明度的裸文字，与标签名挤在一起 ⇒ 用户看不出能点（2026-09-17 反馈"很模糊"）。 */
.chip-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid currentColor;      /* 描边跟随所属胶囊的语义色（待裁决=琥珀 / 其他=朱砂） */
    background: rgba(255, 255, 255, .9);
    color: inherit;
    font: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.chip-act:hover, .chip-act:active { background: #fff; }
/* × 剔除：圆形按钮，与「确认」同高但更紧凑 */
.chip-act-x { width: 24px; padding: 0; font-size: 14px; font-weight: 600; }
/* 「＋ 添加标签」：虚线胶囊，与实心标签区分 */
.tag-add-row { margin-top: 12px; }
.chip-add {
    background: #fff;
    border: 1px dashed var(--line);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
}
.chip-add:hover { border-color: var(--brand); color: var(--brand); }
/* 手动打标的选择弹层 */
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; max-height: 46vh; overflow-y: auto; }
.tag-pick {
    max-width: 100%;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fdfcfb;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.tag-pick:hover { border-color: var(--brand); color: var(--brand); }
.tag-pick.is-on { color: var(--muted); background: #f4f2ef; cursor: default; }
/* AI 低置信：待用户裁决 */
.chip.pending { background: #fdf6e6; color: #8a5d0a; border: 1px dashed #e0c48a; }
/* 人工确认或手动添加 */
.chip.user { background: #f0faf3; color: #1b7a3d; border-color: #bfe3cd; }

.card-link { text-decoration: none; color: inherit; display: block; }

/* 列表卡片整卡可点（点卡片任意位置进详情；卡内按钮/链接优先） */
.card-clickable { cursor: pointer; }
.card-clickable:active { background: #faf7f4; }
.card-link-hint { margin-left: auto; color: var(--brand); font-size: 13px; white-space: nowrap; }

/* 「?」帮助点：点击弹出名词解释 */
.help-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    font-size: 12px;
    line-height: 1;
    color: #fff;
    background: var(--muted);
    border-radius: 50%;
    cursor: pointer;
    vertical-align: middle;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.help-dot:active { background: var(--brand); }

/* 解释类弹层保留换行（文案里用 \n 分段） */
.lt-dialog-msg { white-space: pre-line; }

/* 详情页 */
.detail-title { font-size: 20px; line-height: 1.45; margin: 14px 0 10px; }
/* 标题被平台截断时（悬停显示完整简介）：给个小提示光标 */
.detail-title.is-clipped { cursor: help; }
.detail-sec { margin-top: 22px; }
.detail-sec h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--brand);
    margin: 0 0 10px;
    letter-spacing: .5px;
}
.detail-sec h2::before {
    content: '';
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-light) 100%);
}
.detail-sec p { margin: 0; }
/* ---- 详情页面板：所有区块统一几何 ----
   原来只有「提炼总结」「正文」有面板，「摘要」「标签」裸露在页面底色上，
   同一页里两种观感显得零碎。现统一为「标题 + 面板」：
   圆角 / 边框 / 阴影 / 内边距全部一致，只有底色按语义微调（提炼=暖底）。 */
.sec-panel,
.content {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    font-size: 15px;
    line-height: 1.9;
}
/* 正文：中文阅读优先，字号与行高再放大一点 */
.content { font-size: 16px; line-height: 1.95; letter-spacing: .2px; }
/* 面板自带内边距，内部元素不再自带外边距 */
.sec-panel .chips { margin-top: 0; }
.sec-panel > p:last-child { margin-bottom: 0; }
/* 来源卡片：与面板同内边距（仅详情页，避免影响列表页卡片） */
.detail-sec .card { padding: 16px 18px; }
/* 正文按段渲染（item.js 做段落化）：段间留出间距，段落才看得出来
   —— 原来换行渲染成 <br>，段与段之间只有一行行距，长文就糊成一整块。
   注：.digest 也是 .content，它自己的 .digest p 规则在文件后面，仍优先生效。 */
.content p { margin: 0 0 14px; }
.content p:last-child { margin-bottom: 0; }

.sec-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: var(--brand);
    margin: 0 0 12px;
    letter-spacing: .5px;
}
/* 区块标题前的朱砂竖条：让页面骨架一眼可见 */
.sec-title::before {
    content: '';
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-light) 100%);
    flex: none;
}
section + section { margin-top: 22px; }

/* 上传音视频（快速记页）：与上方"文字/链接/语音"用虚线隔开，进度条给大文件一个交代
   —— 传几百 MB 时若没有进度，手机上会以为卡死了。 */
.upload-sec {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
}
.upload-sec .sec-title { margin-bottom: 8px; }

/* 「发现」页（二期A）：抓取概览 + 候选卡。与既有卡片同几何，只加少量语义差异。 */
.disc-sum {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    font-size: 14px;
    line-height: 1.9;
}
.disc-sum b { color: var(--brand); }
.disc-note { margin: 8px 0 0; }
.disc-list { display: grid; gap: 10px; margin-top: 10px; }
.disc-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}
.disc-title {
    display: block;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.5;
    color: var(--brand);
    text-decoration: none;
}
.disc-meta { margin-top: 4px; color: #8a8a8a; font-size: 12px; }
.disc-prev { margin-top: 6px; color: #555; font-size: 13px; line-height: 1.65; }
.progress {
    height: 6px;
    margin: 10px 0 6px;
    border-radius: 3px;
    background: #efe9e4;
    overflow: hidden;
}
.progress i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand-light) 0%, var(--brand) 100%);
    transition: width .2s ease;
}
.desc a { color: var(--brand); text-decoration: none; }

/* 来源里的原文链接：公众号/新闻的 URL 是一长串无空格字符，
   不加断行规则会直接顶破卡片（手机上尤其明显）。 */
.src-url {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* 「回到顶部」：滚过一屏才出现（短页面不出现），落在右下、避开居中的 toast */
.to-top {
    position: fixed;
    right: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 900;
    width: 42px;
    height: 42px;
    padding: 0 0 2px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--brand);
    font-size: 20px;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(43, 38, 34, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ============================================================
   移动 / 微信内置浏览器兼容
   ============================================================ */
a, button, .card-link, .chip, .tab { -webkit-tap-highlight-color: transparent; }
.topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
body { overscroll-behavior-y: none; }
/* iOS/微信聚焦输入框不放大：控件字号需 ≥ 16px */
.filters input, .filters select { font-size: 16px; }

/* 统一 toast / 对话框（替代原生 alert/confirm） */
#lantai-ui-host { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.lt-toast {
    position: absolute;
    left: 50%;
    bottom: 12%;
    transform: translateX(-50%) translateY(10px);
    max-width: 82vw;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(32, 27, 23, .93);
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
}
.lt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.lt-toast.bad { background: rgba(143, 34, 27, .95); }

.lt-mask {
    position: absolute;
    inset: 0;
    padding: 24px;
    background: rgba(0, 0, 0, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}
.lt-dialog {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 14px;
    padding: 18px;
}
.lt-dialog-msg { font-size: 15px; line-height: 1.6; margin-bottom: 16px; word-break: break-word; }
.lt-dialog-actions { display: flex; gap: 10px; }
.lt-dialog-actions .btn { flex: 1; }

/* 微信绑定邀请：弹层内二维码与链接 */
.lt-panel-body { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 16px; }
.lt-panel-body p { margin: 0 0 10px; }
.bind-qr {
    display: block;
    width: 200px;
    height: 200px;
    margin: 12px auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.bind-url {
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    background: #faf7f4;
    border: 1px dashed var(--line);
    border-radius: 8px;
    word-break: break-all;
    user-select: all;
}
.bind-exp { font-size: 12px; }
.bind-lead { text-align: center; color: var(--muted); font-size: 14px; margin: 0; }
.bind-target { text-align: center; font-size: 22px; font-weight: 600; color: var(--brand); margin: 6px 0 14px; }
.bind-tip { text-align: center; line-height: 1.7; margin-top: 12px; }
.bind-hint { line-height: 1.7; margin: 12px 0 0; }

.lt-field { display: block; margin-bottom: 12px; }
.lt-field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.lt-dialog-input {
    display: block;
    width: 100%;
    padding: 11px 12px;
    font-size: 16px;
    color: var(--text);
    background: #fdfcfb;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
}
.lt-dialog-input:focus { outline: none; border-color: var(--brand); }
.lt-dialog-err { color: var(--danger); font-size: 13px; margin: -2px 0 12px; }

/* 顶栏用户条 */
.userbar {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
/* 桌面：账号项内联排开（与改造前一致），下拉入口隐藏；
   窄屏由下面的媒体查询把同一份内容收成下拉菜单。 */
.userbar-menu { display: flex; align-items: center; gap: 10px; }
.userbar-toggle { display: none; }

.userbar-name { color: rgba(255, 255, 255, .8); }
.userbar-link { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.5); }
.userbar-out {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .55);
    color: #fff;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}
/* 顶栏本身已是 position: sticky，可作为绝对定位子元素的包含块 */

/* 登录页 */
.login-body { background: var(--bg); }
.login-wrap { max-width: 360px; margin: 0 auto; padding: 11vh 20px 40px; }
.login-brand { font-size: 30px; letter-spacing: 8px; color: var(--brand); margin: 0; text-align: center; }
.login-slogan {
    text-align: center;
    color: var(--brand);
    opacity: .72;
    font-size: 14px;
    letter-spacing: 2px;
    margin: 12px 0 26px;
}
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 13px; }
.login-card { padding: 20px 18px; }
.login-tip { text-align: center; margin-top: 18px; line-height: 1.7; }

/* 「或使用账号密码」分隔线 */
.login-or {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    margin: 16px 0 14px;
}
.login-or::before,
.login-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* 微信授权登录：微信绿，与品牌色「登录」按钮明确区分 */
.btn-wechat {
    background: #07C160;
    border-color: #07C160;
    color: #fff;
    font-weight: 500;
}
.btn-wechat:active { background: #06AD56; border-color: #06AD56; }

/* 顶栏 slogan（桌面与「兰台」同行；手机上让位给用户条，见下方窄屏顶栏布局） */
.brand-slogan {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, .72);
    margin-left: 10px;
}

/* 窄屏顶栏布局
   ────────────────────────────────────────────────────────────
   原方案把 .userbar 绝对定位在顶栏右上角，与左侧「兰台 + slogan」抢同一行宽度：
   390px 手机上品牌行约需 205px、账号条（管理员 · 微信内未绑定）约需 216px
   —— 必然重叠（手机上表现为品牌字被账号条压住）。
   现窄屏：账号操作（用户管理/绑定微信/改密/退出）收进**下拉菜单**，品牌行只需
   容下一个小圆点按钮，于是仍是两行：① 品牌行（兰台 + slogan + 下拉入口）
   ② 导航（可整项换行）。用户名在手机上不显示（桌面端仍显示）。 */
@media (max-width: 640px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .brand { grid-area: 1 / 1 / 2 / 2; min-width: 0; }
    /* relative 作为下拉菜单的定位基准（顶栏 sticky 虽也是包含块，但贴按钮更精确） */
    .userbar { position: relative; grid-area: 1 / 2 / 2 / 3; gap: 0; }
    .userbar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 26px;
        padding: 0 0 6px;
        border: 1px solid rgba(255, 255, 255, .55);
        border-radius: 999px;
        background: transparent;
        color: #fff;
        font-size: 17px;
        line-height: 1;
        font-family: inherit;
        cursor: pointer;
    }
    .userbar-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, .18); }
    /* 下拉面板：白底，落在按钮下方右对齐 */
    .userbar-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        z-index: 5;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        min-width: 148px;
        padding: 6px;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 10px 30px rgba(43, 38, 34, .28);
    }
    .userbar-menu.open { display: flex; }
    /* 面板内各项：整行可点（不再是顶栏上的胶囊样式） */
    .userbar-menu .userbar-link,
    .userbar-menu .userbar-out {
        display: block;
        width: 100%;
        padding: 10px 12px;
        border: 0;
        border-radius: 7px;
        background: transparent;
        color: var(--text);
        font-size: 14px;
        font-family: inherit;
        line-height: 1.4;
        text-align: left;
    }
    .userbar-menu .userbar-link { border-bottom: 0; }
    .userbar-menu .userbar-link:active,
    .userbar-menu .userbar-out:active { background: #f6efe9; }
    .userbar-name { display: none; }
    .tabs { grid-area: 2 / 1 / 3 / 3; }
}

/* 录音按钮 */
.btn-rec { margin-top: 4px; padding: 16px; font-size: 17px; letter-spacing: 1px; user-select: none; }
.btn-rec.recording { background: #b3261e; border-color: #b3261e; color: #fff; }
.rec-status { margin: 8px 0 16px; text-align: center; }
.login-card .btn-block { text-decoration: none; }

/* ============================================================
   桌面浏览器适配（≥ 900px 起加宽、双列、hover）
   ============================================================ */
@media (min-width: 900px) {
    .page { max-width: 880px; padding: 24px; }
    /* 必须写 minmax(0, 1fr)：裸 1fr 等于 minmax(auto, 1fr)，网格项的**最小内容宽度**会被强制遵守，
       卡片里只要有一个不可断的超长串（file:///C:/Users/…pdf、长 URL）就会把该列撑大、
       并把相邻那列挤成一字一列的竖条（2026-09-22 用户截图反馈的"错位"✗）。
       同理见第 701 行的 .userbar 写法 ✓。 */
    .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
    .filters { flex-wrap: nowrap; }
    .filters .grow { flex: 1 1 auto; }

    .btn:hover { border-color: var(--brand); color: var(--brand); }
    .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
    .btn-danger:hover { background: #fdf1f0; border-color: #e6b4b0; }
    .card:hover { border-color: #dbcec1; box-shadow: var(--shadow-hover); transform: translateY(-1px); }
    .tab:hover { color: #fff; }
    .node.depth-1, .node.depth-2, .node.depth-3 { grid-column: auto; }
}

/* 「正在处理中」的呼吸点：提示这里的内容系统还在跑 */
.pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-light);
    animation: lt-pulse 1.4s ease-in-out infinite;
}

/* 列表「加载中」：必须与「没有数据」长得不一样（用户 2026-09-22 反馈 ✗）。
   之前是干净的空白 ⇒ 会被读成"这里什么都没有"⚠️。沿用「正在处理中」那颗脉动点 ✗，
   视觉语言统一：有东西在动 = 系统在干活 ✗。 */
/* hidden 属性必须真的隐藏。
   2026-11-04 实际踩到：.loading-row 带 display:flex，类选择器优先级高于浏览器默认的
   [hidden]{display:none} ⇒ JS 里 el.hidden = true 完全无效，数据都加载完了页面还挂着
   「正在加载…」（待入库、知识库两个页面都中招）。这条兜底规则一劳永逸。 */
[hidden] { display: none !important; }

.loading-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px 0;
    color: var(--muted);
    font-size: 14px;
}
.loading-row .pulse { width: 8px; height: 8px; }
/* 加载失败：也要说人话 + 给一个重试入口，别留一片空白 ✗ */
.load-fail { text-align: center; padding: 18px 0; }
.load-fail .err { margin: 0 0 10px; }
@keyframes lt-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .2; }
}

/* 内容提炼总结：与「正文」区分（暖底 + 小标题加重），一眼看出是速览用 */
.digest { background: #fdfaf5; }
/* 提炼缺失时的占位（说明原因 + 一键补生成）：几何与其他面板一致，仅边框改虚线以表示"待生成" */
.digest-empty {
    padding: 16px 18px;
    background: #fdfaf5;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
}
.digest-empty p { margin: 0 0 10px; }
.digest p { margin: 0 0 6px; }
.digest .digest-label {
    margin: 10px 0 6px;
    color: var(--brand);
    font-weight: 600;
    letter-spacing: .3px;
}
.digest .digest-label:first-child { margin-top: 0; }

/* ============================================================
   阅读体验细化（列表 / 空态 / 悬停提示）
   ============================================================ */
/* 入库内容列表：摘要统一截两行，卡片高度整齐，浏览更省力
   （待裁决卡片不截行，避免把「查看详情 ›」提示裁掉） */
#list .desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.empty { line-height: 1.9; }

/* 「?」悬停即显（桌面指针设备）：触屏没有 hover，仍走点击弹层 */
.help-dot:hover { background: var(--brand); }
.lt-tip {
    position: absolute;
    max-width: min(300px, calc(100vw - 24px));
    padding: 11px 13px;
    border-radius: 10px;
    background: rgba(38, 32, 28, .97);
    color: #fff;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-line;
    box-shadow: 0 8px 24px rgba(43, 38, 34, .22);
    pointer-events: none;
}
.lt-tip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: var(--tip-arrow-x, 14px);
    width: 8px;
    height: 8px;
    background: inherit;
    transform: rotate(45deg);
    border-radius: 1px;
}
/* 浮层翻到问号上方时，箭头移到浮层底部 */
.lt-tip-above::before { top: auto; bottom: -4px; }

/* ---------------- 「置信度」说明的结构化排版 ----------------
   四层：标题 → 一句话定义 → 阈值规则（数值等宽胶囊对齐）→ 脚注。
   悬停浮层（深色）与点击弹层（浅色）共用同一份 HTML，故配色按上下文分别覆盖。 */
.lt-tip-title { font-size: 13.5px; font-weight: 600; letter-spacing: .3px; }
.lt-tip-lead { margin-top: 5px; font-size: 12.5px; line-height: 1.6; }
.lt-tip-rules { margin: 9px 0 0; padding: 0; list-style: none; }
.lt-tip-rules li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.55;
}
.lt-tip-rules li b {
    flex: none;
    min-width: 54px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.lt-tip-note {
    margin-top: 9px;
    padding-top: 8px;
    font-size: 11.5px;
    line-height: 1.6;
}
/* 深色浮层内 */
.lt-tip .lt-tip-lead { color: rgba(255, 255, 255, .84); }
.lt-tip .lt-tip-rules li b { background: rgba(255, 255, 255, .14); color: #fff; }
.lt-tip .lt-tip-note { color: rgba(255, 255, 255, .72); border-top: 1px solid rgba(255, 255, 255, .16); }
/* 浅色弹层内 */
.lt-dialog-msg .lt-tip-title { color: var(--text); }
.lt-dialog-msg .lt-tip-lead { color: var(--muted); }
.lt-dialog-msg .lt-tip-rules li b {
    background: #f6efe9;
    color: var(--brand);
    border: 1px solid #eddfd4;
}
.lt-dialog-msg .lt-tip-note { color: var(--muted); border-top: 1px solid var(--line); }
