/* 云档 · 公司资料管理库 —— 侧边栏 + 工作台布局 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb;
  --primary-weak: #eaf1fe;
  --danger: #dc2626;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --side-w: 232px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }

/* ---------- 登录 / 激活（左右分屏） ---------- */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-left {
  flex: 1.15; min-width: 0; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #1e3fae 0%, #2456e0 55%, #3b7af0 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 36px 46px;
}
.auth-left::after { content: ""; position: absolute; right: -140px; bottom: -140px;
  width: 380px; height: 380px; border-radius: 50%; background: rgba(255,255,255,.06); }
.auth-left .brand { display: flex; align-items: center; gap: 10px; }
.auth-left .brand .logo { width: 36px; height: 36px; border-radius: 9px;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.auth-left .brand b { font-size: 16px; font-weight: 600; }
.auth-left .mid { max-width: 440px; }
.auth-left h1 { font-size: 30px; line-height: 1.4; letter-spacing: 1px; }
.auth-left .lead { margin-top: 14px; font-size: 13px; color: rgba(255,255,255,.82); line-height: 1.9; }
.auth-left ul { list-style: none; margin-top: 20px; }
.auth-left ul li { font-size: 13.5px; color: rgba(255,255,255,.92); padding: 4.5px 0; }
.auth-left ul li::before { content: "✓"; margin-right: 9px; font-weight: 700; color: #9dc0ff; }
.welcome-tag { display: inline-block; font-size: 12px; letter-spacing: 2px;
  color: #cfe0ff; border: 1px solid rgba(255,255,255,.35); border-radius: 99px;
  padding: 3px 12px; margin-bottom: 14px; }
.welcome-list { margin-top: 20px; border-top: 1px solid rgba(255,255,255,.18); padding-top: 16px; }
.welcome-list li { font-size: 14px; padding: 5px 0; }
.welcome-list li::before { content: "✦"; margin-right: 9px; color: #9dc0ff; }
.welcome-list li b { font-weight: 600; }
.welcome-foot { margin-top: 18px; font-size: 12.5px; color: rgba(255,255,255,.7);
  line-height: 1.9; border-left: 2px solid rgba(255,255,255,.3); padding-left: 12px; }
.auth-left .copy { font-size: 12px; color: rgba(255,255,255,.55); position: relative; z-index: 1; }
.auth-right { flex: 1; min-width: 0; background: #fff; display: flex;
  flex-direction: column; justify-content: center; align-items: center; padding: 36px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-title { font-size: 23px; }
.auth-sub { font-size: 13px; color: var(--muted); margin: 6px 0 24px; }
.auth-mobile-head { display: none; }
@media (max-width: 900px) {
  .auth-wrap { flex-direction: column; }
  .auth-left { display: none; }
  .auth-right { justify-content: flex-start; padding-top: 20px; }
  .auth-mobile-head { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
  .auth-mobile-head .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--primary);
    color: #fff; font-size: 19px; display: flex; align-items: center; justify-content: center; }
  .auth-mobile-head b { font-size: 16px; display: block; line-height: 1.2; }
  .auth-mobile-head span { font-size: 11px; color: var(--muted); }
}
.auth-wrap.simple .auth-left { display: none; }
.auth-wrap.simple .auth-right { justify-content: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input, .select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--text); outline: none;
}
.input:focus { border-color: var(--primary); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; font-size: 14px;
  cursor: pointer; background: var(--primary); color: #fff; transition: opacity .15s, background .15s;
}
.btn:active { opacity: .8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.soft { background: var(--primary-weak); color: var(--primary); }
.btn.danger { background: #fee2e2; color: var(--danger); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.form-err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ---------- 布局：侧边栏 + 主区 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); flex-shrink: 0; background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.brand-stack { flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 16px 12px; }
.brand-stack img.brand-logo { height: 58px; }
.brand-stack b { font-size: 15px; letter-spacing: 1px; }
img.brand-logo { height: 52px; width: auto; display: block; }
.mobile-top img.brand-logo, .auth-mobile-head img.brand-logo { height: 44px; }
.auth-left .brand { gap: 14px; }
.auth-left .brand .auth-mark { width: 84px; height: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,.18)); }
.brand-lockup .brand-txt b { display: block; font-size: 34px; font-weight: 700; color: #fff; letter-spacing: 6px; line-height: 1.15; }
.brand-lockup .brand-txt .py { display: block; margin-top: 4px; font-size: 13px; letter-spacing: 7px; color: rgba(255,255,255,.85); }
.brand-lockup .brand-txt i { display: block; margin-top: 7px; font-style: normal; font-size: 12px; letter-spacing: 1px; color: rgba(255,255,255,.72); }
.auth-left .brand .logo-card { background: #fff; border-radius: 10px; padding: 5px 10px;
  display: inline-flex; align-items: center; }
.auth-left .brand .logo-card img { height: 30px; display: block; }
.brand .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--primary);
  color: #fff; font-size: 19px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand b { font-size: 16px; display: block; line-height: 1.2; }
.brand span { font-size: 11px; color: var(--muted); }
.side-nav { flex: 1; padding: 4px 10px 12px; }
.side-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; margin: 1px 0; border: none; background: none; border-radius: 9px;
  font-size: 14px; color: var(--text); cursor: pointer; text-align: left;
}
.side-item:hover { background: #f1f5f9; }
a.side-item { text-decoration: none; }
.side-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.side-item .si { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.side-item .side-tag { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; }
.side-item .side-count { margin-left: auto; font-size: 11px; color: var(--muted); }
.side-label { font-size: 11px; color: #9ca3af; padding: 14px 10px 5px; letter-spacing: .5px; }
.side-foot { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; align-items: center; gap: 9px; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { font-size: 11px; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1060px; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 0 14px 90px; max-width: none; }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; gap: 10px; padding: 14px 2px 12px;
  position: sticky; top: 0; background: var(--bg); z-index: 30; }
.mobile-top .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--primary);
  color: #fff; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.mobile-top b { font-size: 16px; display: block; line-height: 1.2; }
.mobile-top span { font-size: 11px; color: var(--muted); }

/* 移动端底部导航 */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; background: none; border: none; padding: 9px 0 8px; font-size: 11px;
  color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabbar button .ti { font-size: 19px; line-height: 1; }
.tabbar button.active { color: var(--primary); font-weight: 600; }
.tabbar a.tab-link { flex: 1; background: none; border: none; padding: 9px 0 8px; font-size: 11px;
  color: var(--muted); text-decoration: none; text-align: center; display: block; }
.tabbar a.tab-link .ti { font-size: 19px; line-height: 1; display: block; margin-bottom: 2px; }
@media (max-width: 900px) { .tabbar { display: flex; } }

/* ---------- 工作台 ---------- */
.greet { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.greet h1 { font-size: 24px; }
.greet .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.greet .acts { display: flex; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-card .lb { font-size: 12px; color: var(--muted); }
.stat-card .num { font-size: 24px; font-weight: 700; margin-top: 3px; }
.stat-card .num small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.stat-card .tip { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.home-sec { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 10px; }
.home-sec h2 { font-size: 16px; }
.home-sec .note { font-size: 12px; color: var(--muted); }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 24px; }
.lib-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.lib-card:hover { border-color: var(--primary); box-shadow: 0 3px 14px rgba(37,99,235,.08); }
.lib-card .top { display: flex; align-items: center; gap: 10px; }
.lib-card .ic { width: 38px; height: 38px; border-radius: 10px; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.lib-card .name { font-size: 15px; font-weight: 600; }
.lib-card .desc { font-size: 12px; color: var(--muted); margin-top: 1px; }
.lib-card .foot { display: flex; align-items: center; gap: 10px; margin-top: 11px; font-size: 12px; color: var(--muted); }

.badge { font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--primary-weak); color: var(--primary); font-weight: 500; white-space: nowrap; }
.badge.ro { background: #f1f5f9; color: var(--muted); }
.badge.gold { background: #fef3c7; color: #92400e; }

/* 数据表 */
.data-table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: #f8fafc; color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.rowlink { cursor: pointer; }
.data-table tr.rowlink:hover td { background: #f8fafc; }
.td-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.td-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-name .ic { flex-shrink: 0; }
.muted { color: var(--muted); }
.table-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; min-height: 240px; }
.table-card table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-card th, .table-card td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-card th { background: #f8fafc; color: var(--muted); font-weight: 500; font-size: 12px; }
.table-card tr:last-child td { border-bottom: none; }

/* 权限说明 */
.perm-note { background: var(--primary-weak); border-radius: var(--radius); padding: 16px 18px;
  margin-top: 26px; font-size: 12px; color: #334155; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; }
@media (max-width: 900px) { .perm-note { grid-template-columns: 1fr; } }
.perm-note b { color: var(--primary); display: block; font-size: 13px; margin-bottom: 4px; grid-column: 1 / -1; }

/* ---------- 内页头部 ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.page-head .hl { display: flex; gap: 12px; align-items: flex-start; }
.page-head .big-ic { width: 46px; height: 46px; border-radius: 12px; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.page-head h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* 面包屑 */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px;
  color: var(--muted); padding: 0 2px 12px; }
.crumbs .sep { color: #c4c9d4; }

/* 搜索行 */
.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-box { flex: 1; position: relative; min-width: 0; }
.search-box .input { padding-left: 34px; }
.search-box .s-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.search-row .btn { white-space: nowrap; }

/* 列表卡片 */
.card-list { display: flex; flex-direction: column; gap: 8px; }
.row-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: border-color .15s; }
.row-card:hover { border-color: var(--primary); }
.row-card .ic { font-size: 22px; flex-shrink: 0; width: 26px; text-align: center; }
.row-card .info { flex: 1; min-width: 0; }
.row-card .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card .meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 14px;
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty .e-ic { font-size: 38px; margin-bottom: 10px; }

/* ---------- 弹层 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 620px; border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }
@media (min-width: 640px) { .overlay { align-items: center; padding: 24px; } .modal { border-radius: 16px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { font-size: 17px; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-foot { display: flex; gap: 10px; margin-top: 16px; }
.modal-foot .btn { flex: 1; }

/* 文档编辑器 */
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.doc-toolbar button { border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 6px 10px; font-size: 13px; cursor: pointer; }
.doc-editor { min-height: 240px; max-height: 52vh; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; font-size: 15px; outline: none; background: #fff; }
.doc-editor:focus { border-color: var(--primary); }
.doc-editor h2, .doc-view h2 { font-size: 19px; margin: 12px 0 6px; }
.doc-editor h3, .doc-view h3 { font-size: 16px; margin: 10px 0 5px; }
.doc-editor ul, .doc-editor ol, .doc-view ul, .doc-view ol { padding-left: 22px; margin: 6px 0; }
.doc-editor blockquote, .doc-view blockquote { border-left: 3px solid var(--primary); padding-left: 10px; color: var(--muted); margin: 8px 0; }
.doc-view { border: 1px solid var(--border); border-radius: 10px; padding: 16px; min-height: 200px;
  max-height: 56vh; overflow-y: auto; background: #fff; }

/* 预览 */
.preview-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 200px; }
.preview-box img { max-width: 100%; max-height: 56vh; object-fit: contain; }
.preview-box iframe { width: 100%; height: 56vh; border: none; }
.preview-box video, .preview-box audio { width: 100%; }
.preview-fallback { text-align: center; color: var(--muted); padding: 40px 16px; }
.preview-fallback .big { font-size: 44px; margin-bottom: 10px; }

/* 管理后台 */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.admin-tabs button { flex: 1; padding: 9px; border: 1px solid var(--border); background: #fff;
  border-radius: 10px; font-size: 14px; cursor: pointer; color: var(--muted); }
.admin-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.code-chip { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--primary-weak);
  color: var(--primary); padding: 2px 8px; border-radius: 6px; font-weight: 600; letter-spacing: 1px; }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 99px; }
.tag.ok { background: #dcfce7; color: #166534; }
.tag.no { background: #f1f5f9; color: var(--muted); }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
.share-box { background: #f8fafc; border: 1px dashed var(--border); border-radius: 10px;
  padding: 12px; font-size: 13px; word-break: break-all; color: var(--muted); margin-top: 10px; }
.role-badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--primary-weak); color: var(--primary); }
.role-badge.admin { background: #fef3c7; color: #92400e; }

/* ⋯ 菜单 */
.menu { position: fixed; z-index: 80; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,.16); padding: 4px; min-width: 132px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 9px 12px; font-size: 14px; border-radius: 8px; cursor: pointer; color: var(--text); }
.menu button:hover { background: #f1f5f9; }
.menu button.danger { color: var(--danger); }

/* 回收站 */
.recycle-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.recycle-item:last-child { border-bottom: none; }
.recycle-item .info { flex: 1; min-width: 0; }
.recycle-item .name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recycle-item .meta { font-size: 12px; color: var(--muted); }

/* 其他 */
#toast-root { position: fixed; top: 16px; left: 0; right: 0; z-index: 99;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: rgba(15,23,42,.88); color: #fff; padding: 10px 18px; border-radius: 99px;
  font-size: 14px; max-width: 86vw; animation: fadein .2s; z-index: 99; }
.toast.err { background: rgba(220,38,38,.94); }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.loading { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
.section-title { font-size: 13px; color: var(--muted); margin: 16px 2px 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* 筛选标签 */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.chip { padding: 6px 14px; border: 1px solid var(--border); background: #fff; border-radius: 99px;
  font-size: 13px; color: var(--muted); cursor: pointer; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary-weak); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chip-note { font-size: 12px; color: #9ca3af; }
.log-act { background: #f1f5f9; border-radius: 6px; padding: 2px 8px; font-size: 12px; color: #475569; }

/* 图标选择器 */
.icon-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ic-opt { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; font-size: 19px; cursor: pointer; }
.ic-opt.active { border-color: var(--primary); background: var(--primary-weak); box-shadow: 0 0 0 2px var(--primary-weak); }

/* 资料库卡片行（管理后台） */
.lib-row { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 13px; }
.lib-row > .ic { font-size: 26px; flex-shrink: 0; width: 34px; text-align: center; }
.lib-row .info { flex: 1; min-width: 0; }
.lib-row .name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-row .desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.lib-row .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-tag { font-size: 11px; color: var(--muted); background: #f1f5f9; border-radius: 99px;
  padding: 1px 9px; font-weight: 400; }
@media (max-width: 900px) { .lib-row { flex-wrap: wrap; } .lib-row .acts { width: 100%; } }

/* ---------- 防泄露：水印 + 复制/打印保护 ---------- */
.wm-layer {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around;
  transform: rotate(-24deg); opacity: .09; user-select: none;
}
.wm-layer span { font-size: 13px; font-weight: 700; color: #14563e; white-space: nowrap; padding: 8px 12px; }
.doc-view { position: relative; }
@media print {
  body.no-print * { display: none !important; }
  body.no-print::after {
    content: "该内容没有打印权限，请联系管理员开通";
    display: block; padding: 80px 24px; font-size: 18px; text-align: center; color: #333;
  }
}

/* ---------- Word 文档在线预览 ---------- */
.docx-view {
  max-height: 62vh; overflow: auto; background: #fff;
  padding: 16px 20px; border-radius: 8px; text-align: left;
}
.docx-view .docx-wrapper { background: #fff !important; padding: 8px !important; }
.docx-view .docx-wrapper > section.docx { box-shadow: 0 1px 6px rgba(0,0,0,.12); margin-bottom: 12px; }

/* ---------- Excel / PPT / 文本 预览 ---------- */
.xlsx-view { max-height: 62vh; overflow: auto; background: #fff; padding: 14px; border-radius: 8px; text-align: left; }
.sheet-tag { font-weight: 700; margin: 12px 0 6px; color: #14563e; }
.xlsx-view table { border-collapse: collapse; margin-bottom: 14px; }
.xlsx-view td, .xlsx-view th { border: 1px solid #d3d8e0; padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.pptx-view { max-height: 62vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; align-items: center; background: #f2f4f8; padding: 14px; border-radius: 8px; }
.pptx-slide { background: #fff; width: 100%; max-width: 720px; min-height: 180px; border: 1px solid #e3e7ee; border-radius: 8px; padding: 16px; position: relative; }
.pptx-slide img { max-width: 100%; display: block; margin: 8px auto; }
.pptx-text p { margin: 4px 0; font-size: 14px; line-height: 1.7; }
.slide-no { position: absolute; right: 10px; top: 8px; font-size: 11px; color: #9aa3af; }
.txt-view { max-height: 62vh; overflow: auto; background: #fff; padding: 14px; border-radius: 8px; text-align: left; white-space: pre-wrap; word-break: break-all; font-size: 13px; line-height: 1.7; font-family: Consolas, 'Courier New', monospace; margin: 0; }

/* ---------- 上传进度条 ---------- */
.upload-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 80px; z-index: 3000;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(31,41,55,.18); padding: 10px 14px; max-width: 92vw;
}
.upload-bar .ub-row { display: flex; align-items: center; gap: 12px; }
.upload-bar #ub-info { font-size: 13px; display: inline-block; max-width: 62vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 批量选择操作条 */
.batch-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 3000;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(31,41,55,.18); padding: 10px 16px; max-width: 92vw;
}
.batch-bar .bb-txt { font-size: 13px; color: var(--text); white-space: nowrap; }
.batch-bar .bb-txt b { color: var(--primary); }
.table-card input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); vertical-align: middle; }
.batch-hint { font-size: 12px; color: var(--muted); background: #f0f5ff; border: 1px dashed #b6ccf7; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.ver-tag { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.mobile-top .m-out { margin-left: auto; font-size: 13px; color: #d84a3f; border: 1px solid #f0c4bf; padding: 5px 14px; border-radius: 999px; cursor: pointer; flex-shrink: 0; }

/* 拖拽上传覆盖层 */
#drop-overlay {
  position: fixed; inset: 0; z-index: 3500; display: none;
  background: rgba(37, 99, 235, .10); backdrop-filter: blur(2px); pointer-events: none;
}
#drop-overlay.on { display: flex; align-items: center; justify-content: center; }
#drop-overlay .dz-box {
  background: var(--card); border: 3px dashed var(--primary); border-radius: 16px;
  padding: 32px 48px; text-align: center; font-size: 18px; font-weight: 600; color: var(--primary);
  box-shadow: 0 12px 40px rgba(31, 41, 55, .25);
}
#drop-overlay .dz-box span { display: block; margin-top: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }

/* 禁止页面内图片被拖拽出去（防止拖动图片时浏览器另存副本/触发误上传） */
img { -webkit-user-drag: none; user-drag: none; }

/* ===== 在线表格编辑器 ===== */
.modal.wide { max-width: 1000px; }
.sh-tabbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sh-tab { border: 1px solid var(--border); background: #fff; border-radius: 8px 8px 0 0; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--text); }
.sh-tab.active { background: #eef6f1; border-color: var(--primary); color: var(--primary); font-weight: 600; }
.sh-tab.add { color: var(--muted); padding: 6px 10px; }
.sh-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.sh-tip { font-size: 12px; color: var(--muted); margin-left: 4px; }
.sh-wrap { overflow: auto; max-height: 56vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.sh-grid { border-collapse: collapse; font-size: 13px; }
.sh-grid th, .sh-grid td { border: 1px solid #dfe4ec; padding: 4px 8px; min-width: 84px; max-width: 260px; }
.sh-grid th { background: #f6f8fb; font-weight: 600; color: var(--muted); font-size: 12px; text-align: center; position: sticky; top: 0; z-index: 1; }
.sh-grid .sh-rh { position: sticky; left: 0; z-index: 1; min-width: 44px; }
.sh-grid .sh-corner { position: sticky; left: 0; top: 0; z-index: 2; }
.sh-grid td { vertical-align: top; white-space: pre-wrap; word-break: break-word; }
.sh-grid td:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: #fbfefc; }
.sheet-scroll { overflow: auto; max-height: 58vh; }
.sheet-preview { border-collapse: collapse; font-size: 13px; }
.sheet-preview td, .sheet-preview th { border: 1px solid #d3d8e0; padding: 4px 8px; white-space: nowrap; }
.sheet-preview th { background: #f6f8fb; font-weight: 600; }

/* 上传查重弹窗说明 */
.dup-tip { font-size: 12px; color: var(--muted); line-height: 1.75; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.dup-tip b { color: var(--text); }

/* 查重弹窗：同名位置与「去看看」 */
.dup-item { font-size: 13px; margin: 10px 0; }
.dup-item b { word-break: break-all; }
.dup-loc { display: flex; align-items: center; gap: 8px; margin: 4px 0 0 2px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.dup-path { color: var(--text); }
.dup-size { color: var(--muted); }
.dup-go { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 2px 9px; font-size: 12px; color: var(--primary); cursor: pointer; }
.dup-go:hover { background: #eef6f1; border-color: var(--primary); }
