/* 249b 文档工作台样式 —— 左文档列表 + 多标签 + 工具栏，密集行距（参考 WPS/表格观感） */
.desk { position: relative; display: flex; height: calc(100vh - 132px); min-height: 520px; border: 1px solid #e5e7eb; border-radius: 10px; overflow: visible; background: #fff; }
.desk-left { border-radius: 10px 0 0 10px; }
.desk-main { border-radius: 0 10px 10px 0; overflow: hidden; }
.desk-fs { position: fixed; inset: 8px; z-index: 9500; height: auto; min-height: 0; box-shadow: 0 18px 60px rgba(15,23,42,.25); }
.desk-left { width: 236px; flex: 0 0 236px; border-right: 1px solid #eef2f7; background: #fbfcfe; display: flex; flex-direction: column; overflow: auto; }
.desk-lh { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid #eef2f7; font-size: 13px; color: #111827; }
.desk-lsec { padding: 10px 12px 4px; font-size: 11px; color: #6b7280; letter-spacing: .04em; }
.desk-lhint { color: #9ca3af; font-size: 10px; }
.desk-list { padding: 0 6px 6px; }
.desk-row { display: flex; align-items: center; gap: 7px; width: 100%; border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 6px; font-size: 12.5px; color: #1f2937; cursor: pointer; line-height: 1.25; }
.desk-row:hover { background: #eef4ff; }
.desk-row.on { background: #e0ebff; color: #1d4ed8; font-weight: 600; }
.desk-ic { width: 16px; flex: 0 0 16px; text-align: center; color: #2563eb; font-size: 12px; }
.desk-rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.desk-tabs { display: flex; align-items: stretch; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid #e5e7eb; overflow-x: auto; background: #f8fafc; }
.desk-tab { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 7px 7px 0 0; font-size: 12.5px; color: #4b5563; cursor: pointer; max-width: 220px; background: transparent; }
.desk-tab .desk-tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-tab.on { background: #fff; color: #111827; border-color: #e5e7eb; font-weight: 600; box-shadow: 0 1px 0 #fff inset; }
.desk-x { color: #9ca3af; font-weight: 400; padding: 0 2px; border-radius: 3px; }
.desk-x:hover { background: #fee2e2; color: #b91c1c; }
.desk-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #eef2f7; background: #fff; }
.desk-title { font-size: 13px; font-weight: 600; color: #111827; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-path { font-size: 11px; color: #9ca3af; margin-left: 8px; }
.desk-body { flex: 1; min-height: 0; position: relative; background: #fff; }
.desk-frame { width: 100%; height: 100%; border: 0; display: block; }
.desk-office { width: 100%; height: 100%; }
.desk-imgwrap { height: 100%; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 16px; background: #f8fafc; }
.desk-imgwrap img { max-width: 100%; box-shadow: 0 4px 18px rgba(15,23,42,.12); background: #fff; }
.desk-load, .desk-empty { padding: 18px; color: #6b7280; font-size: 13px; }
.desk-empty.big { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.desk .grow { flex: 1; }
.desk .mini { border: 1px solid #d1d5db; background: #fff; border-radius: 6px; padding: 3px 9px; font-size: 12px; color: #374151; cursor: pointer; }
.desk .mini:hover { border-color: #2563eb; color: #2563eb; }
@media (max-width: 900px) { .desk-left { width: 190px; flex-basis: 190px; } }

.desk-doc { height: 100%; overflow: auto; padding: 22px 28px; background: #fff; }
.desk-doc pre { margin: 0; font-family: "Cascadia Mono", Consolas, "Microsoft YaHei", monospace; font-size: 13px; line-height: 1.75; color: #1f2937; white-space: pre-wrap; word-break: break-word; }

.desk-doc.edit { display: flex; flex-direction: column; padding: 0; }
.desk-doc.edit textarea { flex: 1; width: 100%; border: 0; resize: none; padding: 18px 22px; font-family: "Cascadia Mono", Consolas, "Microsoft YaHei", monospace; font-size: 13px; line-height: 1.7; outline: none; }
.desk-editbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid #eef2f7; background: #fbfcfe; }

/* 左侧文档列表折叠（249b6）：收起后留窄栏，点窄栏展开 */
.desk-lc .desk-left { display: none; }
.desk-rail { display: none; flex: 0 0 26px; width: 26px; border-right: 1px solid #eef2f7; background: #fbfcfe; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: #6b7280; font-size: 12px; user-select: none; }
.desk-lc .desk-rail { display: flex; flex-direction: column; }
.desk-rail span { writing-mode: vertical-rl; letter-spacing: .12em; color: #9ca3af; }
.desk-rail b { font-weight: 600; color: #2563eb; }
.desk-rail:hover { background: #eef4ff; color: #2563eb; }
.desk-fold { padding: 3px 7px !important; }

/* 折叠键：与左侧栏同款白色胶囊，贴文档面板右缘中线（249b7） */
.desk-edge-btn { position: absolute; top: 50%; left: 236px; transform: translate(-50%, -50%); width: 20px; height: 42px; border-radius: 999px; border: 1px solid #1d4ed8; background: #2563eb; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.35); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 6; font-size: 13px; padding: 0; }
.desk-edge-btn:hover { background: #1d4ed8; border-color: #1e40af; color: #fff; }
.desk-lc .desk-edge-btn { left: 26px; }

/* 折叠键高对比（249b8）：侧栏键与文档面板键统一品牌蓝底白箭头，任何背景上都看得见 */
.nav-edge-btn { background: #2563eb !important; border-color: #1d4ed8 !important; color: #fff !important; box-shadow: 0 2px 8px rgba(37,99,235,.35) !important; }
.nav-edge-btn:hover { background: #1d4ed8 !important; }

/* Markdown 排版（249c） */
.desk-md { height: 100%; overflow: auto; background: #fff; }
.md-body { max-width: 940px; margin: 0 auto; padding: 26px 40px 72px; font-size: 15px; line-height: 1.85; color: #1f2937; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { line-height: 1.35; color: #111827; margin: 1.4em 0 .6em; font-weight: 700; }
.md-body h1 { font-size: 26px; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
.md-body h2 { font-size: 21px; padding-bottom: 6px; border-bottom: 1px solid #eef2f7; }
.md-body h3 { font-size: 17px; }
.md-body h4 { font-size: 15px; color: #374151; }
.md-body p { margin: 10px 0; }
.md-body ul, .md-body ol { margin: 8px 0 12px; padding-left: 26px; }
.md-body li { margin: 4px 0; }
.md-body li.md-li2 { margin-left: 18px; list-style: circle; }
.md-body a { color: #2563eb; text-decoration: none; border-bottom: 1px solid rgba(37,99,235,.25); }
.md-body a:hover { border-bottom-color: #2563eb; }
.md-body code.md-ic { background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 4px; padding: 0 5px; font-size: 13px; font-family: "Cascadia Mono", Consolas, monospace; }
.md-body .md-code { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px 16px; overflow: auto; margin: 14px 0; }
.md-body .md-code code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; color: #0f172a; white-space: pre; }
.md-body blockquote.md-q { margin: 14px 0; padding: 10px 16px; border-left: 3px solid #d1d5db; background: #f9fafb; color: #374151; border-radius: 0 6px 6px 0; }
.md-body blockquote.md-q p { margin: 4px 0; }
.md-body .md-call { border-left-width: 4px; }
.md-body .md-call-t { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; opacity: .75; }
.md-body .md-important, .md-body .md-warning, .md-body .md-danger { border-left-color: #ef4444; background: #fef2f2; }
.md-body .md-note, .md-body .md-info { border-left-color: #3b82f6; background: #eff6ff; }
.md-body .md-tip, .md-body .md-success { border-left-color: #10b981; background: #ecfdf5; }
.md-body hr { border: 0; border-top: 1px solid #e5e7eb; margin: 22px 0; }
.md-tbl { overflow: auto; margin: 14px 0; border: 1px solid #e5e7eb; border-radius: 8px; }
.md-body table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.md-body th, .md-body td { border-bottom: 1px solid #eef2f7; padding: 8px 12px; text-align: left; vertical-align: top; }
.md-body thead th { background: #f8fafc; color: #374151; font-weight: 600; }
.md-body tbody tr:hover td { background: #f8fbff; }
.md-fm { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 16px; margin: 0 0 18px; }
.md-fm summary { cursor: pointer; font-size: 12.5px; color: #6b7280; letter-spacing: .04em; list-style: none; user-select: none; }
.md-fm summary::-webkit-details-marker { display: none; }
.md-fm summary:before { content: '▸ '; color: #9ca3af; }
.md-fm[open] summary:before { content: '▾ '; }
.md-fm[open] summary { margin-bottom: 6px; }
.md-fm-h { font-size: 12px; color: #6b7280; letter-spacing: .06em; margin-bottom: 6px; }
.md-fm table { width: 100%; border-collapse: collapse; }
.md-fm th { width: 96px; color: #6b7280; font-weight: 500; font-size: 12.5px; padding: 4px 8px 4px 0; text-align: left; vertical-align: top; }
.md-fm td { padding: 4px 0; font-size: 13px; color: #1f2937; }
.md-chip { display: inline-block; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 1px 9px; margin: 2px 4px 2px 0; font-size: 12px; }
.md-wiki { color: #2563eb; background: #eff6ff; border-radius: 4px; padding: 0 4px; }
