﻿.workspace-main,.document-workspace{position:relative;min-height:0}
.document-word-count{display:flex;align-items:center;padding:3px 7px;border-radius:var(--vex-radius-xs);background:color-mix(in srgb,var(--vex-sheet,var(--paper)) 94%,transparent);color:var(--muted);font:12px/20px system-ui;font-variant-numeric:tabular-nums;white-space:nowrap;user-select:none}
.focus-mode .document-word-count,.presentation-mode .document-word-count{display:none}
.side-pane{display:flex;flex-direction:column;overflow:hidden}
.side-pane>.file-list,.side-pane>.outline-list{min-height:0;flex:1;overflow:auto}
.sidebar-search{flex-shrink:0}
.sidebar-search input{min-width:0}
/* 与正文查找输入框（.input）同一焦点配方：外框强调色 + 3px 柔光，内层输入不再叠第二圈描边。 */
.sidebar-search:hover{border-color:color-mix(in srgb,var(--accent) 35%,var(--border))}
.sidebar-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.sidebar-search input:focus-visible{outline:none}
/* 底部条：目录名占满剩余宽度，排序/视图两枚按钮靠右（对齐原生 ShellFilesView 底栏意图）。 */
.files-footer{display:flex;flex:none;align-items:center;gap:2px;height:40px;padding:6px 10px;border-top:1px solid var(--vex-hairline)}
.files-folder{flex:1;min-width:0;display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:0;border-radius:var(--vex-radius-xs);background:transparent;color:var(--muted);font-size:12px;cursor:pointer;text-align:left}
.files-folder:hover{background:var(--hover);color:var(--fg)}
.files-folder .ico{width:13px;height:13px;flex:none}
.files-folder span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.files-footer .icon-button{width:26px;height:26px;flex:none}
.files-footer .icon-button .ico{width:14px;height:14px}
.files-sort-menu{position:fixed;z-index:260;min-width:216px}
.files-sort-item{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;border:0;border-radius:var(--vex-radius-xs);background:transparent;color:var(--fg);font-size:12px;cursor:pointer;text-align:left}
.files-sort-item:hover{background:var(--hover)}
.files-sort-item[aria-checked="true"]{background:var(--accent-soft);color:var(--accent)}
.files-sort-item .ico{width:14px;height:14px;flex:none;color:var(--muted)}
.files-sort-item[aria-checked="true"] .ico{color:var(--accent)}
.files-sort-item .sort-check{margin-left:auto;font-size:11px}
/* 文件树/列表行：与原生 side-tree 同口径 —— 24px 行高、12px 字、12px 描边图标、16px 缩进、
   直角通栏 hover/选中底。密度档只作用于界面控件，不拉伸文件行（原生即固定值）。 */
.file-list{padding:0 6px}
.file-row{width:100%;height:28px;min-height:28px;display:flex;align-items:center;gap:7px;margin:0 0 1px;padding:0 8px;border:0;border-radius:6px;background:transparent;color:var(--fg);font-size:12.5px;line-height:28px;text-align:left}
.file-row .ico{width:13px;height:13px;flex:none;color:var(--muted);stroke-width:1.4}
.file-row:hover{background:var(--hover);border-radius:6px}
.file-row.selected,.file-row.active{background:var(--accent-soft);color:var(--accent);font-weight:600;border-radius:6px}
.file-row.selected .ico,.file-row.active .ico{color:var(--accent)}
.file-row span{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.file-folder-tag{flex:none;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:11px}
.file-row.selected .file-folder-tag,.file-row.active .file-folder-tag{color:color-mix(in srgb,var(--accent) 70%,var(--muted))}
.file-directory{margin:0}
.file-directory>summary{display:flex;align-items:center;gap:6px;list-style:none;height:24px;padding:0 4px;cursor:pointer;font-size:12px;color:var(--muted);border-radius:0}
.file-directory>summary:hover{background:var(--hover)}
.file-directory>summary:before{content:'›';width:8px;flex:none;font:12px/1 system-ui;transform:rotate(90deg);transition:transform var(--vex-fast)}
.file-directory:not([open])>summary:before{transform:none}
.file-directory>summary::-webkit-details-marker{display:none}
.file-directory>summary .ico{width:12px;height:12px;flex:none;stroke-width:1.4}
.file-directory>summary span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-directory>.file-children{padding-left:16px}
.file-list-overflow{padding:34px 24px;font-size:12px;line-height:2;color:var(--muted);text-align:left}
.file-list-overflow .overflow-warn{font-size:16px;margin-bottom:6px}
.file-list-overflow a{color:var(--accent);text-decoration:none}
.file-list-overflow a:hover{text-decoration:underline}
.sidebar #files-pane{display:flex;flex:1;min-height:0;overflow:hidden;flex-direction:column}
.sidebar #files-pane>.file-list{flex:1;min-height:0;overflow:auto}
.sidebar #outline-list{flex:1;min-height:0;overflow:auto}
.device-phone .document-word-count{right:12px;bottom:12px}
.device-phone .file-navigation-footer{height:52px}
.device-phone .file-navigation-footer button{min-width:40px;height:44px}
.device-phone .file-navigation-menu{bottom:54px}

/* 纸面就是调色板的 --paper：不再另立一套硬写文档色（旧 --document-* 硬值会把九套配色在正文里抹平），
 * 选区与悬停也交还调色板令牌；别名定义归 surface.css。 */
.typography-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.typography-popover{width:min(440px,calc(100% - 16px))}
.typography-popover .typography-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.typography-card{padding:8px;border-radius:var(--vex-radius-sm);min-width:0}
.typography-card>small{display:none}
.type-swatch{position:relative;display:block;width:100%;height:140px;overflow:hidden;padding:0;border:0;border-radius:0;pointer-events:none;background:var(--paper);color:var(--fg)}
.type-swatch .type-document{display:block;width:360px;height:420px;transform:scale(.33);transform-origin:top left;padding:18px;letter-spacing:0}
.type-document h4{font-size:1em;font-weight:600;margin:1.2em 0 .5em}
.type-document h1,.type-document h2,.type-document h3{letter-spacing:0!important}
.typography-choices{width:100%}
.typography-choices .typography-card{border:1px solid var(--line);background:var(--surface);color:var(--fg)}
.typography-choices .typography-card[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft)}
@media(max-width:760px){.typography-popover .typography-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
