﻿/* 编辑方式、Markdown 排版与统一的文字菜单。 */
.workspace-main { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.edit-options { height: 42px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); background: var(--panel); }
.edit-methods { display: flex; gap: 4px; }
.edit-methods button { border: none; border-radius: 5px; padding: 5px 10px; background: transparent; font-size: 11px; color: var(--muted); transition: background .18s, color .18s; }
.edit-methods button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.edit-method-description { font-size: 10px; color: var(--muted); margin-right: auto; }
.typography-trigger { color: var(--muted); }
.typography-trigger [data-typography-label] { font-weight: 600; color: var(--fg); }
.instant-pane { display: flex; flex-direction: column; flex: 1; min-width: 0; background: var(--bg); }
.instant-scroll { flex: 1; min-height: 0; overflow: auto; }
.instant-scroll .md-body { max-width: 1280px; padding: 34px 44px 70px; margin: 0 auto; }
.instant-scroll.typewriter-on, .source-scroll.typewriter-on { overflow-anchor: none; scroll-behavior: auto; }
.instant-scroll.typewriter-on .md-body, .source-scroll.typewriter-on textarea { padding-top: var(--typewriter-space) !important; padding-bottom: var(--typewriter-space) !important; }
.source-scroll.typewriter-on .line-numbers { top: var(--typewriter-space); }
.instant-block { position: relative; display: flow-root; cursor: text; outline: none !important; caret-color: var(--fg); overflow-wrap: anywhere; }
.instant-block.is-editing { outline: none; }
.instant-input { outline: none !important; }
.instant-hint { flex: none; font-size: 10px; color: var(--muted); padding: 9px 20px; border-top: 1px solid var(--border); background: var(--panel); }
.instant-empty { min-height: 1.95em; }
.instant-empty:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.workspace.source-only .source-pane { width: 100%; border-right: none; }
.typography-popover { position: absolute; z-index: 30; right: 18px; top: 108px; width: 338px; max-height: calc(100% - 124px); padding: 18px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); animation: inspector-in .2s ease; }
.typography-popover .popover-title { flex: none; margin-bottom: 0; }
.typography-note { font-size: 10px; color: var(--muted); margin: 3px 0 14px; }
.typography-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow: auto; min-height: 0; }
.typography-card { position: relative; border: 1px solid var(--border); background: var(--bg); padding: 9px 6px 7px; border-radius: 6px; color: var(--muted); font-size: 10px; min-width: 0; transition: border-color .16s, background .16s; }
.typography-card:hover { border-color: var(--accent); }
.typography-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.type-swatch { display: block; width: 36px; height: 17px; margin: 0 auto 6px; border-top: 3px solid var(--swatch); background: linear-gradient(var(--border),var(--border)) 0 7px/36px 1px no-repeat, linear-gradient(var(--border),var(--border)) 0 12px/26px 1px no-repeat; }
.typography-compact { display: flex; justify-content: space-between; font-size: 11px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); flex: none; }
.typography-compact input { accent-color: var(--accent); }
.content-area .md-body { line-height: 1.95; font-size: 14.5px; }
.content-area .md-body h1 { color: var(--fg); font-size: 26px; margin: 6px 0 18px; padding-bottom: 14px; }
.content-area .md-body h2 { color: var(--typography-accent); margin: 26px 0 12px; }
.content-area .md-body h3 { color: var(--typography-accent); margin: 18px 0 10px; }
.content-area .md-body blockquote { border-left-color: var(--typography-accent); background: color-mix(in srgb, var(--typography-accent) 6%, transparent); }
:root[data-typography-variant="simple"] .content-area .md-body h2, :root[data-typography-variant="simple"] .content-area .md-body h3 { color: var(--fg); }
:root[data-typography-variant="basic"] .content-area .md-body h2 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
:root[data-typography-variant="stripe"] .content-area .md-body h2 { border-left: 3px solid var(--typography-accent); padding: 3px 0 3px 12px; }
:root[data-typography-variant="underline"] .content-area .md-body h2 { border-bottom: 2px solid color-mix(in srgb, var(--typography-accent) 45%, transparent); padding-bottom: 8px; }
:root[data-typography-variant="technical"] .content-area .md-body h2 { background: color-mix(in srgb, var(--typography-accent) 8%, transparent); border-left: 3px solid var(--typography-accent); padding: 7px 12px; border-radius: 0 4px 4px 0; }
:root[data-typography-variant="serif"] .content-area .md-body { font-family: "Noto Serif SC", "Songti SC", SimSun, serif; }
:root[data-typography-variant="editorial"] .content-area .md-body h1 { text-align: center; border-bottom: none; }
:root[data-typography-variant="editorial"] .content-area .md-body h2 { text-align: center; padding: 7px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
:root[data-compact="true"] .content-area .md-body { font-size: 13px; line-height: 1.65; }
:root[data-compact="true"] .content-area .md-body h2 { margin-top: 18px; margin-bottom: 7px; }
:root[data-compact="true"] .content-area .md-body h3 { margin-top: 12px; margin-bottom: 6px; }
.app-window.focus-mode .sidebar { width: 0; opacity: 0; border: none; pointer-events: none; }
.app-window.focus-mode .statusbar { display: none; }
:root[data-motion="false"] *, :root[data-motion="false"] *::before, :root[data-motion="false"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.menu-item { display: grid; grid-template-columns: 15px minmax(110px, 1fr) auto; gap: 8px; padding: 6px 10px; line-height: 20px; font-size: 12px; cursor: pointer; }
.menu-item .menu-state { color: var(--accent); font-size: 12px; width: 15px; text-align: center; }
.menu-item.checked::after { display: none; }
.menu-item .mi-gesture { margin: 0; padding: 0 0 0 26px; min-width: 80px; text-align: right; background: transparent; border: none; border-radius: 0; color: var(--muted); font-size: 10.5px; line-height: 20px; font-family: inherit; font-variant-numeric: tabular-nums; }
.menu-item .mi-arrow { margin: 0; padding: 0 0 0 16px; text-align: right; font-size: 14px; }
.menu-item > .submenu { grid-column: 1 / -1; max-height: calc(100vh - 24px); overflow-y: auto; }
.menu-flyout > .flyout { max-height: calc(100vh - 76px); overflow-y: auto; }
@media (max-width: 1100px) { .instant-scroll .md-body { padding: 26px 32px 60px; } .edit-method-description { display: none; } .edit-options > .typography-trigger { margin-left: auto; } }
@media (max-width: 760px) { .edit-options { gap: 4px; padding: 0 8px; } .instant-scroll .md-body { padding: 24px; } .typography-popover { right: 8px; width: min(338px, calc(100% - 16px)); } }
@media (prefers-reduced-motion: reduce) { .instant-block, .edit-methods button, .typography-card { transition: none; } .typography-popover { animation: none; } }

/* 分隔线占位与命中宽度一致，侧栏内部随列伸缩。 */
.sidebar { width: var(--sidebar-width, 226px); transition: opacity .2s; border-right: none; }
.sidebar-inner { width: 100%; min-width: 0; }
.sidebar-splitter { width: 5px; flex: none; cursor: col-resize; touch-action: none; background: linear-gradient(90deg, transparent 2px, var(--border) 2px, var(--border) 3px, transparent 3px); }
.sidebar-splitter:hover, .sidebar-splitter:focus-visible { background: var(--accent-soft); outline: none; }
.sidebar.closed + .sidebar-splitter, .focus-mode .sidebar-splitter { display: none; }
.sidebar-resizing { cursor: col-resize; user-select: none; }
.reading-scroll .md-body { max-width: 1280px; }
.content-area .md-body pre, .content-area .md-body table { max-width: 100%; }
.content-area .md-body pre { font-size: 14px; line-height: 22px; }

.content-area .md-body pre code { font-size: 14px; line-height: 22px; }
.content-area .md-body h2 { font-size: 21px; }
.content-area .md-body h3 { font-size: 17px; }

/* 代码正文保持安静；语言输入只在即时编辑块下方出现。 */
.md-code-block { margin: 8px 0 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 3px; background: var(--code-bg); }
.content-area .md-body .md-code-block pre { margin: 0; padding: 0; border: none; border-radius: 0; overflow-x: auto; background: transparent; outline: none; min-height: 22px; color: var(--fg); font: 14px/22px "Cascadia Code", Consolas, monospace; }
.content-area .md-body .md-code-block pre code { display: block; min-height: 22px; padding: 0; color: var(--fg); background: transparent; outline: none; font: 14px/22px "Cascadia Code", Consolas, monospace; }
.md-code-footer { display: flex; justify-content: flex-end; margin: -8px 0 12px; }
.md-code-language { box-sizing: border-box; width: 180px; max-width: 100%; height: 26px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 3px; color: var(--fg); background: var(--code-bg); text-align: center; font: 12px/18px "Cascadia Code", Consolas, monospace; }
.md-code-language::placeholder { color: var(--muted); }
.md-code-language:focus { outline: none; border-color: var(--accent); }
:root[data-compact="true"] .content-area .md-body .md-code-block pre code { font-size: 13px; line-height: 20px; }

.format-toolbar { display:flex; align-items:center; gap:2px; min-width:0; margin-left:4px; }
.format-button { width:28px; height:28px; display:grid; place-items:center; padding:5px; border:0; border-radius:5px; background:transparent; color:var(--fg); cursor:pointer; font-size:11px; }
.format-button:hover,.format-button:focus-visible { background:var(--hover); color:var(--accent); outline:none; }
.format-button .ico { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; }
.format-divider { height:18px; width:1px; background:var(--border); margin:0 3px; }
.format-more { font-size:16px; letter-spacing:1px; }
.presentation-tools { position:absolute; z-index:80; right:24px; top:24px; display:flex; gap:3px; padding:5px; border:1px solid var(--border); border-radius:8px; background:color-mix(in srgb,var(--panel) 82%,transparent); opacity:.2; transition:opacity .2s; }
.presentation-tools:hover,.presentation-tools:focus-within { opacity:1; }
.presentation-tools button { border:0; border-radius:5px; padding:5px 9px; color:var(--fg); background:transparent; cursor:pointer; }
.presentation-tools button:hover { background:var(--hover); color:var(--accent); }
.app-window.presentation-mode .titlebar,.app-window.presentation-mode .sidebar,.app-window.presentation-mode .sidebar-splitter,.app-window.presentation-mode .work-toolbar,.app-window.presentation-mode .edit-options,.app-window.presentation-mode .statusbar { display:none!important; }
.app-window.presentation-mode .workspace { height:100%; }
.app-window.presentation-mode .reading-pane { display:flex!important; }
.app-window.presentation-mode .reading-pane .reading-scroll .md-body { max-width:1000px; font-size:var(--presentation-scale,1.5)em; }
@media (max-width:1100px) { .format-toolbar { overflow:hidden; } .format-button:nth-of-type(n+9):not(.format-more) { display:none; } .format-more { display:grid; } }
@media (max-width:760px) { .format-toolbar { gap:0; margin-left:0; } .format-button:nth-of-type(n+6):not(.format-more) { display:none; } }
