/* ===== 扩展模块（文件 / 公文 / 会议 / 项目 / 借款 / 事项） ===== */

/* 进度条 */
.mbar{ height:7px; border-radius:6px; background:#EDF1F8; overflow:hidden; flex:1; }
.mbar > i{ display:block; height:100%; border-radius:6px; transition:width .3s; }
.stat .mbar{ margin:6px 0 2px; }

/* 文件管理 */
.mfiles{ display:grid; grid-template-columns:224px 1fr; gap:16px; align-items:start; }
@media (max-width:1080px){ .mfiles{ grid-template-columns:1fr; } }
.ftree{ padding:12px 10px; position:sticky; top:80px; }
.ftree-hd{ font-size:11.5px; color:var(--muted); font-weight:600; letter-spacing:.04em; padding:6px 10px; }
.fnode{
  display:flex; align-items:center; gap:8px; height:34px; padding:0 10px; border-radius:8px;
  font-size:13px; color:var(--ink2); cursor:pointer; transition:.14s;
}
.fnode:hover{ background:#F5F8FE; }
.fnode.on{ background:var(--primary-soft); color:var(--primary); font-weight:600; }
.fnode .fn{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fnode .fc{ font-size:11.5px; color:var(--muted); }
.frow{ display:flex; align-items:center; gap:10px; }
.fic{ width:34px; height:34px; border-radius:9px; background:#F4F7FD; display:grid; place-items:center; font-size:16px; flex:0 0 auto; }
.fname{ font-weight:500; line-height:1.35; }
.fsub{ font-size:11.5px; color:var(--muted); }

.avatar.xs{ width:22px; height:22px; font-size:10px; }
.avs{ display:flex; }
.avs .avatar{ margin-left:-6px; border:2px solid #fff; }
.avs .avatar:first-child{ margin-left:0; }
.avmore{ width:22px; height:22px; border-radius:50%; background:#EEF2F9; color:var(--muted); font-size:10px; display:grid; place-items:center; margin-left:-6px; border:2px solid #fff; }

/* 通用键值网格 */
.kv-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px 20px; font-size:13px; }
.kv-grid > div{ display:flex; gap:8px; align-items:center; color:var(--ink); }
.kv-grid > div > span:first-child{ color:var(--muted); min-width:76px; font-size:12.5px; }

/* 看板式卡片 */
.dec-row{ display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; margin-bottom:8px; background:#FBFCFE; }
.room-slot{ display:grid; grid-template-columns:118px 1fr auto; gap:8px; font-size:12.5px; padding:7px 0; border-bottom:1px dashed var(--line); }
.room-slot:last-child{ border-bottom:none; }

/* 公文流程步骤 */
.dsteps{ display:flex; align-items:center; }
.dstep{ display:flex; flex-direction:column; align-items:center; gap:6px; min-width:52px; }
.dstep .dot{ width:26px; height:26px; border-radius:50%; background:#F1F4F9; color:var(--muted); display:grid; place-items:center; font-size:12px; font-weight:600; }
.dstep .lb{ font-size:11.5px; color:var(--muted); }
.dstep.ok .dot{ background:var(--green-soft); color:var(--green); }
.dstep.ok .lb{ color:var(--green); }
.dstep.now .dot{ background:var(--primary); color:#fff; box-shadow:0 0 0 4px rgba(37,99,235,.14); }
.dstep.now .lb{ color:var(--primary); font-weight:600; }
.dline{ flex:1; height:2px; background:#E9EDF5; margin:0 4px 20px; }

.doc-body{
  background:#F8FAFE; border:1px solid var(--line); border-radius:10px; padding:14px 16px;
  font-size:13px; line-height:1.85; color:var(--ink2); white-space:pre-line;
}
.reply-box{ border-left:3px solid var(--primary); background:var(--primary-soft); border-radius:0 10px 10px 0; padding:12px 14px; font-size:13px; line-height:1.75; }
.reply-box .rb-hd{ font-size:12px; color:var(--muted); margin-bottom:4px; }

/* 项目卡片 */
.pgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(310px,1fr)); gap:14px; }
.pcard{ padding:16px 16px 12px; cursor:pointer; transition:.16s; }
.pcard:hover{ transform:translateY(-2px); box-shadow:var(--shadow); border-color:#CAD9F8; }
.pcard-hd{ display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.pcode{ font-size:11.5px; color:var(--muted); letter-spacing:.02em; }
.pname{ font-size:15px; font-weight:600; margin-top:2px; line-height:1.4; }
.pmeta{ font-size:12px; color:var(--muted); margin:8px 0 12px; }
.pprog{ display:flex; align-items:center; gap:10px; font-size:12px; color:var(--muted); }
.pms{ font-size:12px; color:var(--ink2); margin-top:10px; }
.pfoot{ display:flex; justify-content:space-between; align-items:center; margin-top:12px; padding-top:10px; border-top:1px solid var(--line); font-size:12px; color:var(--muted); }

.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
@media (max-width:760px){ .two-col{ grid-template-columns:1fr; } }
.mini-lb{ font-size:12.5px; color:var(--muted); margin-bottom:6px; }

.ms-list{ display:grid; gap:2px; }
.ms-row{ display:flex; align-items:center; gap:12px; padding:9px 4px; border-bottom:1px dashed var(--line); }
.ms-row:last-child{ border-bottom:none; }
.ms-ck{
  width:22px; height:22px; border-radius:50%; border:1.5px solid #D5DEEC; background:#fff;
  display:grid; place-items:center; font-size:12px; color:#fff; flex:0 0 auto; transition:.14s;
}
.ms-row.done .ms-ck{ background:var(--green); border-color:var(--green); }
.ms-row.doing .ms-ck{ border-color:var(--primary); color:var(--primary); }
.ms-row.done .ms-n{ color:var(--muted); text-decoration:line-through; }
.ms-n{ font-size:13.5px; font-weight:500; }
.ms-d{ font-size:12px; color:var(--muted); }
.risk-row{ display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid #FBE3E3; background:#FEF7F7; border-radius:10px; margin-bottom:8px; }

/* 甘特图 */
.gantt{ position:relative; padding:10px 0 26px; }
.grow-row{ display:grid; grid-template-columns:150px 1fr; gap:12px; align-items:center; height:38px; }
.gname{ font-size:12.5px; color:var(--ink2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gtrack{ position:relative; height:22px; background:repeating-linear-gradient(90deg,#F7F9FD 0 1px,transparent 1px 12.5%); border-radius:6px; }
.gbar{ position:absolute; top:0; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:flex-end; padding-right:6px; }
.gbar span{ font-size:10.5px; color:#fff; font-weight:600; }
.gbar.running{ background:linear-gradient(90deg,#3B82F6,#2563EB); }
.gbar.risk{ background:linear-gradient(90deg,#F87171,#DC2626); }
.gbar.done{ background:linear-gradient(90deg,#34D399,#0E9F6E); }
.gbar.planning{ background:linear-gradient(90deg,#A5B4CB,#8494AC); }
.gbar.paused{ background:linear-gradient(90deg,#FBBF24,#D97706); }
.gms{ position:absolute; top:6px; width:10px; height:10px; border-radius:2px; transform:rotate(45deg); background:#fff; border:2px solid var(--primary); }
.gms.done{ background:var(--green); border-color:var(--green); }
.gms.wait{ border-color:#C3CDDF; }
.gnow{ position:absolute; top:0; bottom:20px; width:2px; background:var(--red); pointer-events:none; }
.gnow span{ position:absolute; top:-4px; left:-16px; font-size:10.5px; color:var(--red); white-space:nowrap; background:#fff; padding:0 4px; }
.legend{ display:flex; gap:16px; font-size:12px; color:var(--muted); margin-top:6px; }
.legend i{ display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:5px; }
.legend i.running{ background:var(--primary); }
.legend i.risk{ background:var(--red); }
.legend i.done{ background:var(--green); }
.legend i.planning{ background:#8494AC; }

/* 参会人选择 */
.pick-list{
  max-height:170px; overflow:auto; border:1px solid var(--line); border-radius:10px; padding:8px 10px;
  display:grid; grid-template-columns:1fr 1fr; gap:2px 12px;
}
.pick{ display:flex; align-items:center; gap:7px; font-size:13px; padding:4px 2px; cursor:pointer; }
.pick span{ color:var(--muted); font-size:11.5px; }
.pick input{ accent-color:var(--primary); }

/* 人员/部门选择列表折叠：超过 6 项默认收起，点「展开全部」查看完整名单 */
.pick-list.pick-fold.folded { max-height: 132px !important; overflow: hidden; position: relative; }
.pick-list.pick-fold.folded::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 32px; background: linear-gradient(transparent, #fff); pointer-events: none; }
.pick-fold-btn { margin-top: 6px; }

/* ================= 文件中心：上传 / 预览 / 编辑 ================= */
.fname[data-mact]{ cursor:pointer; }
.fname[data-mact]:hover{ color:var(--primary); text-decoration:underline; }

/* 上传弹窗拖拽区 */
.up-drop{
  display:block; border:1.5px dashed #C9D5E8; border-radius:14px; background:linear-gradient(180deg,#F8FBFF,#F2F6FD);
  padding:22px 16px; text-align:center; cursor:pointer; transition:.18s;
}
.up-drop:hover{ border-color:var(--primary); background:var(--primary-soft); }
.up-drop.on{ border-color:var(--primary); background:var(--primary-soft); box-shadow:inset 0 0 0 3px rgba(37,99,235,.10); }
.up-drop-ico{ font-size:26px; line-height:1; }
.up-drop-t{ margin-top:8px; font-size:14px; font-weight:600; color:var(--ink); }
.up-drop-or{ color:var(--muted); font-weight:400; margin-left:8px; }
.up-drop-hint{ margin-top:4px; font-size:12px; color:var(--muted); }

.up-list{ margin-top:10px; display:flex; flex-direction:column; gap:8px; max-height:190px; overflow:auto; }
.up-item{ display:flex; align-items:center; gap:10px; border:1px solid var(--line); border-radius:10px; padding:8px 10px; background:#fff; }
.up-item.bad{ border-color:#F6C9C9; background:var(--red-soft); }
.up-item-ico{ font-size:18px; }
.up-item-main{ flex:1; min-width:0; }
.up-item-name{ font-size:13px; font-weight:600; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.up-item-sub{ font-size:11.5px; color:var(--muted); }

/* 详情内操作条 */
.fp-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.fp-tip{ background:var(--amber-soft); color:#8A4D00; border:1px solid #F3DDBB; border-radius:10px; padding:9px 12px; font-size:12.5px; margin-bottom:12px; }

/* 预览容器 */
.fp-prev{
  border:1px solid var(--line); border-radius:12px; background:#F7F9FD; overflow:hidden;
  min-height:120px; display:flex; align-items:center; justify-content:center;
}
.fp-prev-lg{ min-height:56vh; max-height:66vh; }
.fp-loading{ color:var(--muted); font-size:13px; padding:26px; }
.fp-img{ display:block; max-width:100%; max-height:62vh; object-fit:contain; margin:0 auto; }
.fp-frame{ width:100%; height:56vh; border:0; background:#fff; }
.fp-prev-lg .fp-frame{ height:62vh; }
.fp-media{ max-width:100%; max-height:60vh; display:block; }
.fp-text{
  width:100%; max-height:52vh; overflow:auto; margin:0; padding:14px 16px; background:#fff;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px; line-height:1.75; color:#1F2937;
  white-space:pre-wrap; word-break:break-word;
}
.fp-md{ padding:16px 18px; background:#fff; max-height:52vh; overflow:auto; }
.fp-empty{ text-align:center; padding:22px 16px; }
.fp-empty-ico{ font-size:34px; }
.fp-empty p{ font-size:13px; margin-top:6px; }

/* 全屏预览弹层 */
.fp-modal-bd{ display:flex; flex-direction:column; }

/* 文本在线编辑器：等宽字体 + 可拉伸，行号感留白与预览一致 */
.fp-editor{
  min-height:44vh; max-height:58vh; overflow:auto; white-space:pre; tab-size:2;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:13px; line-height:1.75;
}
.fp-editor[disabled]{ background:#F3F5F9; color:var(--muted); }

/* 表头排序箭头（文件列表按更新时间/名称/大小/版本排） */
.sortico{ font-style:normal; font-size:10px; color:var(--primary); margin-left:2px; }

/* 共享成员列表 */
.share-list{ max-height:300px; overflow:auto; border:1px solid var(--line); border-radius:10px; padding:6px; display:flex; flex-direction:column; gap:2px; }
.share-item{ display:flex; align-items:center; gap:9px; padding:6px 8px; border-radius:8px; cursor:pointer; }
.share-item:hover{ background:var(--primary-soft); }
.share-item input{ accent-color:var(--primary); }
.share-name{ font-size:13px; color:var(--ink); }
.share-dept{ font-size:11.5px; color:var(--muted); margin-left:auto; }
.avatar.sm{ width:24px; height:24px; font-size:11px; }

/* 拖拽浮层 */
.drop-overlay{
  position:fixed; inset:0; z-index:12000; background:rgba(14,23,41,.62);
  display:flex; align-items:center; justify-content:center; pointer-events:none;
}
.drop-overlay-in{
  background:#fff; border-radius:18px; padding:34px 46px; text-align:center;
  border:2px dashed var(--primary); box-shadow:var(--shadow-lg);
}
.drop-ico{ font-size:38px; }
.drop-t{ margin-top:10px; font-size:16px; font-weight:700; color:var(--ink); }
.drop-s{ margin-top:4px; font-size:12.5px; color:var(--muted); }

/* 文本/文档类预览：内容贴顶铺满 */
.fp-prev:has(.fp-text), .fp-prev:has(.fp-frame), .fp-prev:has(.fp-md){ align-items:stretch; }
.fp-prev .fp-text{ flex:1; max-height:none; }
.fp-prev:not(.fp-prev-lg) .fp-text{ flex:none; max-height:52vh; overflow:auto; }

/* ===== 在线查看（Word / Excel / PPT / ZIP / 图片工具条） ===== */
.fname{ cursor:pointer; }
.fname:hover{ color:var(--primary); text-decoration:underline; }

/* 通用：让预览容器撑满、纵向堆叠（内容在上，说明条在下） */
.fp-prev:has(.oa-paper-wrap), .fp-prev:has(.oa-sheet-wrap), .fp-prev:has(.oa-ppts),
.fp-prev:has(.oa-zip), .fp-prev:has(.oa-img), .fp-prev:has(.oa-pdf){
  align-items:stretch; flex-direction:column;
}
.oa-pv-note{
  font-size:12px; color:var(--muted); background:#F5F8FE; border-top:1px solid var(--line);
  padding:8px 12px; line-height:1.6; text-align:left;
}
.oa-dim{ color:var(--muted); }

/* Word：纸张效果 */
.oa-paper-wrap{ width:100%; max-height:58vh; overflow:auto; background:#EDF1F8; padding:14px; }
.fp-prev-lg .oa-paper-wrap{ max-height:62vh; }
.oa-paper{
  background:#fff; max-width:800px; margin:0 auto; padding:30px 44px; border-radius:4px;
  box-shadow:0 2px 14px rgba(16,32,64,.10); font-size:14px; line-height:1.95; color:#1F2937;
}
.oa-paper p{ margin:0 0 10px; }
.oa-paper strong, .oa-paper b{ font-weight:600; color:#0E1729; }
.oa-paper table{ border-collapse:collapse; margin:10px 0; font-size:13px; }
.oa-paper td, .oa-paper th{ border:1px solid #DCE3EF; padding:6px 10px; }
.oa-paper img{ max-width:100%; height:auto; }
.oa-md{ font-size:13.5px; line-height:1.85; }
.oa-md h1{ font-size:20px; margin:0 0 12px; }
.oa-md h2{ font-size:16px; margin:18px 0 8px; }
.oa-md h3{ font-size:14px; margin:14px 0 6px; }
.oa-md ul{ margin:6px 0 10px; padding-left:20px; }
.oa-md li{ margin:3px 0; }
.oa-md code{ background:#F1F4FA; border-radius:4px; padding:1px 5px; font-size:12px; }
.oa-md pre{ background:#F7F9FD; border:1px solid var(--line); border-radius:8px; padding:10px 12px; overflow:auto; }
.oa-md blockquote{ margin:8px 0; padding:6px 12px; border-left:3px solid var(--primary); background:var(--primary-soft); border-radius:0 8px 8px 0; color:var(--ink2); }
.oa-md table{ border-collapse:collapse; margin:10px 0; font-size:12.5px; }
.oa-md th, .oa-md td{ border:1px solid #DCE3EF; padding:6px 10px; }

/* Excel：表头吸顶 + 工作表页签 */
.oa-sheet-wrap{ width:100%; display:flex; flex-direction:column; min-height:0; }
.oa-sheet-tabs{ display:flex; gap:6px; padding:8px 10px 0; background:#F5F8FE; border-bottom:1px solid var(--line); overflow:auto; }
.oa-sheet-tab{
  height:28px; padding:0 12px; border:1px solid var(--line); border-bottom:none;
  border-radius:8px 8px 0 0; background:#EDF1F8; font-size:12.5px; color:var(--ink2);
  cursor:pointer; white-space:nowrap;
}
.oa-sheet-tab.on{ background:#fff; color:var(--primary); font-weight:600; }
.oa-sheet-scroll{ width:100%; max-height:56vh; overflow:auto; background:#fff; }
.fp-prev-lg .oa-sheet-scroll{ max-height:60vh; }
.oa-sheet-tb{ border-collapse:collapse; font-size:12.5px; }
.oa-sheet-tb th, .oa-sheet-tb td{ border:1px solid #E6EAF2; padding:6px 10px; white-space:nowrap; }
.oa-sheet-tb thead th{ background:#F5F8FE; color:var(--ink2); font-weight:600; position:sticky; top:0; z-index:1; }
.oa-sheet-tb .oa-rn{ width:44px; text-align:center; color:var(--muted); background:#F9FBFE; font-size:11.5px; }

/* PPT：逐页文字卡片 */
.oa-ppts{ width:100%; max-height:58vh; overflow:auto; padding:14px; display:grid; gap:12px; align-content:start; background:#EDF1F8; }
.fp-prev-lg .oa-ppts{ max-height:62vh; }
.oa-ppt{ background:#fff; border-radius:10px; padding:14px 18px; box-shadow:0 1px 8px rgba(16,32,64,.08); }
.oa-ppt-no{ font-size:11.5px; color:var(--muted); margin-bottom:6px; letter-spacing:.03em; }
.oa-ppt-bd p{ margin:0 0 6px; font-size:13.5px; line-height:1.7; color:var(--ink2); }
.oa-ppt-bd .oa-ppt-title{ font-size:15px; font-weight:600; color:var(--ink); }

/* 压缩包目录 */
.oa-zip{ width:100%; max-height:56vh; overflow:auto; background:#fff; }
.oa-zip-hd{ padding:10px 14px; font-size:12.5px; color:var(--ink2); background:#F5F8FE; border-bottom:1px solid var(--line); position:sticky; top:0; }
.oa-zip-tb{ width:100%; border-collapse:collapse; font-size:12.5px; }
.oa-zip-tb th, .oa-zip-tb td{ border-bottom:1px solid #EEF1F7; padding:7px 14px; text-align:left; }
.oa-zip-tb th{ background:#FBFCFE; color:var(--muted); font-weight:600; }

/* 图片查看工具条 */
.oa-img, .oa-pdf{ width:100%; display:flex; flex-direction:column; min-height:0; }
.oa-img-tools{
  display:flex; align-items:center; gap:6px; padding:6px 10px; background:#F5F8FE;
  border-bottom:1px solid var(--line); font-size:12.5px; flex-wrap:wrap;
}
.oa-img-tools button{
  height:27px; min-width:30px; padding:0 9px; border:1px solid var(--line); background:#fff;
  border-radius:7px; font-size:12.5px; color:var(--ink2); cursor:pointer; transition:.14s;
}
.oa-img-tools button:hover{ border-color:#C3D4F5; color:var(--primary); background:var(--primary-soft); }
.oa-zoom{ min-width:46px; text-align:center; color:var(--muted); font-variant-numeric:tabular-nums; }
.oa-img-stage{ overflow:auto; max-height:54vh; padding:12px; display:flex; justify-content:center; align-items:flex-start; background:#EEF2F8; }
.fp-prev-lg .oa-img-stage{ max-height:58vh; }
.oa-img-stage img{ display:block; transition:width .12s linear; box-shadow:0 2px 12px rgba(16,32,64,.14); background:#fff; }
@media (max-width:760px){
  .oa-paper{ padding:20px 18px; }
  .oa-sheet-scroll, .oa-ppts, .oa-paper-wrap{ max-height:50vh; }
}

/* ---- 存储空间明细（租户端 / 平台端共用） ---- */
.sp-head{ border:1px solid var(--line); border-radius:12px; padding:12px 14px; background:#FBFCFE; }
.sp-head.warn{ background:#FEF2F2; border-color:#FECACA; }
.sp-num{ font-size:13px; margin-bottom:8px; }
.sp-num b{ font-size:19px; font-weight:700; }
.sp-bar{ height:8px; border-radius:6px; background:#EDF1F8; overflow:hidden; }
.sp-bar.lg{ height:10px; }
.sp-bar > i{ display:block; height:100%; border-radius:6px; background:var(--primary,#2563EB); transition:width .3s; }
.sp-files td{ vertical-align:top; }

/* 项目搜索栏 */
.psearch { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.psearch .input { flex: 1; max-width: 460px; height: 34px; }
.psearch-hit { font-size: 12.5px; color: var(--muted); }
/* 「全部项目」按状态分组可折叠 */
.psec { margin-top: 16px; }
.psec:first-of-type { margin-top: 0; }
.psec-hd { display: flex; align-items: center; gap: 8px; padding: 8px 4px; cursor: pointer; user-select: none; border-radius: 8px; }
.psec-hd:hover { background: #F6F9FF; }
.psec-hd b { font-size: 14.5px; }
.psec-arrow { color: var(--muted); font-size: 12px; width: 14px; }
.psec-tip { font-size: 12px; color: var(--muted); }
.psec-empty { padding: 18px; color: var(--muted); font-size: 13px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; grid-column: 1 / -1; }
