/* ===========================================================
 *  Office 在线编辑器（docx / xlsx / pptx）
 *  —— 全屏弹层 + 顶部工具栏 + 纸面/网格/分页三种编辑区
 * =========================================================== */

/* ---------- 弹层骨架 ---------- */
.modal.oe-xl{
  max-width:1180px; width:100%;
  height:calc(100vh - 48px); height:calc(100dvh - 48px);
  max-height:none;
}
.oe-title{ font-size:16px; font-weight:600; max-width:760px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.oe-sub{ color:var(--muted); font-size:12.5px; margin-top:3px; }

.oe-bar{
  display:flex; align-items:center; gap:6px; flex-wrap:wrap;
  padding:8px 12px; border-bottom:1px solid var(--line);
  background:#F8FAFD; flex:0 0 auto;
  position:sticky; top:0; z-index:2;
}
.oe-grp{ display:flex; align-items:center; gap:3px; padding-right:8px; border-right:1px solid var(--line); }
.oe-grp:last-child{ border-right:none; padding-right:0; }
.oe-b{
  height:28px; min-width:28px; padding:0 8px; border-radius:7px;
  border:1px solid #DDE3EE; background:#fff; color:var(--ink2);
  font-size:12.5px; line-height:1; display:inline-flex; align-items:center; justify-content:center;
  transition:.12s; white-space:nowrap;
}
.oe-b:hover{ background:var(--primary-soft); border-color:#BFD3FF; color:var(--primary-2); }
.oe-b:active{ transform:translateY(1px); }
.oe-sel{
  height:28px; border:1px solid #DDE3EE; border-radius:7px; background:#fff;
  font-size:12.5px; color:var(--ink2); padding:0 6px; max-width:132px;
}
.oe-color{
  position:relative; height:28px; padding:0 7px; border:1px solid #DDE3EE; border-radius:7px;
  background:#fff; display:inline-flex; align-items:center; gap:3px; font-size:13px; color:var(--ink2); cursor:pointer;
}
.oe-color input{ position:absolute; inset:0; opacity:0; cursor:pointer; }
.oe-color::after{ content:''; position:absolute; left:6px; right:6px; bottom:3px; height:3px; border-radius:2px; background:currentColor; opacity:.8; }
.oe-color input:focus-visible + span{ outline:none; }
.oe-hl::after{ background:#F6D662; }
.oe-dim{ font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; min-width:44px; display:inline-block; }

.oe-bd{ padding:0; overflow:auto; background:#EEF1F6; }
.oe-notice{
  margin:0; padding:9px 16px; font-size:12.5px; line-height:1.7; color:#5A6B85;
  background:#F2F6FF; border-bottom:1px solid #E1E9F8;
}
.oe-notice b{ color:var(--primary-2); }

.oe-ft{ gap:9px; align-items:center; }
.oe-note{ height:32px; width:220px; font-size:12.5px; }

/* ---------- Word 纸面 ---------- */
.oe-doc-wrap{ padding:22px 16px 40px; }
.oe-doc{
  max-width:794px; min-height:900px; margin:0 auto;
  background:#fff; padding:56px 64px 72px;
  box-shadow:0 3px 16px rgba(16,24,40,.12);
  border-radius:2px; outline:none;
  font-size:15px; line-height:1.9; color:#1A2233;
  word-break:break-word;
}
.oe-doc:focus{ box-shadow:0 3px 16px rgba(16,24,40,.12), 0 0 0 2px rgba(37,99,235,.14); }
.oe-doc h1{ font-size:26px; font-weight:700; margin:18px 0 12px; line-height:1.45; }
.oe-doc h2{ font-size:21px; font-weight:700; margin:16px 0 10px; line-height:1.5; }
.oe-doc h3{ font-size:18px; font-weight:600; margin:14px 0 8px; }
.oe-doc h4{ font-size:16px; font-weight:600; margin:12px 0 6px; }
.oe-doc p{ margin:0 0 8px; }
.oe-doc ul,.oe-doc ol{ margin:6px 0 10px; padding-left:26px; }
.oe-doc li{ margin:3px 0; }
.oe-doc blockquote{
  margin:10px 0; padding:6px 14px; border-left:3px solid #C9CEDB;
  background:#FAFBFD; color:#3B4759;
}
.oe-doc pre{
  font-family:Consolas,Menlo,monospace; font-size:13px; background:#F5F7FA;
  border:1px solid #E6EAF2; border-radius:6px; padding:10px 12px; white-space:pre-wrap; margin:10px 0;
}
.oe-doc table{ border-collapse:collapse; width:100%; margin:10px 0; table-layout:fixed; }
.oe-doc td,.oe-doc th{ border:1px solid #BFBFBF; padding:6px 9px; vertical-align:top; min-width:40px; }
.oe-doc th{ background:#F5F7FA; font-weight:600; }
.oe-doc img{ max-width:100%; height:auto; }
.oe-doc hr{ border:none; border-top:1px solid #D8DEE9; margin:16px 0; }

/* ---------- Excel 网格 ---------- */
.oe-x-wrap{ background:#fff; min-height:100%; }
.oe-x-scroll{ overflow:auto; max-height:100%; }
.oe-x-tb{
  border-collapse:separate; border-spacing:0; font-size:13px;
  font-variant-numeric:tabular-nums; table-layout:fixed;
}
.oe-x-tb th,.oe-x-tb td{ border-right:1px solid #E3E8F0; border-bottom:1px solid #E3E8F0; height:28px; padding:0 6px; }
.oe-x-rn{
  width:44px; min-width:44px; background:#F7F9FC; color:var(--muted);
  font-size:11.5px; font-weight:400; text-align:center;
  position:sticky; left:0; z-index:3;
}
.oe-x-ch{
  background:#F7F9FC; color:var(--muted); font-size:11.5px; font-weight:500;
  min-width:92px; width:92px; text-align:center;
  position:sticky; top:0; z-index:2;
}
.oe-x-tb thead th.oe-x-rn{ z-index:4; }
.oe-x-c{
  min-width:92px; width:92px; max-width:92px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  cursor:cell; outline:none;
}
.oe-x-c.num{ text-align:right; }
.oe-x-c.fx{ color:#1D4ED8; }
.oe-x-c.sel{ box-shadow:inset 0 0 0 2px var(--primary); background:#F7FAFF; }
.oe-x-c:focus{ box-shadow:inset 0 0 0 2px var(--primary); background:#fff; overflow:visible; white-space:pre-wrap; }
.oe-fx{ height:30px; font-size:12.5px; font-family:Consolas,Menlo,monospace; }

/* ---------- PowerPoint 分页 ---------- */
.oe-ppt{ display:flex; align-items:stretch; min-height:100%; background:#EEF1F6; }
.oe-ppt-side{
  width:170px; flex:0 0 170px; padding:12px 10px; background:#fff;
  border-right:1px solid var(--line); overflow:auto; max-height:100%;
}
.oe-ppt-th{
  display:flex; gap:8px; align-items:center; width:100%; text-align:left;
  padding:7px 8px; border-radius:8px; margin-bottom:6px;
  border:1px solid transparent; background:#F7F9FC; font-size:12.5px; color:var(--ink2);
}
.oe-ppt-th:hover{ background:var(--primary-soft); }
.oe-ppt-th.on{ border-color:#BFD3FF; background:var(--primary-soft); color:var(--primary-2); font-weight:600; }
.oe-ppt-th-no{
  flex:0 0 20px; height:20px; border-radius:5px; background:#E4E9F3; color:#5A6B85;
  font-size:11px; display:inline-flex; align-items:center; justify-content:center;
}
.oe-ppt-th.on .oe-ppt-th-no{ background:var(--primary); color:#fff; }
.oe-ppt-th-tx{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.oe-ppt-main{ flex:1 1 auto; padding:14px 18px 40px; overflow:auto; max-height:100%; }
.oe-ppt-page{
  background:#fff; border-radius:10px; box-shadow:0 1px 3px rgba(16,24,40,.08);
  padding:14px 16px; margin-bottom:14px; border:1px solid #E6EAF2;
}
.oe-ppt-hd{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.oe-ppt-hd b{ font-size:13px; }
.oe-ppt-hd span{ font-size:12px; color:var(--muted); }
.oe-ppt-ta{
  display:block; width:100%; resize:none; border:1px solid #E3E8F0; border-radius:7px;
  padding:7px 10px; margin-bottom:6px; font-size:14px; line-height:1.6; color:var(--ink);
  background:#FCFDFE; overflow:hidden;
}
.oe-ppt-ta:focus{ outline:none; border-color:#BFD3FF; background:#fff; box-shadow:0 0 0 3px rgba(37,99,235,.10); }
.oe-ppt-ta.title{ font-size:17px; font-weight:600; }
.oe-ppt-none{ font-size:12.5px; color:var(--muted); padding:6px 2px; }

/* ---------- 小屏 ---------- */
@media (max-width:820px){
  .mask{ padding:0; }
  .modal.oe-xl{ max-width:100%; height:100dvh; border-radius:0; }
  .modal-hd{ padding:12px 14px; }
  .oe-title{ font-size:15px; max-width:60vw; }
  .oe-bar{ padding:7px 8px; gap:5px; overflow-x:auto; flex-wrap:nowrap; }
  .oe-doc-wrap{ padding:10px 6px 24px; }
  .oe-doc{ padding:24px 18px 40px; min-height:70vh; font-size:14.5px; }
  .oe-ft{ padding:10px 12px; }
  .oe-note{ width:120px; }
  .oe-ppt-side{ width:110px; flex:0 0 110px; }
  .oe-ppt-main{ padding:10px 10px 30px; }
  .oe-x-ch{ min-width:80px; width:80px; }
  .oe-x-c{ min-width:80px; width:80px; max-width:80px; }
}
