Files
genoffice/apps/docs/src/renderer/styles.css
T
2026-08-02 19:52:16 +08:00

6779 lines
128 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
:root {
--word-blue: #185abd;
--word-blue-dark: #124a9e;
--word-heading: #2f5496;
--surface: #ffffff;
--chrome-bg: #ffffff;
--border: #e1dfdd;
--border-strong: #c8c6c4;
--text: #252423;
--text-dim: #605e5c;
--hover: #f3f2f1;
--pressed: #edebe9;
--active-bg: #e8f1fb;
--canvas: #e6e6e6;
--ai-highlight: #fff3c4;
--ai-highlight-border: #f2b900;
}
* {
box-sizing: border-box;
}
html,
body,
#root {
height: 100%;
margin: 0;
}
body {
font-family:
'Segoe UI',
-apple-system,
BlinkMacSystemFont,
'PingFang SC',
'Microsoft YaHei',
sans-serif;
color: var(--text);
background: var(--chrome-bg);
font-size: 13px;
-webkit-font-smoothing: antialiased;
/* The document itself never scrolls: a too-wide ribbon (or any other
overflowing chrome) must scroll inside its own container, not drag the
whole page sideways. */
overflow: hidden;
}
.app {
display: flex;
flex-direction: column;
height: 100%;
}
button {
font-family: inherit;
}
/* ================= title bar (doc name centered) ================= */
.qa-btn {
width: 30px;
height: 28px;
border: none;
background: none;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
color: var(--text-dim);
}
.qa-btn svg {
display: block;
margin: 0 auto;
}
.qa-btn:hover:not(:disabled) {
background: var(--hover);
}
.qa-btn:disabled {
opacity: 0.55;
cursor: default;
}
/* ================= ribbon ================= */
.ribbon {
flex-shrink: 0;
background: var(--chrome-bg);
border-bottom: 1px solid var(--border-strong);
user-select: none;
/* shared toolbar ink (glyphs, letterforms, labels) — same as sheets/slides */
color: #232425;
}
.ribbon-tabs {
display: flex;
align-items: center;
/* same tab-row metrics as PowerPoint's ribbon (slides app): 5px top inset,
no bottom padding — the active tab's underline sits on the row's edge */
padding: 5px 10px 0;
gap: 2px;
/* the title-bar row was removed; the tab row doubles as the frameless-window drag area */
-webkit-app-region: drag;
user-select: none;
}
.ribbon-tabs button,
.ribbon-tabs .file-tab-wrap,
.ribbon-tabs .autosave-toggle,
.ribbon-tabs .qa-btn {
-webkit-app-region: no-drag;
}
.ribbon-tabs-mac {
padding-left: 84px; /* room for traffic lights */
}
.ribbon-tabs-win {
padding-right: 150px; /* room for windows caption buttons overlay */
}
.ribbon-file {
max-width: 30%;
font-size: 12px;
color: var(--text-dim);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 6px;
}
.ribbon-tab {
position: relative;
border: none;
background: none;
padding: 7px 9px 6px;
font-size: 13px;
/* every tab label is semibold, not just the active one */
font-weight: 600;
color: inherit;
cursor: pointer;
/* transparent border keeps the row height; the visible underline is the
* ::after, sized to the label text rather than the padded button */
border-bottom: 2.5px solid transparent;
border-radius: 4px 4px 0 0;
}
/* hovering a tab tints the label, it doesn't paint a box */
.ribbon-tab:hover {
color: var(--word-blue);
}
.ribbon-tab.active {
color: var(--word-blue);
font-weight: 600;
}
/* active underline: exactly the text width (insets = horizontal padding),
* ends slightly rounded — not a full capsule */
.ribbon-tab.active::after {
content: '';
position: absolute;
left: 13px;
right: 13px;
bottom: -2.5px;
height: 2.5px;
border-radius: 1px;
background: var(--word-blue);
}
.ribbon-tab-file {
color: #fff;
background: var(--word-blue);
border-radius: 4px;
padding: 6px 16px;
margin-right: 6px;
}
.ribbon-tab-file:hover,
.ribbon-tab-file.open {
background: var(--word-blue-dark);
}
.file-tab-wrap {
position: relative;
}
.file-menu {
position: absolute;
top: calc(100% + 2px);
left: 0;
z-index: 60;
min-width: 210px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 5px;
}
.file-menu button {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
border: none;
background: none;
padding: 8px 12px;
font-size: 13px;
border-radius: 4px;
cursor: pointer;
color: var(--text);
}
.file-menu button:hover:not(:disabled) {
background: var(--hover);
}
.file-menu button:disabled {
opacity: 0.4;
cursor: default;
}
.file-menu-key {
color: var(--text-dim);
font-size: 12px;
}
.ribbon-tabs-spacer {
flex: 1;
}
.qa-sep {
width: 1px;
height: 16px;
margin: 0 6px;
background: var(--border-strong, #c8c6c4);
flex-shrink: 0;
}
.copilot-btn {
display: flex;
align-items: center;
gap: 6px;
border: 1px solid var(--border);
background: linear-gradient(135deg, #f5f0ff, #eef6ff);
border-radius: 14px;
padding: 4px 14px;
font-size: 12.5px;
cursor: pointer;
color: var(--text);
}
.copilot-btn:hover,
.copilot-btn.active {
border-color: var(--word-blue);
color: var(--word-blue);
}
/* AI entry points share the app icon (used by the Ribbon AI button and the AI panel title) */
.app-badge {
display: block;
width: 22px;
height: 22px;
border-radius: 7px;
box-shadow: 0 2px 6px rgba(74, 92, 255, 0.25);
}
/* Genspark brand logo (Ribbon AI button and AI panel title) */
.genspark-badge {
display: block;
width: 22px;
height: 22px;
border-radius: 50%;
}
.ai-panel-title .genspark-badge {
width: 18px;
height: 18px;
}
/* ---- ribbon body ---- */
.ribbon-body {
display: flex;
align-items: stretch;
/* band metrics shared with the slides ribbon */
padding: 6px 12px;
/* HARD-fixed height, not min-height: the ribbon height stays constant across
tabs, so switching tabs or auto-jumping to Table Layout when the cursor
enters a table never pushes the editing area below. A tab that outgrows this must
compact its own content instead. */
height: 80px;
/* Groups never shrink below content, so a narrow window overflows the row:
scroll it inside the ribbon instead of stretching the document (matching
the sheets/slides ribbons). Dropdown panels are NOT clipped by this —
they escape the scroll container via anchor positioning (see
.rb-split-wrap). */
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: none;
}
.ribbon-body::-webkit-scrollbar {
display: none;
}
.ribbon-group {
display: flex;
flex-direction: column;
justify-content: center;
padding: 2px 4px;
}
.ribbon-group-items {
display: flex;
align-items: center;
gap: 2px;
flex: 1;
}
/* Word for Mac shows no group captions under the ribbon */
.ribbon-group-label {
display: none;
}
.ribbon-sep {
width: 1px;
background: var(--border);
margin: 8px 6px;
}
.ribbon-placeholder {
align-self: center;
color: var(--text-dim);
font-size: 12.5px;
padding: 0 14px;
}
/* big paste button */
.rb-big {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
border: none;
background: none;
border-radius: 4px;
/* PowerPoint-density: minimal side padding (slides ribbon parity) */
padding: 4px 7px 6px;
font-size: 12px;
/* no tab wrapping: wrapping in narrow windows makes the ribbon taller, causing height jumps when switching tabs */
white-space: nowrap;
cursor: pointer;
color: var(--text);
}
.rb-big-icon {
min-height: 28px;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
color: #232425;
}
/* hover/open paint only the icon row — the label below
* stays outside the gray. The box spans the whole button width (align-self
* stretch + horizontal bleed), not just the icon content. Negative margins
* cancel the bleed so button layout/alignment is unchanged. */
.rb-big .rb-big-icon {
align-self: stretch;
border-radius: 4px;
padding: 3px 4px;
margin: 0 -4px;
}
/* the dropdown chevron sits beside the icon (top row), not the label */
.rb-caret-svg {
flex-shrink: 0;
}
.rb-big-icon .rb-caret-svg {
display: block;
margin-left: 3px;
color: #605e5c;
}
.rb-big-icon-colored {
position: relative;
}
.rb-big-icon-colored .rb-color-bar {
position: absolute;
left: 1px;
right: 1px;
bottom: -3px;
width: auto;
border: 1px solid rgba(0, 0, 0, 0.15);
}
/* AI badge marking AI-backed entry points (ribbon buttons and context-menu items), same look as slides */
.copilot-badge {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border-radius: 7px;
color: #fff;
background: linear-gradient(135deg, #6a5cff 0%, #2b88f8 55%, #29c3a6 120%);
box-shadow: 0 2px 6px rgba(74, 92, 255, 0.35);
}
.copilot-badge-menu {
width: 16px;
height: 16px;
border-radius: 5px;
margin-right: 6px;
flex-shrink: 0;
}
.rb-big:hover:not(:disabled) .rb-big-icon {
background: var(--hover);
}
.rb-big:disabled {
opacity: 0.4;
cursor: default;
}
.rb-big.active {
color: var(--word-blue);
}
.rb-big.active .rb-big-icon {
background: var(--active-bg);
}
/* The Genspark AI entry keeps a black label even while the panel is open. */
.rb-big.ai-entry.active {
color: var(--text);
}
/* The AI entry buttons read as one piece: hover/press tint the whole button
(icon + label together), unlike the other tall buttons where only the icon
row is painted. */
.rb-big.ai-entry {
border-radius: 4px;
/* Fill the 80px band like the slides/sheets AI entries — .ribbon-group-items
centers buttons at natural height, which made this plate shorter and shifted
the icon/label a couple px vs the other apps' identical button. */
align-self: stretch;
}
.rb-big.ai-entry:hover:not(:disabled) {
background: var(--hover);
}
/* Neutral gray, not the Word-blue --active-bg: the Genspark entry is the same
control across docs/sheets/slides, so its open state matches their ribbons. */
.rb-big.ai-entry.active {
background: #e2e0de;
}
.rb-big.ai-entry:hover:not(:disabled) .rb-big-icon,
.rb-big.ai-entry.active .rb-big-icon {
background: transparent;
}
.rb-col {
display: flex;
flex-direction: column;
gap: 2px;
}
.rb-small {
display: flex;
align-items: center;
gap: 5px;
border: none;
background: none;
border-radius: 3px;
padding: 3px 8px;
font-size: 12px;
text-align: left;
white-space: nowrap;
cursor: pointer;
color: var(--text);
}
.rb-small svg {
flex-shrink: 0;
width: 14px;
height: 14px;
color: #232425;
/* CSS resizes these below their attr size — re-pin the painted stroke
(1.43 units × 14/16 ≈ 1.25px) */
stroke-width: 1.43;
}
.rb-small:hover:not(:disabled) {
background: var(--hover);
}
.rb-small.active {
background: var(--active-bg);
}
.rb-small.active svg {
color: var(--word-blue);
}
.rb-small:disabled {
opacity: 0.4;
cursor: default;
}
.rb-font-group {
flex-direction: column;
align-items: stretch;
gap: 4px;
justify-content: center;
}
.rb-row {
display: flex;
align-items: center;
gap: 3px;
}
.rb-select {
height: 28px;
border: 1px solid var(--border-strong);
border-radius: 3px;
background: var(--surface);
font-size: 12px;
padding: 0 4px;
color: var(--text);
}
.rb-select:disabled {
opacity: 0.55;
}
.rb-font-family {
width: 128px;
}
.rb-font-size {
width: 58px;
}
.rb-icon {
min-width: 28px;
height: 30px;
border: none;
background: none;
border-radius: 3px;
font-size: 15px;
cursor: pointer;
color: var(--text);
padding: 0 4px;
/* flex-center the content: buttons whose svg is followed by an inline caret
(line spacing / shading / borders) otherwise sit on baseline math and land
a couple px off the plain icon buttons (align left/center/right/justify) */
display: inline-flex;
align-items: center;
justify-content: center;
}
.rb-icon:hover:not(:disabled) {
background: var(--hover);
}
.rb-icon.active {
background: var(--active-bg);
color: var(--word-blue);
}
.rb-icon:disabled {
opacity: 0.35;
cursor: default;
}
.rb-mini-sep {
width: 1px;
height: 20px;
background: var(--border);
margin: 0 5px;
}
.rb-icon svg {
display: block;
margin: 0 auto;
}
.rb-script {
font-size: 12px;
}
.rb-script sub,
.rb-script sup {
font-size: 9px;
}
/* split button: main action + caret dropdown */
.rb-split-wrap {
position: relative;
display: flex;
align-items: center;
}
/* Anchor for the dropdown panels (color-palette / layout-menu / …), which are
position: fixed so they escape the ribbon-body scroll clip while tracking
their trigger through ribbon scrolling. Every wrap shares the name, so the
scope is essential: without it a fixed-position panel (laid out after all
in-flow content) would resolve to the LAST wrap in the document instead of
its own parent. */
.rb-split-wrap,
.rb-color-wrap {
anchor-name: --rb-drop-wrap;
anchor-scope: --rb-drop-wrap;
}
.rb-caret {
width: 13px;
height: 26px;
border: none;
background: none;
border-radius: 0 3px 3px 0;
font-size: 8px;
color: var(--text-dim);
cursor: pointer;
padding: 0;
}
.rb-caret:hover:not(:disabled) {
background: var(--hover);
}
.rb-caret:disabled {
opacity: 0.35;
cursor: default;
}
.rb-color-caret {
width: 24px;
height: 30px;
font-size: 15px;
font-weight: 700;
}
.rb-caret-inline {
font-size: 8px;
color: var(--text-dim);
margin-left: 2px;
}
/* font color button with color bar */
.rb-color-wrap {
position: relative;
}
.rb-color-btn {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-width: 32px;
height: 30px;
line-height: 1;
padding-top: 2px;
}
.rb-color-a {
font-weight: 700;
font-size: 12px;
}
.rb-color-bar {
width: 16px;
height: 4px;
margin-top: 1px;
border-radius: 1px;
}
.color-palette {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
display: grid;
grid-template-columns: repeat(6, 22px);
gap: 4px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
padding: 8px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.color-swatch {
width: 22px;
height: 22px;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 3px;
cursor: pointer;
}
.color-swatch:hover {
outline: 2px solid var(--word-blue);
}
/* "No Shading" reset row under the swatch grid */
.color-clear {
grid-column: 1 / -1;
margin-top: 2px;
border: none;
background: none;
border-radius: 4px;
padding: 5px 6px;
font-size: 12.5px;
text-align: left;
white-space: nowrap;
color: var(--text);
cursor: pointer;
}
.color-clear:hover {
background: var(--hover);
}
.color-palette-highlight {
grid-template-columns: none;
}
.color-palette-highlight-word {
display: block;
width: 233px;
padding: 12px 14px;
border-radius: 8px;
}
.color-highlight-title {
margin: 0 0 10px;
}
.color-highlight-grid {
display: grid;
grid-template-columns: repeat(5, 35px);
gap: 7px;
}
.color-highlight-swatch {
width: 35px;
height: 35px;
border-radius: 4px;
}
.color-highlight-swatch:hover,
.color-highlight-swatch.selected {
outline: 2px solid var(--word-blue);
outline-offset: 1px;
}
.color-highlight-none {
width: 100%;
margin-top: 12px;
padding: 7px 0;
font-size: 14px;
}
.color-highlight-none.selected {
outline: 2px solid color-mix(in srgb, var(--word-blue) 65%, transparent);
outline-offset: -2px;
}
.color-palette-word {
display: block;
width: 389px;
padding: 12px 16px;
border-radius: 8px;
}
.color-automatic {
width: 100%;
height: 36px;
border: 1px solid var(--border-strong);
border-radius: 0;
background: var(--surface);
color: var(--text);
font-size: 15px;
cursor: pointer;
}
.color-automatic:hover,
.color-automatic.selected {
background: var(--hover);
outline: 2px solid color-mix(in srgb, var(--word-blue) 65%, transparent);
outline-offset: -2px;
}
.color-section-title {
margin: 18px 0 8px;
color: var(--text);
font-size: 15px;
font-weight: 500;
}
.color-theme-base,
.color-theme-shades,
.color-standard-row {
display: grid;
grid-template-columns: repeat(10, 31px);
column-gap: 5px;
}
.color-theme-base {
row-gap: 0;
margin-bottom: 12px;
}
.color-theme-shades {
row-gap: 0;
}
.color-swatch-large {
width: 31px;
height: 31px;
border-radius: 0;
}
.color-swatch-large:hover,
.color-swatch-large.selected {
position: relative;
z-index: 1;
outline: 2px solid var(--word-blue);
outline-offset: 1px;
}
.color-standard-title {
margin-top: 18px;
}
.color-more {
position: relative;
display: flex;
align-items: center;
gap: 10px;
margin: 14px -16px -12px;
padding: 11px 18px;
border-top: 1px solid var(--border);
color: var(--text);
font-size: 15px;
cursor: pointer;
}
.color-more:hover {
background: var(--hover);
}
.color-more-icon {
font-size: 19px;
line-height: 1;
}
.color-more input {
position: absolute;
width: 1px;
height: 1px;
opacity: 0;
pointer-events: none;
}
.color-none {
grid-column: 1 / -1;
border: 1px solid var(--border);
border-radius: 3px;
background: var(--surface);
font-size: 12px;
padding: 4px 0;
cursor: pointer;
color: var(--text);
}
.color-none:hover {
background: var(--hover);
}
/* line spacing dropdown */
/* Home-tab Genspark AI entry: black circular "+" badge with a dropdown caret,
brand label below (mirrors the sheets Home ribbon). */
/* AI feature buttons next to the entry: purple glyphs, label below */
.ai-feature-icon {
display: grid;
place-items: center;
width: 28px;
height: 28px;
color: #0f7fff;
}
.ai-feature-icon svg {
/* 28px like the other tall-button glyphs (Paste etc.); the 24-unit viewBox's
1.5 stroke scales to 1.75px = 28/16, keeping the 1:16 stroke standard */
width: 28px;
height: 28px;
}
.spacing-menu {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
min-width: 92px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 4px;
}
.spacing-menu button {
display: block;
width: 100%;
border: none;
background: none;
text-align: left;
padding: 6px 12px;
font-size: 13px;
border-radius: 4px;
cursor: pointer;
color: var(--text);
}
.spacing-menu button:hover {
background: var(--hover);
}
.spacing-menu button.active {
background: var(--active-bg);
color: var(--word-blue);
}
/* ---- Insert: table size picker ---- */
/* Insert → Cover Page gallery */
.cover-gallery {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
display: grid;
grid-template-columns: repeat(4, 104px);
gap: 8px;
padding: 10px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
max-height: 420px;
overflow-y: auto;
}
.cover-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 6px 6px 5px;
border: 1px solid transparent;
border-radius: 6px;
background: none;
cursor: pointer;
}
.cover-card:hover {
border-color: var(--word-blue);
background: var(--hover);
}
.cover-thumb-page {
width: 88px;
height: 116px;
overflow: hidden;
background: #fff;
border: 1px solid var(--border-strong);
border-radius: 2px;
padding: 4px 5px;
font-size: 4px;
line-height: 1.3;
color: #333;
text-align: left;
pointer-events: none;
}
.cover-thumb-para {
white-space: nowrap;
overflow: hidden;
}
.cover-card-name {
font-size: 11px;
color: var(--text);
}
.table-picker {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 8px;
}
.table-picker-title {
font-size: 12px;
color: var(--text-dim);
margin-bottom: 6px;
text-align: center;
white-space: nowrap;
}
.table-picker-grid {
display: grid;
grid-template-columns: repeat(8, 18px);
gap: 3px;
}
.table-cell {
width: 18px;
height: 16px;
border: 1px solid var(--border-strong);
border-radius: 2px;
background: var(--surface);
cursor: pointer;
padding: 0;
}
.table-cell.hot {
background: var(--active-bg);
border-color: var(--word-blue);
}
/* ---- Insert: symbol palette ---- */
.symbol-palette {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
display: grid;
grid-template-columns: repeat(10, 28px);
gap: 2px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 8px;
}
.symbol-cell {
width: 28px;
height: 28px;
border: none;
background: none;
border-radius: 3px;
font-size: 15px;
cursor: pointer;
color: var(--text);
}
.symbol-cell:hover {
background: var(--active-bg);
}
/* ---- Shape picker dropdown ---- */
.shape-palette {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
display: grid;
grid-template-columns: repeat(4, 64px);
gap: 4px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 8px;
}
.shape-cell {
display: flex;
flex-direction: column;
align-items: center;
gap: 3px;
width: 64px;
padding: 4px 2px;
border: none;
background: none;
border-radius: 4px;
cursor: pointer;
color: var(--text);
}
.shape-cell:hover {
background: var(--active-bg);
}
.shape-preview {
display: block;
width: 36px;
height: 24px;
border: 1.5px solid #2f5496;
}
.shape-label {
font-size: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 60px;
}
/* ---- WordArt picker panel ---- */
.wordart-palette {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
display: grid;
grid-template-columns: repeat(2, 120px);
gap: 4px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 8px;
}
.wordart-cell {
display: flex;
flex-direction: row;
align-items: center;
gap: 6px;
width: 120px;
padding: 6px 8px;
border: none;
background: none;
border-radius: 4px;
cursor: pointer;
color: var(--text);
}
.wordart-cell:hover {
background: var(--active-bg);
}
.wordart-preview {
font-size: 22px;
font-weight: 700;
line-height: 1;
font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
min-width: 26px;
text-align: center;
}
.wordart-label {
font-size: 11px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
text-align: left;
}
/* ---- Drop cap dropdown menu ---- */
.dropcap-menu {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
display: flex;
flex-direction: row;
gap: 4px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 8px;
min-width: 200px;
}
.dropcap-option {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
padding: 8px 12px;
border: 1px solid transparent;
border-radius: 4px;
background: none;
cursor: pointer;
font-size: 11px;
color: var(--text);
min-width: 56px;
}
.dropcap-option:hover {
background: var(--active-bg);
border-color: var(--border);
}
.dropcap-preview {
font-size: 28px;
font-weight: bold;
line-height: 1;
color: var(--text);
min-height: 32px;
display: flex;
align-items: center;
}
/* ---- Equations: built-in equation library dropdown + LaTeX insert dialog ---- */
.equation-gallery {
/* right-aligned to its trigger (the Equation button sits at the ribbon's
far right) — fixed + anchored like the other panels */
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
right: anchor(right);
position-visibility: anchors-visible;
z-index: 60;
width: 300px;
max-height: 420px;
overflow-y: auto;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 6px;
}
.equation-gallery-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
width: 100%;
border: none;
background: none;
border-radius: 4px;
padding: 8px 6px;
cursor: pointer;
color: var(--text);
}
.equation-gallery-item:hover {
background: var(--active-bg);
}
.equation-gallery-name {
font-size: 11px;
color: var(--text-dim, #777);
align-self: flex-start;
}
.equation-gallery-preview {
font-family: 'Cambria Math', 'STIX Two Math', serif;
font-size: 15px;
max-width: 100%;
overflow-x: hidden;
}
.equation-gallery-custom {
width: 100%;
border: none;
border-top: 1px solid var(--border-strong);
background: none;
padding: 8px 6px;
text-align: left;
font-size: 12px;
cursor: pointer;
color: var(--text);
}
.equation-gallery-custom:hover {
background: var(--active-bg);
}
.equation-modal {
min-width: 460px;
}
.equation-preview {
min-height: 64px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid var(--border-strong);
border-radius: 6px;
margin: 10px 0 2px;
padding: 10px;
font-family: 'Cambria Math', 'STIX Two Math', serif;
font-size: 18px;
overflow-x: auto;
}
.equation-preview-hint {
font-size: 12px;
color: var(--text-dim, #999);
font-family: system-ui, sans-serif;
}
.equation-preview-error {
font-size: 12px;
color: #c0392b;
font-family: system-ui, sans-serif;
}
.equation-inline-toggle {
display: flex;
align-items: center;
gap: 6px;
margin-top: 8px;
font-size: 12px;
color: var(--text-dim, #666);
user-select: none;
}
/* ---- Layout: preset menus + paragraph spinners ---- */
.layout-menu {
position: fixed;
position-anchor: --rb-drop-wrap;
top: calc(anchor(bottom) + 4px);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 60;
min-width: 200px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
padding: 5px;
}
.layout-menu button {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 1px;
width: 100%;
border: none;
background: none;
padding: 7px 12px;
border-radius: 4px;
cursor: pointer;
color: var(--text);
font-size: 13px;
}
.layout-menu button span {
font-size: 11px;
color: var(--text-dim);
}
.layout-menu button:hover {
background: var(--hover);
}
.layout-menu button.active {
background: var(--active-bg);
}
/* table row/cell revisions: insert = green background, delete = red background (inline text has separate ins/del underline/strike styles) */
tr.row-rev-ins > td,
tr.row-rev-ins > th,
td.cell-rev-ins,
th.cell-rev-ins {
background: rgba(22, 163, 74, 0.08);
}
tr.row-rev-del > td,
tr.row-rev-del > th,
td.cell-rev-del,
th.cell-rev-del {
background: rgba(220, 38, 38, 0.08);
}
/* no-markup mode = as if all accepted: deleted rows hidden, insert background removed */
.rev-display-none tr.row-rev-del,
.rev-display-none td.cell-rev-del,
.rev-display-none th.cell-rev-del {
display: none;
}
.rev-display-none tr.row-rev-ins > td,
.rev-display-none tr.row-rev-ins > th,
.rev-display-none td.cell-rev-ins,
.rev-display-none th.cell-rev-ins {
background: none;
}
/* original mode = as if all rejected: inserted rows hidden, delete background removed */
.rev-display-original tr.row-rev-ins,
.rev-display-original td.cell-rev-ins,
.rev-display-original th.cell-rev-ins {
display: none;
}
.rev-display-original tr.row-rev-del > td,
.rev-display-original tr.row-rev-del > th,
.rev-display-original td.cell-rev-del,
.rev-display-original th.cell-rev-del {
background: none;
}
/* Arrange group position gallery: 3x3 page thumbnail grid, dots indicate image placement */
.pos-grid {
display: grid;
grid-template-columns: repeat(3, 36px);
gap: 4px;
padding: 6px 8px 4px;
}
.layout-menu button.pos-cell {
display: flex;
width: 36px;
height: 36px;
padding: 4px;
border: 1px solid var(--border-strong);
border-radius: 4px;
}
.layout-menu button.pos-cell.active {
border-color: var(--accent, #2b579a);
background: var(--active-bg);
}
.pos-cell .pos-dot {
width: 10px;
height: 10px;
border-radius: 2px;
background: var(--text-dim);
}
.pos-cell.ph-left {
justify-content: flex-start;
}
.pos-cell.ph-center {
justify-content: center;
}
.pos-cell.ph-right {
justify-content: flex-end;
}
.pos-cell.pv-top {
align-items: flex-start;
}
.pos-cell.pv-center {
align-items: center;
}
.pos-cell.pv-bottom {
align-items: flex-end;
}
/* Switch Windows sits at the ribbon's right edge — anchor right so it isn't clipped */
.layout-menu.align-right {
left: auto;
right: anchor(right);
}
.layout-para {
gap: 14px;
}
.layout-col {
display: flex;
flex-direction: column;
gap: 5px;
justify-content: center;
}
.layout-num {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--text);
}
.layout-num > span:first-child {
width: 44px;
text-align: right;
color: var(--text-dim);
}
.layout-num input {
width: 56px;
height: 24px;
border: 1px solid var(--border-strong);
border-radius: 3px;
padding: 0 4px;
font-size: 12px;
}
.layout-num input:disabled {
opacity: 0.5;
}
.layout-unit {
color: var(--text-dim);
font-size: 11px;
}
/* ---- Review: word count ---- */
.stats-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.stats-table td {
padding: 7px 4px;
border-bottom: 1px solid var(--border);
}
.stats-table td:last-child {
text-align: right;
font-weight: 600;
}
/* ---- page color swatch selection ---- */
.color-palette-page {
grid-template-columns: repeat(5, 22px);
}
.color-swatch.selected {
outline: 2px solid var(--word-blue);
}
/* style gallery */
.style-gallery {
gap: 4px;
}
.style-card {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
width: 74px;
height: 62px;
border: 1px solid var(--border);
border-radius: 4px;
background: var(--surface);
cursor: pointer;
}
.style-card:hover:not(:disabled) {
border-color: var(--word-blue);
background: var(--hover);
}
.style-card.active {
border-color: var(--word-blue);
background: var(--active-bg);
}
.style-card:disabled {
opacity: 0.45;
cursor: default;
}
.style-card-label {
font-size: 10.5px;
color: var(--text-dim);
}
.style-card-preview {
font-size: 15px;
}
.style-card-preview.style-normal {
color: var(--text);
}
.style-card-preview.style-h1 {
color: var(--word-heading);
font-size: 18px;
font-weight: 400;
}
.style-card-preview.style-h2 {
color: var(--word-heading);
font-size: 15px;
}
.style-card-preview.style-h3 {
color: #1f3864;
font-size: 13px;
}
.style-gallery-more {
width: 20px;
height: 62px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid var(--border);
border-radius: 4px;
background: var(--surface);
color: var(--text-dim);
cursor: pointer;
}
.style-gallery-more:hover:not(:disabled),
.style-gallery-more.active {
border-color: var(--word-blue);
background: var(--hover);
}
.style-gallery-more:disabled {
opacity: 0.45;
cursor: default;
}
/* ================= workspace / document canvas ================= */
.workspace {
display: flex;
flex: 1;
min-height: 0;
background: var(--canvas);
}
.editor-scroll {
flex: 1;
overflow-y: auto;
padding: 26px 24px 140px;
}
.doc-zoom {
width: fit-content;
margin: 0 auto;
}
/* ---- Word basics: marks / columns / page border / header-footer / nav / ruler ---- */
/* ¶ editing marks (front-end only) */
.show-marks .doc-page p::after,
.show-marks .doc-page h1::after,
.show-marks .doc-page h2::after,
.show-marks .doc-page h3::after,
.show-marks .doc-page h4::after {
content: '¶';
color: #2b7cd3;
opacity: 0.55;
font-size: 0.85em;
margin-left: 2px;
user-select: none;
}
/* multi-column layout (w:cols) */
.doc-page {
column-count: var(--page-cols, auto);
column-gap: 28px;
column-fill: auto;
}
/* page border (w:pgBorders): a box inset from the page edge */
.page-bordered .doc-page {
outline: 1.5px solid #333;
outline-offset: -32px;
}
/* ---- tab stops (w:tabs) ---- */
/* Paragraphs whose tabs were measured (TabStopExtension): tab chars get zero
intrinsic width; the jump to the stop is a letter-spacing decoration on the
tab char itself, so an ancestor <u> still underlines the gap. */
.has-tab-stops {
tab-size: 0;
}
/* underlined tab run: browsers skip text-decoration over a tab advance, so
the blank (e.g. signature "By: ____") gets an explicit line */
.doc-tab-underline {
border-bottom: 1px solid currentColor;
}
/* tab leader (w:leader) drawn across the tab gap */
.doc-tab-leader-dot,
.doc-tab-leader-middleDot {
border-bottom: 1px dotted currentColor;
}
.doc-tab-leader-hyphen {
border-bottom: 1px dashed currentColor;
}
.doc-tab-leader-underscore {
border-bottom: 1px solid currentColor;
}
.doc-tab-leader-heavy {
border-bottom: 2px solid currentColor;
}
/* Drop cap: first-letter floats to 3 lines height */
.has-drop-cap::first-letter {
float: left;
font-size: 3em;
line-height: 0.85;
margin-right: 0.05em;
margin-top: 0.1em;
font-weight: normal;
}
/* Margin drop cap (in-margin): negative left margin to push it outside text area */
[data-drop-cap*='"type":"margin"']::first-letter {
margin-left: -0.6em;
}
/* Move-from revision: strikethrough + light red background (content moved away) */
.has-move-from {
background: rgba(220, 38, 38, 0.08);
text-decoration: line-through;
text-decoration-color: #dc2626;
}
/* Move-to revision: light green background (content moved in) */
.has-move-to {
background: rgba(22, 163, 74, 0.08);
}
/* pPrChange (tracked paragraph format change): light amber left border + badge */
.has-ppr-change {
border-left: 3px solid #f59e0b;
padding-left: 4px;
position: relative;
}
/* pPrChange badge: "format revision" label at paragraph end via ::after */
.has-ppr-change::after {
content: attr(data-ppr-change-label);
margin-left: 6px;
font-size: 8px;
color: #b45309;
background: #fef3c7;
border: 1px solid #fcd34d;
border-radius: 2px;
padding: 0 3px;
vertical-align: middle;
pointer-events: none;
}
.has-sdt {
position: relative;
border: 1px solid #a0c0e8;
border-radius: 2px;
padding: 1px 2px;
margin: 0 -2px;
}
/* SDT alias label: tiny floating tag in the top-left corner via ::before */
.has-sdt::before {
content: attr(data-sdt-alias);
position: absolute;
top: -10px;
left: 0;
font-size: 8px;
line-height: 1;
color: #5080b0;
background: #eef4fb;
border: 1px solid #a0c0e8;
border-radius: 2px 2px 0 0;
padding: 0 3px;
pointer-events: none;
white-space: nowrap;
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
}
.page-wrap {
position: relative;
min-height: var(--page-h, 1056px);
}
.page-hf {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: calc(var(--page-w, 816px) - 120px);
text-align: center;
font-size: 9pt;
color: #777;
overflow: hidden;
z-index: 1;
cursor: default;
}
.page-hf-para {
white-space: pre-wrap;
min-height: 1.3em;
}
/* logo and other images in the part (display-only, excluded from text editing) */
.page-hf-images {
display: flex;
gap: 8px;
align-items: center;
justify-content: flex-start;
user-select: none;
pointer-events: none;
}
.page-hf-images img {
max-width: 100%;
object-fit: contain;
}
.page-hf-editing {
outline: 2px solid var(--word-blue);
outline-offset: 2px;
border-radius: 2px;
background: var(--surface);
color: var(--text);
overflow: visible;
cursor: text;
}
/* editing surface: a separate element receives input and clears on unmount (no leftover input text nodes) */
.page-hf-edit-surface {
outline: none;
min-height: 1.3em;
white-space: pre-wrap;
}
.page-hf-header {
top: var(--header-dist, 48px);
border-bottom: 1px dashed #d0d0d0;
padding-bottom: 2px;
}
.page-hf-footer {
bottom: var(--footer-dist, 48px);
border-top: 1px dashed #d0d0d0;
padding-top: 2px;
}
/* first/odd/even header-footer switcher (only shown when Different First Page or Different Odd & Even is on) */
.hf-variant-chips {
position: absolute;
top: 6px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 4px;
z-index: 2;
}
.hf-variant-chips button {
font-size: 10px;
padding: 1px 8px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--surface);
color: var(--text-dim, #777);
cursor: pointer;
}
.hf-variant-chips button.on {
background: var(--word-blue);
border-color: var(--word-blue);
color: #fff;
}
/* "Different first page" entry next to the header itself: while the
feature is off the whole chip bar stays invisible until the header area is
hovered or being edited, so plain documents keep a clean page top. The
padding-bottom stretches the (invisible) bar down to the header so the cursor
can travel from the header up to the chip without a hover gap. */
.hf-chips-idle {
opacity: 0;
pointer-events: none;
transition: opacity 0.15s ease;
padding-bottom: max(0px, calc(var(--header-dist, 48px) - 24px));
}
.page-wrap:has(.page-hf-header:hover) .hf-chips-idle,
.page-wrap:has(.page-hf-header.page-hf-editing) .hf-chips-idle,
.hf-variant-chips.hf-chips-idle:hover {
opacity: 1;
pointer-events: auto;
}
/* navigation pane */
.nav-pane {
width: 232px;
flex: none;
border-right: 1px solid var(--border);
background: var(--surface);
display: flex;
flex-direction: column;
overflow: hidden;
}
.nav-pane-title {
padding: 10px 14px 8px;
font-size: 12px;
font-weight: 600;
color: var(--text);
border-bottom: 1px solid var(--border);
}
.nav-pane-list {
overflow-y: auto;
padding: 6px 0;
}
.nav-item {
display: block;
width: 100%;
text-align: left;
border: none;
background: none;
padding: 4px 14px;
font-size: 12.5px;
color: var(--text);
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.nav-item:hover {
background: var(--hover);
color: #2b7cd3;
}
.nav-l2 {
padding-left: 28px;
font-size: 12px;
}
.nav-l3 {
padding-left: 42px;
font-size: 11.5px;
}
.nav-l4 {
padding-left: 56px;
font-size: 11.5px;
}
.nav-empty {
padding: 12px 14px;
font-size: 12px;
color: var(--text-dim);
}
/* tracked changes: insertions underlined, deletions struck through (Word revisions) */
.doc-ins {
color: #b91c1c;
text-decoration: underline;
text-decoration-color: #b91c1c;
}
.doc-del {
color: #b91c1c;
text-decoration: line-through;
text-decoration-color: #b91c1c;
opacity: 0.72;
}
/* deleted text inside an insertion (insert-then-delete) keeps both cues */
.doc-ins .doc-del,
.doc-del .doc-ins {
text-decoration: underline line-through;
}
/* revision display mode: No Markup = as if all accepted (insertions shown normally, deletions hidden) */
.rev-display-none .doc-ins {
color: inherit;
text-decoration: none;
}
.rev-display-none .doc-del,
.rev-display-none .has-move-from {
display: none;
}
.rev-display-none .has-move-to {
background: none;
}
.rev-display-none .has-rpr-change {
text-decoration: none;
}
.rev-display-none .has-ppr-change {
border-left: none;
padding-left: 0;
}
.rev-display-none .has-ppr-change::after {
content: none;
}
/* revision display mode: Original = as if all rejected (deletions shown normally, insertions hidden).
known approximation: old formats of rPrChange/pPrChange can't be restored in CSS; markers are merely hidden */
.rev-display-original .doc-del {
color: inherit;
text-decoration: none;
opacity: 1;
}
.rev-display-original .doc-ins,
.rev-display-original .has-move-to {
display: none;
}
.rev-display-original .has-move-from {
background: none;
text-decoration: none;
}
.rev-display-original .has-rpr-change {
text-decoration: none;
}
.rev-display-original .has-ppr-change {
border-left: none;
padding-left: 0;
}
.rev-display-original .has-ppr-change::after {
content: none;
}
/* inserted then deleted: they cancel out in No Markup view → hidden; also nonexistent in Original view */
.rev-display-none .doc-ins .doc-del,
.rev-display-original .doc-del .doc-ins {
display: none;
}
/* Compare result pane */
.compare-meta {
padding: 8px 12px;
font-size: 12px;
color: var(--text-dim);
border-bottom: 1px solid var(--border);
}
.compare-same {
text-align: center;
font-size: 11px;
color: var(--text-dim);
padding: 4px 0;
}
.compare-card {
border: 1px solid var(--border);
border-radius: 6px;
padding: 7px 9px;
margin: 4px 8px;
font-size: 12px;
display: flex;
flex-direction: column;
gap: 4px;
}
.compare-left {
color: #b91c1c;
text-decoration: line-through;
opacity: 0.8;
}
.compare-right {
color: #166534;
}
.compare-added {
background: rgba(22, 101, 52, 0.06);
}
.compare-removed {
background: rgba(185, 28, 28, 0.06);
}
/* comment composer (new comment) */
.comment-compose {
border-bottom: 1px solid var(--border);
padding: 8px;
display: flex;
flex-direction: column;
gap: 6px;
}
.comment-compose textarea {
width: 100%;
min-height: 56px;
resize: vertical;
border: 1px solid var(--border-strong);
border-radius: 6px;
padding: 6px 8px;
font-size: 13px;
font-family: inherit;
background: var(--surface);
color: var(--text);
}
.comment-compose-actions {
display: flex;
gap: 6px;
justify-content: flex-end;
}
.comment-compose-actions button {
border: 1px solid var(--border-strong);
background: var(--surface);
border-radius: 5px;
padding: 4px 12px;
font-size: 12px;
cursor: pointer;
color: var(--text);
}
.comment-compose-actions button.primary {
background: #2b579a;
border-color: #2b579a;
color: #fff;
}
.comment-card-del {
margin-left: auto;
border: none;
background: none;
color: var(--text-dim);
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
flex: none;
padding: 3px;
border-radius: 4px;
}
.comment-card-del:hover {
background: var(--hover);
color: #b91c1c;
}
/* comments: in-text highlight + right-side pane */
.doc-comment {
background: rgba(255, 196, 0, 0.22);
border-bottom: 2px solid #e8a33d;
cursor: pointer;
}
/* range picked for a comment that is still being composed */
.comment-pending {
background: rgba(255, 196, 0, 0.22);
border-bottom: 2px dashed #e8a33d;
}
/* Word: body shading of resolved threads is hidden (the jump flash animation can still briefly reveal the position) */
.doc-comment:has(.doc-comment-resolved),
.doc-comment-resolved,
.doc-comment-resolved .doc-comment {
background: none;
border-bottom: none;
cursor: text;
}
.doc-comment-flash {
animation: comment-flash 1.2s ease-out;
}
@keyframes comment-flash {
0%,
40% {
background: rgba(255, 170, 0, 0.55);
}
100% {
background: rgba(255, 196, 0, 0.22);
}
}
.comments-pane {
width: 264px;
flex: none;
border-left: 1px solid var(--border);
background: var(--surface);
display: flex;
flex-direction: column;
overflow: hidden;
}
.comments-pane-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px 8px;
border-bottom: 1px solid var(--border);
}
.comments-pane-title {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
font-weight: 600;
color: var(--text);
}
.comments-pane-close {
border: none;
background: none;
cursor: pointer;
font-size: 12px;
color: var(--text-dim);
border-radius: 3px;
padding: 2px 6px;
}
.comments-pane-close:hover {
background: var(--hover);
}
.comments-pane-list {
overflow-y: auto;
padding: 8px;
display: flex;
flex-direction: column;
gap: 8px;
}
.comment-card {
display: block;
width: 100%;
text-align: left;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--bg, #fff);
padding: 8px 10px;
cursor: pointer;
font-size: 12.5px;
color: var(--text);
}
.comment-card:hover {
border-color: #e8a33d;
}
.comment-card.active {
border-color: #e8a33d;
box-shadow: 0 0 0 1px #e8a33d;
}
.comment-card-head {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
}
.comment-avatar {
flex: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: #e8a33d;
color: #fff;
font-size: 10px;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
}
.comment-author {
font-weight: 600;
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.comment-date {
margin-left: auto;
flex: none;
font-size: 10.5px;
color: var(--text-dim);
}
.comment-anchor {
font-size: 11px;
color: var(--text-dim);
border-left: 2px solid #e8a33d;
padding-left: 6px;
margin-bottom: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.comment-text {
white-space: pre-wrap;
word-break: break-word;
}
.comments-empty {
padding: 12px 14px;
font-size: 12px;
color: var(--text-dim);
}
/* horizontal ruler */
.ruler {
position: relative;
height: 20px;
margin: 0 auto 6px;
background:
repeating-linear-gradient(to right, #b9b9b9 0, #b9b9b9 1px, transparent 1px, transparent 12px)
bottom / 100% 5px no-repeat,
#f3f2f1;
border: 1px solid #d6d6d6;
border-radius: 2px;
font-size: 9px;
color: #666;
user-select: none;
overflow: hidden;
cursor: pointer;
}
.ruler-tab-type {
position: absolute;
left: 0;
top: 0;
width: 20px;
height: 100%;
background: #e0e0e0;
border: none;
border-right: 1px solid #ccc;
font-size: 9px;
font-weight: bold;
cursor: pointer;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
color: #333;
}
.ruler-tab-type:hover {
background: #d0d0d0;
}
/* tab stop markers on ruler */
.ruler-tab {
position: absolute;
bottom: 2px;
width: 10px;
height: 10px;
font-size: 8px;
font-weight: bold;
color: #185abd;
cursor: move;
transform: translateX(-50%);
text-align: center;
line-height: 10px;
z-index: 3;
user-select: none;
}
.ruler-tab:hover {
color: #0c3c82;
background: rgba(24, 90, 189, 0.1);
}
/* default tab stop guide (no interaction) */
.ruler-tab-default {
position: absolute;
bottom: 0;
width: 1px;
height: 4px;
background: #aaa;
transform: translateX(-50%);
z-index: 1;
pointer-events: none;
}
.ruler-zone {
position: absolute;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.08);
}
.ruler-num {
position: absolute;
top: 3px;
transform: translateX(-50%);
line-height: 1;
}
/* header/footer dropdown editor */
.hf-menu {
/* fixed + anchored like the other ribbon panels, so the ribbon-body
scroll clip can't cut it off */
position: fixed;
position-anchor: --rb-drop-wrap;
top: anchor(bottom);
left: anchor(left);
position-try-fallbacks: flip-inline;
position-visibility: anchors-visible;
z-index: 30;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 6px;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
padding: 10px;
width: 260px;
}
.hf-menu-title {
font-size: 11px;
color: var(--text-dim);
margin-bottom: 6px;
}
.hf-menu input {
width: 100%;
box-sizing: border-box;
padding: 5px 8px;
border: 1px solid var(--border);
border-radius: 4px;
font-size: 12.5px;
background: var(--bg);
color: var(--text);
}
.hf-menu-actions {
display: flex;
gap: 6px;
margin-top: 8px;
justify-content: flex-end;
}
.hf-menu-actions button {
padding: 4px 12px;
font-size: 12px;
border-radius: 4px;
border: 1px solid var(--border);
background: var(--surface);
color: var(--text);
cursor: pointer;
}
.hf-menu-actions .btn-primary {
background: #2b7cd3;
border-color: #2b7cd3;
color: #fff;
}
/* the page: size/margins/background follow the docx sectPr via CSS vars */
.doc-page {
width: var(--page-w, 816px);
margin: 0 auto;
background: var(--page-bg, var(--surface));
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.28),
0 4px 16px rgba(0, 0, 0, 0.1);
padding: var(--page-pad, 96px 96px 120px);
min-height: var(--page-h, 1056px);
outline: none;
font-family: Calibri, 'DengXian', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
font-size: 11pt;
line-height: 1.35;
color: #000;
}
.workspace-dark {
background: #3d3d3d;
}
/* visual page-break indicator (w:pageBreakBefore) */
.doc-page .page-break-before {
position: relative;
border-top: 1px dashed var(--border-strong);
padding-top: 14px;
margin-top: 14pt;
}
.doc-page .page-break-before::before {
content: attr(data-page-break-label);
position: absolute;
top: -9px;
left: 50%;
transform: translateX(-50%);
font-size: 10px;
color: var(--text-dim);
background: var(--page-bg, var(--surface));
padding: 0 8px;
}
.doc-page p {
margin: 0 0 8pt;
}
/* M4 always-on pagination in the canvas: page gap = previous page's bottom margin (white) + inter-page band (gray) + next page's top margin (white) */
.page-gap {
position: relative;
cursor: default;
user-select: none;
}
.page-gap::before {
content: '';
position: absolute;
top: var(--gap-mb, 96px);
bottom: var(--gap-mt, 96px);
left: 0;
right: 0;
background: var(--canvas);
box-shadow:
inset 0 8px 8px -8px rgba(0, 0, 0, 0.35),
inset 0 -3px 3px -3px rgba(0, 0, 0, 0.18);
}
.workspace-dark .page-gap::before {
background: #3d3d3d;
}
/* inline gap for mid-paragraph page breaks: inserted at the broken line inside the paragraph, takes its own line, excluded from text selection/cursor */
.page-gap-inline {
display: inline-block;
vertical-align: top;
pointer-events: none;
text-indent: 0;
}
/* In-table gap at a row boundary. A real spanning cell isolates collapsed
borders/backgrounds from the page gutter; the inner fill paints paper /
canvas / paper bands without inheriting table-cell decoration. */
.page-gap-table {
display: table-row;
}
.doc-table .page-gap-table > td {
position: relative;
height: auto;
padding: 0;
border: 0;
background: var(--page-bg, var(--surface));
}
.page-gap-table::before {
display: none;
}
/* absolute: height 100% of an auto-height td resolves to 0, hiding the bands */
.page-gap-table-fill {
position: absolute;
inset: 0;
background: linear-gradient(
to bottom,
var(--page-bg, var(--surface)) 0 var(--gap-mb, 96px),
var(--canvas) var(--gap-mb, 96px) calc(var(--gap-mb, 96px) + 28px),
var(--page-bg, var(--surface)) calc(var(--gap-mb, 96px) + 28px) 100%
);
}
.workspace-dark .page-gap-table-fill {
--canvas: #3d3d3d;
}
/* footnote area at the top of a page gap (previous page's bottom, Word behavior): the gap was already enlarged by the reserved height;
the estimated height differs from actual rendering by pixels, so overflow into the bottom-margin area is allowed (no clipping) */
.page-gap-notes {
position: absolute;
top: 0;
overflow: visible;
box-sizing: border-box;
pointer-events: auto;
font-size: 10pt;
line-height: 1.3;
color: var(--text, #333);
text-indent: 0;
text-align: left;
}
.page-gap-notes::before {
content: '';
display: block;
width: 33%;
border-top: 1px solid #888;
margin-bottom: 4px;
}
.page-gap-note {
cursor: default;
overflow: hidden;
}
.pv-footnote {
overflow: hidden;
}
.page-gap-note sup {
margin-right: 4px;
}
/* pagination preview: page-bottom footnote area (the referencing page; separator + small text); tiny overflow spills into the bottom margin */
.pv-footnotes {
position: absolute;
overflow: visible;
box-sizing: border-box;
font-size: 10pt;
line-height: 1.3;
color: #333;
}
.pv-footnotes::before {
content: '';
display: block;
width: 33%;
border-top: 1px solid #888;
margin-bottom: 4px;
}
.pv-footnote sup {
margin-right: 4px;
}
/* endnote area: right after the body's end, separator above the first entry, continuation pages have no separator */
.pv-endnotes {
position: absolute;
overflow: visible;
box-sizing: border-box;
font-size: 10pt;
line-height: 1.3;
color: #333;
}
.pv-endnote-separator {
/* matches FOOTNOTE_SEPARATOR_H (16px): 11 + 1 border + 4 bottom spacing */
width: 33%;
border-top: 1px solid #888;
margin-bottom: 4px;
height: 11px;
}
/* when a page gap is right next to a page-break indicator, hide the duplicate dashed marker (keep placeholder height) */
.page-gap + .page-break-before {
border-top-color: transparent;
}
.page-gap + .page-break-before::before {
display: none;
}
/* pagination preview: read-only overlay, one fixed-size box per page, content clone clipped via negative margin */
.pagination-preview {
position: fixed;
inset: 0;
z-index: 60;
display: flex;
flex-direction: column;
background: #525659;
}
.pv-toolbar {
position: relative;
z-index: 1;
flex: none;
display: flex;
align-items: center;
gap: 12px;
padding: 8px 16px;
background: var(--surface);
border-bottom: 1px solid var(--border);
-webkit-app-region: no-drag;
}
.pv-title {
font-weight: 600;
}
.pv-count {
color: var(--text-dim, #777);
}
.pv-hint {
margin-left: auto;
font-size: 12px;
color: var(--text-dim, #777);
}
.pv-close {
border: 1px solid var(--border);
background: var(--surface);
border-radius: 4px;
padding: 4px 14px;
cursor: pointer;
-webkit-app-region: no-drag;
}
.pv-close:hover {
background: var(--word-blue);
border-color: var(--word-blue);
color: #fff;
}
.pv-scroll {
flex: 1;
overflow: auto;
padding: 24px 0 48px;
}
.pv-page {
position: relative;
margin: 0 auto 24px;
background: #fff;
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.28),
0 4px 16px rgba(0, 0, 0, 0.1);
box-sizing: border-box;
overflow: hidden;
font-family: Calibri, 'DengXian', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
font-size: 11pt;
line-height: 1.35;
color: #000;
}
.pv-clip {
overflow: hidden;
}
/* clip at the paper edge, not the content box: over-wide tables bleed into the margin
like Word (keep overflow hidden — print pagination needs the box monolithic) */
.pv-page > .pv-clip {
margin-right: calc(-1 * var(--pv-mr, 0px));
}
/* column flow: regions stack vertically; narrow clipped columns sit side by side within a region */
.pv-region {
display: flex;
align-items: flex-start;
overflow: hidden;
}
.pv-col {
flex: none;
}
/* the clone is a gapless continuous flow (slices use virtual coordinates); canvas page gaps don't enter the clone */
.pv-clip .page-gap {
display: none;
}
/* the clone keeps only content layout, stripping the page box's chrome (width = content area, matching the canvas) */
.pv-clip .doc-page {
width: auto;
margin: 0;
padding: 0;
background: transparent;
box-shadow: none;
min-height: 0;
pointer-events: none;
}
/* page-break indicators are only visually hidden, keeping placeholder height — clone line heights must match measurement */
.pv-clip .doc-page .page-break-before {
border-top-color: transparent;
}
.pv-clip .doc-page .page-break-before::before {
visibility: hidden;
}
.pv-page .page-hf {
cursor: default;
}
.pv-pageno {
position: absolute;
right: 8px;
bottom: 8px;
font-size: 10px;
color: #aaa;
user-select: none;
}
.doc-page h1,
.doc-page h2,
.doc-page h3,
.doc-page h4,
.doc-page h5,
.doc-page h6 {
font-weight: 400;
line-height: 1.2;
margin: 14pt 0 4pt;
}
.doc-page h1 {
font-size: 16pt;
color: var(--word-heading);
}
.doc-page h2 {
font-size: 13pt;
color: var(--word-heading);
}
.doc-page h3 {
font-size: 12pt;
color: #1f3864;
}
.doc-page h4,
.doc-page h5,
.doc-page h6 {
font-size: 11pt;
color: var(--word-heading);
font-style: italic;
}
.doc-link {
color: #0563c1;
text-decoration: underline;
cursor: pointer;
}
/* flat list items (1:1 with w:p anchors)
geometry comes from w:ind (--li-left text indent / --li-hang hanging marker-area width,
emitted by extensions.ts); defaults replicate the old fixed per-level indents. The marker
is an inline hanging box: it fills the hanging area, and when too wide it pushes the body
text aside instead of overlapping it (Word behavior) */
.doc-li {
position: relative;
padding-left: var(--li-left, 0.55in);
margin: 0 0 4pt;
}
.doc-li.ilvl-1 {
padding-left: var(--li-left, 0.85in);
}
.doc-li.ilvl-2 {
padding-left: var(--li-left, 1.15in);
}
.doc-li.ilvl-3 {
padding-left: var(--li-left, 1.45in);
}
.doc-li.ilvl-4 {
padding-left: var(--li-left, 1.75in);
}
.doc-li::before {
display: inline-block;
min-width: var(--li-hang, 0.25in);
margin-left: calc(-1 * var(--li-hang, 0.25in));
font-size: var(--li-marker-size, inherit);
}
.doc-li-bullet::before {
content: '•';
}
.doc-li.ilvl-1.doc-li-bullet::before {
content: '◦';
}
.doc-li.ilvl-2.doc-li-bullet::before {
content: '▪';
}
.doc-page {
counter-reset: doc-ol;
}
.doc-li-ordered {
counter-increment: doc-ol;
}
.doc-li-ordered::before {
content: counter(doc-ol) '.';
}
/* restart numbering after any non-ordered block; counter-set (applied after
increment) mutates the page-scoped counter, while a sibling counter-reset
would nest a new instance and desync the numbers from the 2nd item on */
.doc-page > :not(.doc-li-ordered) + .doc-li-ordered {
counter-set: doc-ol 1;
}
/* real multilevel numbering: items defined in numbering.xml get data-marker computed by ListNumberingExtension,
overriding the bullet/CSS-counter fallbacks above (selector includes .doc-page for higher specificity and comes later) */
.doc-page .doc-li[data-marker] {
counter-increment: none;
}
.doc-page .doc-li[data-marker]::before {
content: attr(data-marker);
}
/* protected blocks (table / image / chart / math ...) */
.doc-protected {
position: relative;
border: 1px dashed var(--border-strong);
border-radius: 3px;
padding: 10px 14px;
margin: 0 0 8pt;
background: #fafafa;
cursor: grab;
user-select: none;
}
.doc-move-handle {
position: absolute;
z-index: 4;
top: -14px;
left: -14px;
display: flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
border: 1px solid var(--word-blue);
border-radius: 3px;
background: var(--surface);
color: var(--word-blue);
font: 13px/1 sans-serif;
cursor: move;
user-select: none;
-webkit-user-select: none;
opacity: 0;
pointer-events: none;
}
.doc-protected:hover > .doc-move-handle,
.doc-protected.ProseMirror-selectednode > .doc-move-handle {
opacity: 1;
pointer-events: auto;
}
/* Native ProseMirror tables */
.doc-page > .doc-table {
margin: 2px 0;
}
.doc-protected[data-doc-protected='table'] {
border-color: transparent;
background: transparent;
padding: 2px;
}
.doc-protected[data-doc-protected='table']:hover {
border-color: var(--border-strong);
}
.doc-table {
/* fallback when there are no absolute grid widths; tables with w:tblGrid are overridden by inline width.
font size/line spacing inherit the document defaults (.doc-page, i.e. the Normal style) */
width: 100%;
max-width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
.doc-table td,
.doc-table th {
position: relative;
box-sizing: border-box;
/* default grid lines; tables with w:tblBorders override via --doc-b-h/--doc-b-v, the outer frame wins through the table element's border collapse */
border-top: var(--doc-b-h, 1px solid #808080);
border-bottom: var(--doc-b-h, 1px solid #808080);
border-left: var(--doc-b-v, 1px solid #808080);
border-right: var(--doc-b-v, 1px solid #808080);
/* Word default cell margins: 108 twips (7.2px) sides / 0 top-bottom; w:tblCellMar overrides via table-level variables */
padding: var(--doc-cell-pad, 0 7.2px);
vertical-align: top;
/* a word wider than the cell's line box overflows the cell
instead of stacking letter-by-letter; prosemirror-view's built-in
.ProseMirror { word-wrap: break-word } would otherwise inherit in */
overflow-wrap: normal;
}
.doc-table th {
font-weight: 600;
}
.doc-table .selectedCell {
position: relative;
}
.doc-table .selectedCell::after {
position: absolute;
inset: 0;
content: '';
pointer-events: none;
background: color-mix(in srgb, var(--word-blue) 18%, transparent);
}
.doc-page.resize-cursor {
cursor: col-resize;
}
.column-resize-handle {
position: absolute;
top: 0;
right: -2px;
bottom: -2px;
width: 4px;
pointer-events: none;
background: var(--word-blue);
}
.table-ribbon-body {
display: flex;
align-items: stretch;
min-width: 0;
}
.table-tool-group {
display: flex;
flex-direction: column;
justify-content: center;
min-width: 66px;
padding: 2px 6px;
}
.table-tool-row,
.table-tool-grid {
display: flex;
align-items: center;
gap: 3px;
flex: 1;
}
.table-tool-grid {
display: grid;
}
.table-tool-grid-four {
grid-template-columns: repeat(2, minmax(66px, auto));
}
.table-tool-grid-two {
grid-template-columns: repeat(2, minmax(58px, auto));
}
.table-tool-group button {
min-height: 26px;
padding: 3px 8px;
border: 1px solid transparent;
border-radius: 3px;
background: transparent;
color: var(--text);
font-size: 11px;
white-space: nowrap;
cursor: pointer;
}
/* icon + label buttons (insert/delete/merge/align/borders) */
.table-tool-row > button,
.table-tool-grid > button,
.table-tool-delete > .table-tool-button {
display: inline-flex;
align-items: center;
justify-content: flex-start;
gap: 5px;
}
.table-tool-row > button svg,
.table-tool-grid > button svg,
.table-tool-delete > .table-tool-button svg {
flex: none;
opacity: 0.9;
}
.table-tool-delete > .table-tool-button {
justify-content: center;
}
.table-tool-group button:hover:not(:disabled) {
border-color: var(--border);
background: var(--hover);
}
.table-tool-group button:disabled {
opacity: 0.35;
cursor: default;
}
.table-tool-group button.danger {
color: #a12622;
}
.table-tool-delete {
min-width: 72px;
}
.table-style-swatches {
display: grid;
grid-template-columns: repeat(6, 28px);
gap: 3px;
align-content: center;
flex: 1;
}
.table-tool-group .table-style-swatch {
box-sizing: border-box;
min-width: 28px;
min-height: 24px;
padding: 0;
border-color: #a6a6a6;
}
.table-tool-group .table-style-clear {
grid-column: span 2;
min-height: 22px;
padding: 1px 5px;
}
/* anchored textboxes (code boxes, callout cards): render the box itself,
text edits happen in place */
.doc-protected-textboxes {
border-color: transparent;
background: transparent;
padding: 2px 0;
cursor: default;
width: fit-content;
max-width: 100%;
}
.doc-protected-textboxes:hover {
border-color: var(--border);
}
.doc-protected.doc-protected-textboxes.ProseMirror-selectednode {
border-color: var(--word-blue);
outline: none;
background: transparent;
}
.doc-textbox {
border: 1px solid transparent;
border-radius: 3px;
padding: 5px 10px;
margin: 2px 0;
max-width: 100%;
cursor: text;
user-select: text;
-webkit-user-select: text;
/* fixed-height boxes (noAutofit) clip overflow instead of growing */
overflow: hidden;
}
.doc-protected-textboxes:not(.doc-content-editing) .doc-textbox,
.doc-protected[data-doc-protected='table']:not(.doc-content-editing) td {
cursor: move;
user-select: none;
-webkit-user-select: none;
}
.doc-content-editing > .doc-move-handle {
opacity: 0;
pointer-events: none;
}
/* the nested tiptap editor inside each box */
.doc-textbox .doc-textbox-editor {
outline: none;
white-space: pre-wrap;
}
.doc-textbox-editor p {
margin: 0;
}
/* Word gives empty w:p elements no line box; only their explicit w:spacing
contributes height. Keeping browser-default <br> line boxes made fixed
textboxes clip valid content far above their actual bottom edge. */
.doc-textbox-editor p:has(> br.ProseMirror-trailingBreak:only-child),
.doc-textbox-para-empty {
height: 0;
min-height: 0;
line-height: 0;
}
.doc-textbox:focus-within {
outline: 2px solid var(--word-blue);
outline-offset: 1px;
}
.doc-textbox-para {
white-space: pre-wrap;
word-break: break-word;
}
/* empty section-break paragraphs: invisible unless hovered/selected */
.doc-protected-sectbreak {
border-color: transparent;
background: transparent;
padding: 0 0 2px;
}
.doc-protected-sectbreak:hover {
border-color: var(--border-strong);
}
.doc-sectbreak-label {
display: block;
font-size: 10px;
color: transparent;
line-height: 1.2;
user-select: none;
}
.doc-protected-sectbreak:hover .doc-sectbreak-label,
.doc-protected-sectbreak.ProseMirror-selectednode .doc-sectbreak-label {
color: var(--text-dim);
}
/* decorative rule drawings (heading underlines, dividers): a plain line */
.doc-protected-rule {
border-color: transparent;
background: transparent;
padding: 4px 0;
}
.doc-protected-rule:hover {
border-color: var(--border-strong);
}
.doc-rule-line {
display: block;
height: 1px;
background: #333;
}
/* field paragraphs whose visible result is rendered directly (TOC lines, page
fields...): no chip frame, dashed outline only on hover */
.doc-protected-field {
border-color: transparent;
background: transparent;
padding: 2px 4px;
cursor: default;
user-select: none;
-webkit-user-select: none;
}
.doc-protected-field:hover {
border-color: var(--border-strong);
}
.doc-toc-line {
display: flex;
align-items: baseline;
gap: 4px;
font-size: 11pt;
line-height: 1.7;
cursor: pointer;
}
.doc-toc-line:hover .doc-toc-title {
color: var(--accent, #2b579a);
text-decoration: underline;
}
.doc-toc-l2 .doc-toc-title {
padding-left: 1.5em;
}
.doc-toc-l3 .doc-toc-title {
padding-left: 3em;
}
.doc-toc-l4 .doc-toc-title {
padding-left: 4.5em;
}
.doc-toc-dots {
flex: 1;
border-bottom: 2px dotted #555;
transform: translateY(-3px);
min-width: 24px;
}
.doc-field-pagebreak {
display: flex;
align-items: center;
gap: 8px;
color: var(--text-tertiary, #999);
font-size: 10px;
user-select: none;
}
.doc-field-pagebreak::before,
.doc-field-pagebreak::after {
content: '';
flex: 1;
border-top: 1px dashed var(--border-strong);
}
.doc-field-text {
font-size: 11pt;
line-height: 1.7;
}
.doc-content-editing .doc-toc-title,
.doc-content-editing .doc-toc-page,
.doc-content-editing .doc-field-text,
.doc-content-editing .doc-formula-token {
cursor: text;
user-select: text;
-webkit-user-select: text;
outline: 1px solid color-mix(in srgb, var(--word-blue) 45%, transparent);
border-radius: 2px;
}
.doc-protected-formula {
padding: 5px 8px;
background: transparent;
}
.doc-formula {
display: inline-flex;
align-items: baseline;
min-height: 24px;
font-family: 'Cambria Math', 'STIX Two Math', serif;
font-size: 16px;
cursor: move;
user-select: none;
-webkit-user-select: none;
}
.doc-content-editing .doc-formula {
cursor: text;
user-select: text;
-webkit-user-select: text;
}
.doc-formula-token:empty::before {
content: '\00a0';
}
/* 2D MathML rendering: shown by default, swapped for the editable token
strip while the block is in content-editing mode */
.doc-formula-wrap {
display: inline-flex;
align-items: center;
}
.doc-formula-math {
display: inline-block;
font-family: 'Cambria Math', 'STIX Two Math', 'Latin Modern Math', serif;
font-size: 16px;
cursor: move;
user-select: none;
-webkit-user-select: none;
}
.doc-formula-math math {
font-family: inherit;
}
.doc-formula.doc-formula-has-math {
display: none;
}
.doc-content-editing .doc-formula.doc-formula-has-math {
display: inline-flex;
}
.doc-content-editing .doc-formula-math {
display: none;
}
/* display equations (oMathPara-style) are centered; inline fallbacks keep flow */
.doc-protected-formula-display {
text-align: center;
}
/* embedded charts: SVG preview + editable data sheet */
.doc-protected-chart {
background: var(--surface, #fff);
}
.doc-chart {
display: flex;
flex-direction: column;
gap: 8px;
}
.doc-chart-title {
font-size: 13pt;
font-weight: 600;
text-align: center;
color: var(--text, #333);
}
.doc-chart-svg {
display: block;
width: 100%;
max-width: 560px;
margin: 0 auto;
height: auto;
}
.doc-chart-grid {
stroke: var(--border, #e0e0e0);
stroke-width: 1;
}
.doc-chart-axis-label {
font:
10px 'Segoe UI',
'PingFang SC',
sans-serif;
fill: var(--text-dim, #888);
}
.doc-chart-data {
border-collapse: collapse;
align-self: center;
font-size: 10pt;
line-height: 1.4;
}
.doc-chart-data th,
.doc-chart-data td {
border: 1px solid var(--border, #d9d9d9);
padding: 2px 10px;
min-width: 52px;
text-align: right;
font-weight: 400;
}
.doc-chart-data th.doc-chart-corner {
border: none;
}
.doc-chart-data th.doc-chart-cat {
font-weight: 600;
text-align: center;
background: color-mix(in srgb, var(--word-blue) 6%, transparent);
}
.doc-chart-data th.doc-chart-name {
font-weight: 600;
text-align: left;
border-left-width: 4px;
border-left-style: solid;
}
.doc-chart-data td.doc-chart-gap {
background: repeating-linear-gradient(
45deg,
transparent,
transparent 4px,
#f0f0f0 4px,
#f0f0f0 8px
);
}
.doc-content-editing .doc-chart-title,
.doc-content-editing .doc-chart-cell {
cursor: text;
user-select: text;
-webkit-user-select: text;
outline: 1px solid color-mix(in srgb, var(--word-blue) 45%, transparent);
border-radius: 2px;
}
.doc-protected.ProseMirror-selectednode {
border: 1px solid var(--word-blue);
outline: 1px solid var(--word-blue);
background: var(--active-bg);
}
.doc-protected-label {
display: inline-block;
font-size: 11px;
color: var(--text-dim);
border: 1px solid var(--border);
border-radius: 3px;
padding: 1px 8px;
margin-right: 10px;
background: var(--surface);
font-family: 'Segoe UI', 'PingFang SC', sans-serif;
}
.doc-protected-preview {
font-size: 12px;
color: var(--text-dim);
cursor: text;
user-select: text;
-webkit-user-select: text;
/* SmartArt degrade lists one node label per line */
white-space: pre-line;
}
/* OLE embed degrade: the packaged preview picture + a friendly type caption */
.doc-protected-ole .doc-ole-wrap {
display: block;
}
.doc-protected-ole .doc-ole-img {
display: block;
max-width: 100%;
margin-bottom: 4px;
}
.doc-protected-img {
max-width: 100%;
display: block;
}
/* image blocks: no chip chrome, selection border with resize handle */
.doc-protected[data-doc-protected='image'] {
border-color: transparent;
background: none;
padding: 2px 0;
}
.doc-protected[data-doc-protected='image']:hover {
border-color: var(--border);
}
.doc-protected[data-doc-protected='image'].ProseMirror-selectednode {
border-color: transparent;
outline: none;
background: none;
}
.doc-img-wrap {
position: relative;
display: inline-block;
max-width: 100%;
}
/* find option toggles (match case / whole word) */
.find-opt {
border: 1px solid var(--border);
background: var(--surface);
border-radius: 3px;
font-size: 11px;
padding: 2px 6px;
cursor: pointer;
color: var(--text-dim, #777);
}
.find-opt.on {
background: var(--word-blue);
border-color: var(--word-blue);
color: #fff;
}
/* data grid of the Insert Chart dialog */
.modal-chart {
min-width: 460px;
}
.chart-data-grid {
border-collapse: collapse;
margin-bottom: 8px;
width: 100%;
}
.chart-data-grid th,
.chart-data-grid td {
border: 1px solid var(--border);
padding: 0;
}
.chart-data-grid input {
border: none;
background: transparent;
width: 90px;
padding: 4px 6px;
font-size: 12px;
}
.chart-data-grid thead input {
font-weight: 600;
}
/* cross-reference (REF field): gray field shading */
.doc-ref-field {
background: rgba(0, 0, 0, 0.07);
border-radius: 2px;
}
.workspace-dark .doc-ref-field {
background: rgba(255, 255, 255, 0.12);
}
/* Bookmark / Cross-reference dialogs */
.modal-row {
display: flex;
gap: 8px;
margin-bottom: 8px;
}
.modal-row input {
flex: 1;
}
.modal-error {
color: #c00000;
font-size: 12px;
margin-bottom: 6px;
}
.bookmark-list {
max-height: 260px;
overflow-y: auto;
border: 1px solid var(--border);
border-radius: 4px;
}
.bookmark-empty {
padding: 14px;
color: var(--text-dim, #888);
font-size: 13px;
}
.bookmark-row {
display: flex;
align-items: center;
gap: 8px;
padding: 5px 10px;
border-bottom: 1px solid var(--border);
}
.bookmark-row:last-child {
border-bottom: none;
}
.bookmark-name {
background: none;
border: none;
color: var(--word-blue);
cursor: pointer;
font-weight: 600;
padding: 0;
}
.bookmark-preview {
flex: 1;
color: var(--text-dim, #888);
font-size: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.bookmark-del {
background: none;
border: none;
cursor: pointer;
color: var(--text-dim, #888);
font-size: 15px;
}
/* text wrap: square uses a real CSS float so following paragraphs wrap automatically; tight/through display approximately as square */
.doc-protected.img-wrap-square-left,
.doc-protected.img-wrap-tight-left,
.doc-protected.img-wrap-through-left {
float: left;
width: fit-content;
max-width: 60%;
margin: 2px 14px 6px 0;
}
.doc-protected.img-wrap-square-right,
.doc-protected.img-wrap-tight-right,
.doc-protected.img-wrap-through-right {
float: right;
width: fit-content;
max-width: 60%;
margin: 2px 0 6px 14px;
}
.doc-protected.img-wrap-topBottom {
text-align: center;
}
/* behind text / in front of text: the flowing canvas has no absolutely positioned layer; reduced opacity as an approximation */
.doc-protected.img-wrap-behind {
opacity: 0.45;
}
.doc-protected[data-doc-protected='image'].ProseMirror-selectednode .doc-img-wrap {
outline: 2px solid var(--word-blue);
}
.img-resize-handle {
display: none;
position: absolute;
right: -6px;
bottom: -6px;
width: 11px;
height: 11px;
background: #fff;
border: 2px solid var(--word-blue);
border-radius: 50%;
cursor: nwse-resize;
z-index: 2;
}
.doc-protected[data-doc-protected='image'].ProseMirror-selectednode .img-resize-handle {
display: block;
}
/* Crop owns the active image controls while its modal is open. */
body.docs-crop-active
.doc-protected[data-doc-protected='image'].ProseMirror-selectednode
.doc-img-wrap {
outline: none;
}
body.docs-crop-active
.doc-protected[data-doc-protected='image'].ProseMirror-selectednode
.img-resize-handle,
body.docs-crop-active
.doc-protected[data-doc-protected='image'].ProseMirror-selectednode
> .doc-move-handle {
display: none !important;
pointer-events: none !important;
}
/* AI diff highlight */
.doc-page .ai-changed {
background: var(--ai-highlight);
box-shadow: -3px 0 0 var(--ai-highlight-border);
}
/* ================= start screen ================= */
.start-screen {
width: 100%;
min-height: 100%;
padding: 9vh 24px 40px;
text-align: center;
background: var(--surface);
font-family: 'Segoe UI', 'PingFang SC', sans-serif;
}
.editor-scroll:has(> .start-screen) {
padding: 0;
background: var(--surface);
}
/* Starting up (while the pending-open check runs): lightweight placeholder, don't flash the start screen */
.start-booting {
display: flex;
align-items: center;
justify-content: center;
color: var(--text-dim);
font-size: 13px;
}
.btn-primary {
height: 34px;
padding: 0 16px;
border: none;
border-radius: 4px;
background: var(--word-blue);
color: #fff;
font-size: 13px;
cursor: pointer;
}
.btn-primary:hover:not(:disabled) {
background: var(--word-blue-dark);
}
.btn-primary:disabled {
opacity: 0.5;
cursor: default;
}
.btn-ghost {
border: none;
background: none;
color: var(--word-blue);
font-size: 13px;
cursor: pointer;
padding: 4px 8px;
border-radius: 3px;
}
.btn-ghost:hover {
background: var(--hover);
}
.btn-sm {
font-size: 12px;
padding: 2px 10px;
height: 26px;
}
.recent {
margin-top: 44px;
text-align: left;
}
.recent-title {
font-size: 12px;
color: var(--text-dim);
margin-bottom: 8px;
font-weight: 600;
}
.recent-item {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
text-align: left;
padding: 9px 12px;
margin-bottom: 3px;
border: none;
border-radius: 4px;
background: var(--surface);
font-size: 13px;
color: var(--text);
cursor: pointer;
}
.recent-item:hover {
background: var(--active-bg);
}
.recent-path {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* ================= AI panel (Copilot-style pane) ================= */
/* Design tokens — AI panel chrome only.
* Canonical names/values from colors_and_type.css; the editor chrome
* around the panel keeps its own editor theme variables. */
:root {
--gs-font-sans:
'Arial', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
sans-serif;
--color-btn-primary: #232425;
--color-btn-primary-hover: #393a3b;
--color-btn-primary-text: #ffffff;
--color-brand-secondary: #0f7fff;
--color-text-primary: #232425;
--color-text-secondary: #606366;
--color-text-tertiary: #909499;
--color-bg-page: #ffffff;
--color-bg-subtle: #f5f5f5;
--color-border-default: #eaeaea;
--color-border-strong: #d0d3d8;
--color-border-brand: #0f7fff;
--color-error: #ef4444;
--radius-8: 8px;
--radius-12: 12px;
--radius-16: 16px;
--radius-30: 30px;
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
--text-body-lg: 18px;
--text-small: 14px;
--text-caption: 12px;
}
.ai-panel {
position: relative;
width: 360px;
flex-shrink: 0;
display: flex;
flex-direction: column;
background: var(--color-bg-page);
/* Same visible divider as the GenOffice Sheets panel: the editor canvas is gray, so the default border would drown */
border-right: 1px solid var(--color-border-strong);
font-family: var(--gs-font-sans);
color: var(--color-text-primary);
}
/* drag handle on the panel's right edge — resize the panel horizontally */
.ai-panel-resizer {
position: absolute;
right: -3px;
top: 0;
bottom: 0;
width: 7px;
cursor: col-resize;
z-index: 20;
background: transparent;
}
/* while dragging: keep the col-resize cursor everywhere, no text selection */
.ai-panel-resizing {
cursor: col-resize;
user-select: none;
}
.ai-panel-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
padding: 10px 12px 10px 14px;
border-bottom: 1px solid var(--color-border-default);
font-weight: 600;
font-size: 14px;
color: var(--color-text-primary);
}
.ai-panel-title {
display: flex;
align-items: center;
gap: 7px;
white-space: nowrap;
}
.ai-panel-header-actions {
display: flex;
align-items: center;
gap: 2px;
min-width: 0;
}
.ai-header-btn {
display: flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
flex-shrink: 0;
border: none;
background: none;
border-radius: var(--radius-8);
color: var(--color-text-secondary);
cursor: pointer;
padding: 0;
transition: all var(--transition-fast);
}
.ai-header-btn:hover {
background: var(--color-bg-subtle);
color: var(--color-text-primary);
}
/* collapsed AI sidebar: thin rail on the left edge */
.ai-rail {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
width: 34px;
padding: 12px 2px;
border: none;
border-right: 1px solid var(--border);
background: var(--surface);
color: var(--text);
cursor: pointer;
flex-shrink: 0;
}
.ai-rail:hover {
background: var(--hover);
}
.ai-rail-text {
writing-mode: vertical-rl;
font-size: 12px;
letter-spacing: 2px;
color: #605e5c;
}
.ai-chat {
flex: 1;
overflow-y: auto;
padding: 32px 16px;
display: flex;
flex-direction: column;
/* uniform 16px flex gap between blocks, messages carry no margin */
gap: 16px;
font-family: var(--gs-font-sans);
}
/* Boundary between the restored transcript and the live turn */
.ai-history-sep {
display: flex;
align-items: center;
justify-content: center;
height: 30px;
font-size: 14px;
color: #999;
}
.ai-chat-empty {
margin-top: 36px;
padding: 0 10px;
text-align: center;
}
.ai-chat-empty-title {
font-size: var(--text-body-lg);
font-weight: 600;
color: var(--color-text-primary);
margin-bottom: 8px;
}
.ai-chat-empty-body {
color: var(--color-text-secondary);
font-size: var(--text-small);
line-height: 1.5;
}
/* clickable starter prompts in the empty state — suggestion chips:
* 30px-radius outline pills, 13px/400 */
.ai-starter-list {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
margin-top: 16px;
}
.ai-starter {
padding: 8px 16px;
border-radius: var(--radius-30);
border: 1px solid var(--color-border-default);
background: var(--color-bg-page);
font-size: 13px;
font-weight: 400;
line-height: 1.4;
color: var(--color-text-primary);
cursor: pointer;
transition: all var(--transition-fast);
}
.ai-starter:hover {
border-color: var(--color-border-strong);
background: var(--color-bg-subtle);
}
.ai-starter:active {
filter: brightness(0.88);
transform: scale(0.98);
}
/* Chat messages (scaled to the 14px panel): user = gray pill, AI = plain text without a bubble, no accent colors */
.ai-msg {
position: relative;
margin: 0;
font-size: 16px;
line-height: 1.6;
white-space: pre-wrap;
word-break: break-word;
}
/* markdown body inside assistant bubbles */
.ai-md {
white-space: normal;
}
.ai-md p,
.ai-md ul,
.ai-md ol {
margin: 0 0 16px;
}
.ai-md :last-child {
margin-bottom: 0;
}
/* blank markdown paragraphs would each eat a 16px margin — the stream never renders them */
.ai-md p:empty {
display: none;
}
.ai-md ul,
.ai-md ol {
margin-bottom: 20px;
padding-left: 20px;
}
.ai-md li {
margin-left: 20px;
line-height: 28px;
}
.ai-md .ai-md-h {
font-weight: 700;
line-height: 1.3;
margin: 20px 0 8px;
}
.ai-md .ai-md-h:first-child {
margin-top: 0;
}
/* inline code: neutral gray chip (deliberately not red), 2px below body size */
.ai-md code {
padding: 1px 6px;
border-radius: 4px;
background: var(--color-bg-subtle);
color: var(--color-text-secondary);
font-size: 14px;
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}
/* User pill: gray, fully rounded (no tail) */
.ai-msg-user {
align-self: flex-end;
background: var(--color-bg-subtle);
color: var(--color-text-primary);
padding: 8px 16px;
border-radius: 14px;
max-width: 80%;
line-height: 1.5;
}
.ai-msg-assistant {
align-self: stretch;
background: none;
border: none;
padding: 0;
max-width: 100%;
color: var(--color-text-primary);
}
/* tool activity chips inside assistant bubbles */
/* Collapsible tool-activity group */
.ai-work-group {
display: flex;
flex-direction: column;
align-items: flex-start;
margin-top: 12px;
}
.ai-msg-assistant .ai-work-group:first-child,
.ai-work-group:only-child {
margin-top: 0;
}
.ai-work-group-summary {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 4px 0;
margin: 0;
background: none;
border: none;
cursor: pointer;
user-select: none;
font-family: inherit;
font-size: 14px;
line-height: 1.5;
color: #909499;
transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-work-group-summary:hover {
color: #606366;
}
.ai-work-group-summary:focus-visible {
outline: none;
box-shadow: 0 0 0 3px rgba(35, 36, 37, 0.2);
border-radius: 4px;
}
.ai-work-group-summary.running {
color: #606366;
}
.ai-work-group-summary.running .ai-work-group-label {
animation: ai-summary-pulse 1500ms linear infinite;
}
@keyframes ai-summary-pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.45;
}
}
.ai-work-group-body {
align-self: stretch;
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-work-group-body.open {
grid-template-rows: 1fr;
}
.ai-work-group-body-inner {
overflow: hidden;
min-height: 0;
padding: 0 0 0 8px;
transition: padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-work-group-body.open .ai-work-group-body-inner {
padding: 4px 0 8px 8px;
}
/* Step rows inside the group: 20px icon slot + 1px connector */
.ai-step-row {
position: relative;
display: flex;
align-items: flex-start;
gap: 12px;
padding: 8px 0;
color: #909499;
animation: ai-row-ease-in 320ms ease-out;
}
.ai-step-row:not(:last-child) {
padding-bottom: 16px;
}
.ai-step-row:not(:last-child)::after {
content: '';
position: absolute;
left: 9.5px;
top: 32px;
bottom: -4px;
width: 1px;
background: #eaeaea;
}
.ai-step-icon {
flex-shrink: 0;
width: 20px;
height: 20px;
display: inline-flex;
align-items: center;
justify-content: center;
color: #909499;
}
.ai-step-icon.done {
color: #606366;
}
.ai-step-icon.error {
color: #b91c1c;
}
.ai-step-icon.running svg {
animation: ai-hourglass-flip 1.8s ease-in-out infinite;
}
@keyframes ai-hourglass-flip {
0%,
12% {
transform: rotate(0);
}
44%,
56% {
transform: rotate(180deg);
}
88%,
100% {
transform: rotate(360deg);
}
}
.ai-step-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 6px;
padding-top: 1px;
}
.ai-step-title {
font-size: 14px;
line-height: 1.3;
color: #606366;
text-align: left;
background: none;
border: none;
padding: 0;
margin: 0;
font-family: inherit;
}
.ai-step-title.clickable {
cursor: pointer;
transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-step-title.clickable:hover {
color: #232425;
}
.ai-step-title.clickable:focus-visible {
outline: none;
box-shadow: 0 0 0 3px rgba(35, 36, 37, 0.2);
border-radius: 4px;
}
/* Step detail opens instantly, no animation */
.ai-step-detail {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 8px;
}
@media (prefers-reduced-motion: reduce) {
.ai-step-row,
.ai-step-icon.running svg,
.ai-work-group-summary.running .ai-work-group-label {
animation: none;
}
}
/* Running tool row: two grow/shrink brand dots */
.ai-tool-chip-spinner {
flex-shrink: 0;
display: inline-flex;
align-items: center;
gap: 2px;
height: 12px;
}
.ai-tool-chip-spinner::before,
.ai-tool-chip-spinner::after {
content: '';
width: 12px;
height: 12px;
border-radius: 50%;
background: #0f7fff;
}
.ai-tool-chip-spinner::before {
animation: ai-tool-dot-grow 2s infinite;
}
.ai-tool-chip-spinner::after {
animation: ai-tool-dot-shrink 2s infinite;
}
@keyframes ai-tool-dot-grow {
0%,
100% {
transform: scale(0.333);
opacity: 0.45;
}
50% {
transform: scale(1);
opacity: 1;
}
}
@keyframes ai-tool-dot-shrink {
0%,
100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(0.333);
opacity: 0.45;
}
}
@media (prefers-reduced-motion: reduce) {
.ai-tool-chip-spinner::before,
.ai-tool-chip-spinner::after {
animation: none;
opacity: 0.65;
}
}
/* Elapsed run time next to the typing indicator */
.ai-typing-row {
display: inline-flex;
align-items: baseline;
gap: 8px;
}
.ai-elapsed {
font-size: 14px;
color: var(--text-dim);
font-variant-numeric: tabular-nums;
}
/* caret: text glyph right after the label, always visible, rotates open */
.ai-tool-chip-caret {
margin-left: 4px;
opacity: 0.7;
display: inline-block;
transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-tool-chip-caret.open {
transform: rotate(90deg);
}
/* stream rows ease in */
@keyframes ai-row-ease-in {
from {
opacity: 0;
transform: translateY(5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* expanded step detail: subtle gray card, no border */
.ai-tool-output {
background: #f5f5f5;
border: none;
border-radius: 12px;
font-family:
ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
font-size: 14px;
color: #232425;
max-height: 300px;
overflow-y: auto;
width: 100%;
box-sizing: border-box;
}
.ai-tool-output-pre {
padding: 12px 16px;
white-space: pre-wrap;
word-break: break-word;
line-height: 1.5;
}
/* streaming typing indicator */
/* Thinking indicator (white background, no container):
* phase one = two bouncing blue dots (alternating small/large); phase two = shimmering "Thinking…" text + streaming caret block */
.ai-typing {
display: inline-flex;
align-items: center;
padding: 4px 0;
font-size: 15px;
} /* Thinking indicator: shimmer label above two grow/shrink dots */
.ai-typing {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 6px;
padding: 4px 0;
}
.ai-typing-label {
display: inline-block;
position: relative;
font-size: 14px;
line-height: 1;
letter-spacing: 0.01em;
color: #666;
-webkit-text-fill-color: transparent;
background: #666 -webkit-gradient(
linear,
100% 0,
0 0,
from(#666),
color-stop(0.5, #d9d9d9),
to(#666)
);
background-clip: text;
-webkit-background-clip: text;
background-repeat: no-repeat;
background-size: 70% 100%;
animation: ai-thinking-shimmer 1.2s infinite alternate linear;
}
.ai-typing-elapsed {
font-variant-numeric: tabular-nums;
}
@keyframes ai-thinking-shimmer {
0% {
background-position: -100% top;
}
100% {
background-position: 250% top;
}
}
.ai-typing-dots {
height: 12px;
display: flex;
gap: 2px;
}
.ai-typing-dot-slot {
display: flex;
justify-content: center;
align-items: center;
width: 12px;
}
.ai-typing-dot-grow,
.ai-typing-dot-shrink {
background: #0f7fff;
border-radius: 50%;
}
.ai-typing-dot-grow {
animation: ai-dot-grow 2s infinite;
}
.ai-typing-dot-shrink {
animation: ai-dot-shrink 2s infinite;
}
@keyframes ai-dot-grow {
0%,
100% {
width: 4px;
height: 4px;
opacity: 0.45;
}
50% {
width: 12px;
height: 12px;
opacity: 1;
}
}
@keyframes ai-dot-shrink {
0%,
100% {
width: 12px;
height: 12px;
opacity: 1;
}
50% {
width: 4px;
height: 4px;
opacity: 0.45;
}
}
/* streaming caret at the tail of streaming assistant text */
.ai-msg-streaming .ai-md > :last-child::after {
content: '';
display: inline-block;
width: 6px;
height: 1em;
margin-left: 2px;
border-radius: 1px;
background: #606366;
vertical-align: text-bottom;
animation: ai-caret-blink 900ms steps(1, end) infinite;
}
@keyframes ai-caret-blink {
0%,
50% {
opacity: 1;
}
51%,
100% {
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.ai-typing-label,
.ai-msg-streaming .ai-md > :last-child::after {
animation: none;
}
}
/* hover actions under assistant messages (copy / regenerate):
* borderless 30px icon buttons, radius 8, hover = subtle gray fill */
.ai-msg-toolbar {
display: flex;
gap: 4px;
margin-top: 8px;
}
.ai-msg-tool-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 3px;
height: 30px;
min-width: 30px;
padding: 5px;
border: none;
border-radius: 8px;
background: transparent;
color: var(--color-text-secondary);
font-size: 13px;
cursor: pointer;
transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-msg-tool-btn svg {
width: 20px;
height: 20px;
}
.ai-msg-tool-btn:hover {
background: var(--color-bg-subtle);
}
.ai-msg-tool-btn:focus-visible {
outline: none;
box-shadow: 0 0 0 3px rgba(74, 141, 246, 0.3);
}
/* Tooltip: dark pill under the button, 0.3s hover delay */
.ai-msg-tool-btn {
position: relative;
}
.ai-msg-tool-btn::after {
content: attr(data-tip);
position: absolute;
top: 100%;
left: 50%;
translate: -50% 0;
margin-top: 6px;
padding: 4px 8px;
background: #232425;
color: #fff;
font-size: 12px;
line-height: 1.5;
border-radius: 10px;
box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
white-space: nowrap;
pointer-events: none;
opacity: 0;
visibility: hidden;
transition: opacity 0.15s ease;
transition-delay: 0s;
z-index: 10;
}
.ai-msg-tool-btn:hover::after {
opacity: 1;
visibility: visible;
transition-delay: 0.3s;
}
/* Global press feedback */
.ai-msg-tool-btn:active {
filter: brightness(0.88);
transform: scale(0.98);
}
.ai-continue-btn {
margin-top: 8px;
padding: 5px 12px;
border: 1px solid var(--word-blue);
border-radius: 6px;
background: var(--word-blue);
color: #fff;
font-size: 13px;
font-weight: 600;
cursor: pointer;
}
.ai-continue-btn:hover {
filter: brightness(0.94);
}
.ai-versions {
border-top: 1px solid var(--border);
padding: 8px 14px 10px;
max-height: 150px;
overflow-y: auto;
background: rgba(246, 248, 252, 0.7);
}
.ai-versions-title {
display: flex;
align-items: center;
gap: 5px;
font-size: 11.5px;
font-weight: 600;
color: var(--text-dim);
margin-bottom: 4px;
}
.ai-version-row {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
font-size: 12px;
padding: 4px 8px;
margin: 0 -8px;
border-radius: 6px;
}
.ai-version-row:hover {
background: var(--hover);
}
.ai-version-label {
display: flex;
align-items: baseline;
gap: 8px;
overflow: hidden;
white-space: nowrap;
color: var(--text);
min-width: 0;
}
.ai-version-label > :last-child {
overflow: hidden;
text-overflow: ellipsis;
}
.ai-version-time {
flex-shrink: 0;
font-size: 11px;
color: var(--text-dim);
font-variant-numeric: tabular-nums;
}
.ai-version-rollback {
flex-shrink: 0;
border: none;
background: none;
color: var(--word-blue);
font-size: 12px;
padding: 2px 8px;
border-radius: 5px;
cursor: pointer;
}
.ai-version-rollback:hover {
background: var(--active-bg);
}
.ai-msg-error {
margin-top: 6px;
color: #c62828;
font-size: 13px;
}
.ai-msg-actions {
margin-top: 8px;
display: flex;
gap: 6px;
}
.ai-msg-raw {
margin-top: 6px;
font-size: 11px;
}
.ai-msg-raw summary {
cursor: pointer;
color: var(--text-dim);
border-radius: 4px;
padding: 1px 4px;
margin: 0 -4px;
user-select: none;
}
.ai-msg-raw summary:hover {
background: var(--hover);
color: var(--text);
}
.ai-msg-raw pre {
margin: 4px 0 0;
padding: 6px 8px;
border-radius: 6px;
background: #f8f8f8;
border: 1px solid var(--border);
max-height: 200px;
overflow: auto;
white-space: pre-wrap;
word-break: break-all;
font-size: 10.5px;
color: var(--text-dim);
}
.ai-applied-tag {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 11px;
color: #2e7d32;
background: #e6f2e6;
border-radius: 999px;
padding: 2px 9px;
}
.ai-applied-tag::before {
content: '✓';
font-size: 10px;
}
/* Composer floats over the chat scroll area — no top border (agent-shell §4.6) */
.ai-composer {
border-top: none;
padding: 8px 12px 12px;
background: var(--color-bg-page);
}
.ai-composer-top {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 5px;
margin-bottom: 7px;
}
/* scope chip — guidance accent (blue is reserved for guidance/onboarding) */
.ai-scope-hint {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 3px 10px;
border-radius: var(--radius-30);
background: rgba(15, 127, 255, 0.08);
font-size: var(--text-caption);
color: var(--color-brand-secondary);
font-weight: 500;
}
.ai-scope-hint::before {
content: '';
width: 5px;
height: 5px;
border-radius: 50%;
background: currentColor;
}
/* composer card — 16px radius, default border, production float shadow */
.ai-input-box {
border: 1px solid var(--color-border-default);
border-radius: var(--radius-16);
background: var(--color-bg-page);
box-shadow: 0 6px 30px rgba(0, 0, 0, 0.08);
transition:
border-color var(--transition-fast),
box-shadow var(--transition-fast);
}
/* textarea: 15px / 21px fixed line-height, auto-grow band
* (resting height matches the sheets panel, 25% taller than default) */
.ai-input-box textarea {
display: block;
width: 100%;
resize: none;
border: none;
background: none;
border-radius: var(--radius-16) var(--radius-16) 0 0;
padding: 12px 14px 4px;
font-size: 15px;
font-weight: 500;
font-family: inherit;
line-height: 21px;
outline: none;
color: var(--color-text-primary);
min-height: 64px;
max-height: 147px;
overflow-y: auto;
}
.ai-input-box textarea::placeholder {
color: var(--color-text-tertiary);
}
.ai-input-footer {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 8px 8px 10px;
}
.ai-input-footer .ai-send-btn {
margin-left: auto;
}
/* attach — brand-supplied paperclip art, 20×20 (5/9 of the 36px enter button), same as the sheets panel */
.ai-attach-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
flex-shrink: 0;
border: none;
background: transparent;
cursor: pointer;
padding: 0;
transition: all var(--transition-fast);
}
.ai-attach-btn img {
display: block;
width: 100%;
height: 100%;
}
.ai-attach-btn:hover {
filter: brightness(0.7);
}
/* track-changes pill: quiet gray when off, guide-blue tinted when on */
.ai-track-btn {
display: inline-flex;
align-items: center;
gap: 5px;
height: 24px;
padding: 0 10px;
flex-shrink: 0;
border: 1px solid var(--color-border-default);
border-radius: var(--radius-30);
background: none;
color: var(--color-text-secondary);
font-size: var(--text-caption);
font-weight: 500;
cursor: pointer;
transition: all var(--transition-fast);
}
.ai-track-btn:hover {
background: var(--color-bg-subtle);
color: var(--color-text-primary);
}
.ai-track-btn .ai-track-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--color-border-strong);
}
.ai-track-btn.on {
border-color: rgba(15, 127, 255, 0.4);
background: rgba(15, 127, 255, 0.06);
color: var(--color-brand-secondary);
}
.ai-track-btn.on .ai-track-dot {
background: var(--color-brand-secondary);
}
/* attachment chips above the composer */
.ai-attachments {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-bottom: 7px;
}
.ai-attachment-chip {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 2px 4px 2px 9px;
border-radius: 999px;
border: 1px solid var(--border);
background: #f6f8fc;
font-size: 11.5px;
color: var(--text);
max-width: 100%;
}
.ai-attachment-chip svg {
flex-shrink: 0;
color: var(--word-blue);
}
.ai-attachment-remove {
display: inline-flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
border: none;
border-radius: 50%;
background: none;
color: var(--text-dim);
font-size: 13px;
line-height: 1;
cursor: pointer;
padding: 0;
}
.ai-attachment-remove:hover {
background: var(--hover);
color: var(--text);
}
.ai-attach-notice {
margin-bottom: 7px;
font-size: 11.5px;
color: #c62828;
}
/* whole-panel drop target highlight */
.ai-panel-dragover {
outline: 2px dashed var(--word-blue);
outline-offset: -4px;
}
.ai-input-hint {
font-size: var(--text-caption);
color: var(--color-text-tertiary);
user-select: none;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* icon-only enter key: transparent button chrome, visuals come from brand-supplied PNGs
* (gray arrow = disabled, black arrow = enabled), 36×36, same as the sheets panel */
.ai-send-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
padding: 0;
flex-shrink: 0;
border: none;
border-radius: 35%;
background: transparent;
cursor: pointer;
transition: all var(--transition-fast);
}
.ai-send-btn img {
display: block;
width: 100%;
height: 100%;
}
.ai-send-btn:hover:not(:disabled) {
filter: brightness(0.92);
}
.ai-send-btn:active:not(:disabled) {
filter: brightness(0.88);
transform: scale(0.98);
}
.ai-send-btn:disabled {
cursor: default;
}
/* Stop button while generating: brand-supplied art (white square on black), transparent button chrome */
.ai-send-btn.ai-stop-btn {
background: transparent;
}
.ai-send-btn.ai-stop-btn:hover {
filter: brightness(0.92);
}
/* ================= status bar ================= */
.status-bar {
flex-shrink: 0;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 12px;
height: 24px;
font-size: 11.5px;
/* neutral chrome, unified with slides/sheets — no app-brand tint */
color: #605e5c;
background: #f3f4f6;
border-top: 1px solid #e1e4e8;
}
.status-left {
display: flex;
align-items: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.status-item {
margin-right: 14px;
flex-shrink: 0;
}
/* Word: clicking the word count in the status bar opens the word-count dialog */
.status-wordcount {
border: none;
background: none;
color: inherit;
font: inherit;
padding: 0;
cursor: pointer;
}
.status-wordcount:hover {
text-decoration: underline;
}
.status-msg {
opacity: 0.85;
overflow: hidden;
text-overflow: ellipsis;
}
.status-right {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
.zoom-btn {
border: none;
background: none;
color: inherit;
font-size: 14px;
cursor: pointer;
width: 20px;
height: 20px;
border-radius: 3px;
line-height: 1;
}
.zoom-btn:hover {
background: rgba(0, 0, 0, 0.08);
}
.zoom-slider {
width: 110px;
accent-color: #8a8886;
height: 3px;
}
.zoom-value {
min-width: 38px;
text-align: right;
}
/* ================= modal ================= */
.modal-backdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.modal {
width: 440px;
background: var(--surface);
border-radius: 8px;
padding: 22px 24px;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.modal h2 {
margin: 0 0 16px;
font-size: 17px;
}
.modal label {
display: block;
font-size: 12px;
color: var(--text-dim);
margin-bottom: 12px;
}
.modal input {
display: block;
width: 100%;
margin-top: 4px;
height: 34px;
border: 1px solid var(--border-strong);
border-radius: 4px;
padding: 0 10px;
font-size: 13px;
outline: none;
}
.modal input:focus {
border-color: var(--word-blue);
}
.modal select {
display: block;
width: 100%;
margin-top: 4px;
height: 34px;
border: 1px solid var(--border-strong);
border-radius: 4px;
padding: 0 6px;
font-size: 13px;
outline: none;
background: var(--surface);
}
.modal-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 18px;
}
.modal select {
display: block;
width: 100%;
margin-top: 4px;
height: 34px;
border: 1px solid var(--border-strong);
border-radius: 4px;
padding: 0 6px;
font-size: 13px;
outline: none;
background: var(--surface);
}
.modal select:focus {
border-color: var(--word-blue);
}
/* provider tabs in AI settings */
.provider-tabs {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 16px;
}
.provider-tab {
display: inline-flex;
align-items: center;
gap: 5px;
border: 1px solid var(--border-strong);
background: var(--surface);
border-radius: 999px;
padding: 5px 13px;
font-size: 12.5px;
cursor: pointer;
color: inherit;
}
.provider-tab:hover {
border-color: var(--word-blue);
}
.provider-tab-active {
border-color: var(--word-blue);
background: color-mix(in srgb, var(--word-blue) 10%, var(--surface));
color: var(--word-blue);
font-weight: 600;
}
.provider-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #2e9e44;
}
/* ProseMirror basics */
.ProseMirror {
white-space: pre-wrap;
}
.ProseMirror:focus {
outline: none;
}
/* ---- find & replace ---- */
.find-panel {
position: absolute;
top: 8px;
right: 20px;
z-index: 60;
/* the panel overlaps the ribbon-tabs row, which is a window drag region;
* drag regions hit-test by rectangle regardless of z-order and would
* swallow every click (notably the × close button) */
-webkit-app-region: no-drag;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 6px;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
padding: 8px 10px;
display: flex;
flex-direction: column;
gap: 6px;
}
.workspace {
position: relative;
}
.find-row {
display: flex;
align-items: center;
gap: 6px;
}
.find-input {
width: 200px;
height: 28px;
border: 1px solid var(--border-strong);
border-radius: 4px;
padding: 0 8px;
font-size: 13px;
outline: none;
}
.find-input:focus {
border-color: var(--word-blue);
}
.find-count {
min-width: 44px;
font-size: 11px;
color: var(--text-dim);
text-align: center;
}
.find-btn {
width: 24px;
height: 24px;
border: none;
background: none;
border-radius: 4px;
cursor: pointer;
font-size: 15px;
line-height: 1;
color: var(--text);
}
.find-btn:hover:not(:disabled) {
background: var(--hover);
}
.find-btn:disabled {
color: var(--border-strong);
cursor: default;
}
.find-close {
font-size: 12px;
}
.find-action {
height: 26px;
padding: 0 10px;
border: 1px solid var(--border-strong);
border-radius: 4px;
background: var(--surface);
cursor: pointer;
font-size: 12px;
white-space: nowrap;
}
.find-action:hover:not(:disabled) {
background: var(--hover);
}
.find-action:disabled {
color: var(--border-strong);
cursor: default;
}
.search-hit {
background: #ffe28a;
border-radius: 2px;
}
.search-hit-active {
background: #ff9632;
color: #fff;
}
/* ---- autosave toggle (pill in the title bar) ---- */
.autosave-toggle {
display: flex;
align-items: center;
gap: 5px;
cursor: pointer;
margin-right: 4px;
-webkit-app-region: no-drag;
user-select: none;
}
.autosave-toggle input {
display: none;
}
.autosave-knob {
width: 26px;
height: 14px;
border-radius: 7px;
background: var(--border-strong);
position: relative;
transition: background 0.15s;
}
.autosave-knob::after {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 10px;
height: 10px;
border-radius: 50%;
background: #fff;
transition: left 0.15s;
}
.autosave-toggle.on .autosave-knob {
background: var(--word-blue);
}
.autosave-toggle.on .autosave-knob::after {
left: 14px;
}
.autosave-text {
font-size: 11px;
color: var(--text-dim);
white-space: nowrap;
}
/* ---- editable table cells ---- */
.doc-table td[contenteditable='true'] {
cursor: text;
user-select: text;
-webkit-user-select: text;
}
.doc-table td[contenteditable='true']:focus {
outline: 2px solid var(--word-blue);
outline-offset: -2px;
}
/* ---- print / export PDF: only the document itself ---- */
@media print {
html,
body,
#root {
height: auto !important;
overflow: visible !important;
background: none !important;
}
.ribbon,
.status-bar,
.ai-panel,
.ai-rail,
.nav-pane,
.ruler,
.find-panel {
display: none !important;
}
.app,
.workspace,
.editor-scroll {
display: block !important;
overflow: visible !important;
height: auto !important;
padding: 0 !important;
background: none !important;
}
.doc-zoom {
zoom: 1 !important;
width: auto !important;
}
.page-wrap {
margin: 0 !important;
}
.doc-page {
width: auto !important;
min-height: 0 !important;
box-shadow: none !important;
margin: 0 !important;
}
/* Direct PDF uses the same section page box as the editor. Preview export
already supplies one fixed-size .pv-page per sheet and keeps its clone fluid. */
.app:not(:has(.pagination-preview)) .doc-page {
min-height: var(--page-h, 1056px) !important;
}
.page-break-before {
break-before: page;
}
.doc-field-pagebreak {
break-after: page;
visibility: hidden;
height: 0;
margin: 0;
padding: 0;
}
.img-resize-handle {
display: none !important;
}
/* continuous-flow printing still delegates to Chromium auto-pagination; canvas page gaps don't take part */
.page-gap {
display: none !important;
}
/* mixed-paper grouped export: pages outside the current group don't print */
.pv-page.pv-print-skip {
display: none !important;
}
/* with the pagination preview open, print its output: each .pv-page is exactly one sheet */
.app:has(.pagination-preview) > *:not(.pagination-preview) {
display: none !important;
}
/* print fragmentation supports flex containers poorly; preview shells all degrade to plain blocks */
.pagination-preview {
position: static;
background: none;
display: block;
}
.pv-scroll {
display: block;
}
.pv-toolbar {
display: none !important;
}
.pv-scroll {
overflow: visible;
padding: 0;
}
.pv-page {
margin: 0;
box-shadow: none;
break-after: page;
/* 2px shorter than the paper, so print rounding overflow doesn't produce blank pages */
height: calc(var(--pv-page-h, 1056px) - 2px) !important;
}
.pv-page:last-child {
break-after: auto;
}
.pv-pageno {
display: none;
}
/* forced breaks are disabled inside the clone, and page-break fields keep placeholders matching canvas measurement */
.pv-clip .page-break-before {
break-before: auto;
}
.pv-clip .doc-field-pagebreak {
break-after: auto;
height: auto;
}
.editor-area {
display: block !important;
overflow: visible !important;
height: auto !important;
}
.split-pane,
.read-exit {
display: none !important;
}
}
/* ================= View tab: view modes / gridlines / split / windows ================= */
/* editor column: document scroller on top, optional split pane below */
.editor-area {
flex: 1;
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
}
/* ---- Read mode: chrome hidden, document only, Esc to exit ---- */
.read-mode .ribbon,
.read-mode .ai-panel,
.read-mode .ai-rail,
.read-mode .nav-pane,
.read-mode .find-panel,
.read-mode .comments-pane,
.read-mode .split-pane {
display: none !important;
}
.read-mode .editor-scroll {
background: #f5f1e8;
padding-top: 44px;
}
.read-exit {
position: fixed;
top: 52px;
right: 24px;
z-index: 60;
height: 30px;
padding: 0 14px;
border: 1px solid var(--border-strong);
border-radius: 15px;
background: var(--surface);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
font-size: 12px;
color: var(--text);
cursor: pointer;
}
.read-exit:hover {
background: var(--hover);
}
/* ---- Web Layout: document fills the window width, no page chrome ---- */
.view-web {
width: 100%;
}
.view-web .doc-page {
width: auto;
min-height: 0;
box-shadow: none;
padding: 24px 40px 80px;
}
.view-web .page-hf {
display: none;
}
/* ---- Outline view: headings only, still editable ---- */
.view-outline .doc-page > :not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
display: none;
}
.view-outline .doc-page {
min-height: 400px;
column-count: auto;
}
.view-outline .doc-page h1,
.view-outline .doc-page h2,
.view-outline .doc-page h3,
.view-outline .doc-page h4,
.view-outline .doc-page h5,
.view-outline .doc-page h6 {
position: relative;
padding-left: 22px;
}
.view-outline .doc-page h1 {
margin-left: 0;
}
.view-outline .doc-page h2 {
margin-left: 26px;
}
.view-outline .doc-page h3 {
margin-left: 52px;
}
.view-outline .doc-page h4 {
margin-left: 78px;
}
.view-outline .doc-page h5 {
margin-left: 104px;
}
.view-outline .doc-page h6 {
margin-left: 130px;
}
/* Word outline view marks each heading with a ⊕ handle */
.view-outline .doc-page h1::before,
.view-outline .doc-page h2::before,
.view-outline .doc-page h3::before,
.view-outline .doc-page h4::before,
.view-outline .doc-page h5::before,
.view-outline .doc-page h6::before {
content: '⊕';
position: absolute;
left: 0;
color: #8a8886;
font-size: 0.8em;
top: 0.25em;
}
/* ---- Gridlines: alignment grid inside the text area (content-box = inside margins) ---- */
.show-grid .doc-page {
background-image:
linear-gradient(to right, rgba(43, 124, 211, 0.13) 1px, transparent 1px),
linear-gradient(to bottom, rgba(43, 124, 211, 0.13) 1px, transparent 1px);
background-size: 24px 24px;
background-origin: content-box;
background-clip: content-box;
}
/* ---- Split: read-only second pane with independent scrolling ---- */
.split-pane {
height: 42%;
min-height: 160px;
flex: none;
display: flex;
flex-direction: column;
border-top: 3px solid var(--border-strong);
background: var(--canvas);
}
.split-pane-bar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 3px 12px;
font-size: 11.5px;
color: var(--text-dim);
background: var(--surface);
border-bottom: 1px solid var(--border);
}
.split-pane-close {
border: none;
background: none;
cursor: pointer;
font-size: 15px;
line-height: 1;
color: var(--text);
padding: 0 4px;
}
.split-pane-close:hover {
color: var(--word-blue);
}
.split-pane-scroll {
flex: 1;
overflow-y: auto;
padding: 18px 24px 60px;
}
/* preview copy: not interactive (clicks/links disabled) */
.split-doc {
pointer-events: none;
}
/* ---- Design → Watermark: diagonal ghost text across the page ---- */
.page-watermark {
position: absolute;
inset: 0;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
transform: rotate(-35deg);
font-size: 84px;
font-weight: 600;
letter-spacing: 0.1em;
color: rgba(128, 128, 128, 0.18);
white-space: nowrap;
overflow: hidden;
pointer-events: none;
user-select: none;
}
/* ---- Design → Themes/Colors: accent color preview dots in dropdowns ---- */
.theme-accent-row {
display: inline-flex;
gap: 2px;
margin-right: 8px;
vertical-align: middle;
}
.theme-accent-dot {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 2px;
border: 1px solid rgba(0, 0, 0, 0.12);
}
/* ---- References → Footnotes/Endnotes: reference marker + page-bottom notes area ---- */
.doc-note-ref {
color: var(--word-blue);
cursor: default;
}
.doc-note-ref.ProseMirror-selectednode {
outline: 2px solid var(--word-blue);
border-radius: 2px;
}
/* ---- Phonetic guide (w:ruby): native ruby, kept from stretching the line ---- */
ruby.doc-ruby {
ruby-position: over;
}
ruby.doc-ruby rt {
font-size: 0.5em;
line-height: 1;
}
ruby.doc-ruby.ProseMirror-selectednode {
outline: 2px solid var(--word-blue);
border-radius: 2px;
}
/* ---- Inline equations: atomic MathML node flowing with the text ---- */
.doc-inline-math {
display: inline-block;
vertical-align: baseline;
padding: 0 1px;
border-radius: 2px;
cursor: default;
}
.doc-inline-math:hover {
background: color-mix(in srgb, var(--word-blue) 10%, transparent);
}
.doc-inline-math.ProseMirror-selectednode {
outline: 2px solid var(--word-blue);
background: color-mix(in srgb, var(--word-blue) 14%, transparent);
}
.doc-inline-math math {
font-size: 1em;
}
.doc-formula-edit {
position: absolute;
top: 2px;
right: 2px;
padding: 1px 6px;
font-size: 11px;
border: 1px solid var(--border-strong);
border-radius: 4px;
background: var(--surface);
color: var(--text-dim, #666);
cursor: pointer;
opacity: 0;
transition: opacity 0.12s;
}
.doc-protected-formula {
position: relative;
}
.doc-protected-formula:hover .doc-formula-edit {
opacity: 1;
}
.doc-formula-edit:hover {
background: var(--active-bg);
color: var(--text);
}
.page-notes {
position: relative;
box-sizing: border-box;
width: var(--page-w, 816px);
margin: -100px auto 0;
padding: 8px 96px 28px;
background: var(--page-bg, var(--surface));
font-size: 9pt;
line-height: 1.5;
color: #333;
}
.page-notes::before {
content: '';
display: block;
width: 33%;
border-top: 1px solid #888;
margin-bottom: 6px;
}
.page-notes-label {
margin-top: 8px;
font-weight: 600;
color: #555;
}
/* endnotes follow the footnote block as their own area: cancel the pull-up overlap and stack below */
.page-notes + .page-endnotes {
margin-top: 0;
padding-top: 0;
}
.page-endnotes .page-notes-label {
margin-top: 0;
margin-bottom: 4px;
}
.page-note {
display: flex;
align-items: baseline;
gap: 6px;
padding: 1px 0;
}
.page-note sup {
flex: none;
color: var(--word-blue);
}
.page-note-text {
flex: 1;
white-space: pre-wrap;
word-break: break-word;
}
.page-note-btn {
flex: none;
border: none;
background: none;
padding: 0 3px;
font-size: 11px;
color: #999;
cursor: pointer;
visibility: hidden;
}
.page-note:hover .page-note-btn {
visibility: visible;
}
.page-note-btn:hover {
color: var(--word-blue);
}
/* ---- References → Index: XE marks (invisible in Word, a small chip on screen) ---- */
.doc-xe-mark {
display: inline-block;
font-size: 9px;
line-height: 1.3;
color: #8a6d3b;
background: #fdf6e3;
border: 1px dashed #d5c48a;
border-radius: 2px;
padding: 0 3px;
margin: 0 1px;
vertical-align: baseline;
cursor: default;
}
.doc-xe-mark::before {
content: 'XE:' attr(data-xe-term);
}
.doc-xe-mark.ProseMirror-selectednode {
outline: 2px solid var(--word-blue);
}
/* ---- Context menu: editor right-click menu ---- */
.ctx-menu {
position: fixed;
z-index: 200;
padding: 5px 0;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 8px;
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
font-size: 13px;
}
.ctx-item {
display: flex;
align-items: center;
width: 100%;
border: none;
background: none;
padding: 6px 14px;
font-size: 13px;
color: var(--text);
cursor: pointer;
text-align: left;
white-space: nowrap;
}
.ctx-item:hover:not(:disabled) {
background: var(--word-blue);
color: #fff;
}
.ctx-item:hover:not(:disabled) .ctx-key {
color: rgba(255, 255, 255, 0.75);
}
.ctx-item:disabled {
color: var(--text-dim);
opacity: 0.55;
cursor: default;
}
.ctx-label {
flex: 1;
margin-right: 28px;
}
.ctx-key {
color: var(--text-dim);
font-size: 12px;
}
.ctx-arrow {
margin-left: 6px;
color: var(--text-dim);
}
.ctx-sep {
height: 1px;
margin: 4px 10px;
background: var(--border);
}
.ctx-item-wrap {
position: relative;
}
.ctx-submenu {
position: absolute;
top: -5px;
left: calc(100% - 4px);
min-width: 150px;
padding: 5px 0;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: 8px;
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}
/* ---- Font / Paragraph dialogs ---- */
.font-dialog-row {
display: flex;
gap: 12px;
align-items: flex-end;
}
.font-dialog-row > label {
flex: 1;
min-width: 0;
}
.font-check {
display: flex !important;
align-items: center;
gap: 5px;
white-space: nowrap;
flex: none !important;
padding-bottom: 8px;
}
.font-check input[type='checkbox'] {
display: inline-block;
width: auto;
height: auto;
margin: 0;
}
.font-color-input {
padding: 2px !important;
cursor: pointer;
}
.font-preview {
margin: 4px 0 14px;
padding: 14px 10px;
border: 1px solid var(--border);
border-radius: 4px;
text-align: center;
overflow: hidden;
white-space: nowrap;
}
.para-num {
display: flex;
align-items: center;
gap: 4px;
margin-top: 4px;
}
.para-num input {
margin-top: 0 !important;
}
.para-unit {
color: var(--text-dim);
font-size: 12px;
}
.prompt-textarea {
display: block;
width: 100%;
margin-top: 4px;
border: 1px solid var(--border-strong);
border-radius: 4px;
padding: 8px 10px;
font-size: 13px;
font-family: inherit;
outline: none;
resize: vertical;
}
.prompt-textarea:focus {
border-color: var(--word-blue);
}
/* ---- Draw (ink annotations) ---- */
.ink-overlay {
position: absolute;
inset: 0;
z-index: 3;
pointer-events: none;
}
.ink-overlay.ink-active {
pointer-events: auto;
touch-action: none;
}
.ink-tool-pen,
.ink-tool-highlighter {
cursor: crosshair;
}
.ink-tool-eraser {
cursor: cell;
}
.ink-svg {
width: 100%;
height: 100%;
display: block;
overflow: visible;
}
.ink-settings {
flex-direction: column;
gap: 4px;
justify-content: center;
}
.ink-swatches {
display: flex;
gap: 3px;
}
.ink-swatch {
width: 16px;
height: 16px;
border: 1px solid rgba(0, 0, 0, 0.25);
border-radius: 3px;
cursor: pointer;
padding: 0;
}
.ink-swatch.active {
outline: 2px solid var(--accent, #185abd);
outline-offset: 1px;
}
.ink-widths {
display: flex;
gap: 3px;
}
.ink-width {
width: 24px;
height: 22px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid transparent;
border-radius: 3px;
background: none;
cursor: pointer;
padding: 0;
}
.ink-width:hover {
background: var(--hover, rgba(0, 0, 0, 0.06));
}
.ink-width.active {
border-color: var(--accent, #185abd);
background: var(--hover, rgba(24, 90, 189, 0.08));
}
.ink-width-dot {
border-radius: 50%;
display: inline-block;
}
/* Page Number Format dialog */
.pgnum-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin: 10px 0;
font-size: 13px;
}
.pgnum-row select,
.pgnum-row input {
width: 180px;
padding: 4px 6px;
}
.pgnum-hint {
font-size: 12px;
color: var(--text-dim);
margin: 6px 0 0;
}
/* table border / size tools */
.table-border-opts {
display: flex;
gap: 6px;
align-items: center;
margin-top: 4px;
}
.table-border-opts input[type='color'] {
width: 28px;
height: 22px;
padding: 0;
border: 1px solid var(--border);
border-radius: 3px;
}
.table-border-opts select {
font-size: 12px;
padding: 2px 4px;
}
.table-size-inputs {
display: flex;
flex-direction: column;
/* height/width rows + the reset button must fit in the 84px ribbon-body; too much line spacing stretches it and causes jumps */
gap: 2px;
}
.table-size-inputs label {
display: flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: var(--text-dim);
}
.table-size-inputs input {
width: 56px;
padding: 2px 4px;
font-size: 12px;
}
.table-tool-button.active {
background: var(--word-blue-soft, #d5e3f5);
}
/* styles popup */
.styles-modal {
width: 420px;
max-height: 72vh;
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--surface);
border-radius: 8px;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.styles-panel-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
font-weight: 600;
border-bottom: 1px solid var(--border);
}
.styles-panel-close {
border: none;
background: none;
font-size: 16px;
cursor: pointer;
color: var(--text-dim);
}
.styles-panel-body {
flex: 1;
min-height: 0;
overflow-y: auto;
padding: 8px 0 10px;
}
.styles-panel-group {
padding: 6px 12px 2px;
font-size: 11px;
color: var(--text-dim);
}
.styles-panel-row {
display: flex;
align-items: center;
padding: 0 8px;
gap: 4px;
}
.styles-panel-row.active {
background: var(--word-blue-soft, #e7effa);
}
.styles-panel-name {
flex: 1;
text-align: left;
border: none;
background: none;
padding: 5px 6px;
cursor: pointer;
border-radius: 4px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.styles-panel-name:hover {
background: var(--hover, #f0f2f5);
}
.styles-panel-update {
visibility: hidden;
font-size: 11px;
padding: 2px 6px;
border: 1px solid var(--border);
border-radius: 4px;
background: var(--surface);
cursor: pointer;
}
.styles-panel-row:hover .styles-panel-update {
visibility: visible;
}
.styles-panel-new {
border-top: 1px solid var(--border);
padding: 8px 12px 12px;
}
.styles-panel-new-row {
display: flex;
gap: 6px;
}
.styles-panel-new-row input {
flex: 1;
min-width: 0;
padding: 4px 6px;
}
/* run-level format revision (w:rPrChange): amber underline hint */
.has-rpr-change {
text-decoration: underline wavy #c98a00;
text-decoration-skip-ink: none;
text-underline-offset: 3px;
}
/* inline table-break cut point: zero-height dashed page-break marker (spans the page, takes no layout height) */
.page-gap-cut {
display: inline-block;
width: 0;
height: 0;
position: relative;
pointer-events: none;
}
.page-gap-cut::before {
content: '';
position: absolute;
top: 0;
left: -100vw;
width: 200vw;
border-top: 2px dashed #b6c2d2;
}
/* nested table inside a cell (read-only child table) */
.doc-nested-table {
margin: 2px 0;
}
.doc-nested-table .doc-table {
max-width: 100%;
}
/* list library galleries (bullets/numbering/multilevel) */
.list-gallery {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 4px;
padding: 6px;
min-width: 180px;
}
.list-gallery-card {
border: 1px solid var(--border);
border-radius: 4px;
background: var(--surface);
padding: 6px 8px;
font-size: 13px;
cursor: pointer;
text-align: left;
white-space: nowrap;
}
.list-gallery-card:hover {
border-color: var(--accent, #2b579a);
}
.list-gallery-multi {
grid-template-columns: repeat(3, 1fr);
min-width: 320px;
}
.list-gallery-card-multi {
display: flex;
flex-direction: column;
gap: 2px;
font-size: 10px;
color: var(--text-dim);
}
.list-gallery-define {
grid-column: 1 / -1;
border: none;
border-top: 1px solid var(--border);
background: none;
padding: 6px 8px;
font-size: 12px;
cursor: pointer;
text-align: left;
}
.list-gallery-define:hover {
color: var(--accent, #2b579a);
}
/* Define New Multilevel List dialog */
.list-define-modal {
width: 560px;
max-width: 90vw;
}
.list-define-head,
.list-define-row {
display: grid;
grid-template-columns: 36px 110px 1fr 84px 110px;
gap: 6px;
align-items: center;
}
.list-define-head {
font-size: 11px;
color: var(--text-dim);
padding: 4px 0;
}
.list-define-rows {
display: flex;
flex-direction: column;
gap: 4px;
max-height: 320px;
overflow-y: auto;
}
.list-define-row input,
.list-define-row select {
width: 100%;
box-sizing: border-box;
padding: 2px 4px;
}
.list-define-preview {
font-size: 12px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* table style gallery cards */
.table-style-gallery {
display: flex;
gap: 6px;
flex-wrap: wrap;
max-width: 420px;
}
.table-style-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding: 4px 6px;
border: 1px solid var(--border);
border-radius: 4px;
background: var(--surface);
cursor: pointer;
font-size: 10px;
color: var(--text-dim);
max-width: 86px;
}
.table-style-card span:last-child {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 74px;
}
.table-style-card:hover {
border-color: var(--word-blue);
}
.table-style-card-grid {
width: 40px;
height: 22px;
border: 1px solid #b8bcc4;
border-top: 5px solid #7f8b9d;
background: repeating-linear-gradient(#fff 0 4px, #eef1f5 4px 8px);
border-radius: 2px;
}
.table-style-card-grid.plain {
border-top: 1px solid #b8bcc4;
background: #fff;
}
/* comment threads: replies and resolution */
.comment-thread {
border-bottom: 1px solid var(--border);
padding-bottom: 6px;
margin-bottom: 6px;
}
.comment-thread.resolved {
opacity: 0.55;
}
.comments-resolved-group {
margin-top: 4px;
}
.comments-resolved-toggle {
display: flex;
align-items: center;
gap: 5px;
width: 100%;
padding: 6px 8px;
border: none;
background: none;
font-size: 12px;
color: var(--text-dim);
cursor: pointer;
text-align: left;
}
.comments-resolved-toggle:hover {
background: var(--hover);
}
.comments-resolved-caret {
display: inline-block;
transition: transform 0.15s;
}
.comments-resolved-caret.open {
transform: rotate(90deg);
}
.comment-resolved-badge {
font-size: 10px;
color: #2e7d32;
border: 1px solid #a5d6a7;
border-radius: 3px;
padding: 0 4px;
}
.comment-reply {
margin: 4px 8px 4px 26px;
padding: 6px 8px;
border-left: 2px solid var(--border);
background: var(--surface);
border-radius: 4px;
font-size: 12px;
}
.comment-thread-actions {
display: flex;
gap: 8px;
margin: 2px 8px 0 26px;
}
.comment-thread-actions > button {
font-size: 11px;
padding: 2px 8px;
border: 1px solid var(--border);
border-radius: 4px;
background: var(--surface);
cursor: pointer;
color: var(--text-dim);
}
.comment-reply-compose {
flex: 1;
}
.comment-reply-compose textarea {
width: 100%;
min-height: 48px;
font-size: 12px;
padding: 6px;
box-sizing: border-box;
}
/* Sliding AI dock: one persistent wrapper animates between the panel width and
* the 34px collapsed rail (Excel-parity 180ms ease); --ai-panel-width tracks
* the panel's drag-resizer */
.ai-dock {
display: flex;
flex-shrink: 0;
min-height: 0;
width: var(--ai-panel-width, 360px);
overflow: hidden;
transition: width 180ms ease;
}
.ai-dock.collapsed {
width: 34px;
}
/* while dragging the resizer, follow the pointer without easing */
.ai-dock:has(.ai-panel-resizing) {
transition: none;
}
/* the rail stretches to fill the dock while the width animates */
.ai-dock .ai-rail {
flex: 1;
width: auto;
}
@media (prefers-reduced-motion: reduce) {
.ai-dock {
transition: none;
}
}
.ai-msg-undelivered {
margin-top: 6px;
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
color: #c62828;
}
.ai-retry-btn {
border: 1px solid rgb(198 40 40 / 45%);
border-radius: 4px;
background: none;
padding: 1px 8px;
font-size: 12px;
color: #c62828;
cursor: pointer;
}
.ai-retry-btn:hover {
background: rgb(198 40 40 / 8%);
}
.ai-login-btn {
margin-top: 8px;
border: 1px solid var(--accent, #1a73e8);
border-radius: 6px;
background: var(--accent, #1a73e8);
padding: 4px 14px;
font-size: 13px;
color: #fff;
cursor: pointer;
}
.ai-login-btn:hover {
opacity: 0.88;
}