* { box-sizing: border-box; margin: 0; padding: 0; }
/* 让 hidden 属性始终生效，避免被 .xxx{display:flex} 等规则覆盖（登录框/设置/上传按钮等都靠它隐藏） */
[hidden] { display: none !important; }
:root {
  --blue: #1a73e8;
  --blue-dark: #1967d2;
  --blue-bg: #e8f0fe;
  --line: #e6e8eb;
  --text: #202124;
  --muted: #5f6368;
  --faint: #9aa0a6;
}
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
  color: var(--text);
  background: #fff;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 顶栏 */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.brand .ic { color: var(--blue); width: 24px; height: 24px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.upload-progress { display: flex; flex-direction: column; gap: 5px; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.upload-progress .up-text { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.up-bar { height: 5px; background: #eef0f2; border-radius: 3px; overflow: hidden; }
.up-fill { height: 100%; width: 0%; background: var(--blue); border-radius: 3px; transition: width .25s; }
.upload-progress.done .up-fill { background: #34a853; }
.upload-progress.err .up-fill { background: #ea4335; }
.btn-settings {
  display: flex; align-items: center; gap: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.btn-settings:hover { background: #f8f9fa; }

/* 顶栏内容搜索 */
.topbar-search { position: relative; display: flex; align-items: center; gap: 7px; background: #f1f3f4; border: 1px solid transparent; border-radius: 10px; padding: 7px 11px; width: 280px; transition: background .15s, border-color .15s; }
.topbar-search:focus-within { background: #fff; border-color: var(--blue); box-shadow: 0 1px 4px rgba(26,115,232,.12); }
.topbar-search .ic-s { width: 16px; height: 16px; color: var(--faint); flex-shrink: 0; }
.topbar-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; color: var(--text); min-width: 0; }
.topbar-search input::placeholder { color: var(--faint); }
.topbar-search .s-clear { border: none; background: none; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; }
.topbar-search .s-clear:hover { color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 8px); right: 0; width: 460px; max-height: 72vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.16); z-index: 300; }
.sr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.sr-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.sr-toggle input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--blue); }
.sr-tmatch { font-size: 10.5px; color: var(--blue-dark); background: var(--blue-bg); border-radius: 5px; padding: 1px 6px; flex-shrink: 0; }
.sr-item { padding: 11px 14px; border-bottom: 1px solid #f1f3f4; cursor: pointer; }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: #f7f9fc; }
.sr-row1 { display: flex; align-items: center; gap: 8px; }
.sr-row1 .cicon, .sr-row1 svg { width: 17px; height: 17px; color: var(--blue); flex-shrink: 0; }
.sr-name { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-path { font-size: 11.5px; color: var(--faint); margin: 3px 0 0 25px; }
.sr-snip { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 5px 0 0 25px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-snip mark { background: #fff3c4; color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-empty { padding: 18px 14px; font-size: 13px; color: var(--faint); text-align: center; }
.btn-settings .ic { width: 16px; height: 16px; }
.userbox { display: flex; align-items: center; gap: 12px; position: relative; cursor: pointer; }
.role-badge {
  background: var(--blue-bg); color: var(--blue-dark);
  padding: 5px 12px; border-radius: 14px; font-size: 13px; font-weight: 500;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-bg); color: var(--blue-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.user-menu {
  position: absolute; top: 44px; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 6px; min-width: 220px;
  display: none; z-index: 20;
}
.user-menu.open { display: block; }
.user-menu .item { padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.user-menu .item:hover { background: #f1f3f4; }
.user-menu .item .nm { font-size: 14px; font-weight: 500; }
.user-menu .item .sub { font-size: 12px; color: var(--muted); }
.user-menu .hd { padding: 6px 12px; font-size: 12px; color: var(--faint); }

/* 布局 */
.layout { flex: 1; display: flex; overflow: hidden; }

/* 侧栏 */
.sidebar {
  width: 280px; flex-shrink: 0; border-right: 1px solid var(--line);
  padding: 18px 14px; overflow: auto;
}
.sidebar-title { font-size: 13px; color: var(--muted); margin-bottom: 12px; padding-left: 6px; display: flex; align-items: center; justify-content: space-between; }
.btn-newdept { border: 1px solid var(--line); background: #fff; color: var(--blue); border-radius: 7px; padding: 3px 9px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.btn-newdept:hover { background: var(--blue-bg); border-color: #cfe0fb; }
.tree { display: flex; flex-direction: column; gap: 2px; width: max-content; min-width: 100%; }

.tnode { user-select: none; }
.trow {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px;
  position: relative;
}
.trow:hover { background: #f1f3f4; }
.trow.selected { background: var(--blue-bg); color: var(--blue-dark); font-weight: 500; }
.trow .chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--faint); transition: transform .15s; }
.trow .chev.open { transform: rotate(90deg); }
.trow .chev.hidden { visibility: hidden; }
.trow .ficon { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.trow.selected .ficon { color: var(--blue-dark); }
.trow .label { flex: 1; white-space: nowrap; }
.trow .perm { width: 16px; height: 16px; flex-shrink: 0; color: var(--faint); }
.trow.selected .perm { color: var(--blue-dark); }
.children { margin-left: 18px; display: none; flex-direction: column; gap: 2px; }
.children.open { display: flex; }

.tree-hidden { margin-top: 14px; }
.hidden-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; font-size: 13px; color: var(--faint); opacity: .8;
}
.hidden-row .ic { width: 15px; height: 15px; }

/* 内容区 */
.content { flex: 1; padding: 18px 24px; overflow-y: auto; position: relative; }
.content-head { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumb { flex: 1; font-size: 15px; color: var(--text); font-weight: 500; }
.breadcrumb .sep { color: var(--faint); margin: 0 8px; font-weight: 400; }
.btn-upload {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 16px; font-size: 14px; cursor: pointer; color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.btn-upload:hover { background: #f8f9fa; }
.btn-upload .ic { width: 18px; height: 18px; }
/* MinerU 高精度解析上传：橙色主题，区别于普通上传 */
.btn-upload-mineru { color: #1967d2; border-color: #aecbfa; background: #e8f0fe; }
.btn-upload-mineru:hover { background: #d2e3fc; border-color: #8ab4f8; }

/* 文件网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); border-color: #d2d5d9; }
.card .cicon { width: 38px; height: 38px; color: var(--muted); stroke-width: 1.5; }
.card.folder .cicon { color: var(--blue); }
.card { position: relative; }
.card .cname { font-size: 13px; color: var(--text); padding: 0 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.card .card-tr { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 4px; }
.card .card-note { font-size: 13px; line-height: 1; cursor: help; }
.card .card-act { position: absolute; top: 6px; left: 34px; width: 24px; height: 24px; border-radius: 6px; display: none; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; background: rgba(255,255,255,.85); }
.card:hover .card-act { display: flex; }
/* 多选勾选框 */
.card .card-check { position: absolute; top: 9px; left: 10px; width: 17px; height: 17px; cursor: pointer; accent-color: var(--blue); display: none; z-index: 2; }
.card:hover .card-check, .card .card-check:checked { display: block; }
.card.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
/* 多选操作栏 */
.select-bar { display: flex; align-items: center; gap: 14px; background: var(--blue-bg); border: 1px solid #cfe0fb; border-radius: 10px; padding: 8px 14px; margin-bottom: 14px; }
.select-bar .sel-count { font-size: 14px; color: var(--blue-dark); font-weight: 500; flex: 1; }
.select-bar .sb-del { background: #c5221f; color: #fff; border: none; border-radius: 8px; padding: 7px 16px; font-size: 13px; cursor: pointer; }
.select-bar .sb-del:hover { background: #a51d1a; }
.select-bar .sb-share { background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 7px 16px; font-size: 13px; cursor: pointer; }
.select-bar .sb-share:hover { background: var(--blue-dark); }
.select-bar .sb-cancel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.card .card-act:hover { background: #eef0f2; color: var(--text); }
.card .card-act svg { width: 18px; height: 18px; }
.card-menu { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.14); padding: 6px; min-width: 160px; z-index: 60; }
.card-menu .mi { padding: 8px 12px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.card-menu .mi:hover { background: #f1f3f4; }
.card-menu .mi.danger { color: #c5221f; }
.card-menu .mi.danger:hover { background: #fce8e6; }
.card-menu .mhd { font-size: 11px; color: var(--faint); padding: 5px 12px 2px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-menu .mhelp { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; cursor: help; flex-shrink: 0; }
.card-menu .mhelp:hover { background: var(--blue-bg); color: var(--blue-dark); border-color: var(--blue); }
.help-tip { position: fixed; max-width: 290px; background: #2b2b2b; color: #fff; font-size: 12px; line-height: 1.7; padding: 11px 13px; border-radius: 9px; z-index: 80; box-shadow: 0 6px 22px rgba(0,0,0,.28); }
.help-tip b { color: #fff; }
.help-tip .ht-l1 { color: #c9d1d9; } .help-tip .ht-l2 { color: #8ab4f8; } .help-tip .ht-l3 { color: #fcad6b; } .help-tip .ht-l4 { color: #f28b82; }

/* 密级标签 */
.sens-tag { display: inline-block; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 8px; font-weight: 500; white-space: nowrap; }

/* ===== 设置面板 ===== */
.settings-body { padding: 0; background: #fff; }
.settings-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.settings-tabs .tab { padding: 12px 16px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tabs .tab:hover { color: var(--text); }
.settings-tabs .tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.sec-actions { margin-bottom: 14px; }
.usr-table td .seg { transform: scale(.92); transform-origin: left; }

/* 用户多选 + 部门分组（批量授权） */
.usr-table td.usr-ck, .usr-table th:first-child { text-align: center; padding-left: 6px; padding-right: 6px; }
.usr-table .usr-ck input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); vertical-align: middle; }
.usr-table tr.usr-sel td { background: var(--blue-bg); }
.usr-table tr.grp-row td { background: #f4f6f8; border-bottom: 1px solid var(--line); padding-top: 9px; padding-bottom: 9px; }
.usr-table tr.grp-row:hover td { background: #eef1f4; }

/* 通讯录维护 */
.staff-table th, .staff-table td { font-size: 12.5px; padding: 7px 8px; }
.staff-table .ini-pw { background: #e8f0fe; color: #1967d2; padding: 1px 7px; border-radius: 5px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; }
.staff-table .ini-pw:hover { background: #d2e3fc; }
.staff-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; max-width: 640px; }
.staff-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.staff-form label .req { color: #d93025; margin-left: 2px; }
.staff-form input, .staff-form select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.staff-form input:focus, .staff-form select:focus { outline: none; border-color: var(--blue); }
.acct-result { border: 1px solid #aecbfa; background: #e8f0fe; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.acct-result .ar-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: #1967d2; gap: 12px; }
.acct-result .ar-hint { font-size: 12px; color: var(--muted); margin: 6px 0; }
.acct-result .ar-text { width: 100%; height: 130px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; box-sizing: border-box; resize: vertical; background: #fff; }

/* 通讯录搜索框 */
.staff-search { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.staff-search:focus { outline: none; border-color: var(--blue); }

/* 名单/架构 视图切换 */
.staff-viewtab { display: inline-flex; gap: 3px; background: #eef1f4; border-radius: 9px; padding: 3px; margin-bottom: 14px; }
.staff-viewtab button { border: none; background: transparent; padding: 6px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.staff-viewtab button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* 组织架构树（汇报关系） */
.org-tree { font-size: 13px; padding: 4px 2px; }
.org-kids { margin-left: 13px; padding-left: 13px; border-left: 1px dashed #ccd0d5; }
.org-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; cursor: pointer; }
.org-row:hover { background: var(--blue-bg); }
.org-tog { width: 14px; text-align: center; color: var(--muted); font-size: 10px; user-select: none; flex-shrink: 0; transition: transform .12s; }
.org-leaf { width: 14px; flex-shrink: 0; }
.org-av { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.org-nm { font-weight: 600; color: var(--text); }
.org-po { color: var(--muted); }
.org-de { color: var(--faint); font-size: 12px; }
.org-cnt { background: #eef1f4; color: var(--muted); border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.org-noacct { background: #fde8e8; color: #c5221f; border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.org-item.collapsed > .org-kids { display: none; }
.org-item.collapsed > .org-row .org-tog { transform: rotate(-90deg); }
.usr-table .grp-name { font-weight: 600; color: var(--text); font-size: 13px; }
/* 批量编辑器：已选人员 chips + 改动高亮 */
.bchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.bchip { font-size: 12px; background: var(--blue-bg); color: var(--blue-dark); border: 1px solid #cfe0fb; border-radius: 14px; padding: 3px 10px; }
.perm-table tr.brow-dirty td { background: #fff8e6 !important; }
.perm-table tr.brow-dirty .pt-name { font-weight: 600; }

/* 权限矩阵编辑器 */
.perm-editor { padding: 20px 24px; }
.perm-head-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.btn-back { background: #f1f3f4; border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; font-size: 13px; color: var(--text); cursor: pointer; }
.btn-back:hover { background: #e8eaed; }
.perm-title { font-size: 16px; font-weight: 600; }
.perm-tip { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table thead th { position: sticky; top: 0; background: #f7f8fa; z-index: 1; font-size: 12px; color: var(--muted); font-weight: 600; padding: 11px 10px; border-bottom: 1px solid var(--line); }
.perm-table thead th:first-child { text-align: left; }
.perm-table thead th:not(:first-child) { width: 84px; text-align: center; }
.perm-table td { padding: 10px; border-bottom: 1px solid #f1f3f4; font-size: 14px; }
.perm-table tbody tr:hover td { background: #f7f9fc; }
.perm-table .pt-name { white-space: nowrap; color: var(--text); }
.perm-table .pt-ic svg { width: 16px; height: 16px; color: var(--blue); vertical-align: -3px; margin-right: 6px; }
.perm-table .pt-folder { font-size: 11px; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.perm-table .pt-c { text-align: center; }
.perm-table input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; accent-color: var(--blue); }
.perm-table input[type="checkbox"]:disabled { cursor: not-allowed; }
.perm-table tr.pt-locked .pt-name { color: var(--faint); }
.perm-table tr.pt-locked .pt-ic svg { color: var(--faint); }

/* 密级图例 */
.settings-legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 24px; background: #f7f8fa; border-bottom: 1px solid var(--line); }
.settings-legend .lg-label { font-size: 12px; color: var(--muted); margin-right: 4px; }

/* 区块 */
.settings-section { padding: 22px 24px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sec-num { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.sec-head h3 { font-size: 15px; }
.settings-section .desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0 0 16px 32px; }

/* 目录行 */
.node-list { display: flex; flex-direction: column; gap: 2px; }
.node-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; }
.node-row:hover { background: #f7f8fa; }
.node-row .ficon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.node-row .nname { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 目录可折叠：箭头 + 顶部展开/折叠全部按钮 */
.node-row .node-toggle { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; border-radius: 5px; }
.node-row .node-toggle:not(.leaf):hover { background: #e8eaed; }
.node-row .node-toggle.leaf { cursor: default; }
.node-row .node-toggle .chev { width: 14px; height: 14px; color: var(--faint); transition: transform .15s; }
.node-row .node-toggle .chev.open { transform: rotate(90deg); }
.node-row .node-toggle .chev.hidden { visibility: hidden; }
.node-tools { margin-left: auto; display: inline-flex; gap: 8px; }
.btn-tool { background: #f1f3f4; border: 1px solid var(--line); border-radius: 7px; padding: 4px 11px; font-size: 12px; color: var(--muted); cursor: pointer; }
.btn-tool:hover { background: #e8eaed; color: var(--text); }

/* 分段密级控件 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.seg-btn { border: none; background: #fff; padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--muted); border-left: 1px solid var(--line); transition: background .12s; white-space: nowrap; flex-shrink: 0; }
/* 通讯录：姓名/手机/工号/主管（第1/3/4/5列）一行不换行 */
.staff-table th:nth-child(1), .staff-table td:nth-child(1),
.staff-table th:nth-child(3), .staff-table td:nth-child(3),
.staff-table th:nth-child(4), .staff-table td:nth-child(4),
.staff-table th:nth-child(5), .staff-table td:nth-child(5) { white-space: nowrap; }
/* 职位（第2列）给最小宽度，避免被挤成"一字一行"：短职位一行、长职位正常折行 */
.staff-table th:nth-child(2), .staff-table td:nth-child(2) { min-width: 6.5em; }
.seg-btn:first-child { border-left: none; }
.seg-btn:hover { background: #f1f3f4; }
.seg-btn.active { font-weight: 700; }

/* 关键词表 */
.kw-table { width: 100%; border-collapse: collapse; }
.kw-table th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.kw-table td { padding: 9px 10px; border-bottom: 1px solid #f1f3f4; vertical-align: middle; font-size: 13px; }
.kw-table tr:hover td { background: #fafbfc; }
.kw-kw { font-weight: 500; }
.kw-note { display: inline-block; font-size: 12px; color: var(--muted); background: #f1f3f4; padding: 2px 8px; border-radius: 6px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cdd2d8; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch .slider:before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider:before { transform: translateX(16px); }

/* 删除图标 */
.icon-del { background: none; border: none; cursor: pointer; color: var(--faint); padding: 5px; border-radius: 6px; display: inline-flex; }
.icon-del:hover { color: #c5221f; background: #fce8e6; }
.icon-del svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 新增关键词行 */
.kw-add { display: flex; gap: 8px; margin-top: 16px; align-items: center; flex-wrap: wrap; background: #f7f8fa; padding: 12px; border-radius: 10px; }
.kw-add input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.kw-add input#kwNew { flex: 1; min-width: 180px; }
.kw-add .lbl { font-size: 12px; color: var(--muted); }
.set-select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; }
.btn-mini { background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.btn-mini:hover { background: var(--blue-dark); }
.btn-link { background: none; border: none; color: #c5221f; cursor: pointer; font-size: 13px; padding: 2px 6px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.blue { color: var(--blue); }
.sub2 { color: var(--faint); font-size: 12px; }

/* 拖拽上传区 */
.dropzone {
  border: 2px dashed #cdd2d8; border-radius: 14px;
  padding: 38px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--muted); font-size: 14px; transition: all .15s;
}
.dropzone.drag { border-color: var(--blue); background: var(--blue-bg); color: var(--blue-dark); }
.ic-cloud { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--faint); }
.dropzone.drag .ic-cloud { color: var(--blue); }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #323232; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 1000;
}
.toast.show { opacity: 1; }

.empty { color: var(--faint); font-size: 14px; padding: 30px 0; }

/* 登录 */
.login-mask { position: fixed; inset: 0; background: linear-gradient(135deg,#eef2f7,#f7f8fa); display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-card { background: #fff; width: 340px; padding: 32px 28px; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; justify-content: center; }
.login-brand .ic { color: var(--blue); width: 26px; height: 26px; }
.login-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 6px; }
.login-card input { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--blue); }
.login-btn { background: var(--blue); color: #fff; border: none; border-radius: 10px; padding: 11px; font-size: 15px; font-weight: 500; cursor: pointer; letter-spacing: 4px; }
.login-btn:hover { background: var(--blue-dark); }
.login-err { color: #c5221f; font-size: 13px; text-align: center; min-height: 16px; }

/* 预览弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 28px;
}
.modal.show { display: flex; }
.modal-box {
  background: #fff; border-radius: 14px; width: min(960px, 96vw); height: min(86vh, 900px);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 48px rgba(0,0,0,.25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-dl {
  background: var(--blue); color: #fff; border: none; border-radius: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.btn-dl:hover { background: var(--blue-dark); }
.btn-close {
  background: transparent; border: none; font-size: 24px; line-height: 1; color: var(--muted);
  cursor: pointer; width: 32px; height: 32px; border-radius: 8px;
}
.btn-close:hover { background: #f1f3f4; }
.modal-body { flex: 1; overflow: auto; background: #f7f8fa; }
/* 原件 / MinerU 解析文本 容器：默认只有原件全宽；有解析文本时左右并排 */
.modal-split { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-split > .modal-body { flex: 1; min-height: 0; }
.modal-split.split-lr { flex-direction: row; }
.modal-split.split-lr > .modal-body { flex: 1; min-width: 0; border-right: 1px solid var(--line); }
.modal-split.split-lr > .modal-parsed { flex: 1; min-width: 0; max-height: none !important; border-top: none !important; display: flex; flex-direction: column; }
.modal-split.split-lr > .modal-parsed .mp-body { flex: 1; overflow: auto; min-height: 0; }
.modal-box:has(.split-lr) { width: min(1320px, 96vw); }

/* 预览面板内嵌局部图(Local graph) */
.modal-graph { border-top: 1px solid var(--line); background: #fff; flex-shrink: 0; }
.modal-graph-head { display: flex; align-items: center; gap: 7px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; user-select: none; }
.modal-graph-head .lg-caret { color: var(--faint); font-size: 11px; width: 11px; text-align: center; }
.modal-graph-head .lg-en { font-size: 11px; font-weight: 500; color: var(--faint); letter-spacing: .3px; }
.modal-graph-head .lg-count { font-size: 12px; font-weight: 400; color: var(--muted); }
.modal-graph-head .lg-depth { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 400; color: var(--muted); }
.modal-graph-head .gfb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.modal-graph-head .gfb-seg button { border: none; background: #fff; color: var(--muted); font-size: 12px; padding: 2px 9px; cursor: pointer; line-height: 1.5; }
.modal-graph-head .gfb-seg button + button { border-left: 1px solid var(--line); }
.modal-graph-head .gfb-seg button.on { background: var(--blue); color: #fff; }
.modal-graph-body { height: min(260px, 32vh); position: relative; background: radial-gradient(circle at 50% 45%, #ffffff, #f1f3f5); }
.modal-graph-body canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 900px) {
  .modal-split.split-lr { flex-direction: column; }
  .modal-split.split-lr > .modal-body { border-right: none; }
  .modal-box:has(.split-lr) { width: min(960px, 96vw); }
}
.modal-body img { display: block; max-width: 100%; margin: 0 auto; }
.modal-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.modal-body .doc {
  background: #fff; margin: 0 auto; max-width: 820px; padding: 32px 40px;
  font-size: 15px; line-height: 1.8; color: var(--text); min-height: 100%;
}
.modal-body .doc img { max-width: 100%; height: auto; display: block; margin: 12px 0; }
.modal-body .doc table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.modal-body .doc td, .modal-body .doc th { border: 1px solid var(--line); padding: 6px 10px; }
.modal-body .doc h1, .modal-body .doc h2, .modal-body .doc h3 { margin: 18px 0 10px; }
.modal-body .doc p { margin: 8px 0; }
.modal-body pre {
  white-space: pre-wrap; word-break: break-word; font-family: "Consolas","Microsoft YaHei",monospace;
  font-size: 14px; line-height: 1.7; padding: 28px 36px; color: var(--text);
}
.modal-body .md h1,.modal-body .md h2,.modal-body .md h3 { margin: 16px 0 8px; }
.modal-body .md p { margin: 8px 0; }
.modal-body .md code { background: #eef0f2; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.modal-body .md ul { margin: 8px 0 8px 22px; }
/* PPT 逐页预览 */
.modal-body .doc.pptx { max-width: 920px; }
.modal-body .slide {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  margin: 0 0 18px; padding: 20px 24px;
}
.modal-body .slide-no { font-size: 12px; color: var(--faint); margin-bottom: 10px; }
.modal-body .slide-text { font-size: 15px; line-height: 1.7; margin-bottom: 12px; }
.modal-body .slide img { max-width: 100%; height: auto; display: block; margin: 10px 0; border-radius: 6px; }

/* Excel / CSV 表格预览 */
.modal-body .doc.xlsx, .modal-body .doc.xls { max-width: 100%; }
.modal-body .sheet { margin-bottom: 20px; max-width: 100%; overflow-x: auto; }
.modal-body .sheet-name { font-size: 13px; font-weight: 600; color: var(--blue-dark); margin-bottom: 8px; }
.modal-body table { border-collapse: collapse; font-size: 13px; max-width: 100%; background: #fff; }
.modal-body th, .modal-body td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; vertical-align: top; white-space: normal; overflow-wrap: anywhere; max-width: 480px; }
.modal-body th { background: #f1f3f4; font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.modal-body tr:nth-child(even) td { background: #fafbfc; }

.preview-hint { color: var(--faint); font-size: 13px; padding: 10px 36px 0; }
.preview-loading { color: var(--muted); font-size: 14px; padding: 40px; text-align: center; }

/* ---------- 文档关系图谱 ---------- */
.graph-view { position: fixed; inset: 0; z-index: 45; background: radial-gradient(circle at 50% 42%, #ffffff, #eef1f5); overflow: hidden; }
.graph-view #graphCanvas { position: absolute; inset: 0; display: block; cursor: grab; }
.graph-top { position: absolute; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: rgba(255,255,255,.78); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); z-index: 2; }
.graph-title { font-size: 15px; font-weight: 600; color: var(--text); display: flex; align-items: baseline; gap: 8px; }
.graph-meta { font-size: 12px; font-weight: 400; color: var(--faint); }
.graph-search { margin-left: auto; width: 220px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; outline: none; background: #fff; }
.graph-search:focus { border-color: var(--blue); }
.graph-close { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 9px; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.graph-close:hover { background: #f1f3f4; color: var(--text); }
.graph-legend { position: absolute; left: 18px; bottom: 18px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; box-shadow: 0 4px 18px rgba(0,0,0,.10); max-height: 46vh; overflow-y: auto; z-index: 2; min-width: 130px; }
.graph-legend .lg-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); }
.graph-legend .lg-item:hover { background: #f1f3f4; }
.graph-legend .lg-item.off { opacity: .4; }
.graph-legend .lg-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.graph-legend .lg-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.graph-legend .lg-c { font-size: 11px; color: var(--faint); }
.graph-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--faint); background: rgba(255,255,255,.7); padding: 5px 14px; border-radius: 20px; z-index: 2; pointer-events: none; white-space: nowrap; }
.graph-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--muted); z-index: 3; }

/* 图谱控件面板 */
.graph-controls { position: absolute; top: 70px; left: 18px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 4px 18px rgba(0,0,0,.10); z-index: 2; display: flex; flex-direction: column; gap: 11px; min-width: 220px; }
.graph-controls .gc-row { display: flex; align-items: center; gap: 9px; }
.graph-controls .gc-label { font-size: 12px; color: var(--muted); width: 56px; flex-shrink: 0; }
.graph-controls input[type=range] { flex: 1; accent-color: var(--blue); cursor: pointer; height: 4px; }
.graph-controls .gc-val { font-size: 11px; color: var(--faint); width: 42px; text-align: right; flex-shrink: 0; }
.graph-controls .gc-chips { display: flex; gap: 5px; }
.graph-controls .gc-chip { border: 1px solid var(--line); background: #fff; color: var(--faint); border-radius: 7px; padding: 3px 9px; font-size: 12px; cursor: pointer; font-weight: 500; }
.graph-controls .gc-chip.on { border-color: transparent; }
.graph-controls .gc-toggle { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); cursor: pointer; user-select: none; }
.graph-controls .gc-toggle input { width: 14px; height: 14px; accent-color: var(--blue); cursor: pointer; }
.graph-focus-exit { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(26,115,232,.95); color: #fff; font-size: 12.5px; padding: 7px 16px; border-radius: 20px; z-index: 3; cursor: pointer; box-shadow: 0 3px 14px rgba(26,115,232,.35); }
.graph-focus-exit:hover { background: var(--blue-dark); }

/* 图谱：模式下拉 + 聚焦工具条 + 图例脚注 */
.graph-controls .gc-sel { flex: 1; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; background: #fff; color: var(--text); cursor: pointer; outline: none; }
.graph-controls .gc-sel:focus { border-color: var(--blue); }
.graph-controls .gc-sep { height: 1px; background: var(--line); margin: 2px 0; }
.graph-focus-bar { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.96); border: 1px solid #cfe0fb; border-radius: 22px; padding: 5px 7px; z-index: 3; box-shadow: 0 3px 14px rgba(26,115,232,.18); max-width: calc(100vw - 36px); flex-wrap: wrap; justify-content: center; }
.graph-focus-bar .gfb-info { font-size: 12.5px; color: var(--blue-dark); padding: 0 4px; white-space: nowrap; }
.graph-focus-bar .gfb-btn { border: none; background: #eef3fd; color: var(--blue-dark); font-size: 12.5px; padding: 5px 12px; border-radius: 16px; cursor: pointer; white-space: nowrap; }
.graph-focus-bar .gfb-btn:hover { background: #dde9fb; }
.graph-focus-bar .gfb-btn:disabled { opacity: .45; cursor: default; }
.graph-focus-bar .gfb-exit { background: #fce8e6; color: #c5221f; }
.graph-focus-bar .gfb-exit:hover { background: #f9d6d2; }
.graph-focus-bar .gfb-depth { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.graph-focus-bar .gfb-seg { display: inline-flex; border: 1px solid #cfe0fb; border-radius: 14px; overflow: hidden; }
.graph-focus-bar .gfb-seg button { border: none; background: #fff; color: var(--blue-dark); font-size: 12px; padding: 3px 10px; cursor: pointer; line-height: 1.4; }
.graph-focus-bar .gfb-seg button + button { border-left: 1px solid #cfe0fb; }
.graph-focus-bar .gfb-seg button.on { background: var(--blue); color: #fff; }
.graph-legend .lg-foot { border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 10px 2px; display: flex; flex-direction: column; gap: 7px; }
.graph-legend .lg-foot > div { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.graph-legend .lg-sz { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
.graph-legend .lg-sz i { display: inline-block; border-radius: 50%; background: var(--faint); }
.graph-legend .lg-sz .s1 { width: 6px; height: 6px; } .graph-legend .lg-sz .s2 { width: 12px; height: 12px; }
.graph-legend .lg-ln { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
.graph-legend .lg-ln i { display: inline-block; width: 16px; background: var(--faint); }
.graph-legend .lg-ln .t1 { height: 1px; } .graph-legend .lg-ln .t2 { height: 3px; }

/* 图谱：重新布局按钮 */
.graph-controls .gc-relayout { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; padding: 7px 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.graph-controls .gc-relayout:hover { background: #f1f3f4; border-color: #d2d5d9; }
.graph-controls .gc-relayout svg { width: 14px; height: 14px; color: var(--blue); }

/* 图谱：Filters 折叠面板（仿 Obsidian）——把搜索匹配/文件类型/密级/授权/孤立点都收进一处 */
.graph-controls { max-height: calc(100vh - 110px); overflow-y: auto; }
.graph-controls .gc-filters-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; user-select: none; }
.graph-controls .gc-caret { font-size: 10px; color: var(--faint); width: 10px; text-align: center; }
.graph-controls .gc-filters-en { font-size: 10.5px; font-weight: 500; color: var(--faint); letter-spacing: .3px; }
.graph-controls .gc-filters-badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.graph-controls .gc-filters-reset { margin-left: auto; border: none; background: none; color: var(--blue); font-size: 12px; cursor: pointer; padding: 2px; }
.graph-controls .gc-filters-reset:hover { text-decoration: underline; }
.graph-controls .gc-filters { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.graph-controls .gc-filters.collapsed { display: none; }
.graph-controls .gc-row-top { align-items: flex-start; }
.graph-controls .gc-row-top .gc-label { margin-top: 3px; }
.graph-controls .gc-chips-wrap { flex-wrap: wrap; }
.graph-controls .gc-chip-type.on { background: var(--blue-bg); color: var(--blue-dark); border-color: transparent; }
.graph-controls .gc-chip-type i { font-style: normal; margin-left: 4px; opacity: .65; font-size: 10.5px; }
.graph-controls .gc-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.graph-controls .gc-seg button { border: none; background: #fff; color: var(--muted); font-size: 12px; padding: 3px 12px; cursor: pointer; }
.graph-controls .gc-seg button + button { border-left: 1px solid var(--line); }
.graph-controls .gc-seg button.on { background: var(--blue); color: #fff; }

/* ==================== 文件共享 / 授权 ==================== */
/* 授权弹窗（较小） */
.share-box { width: min(560px, 96vw); height: auto; max-height: min(86vh, 760px); }
#shareBody { padding: 6px 18px 18px; overflow-y: auto; }
.share-sec { margin-top: 16px; }
.share-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.share-files { display: flex; flex-wrap: wrap; gap: 6px; }
.share-chip { background: var(--blue-bg); color: var(--blue-dark); border-radius: 7px; padding: 4px 10px; font-size: 12.5px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-filter { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; box-sizing: border-box; }
.share-users { margin-top: 8px; max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.share-user { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f1f3f4; }
.share-user:last-child { border-bottom: none; }
.share-user:hover { background: #f7f8fa; }
.share-user .su-name { font-weight: 500; }
.share-user .sub2 { color: var(--faint); font-size: 12px; }
.share-empty { padding: 14px; text-align: center; color: var(--faint); font-size: 13px; }
.share-selcount { margin-top: 6px; font-size: 12px; color: var(--blue-dark); }
.share-terms { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-term { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--muted); }
.share-term.on { background: var(--blue-bg); border-color: #cfe0fb; color: var(--blue-dark); font-weight: 500; }
.share-date { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.share-date:disabled { background: #f1f3f4; color: var(--faint); }
.share-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; cursor: pointer; }
.share-opt .sub2 { color: var(--faint); font-size: 12px; }
.share-actions { display: flex; gap: 10px; margin-top: 22px; }
.share-actions .sb-cancel, .kw-add .sb-cancel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.share-actions .sb-cancel:hover, .kw-add .sb-cancel:hover { background: #f1f3f4; border-color: #d2d5d9; }

/* 我的授权 列表 */
#sharesBody { padding: 14px 18px; overflow-y: auto; }
.sh-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.sh-row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sh-st { font-size: 12px; border-radius: 6px; padding: 2px 8px; font-weight: 500; }
.sh-st.active { background: #e6f4ea; color: #137333; }
.sh-st.expired { background: #f1f3f4; color: var(--muted); }
.sh-st.revoked { background: #fce8e6; color: #c5221f; }
.sh-period { font-size: 12.5px; color: var(--muted); }
.sh-tag { font-size: 11.5px; background: var(--blue-bg); color: var(--blue-dark); border-radius: 6px; padding: 2px 7px; }
.sh-row1 .btn-link { margin-left: auto; color: #c5221f; }
.sh-files { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.sh-file { font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.sh-grantees { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* 被授权文件：密级标签留在右上角；底部一条整宽小条显示"由 xxx 授权 · 到期" */
.card { padding-bottom: 18px; } /* 所有卡片统一底部留白，保证同行图标对齐（共享卡片在此放小条）*/
.card .card-shareby {
  position: absolute; left: 7px; right: 7px; bottom: 7px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 10.5px; line-height: 1.2; white-space: nowrap; overflow: hidden;
}
.card .card-shareby .sb-by {
  color: var(--blue-dark); background: var(--blue-bg); border: 1px solid #d7e3fb;
  border-radius: 6px; padding: 2px 7px; max-width: 64%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .card-shareby .sb-exp { color: var(--faint); flex-shrink: 0; }
.card.shared.selected .card-shareby .sb-by { background: #fff; }

/* 文件预览弹窗：备注说明区 */
/* MinerU 解析文本区（原件附带的可读层） */
.modal-parsed { flex-shrink: 0; border-top: 1px solid var(--line); padding: 10px 18px; background: #e8f0fe; max-height: 45%; overflow-y: auto; }
.modal-parsed .mp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.modal-parsed .mp-label { font-size: 13px; font-weight: 600; color: #1967d2; }
.modal-parsed .mp-actions { display: flex; gap: 8px; }
.modal-parsed .mp-actions .btn-mini { background: #1967d2; padding: 6px 14px; }
.modal-parsed .mp-actions .btn-mini:hover { background: #1967d2; }
.modal-parsed .mp-body { margin-top: 10px; }

.modal-note { flex-shrink: 0; border-top: 1px solid var(--line); padding: 12px 18px; background: #fbfcfd; max-height: 40%; overflow-y: auto; }
.modal-note .mn-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.modal-note .mn-label { font-size: 13px; font-weight: 600; color: var(--text); }
.modal-note .mn-hint { font-size: 12px; color: var(--faint); }
.modal-note .mn-edit { width: 100%; min-height: 56px; max-height: 140px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.modal-note .mn-edit:focus { outline: none; border-color: var(--blue); }
.modal-note .mn-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.modal-note .mn-status { font-size: 12px; color: #137333; }
.modal-note .mn-view { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; line-height: 1.6; }


/* file-view-toggle 20260825 */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.view-toggle .vt-btn {
  border: none; background: transparent;
  width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
}
.view-toggle .vt-btn + .vt-btn { border-left: 1px solid var(--line); }
.view-toggle .vt-btn:hover { background: #f8f9fa; }
.view-toggle .vt-btn.on { background: var(--blue-bg); color: var(--blue-dark); }
.view-toggle .vt-btn .ic { width: 16px; height: 16px; }
body.view-skills .view-toggle { display: none; }

#grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#grid.view-list .card {
  height: auto;
  min-height: 42px;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 38px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
#grid.view-list .card:last-child { border-bottom: none; }
#grid.view-list .card:hover { box-shadow: none; background: #f8f9fa; border-color: var(--line); }
#grid.view-list .card.selected { background: var(--blue-bg); box-shadow: none; border-color: var(--line); }
#grid.view-list .card .cicon { display: none; }
#grid.view-list .card { gap: 8px; }
#grid.view-list .card .cname {
  text-align: left;
  flex: 1;
  padding: 0;
  font-size: 14px;
  max-width: none;
}
#grid.view-list .card .card-tr {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
}
#grid.view-list .card .card-act {
  position: static;
  width: 28px; height: 28px;
  margin-left: 2px;
  background: transparent;
}
#grid.view-list .card .card-check {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  display: block;
}
#grid.view-list .card .card-shareby {
  position: static;
  left: auto; right: auto; bottom: auto;
  margin-left: 6px;
  flex-shrink: 0;
  max-width: 240px;
  justify-content: flex-start;
}
#grid.view-list .empty { padding: 28px 8px; text-align: left; }

/* list-icons 20260825 */
#grid.view-list .card .cname { order: 2; }
#grid.view-list .card .card-shareby { order: 3; }
#grid.view-list .card .card-tr { order: 4; margin-left: 8px; }
#grid.view-list .card .card-act { order: 5; }
#grid.view-list .card .card-sens { display: inline-flex; }
#grid.view-list .card .sens-tag { font-size: 11px; }
