// lagrange docs-shell styles. The chrome (shell, header, sidebar, menu,
// dialogs) is hikari's own SCSS — nothing here restyles it. This file
// only covers the docs-specific gaps: the app root's height chain, the
// reading column, the header search (a Search icon button opening a
// search window on every viewport), and the mermaid sub-app host. There is no
// footer band: a static docs site has no status to report.
//
// The root rule is the host's obligation, not decoration: HkFaceShell's
// `.s-admin-shell` is `height:100%` + `overflow:hidden`, so without a
// definite-height `#app` the percentage resolves to auto and the shell
// grows with the document (measured in Chrome: a 913px viewport got a
// 1972px shell, and the sidebar/header never pinned). Chest's theme.scss
// carries the same `#app{height:100dvh;overflow:hidden}` contract.
#app {
position: relative;
height: 100vh;
height: 100dvh;
overflow: hidden;
}
// The page canvas. hikari's components paint their own surfaces but the
// DOCUMENT behind them is the host's job: left unpainted the browser's
// default white canvas shows through, and in a dark theme the content
// reads near-white-on-white (measured in Chrome — the docs body inherits
// --color-text, so the canvas MUST follow --color-background).
html,
body {
margin: 0;
background: rgb(var(--color-background));
color: rgb(var(--color-text));
}
.lagrange-docs-content {
width: 100%;
max-width: 860px;
margin: 0 auto;
padding: 1.5rem 1rem 3rem;
}
.lagrange-docs-body {
// The legacy body HTML ships its own typographic classes; keep the
// reading measure stable while those rules still apply.
line-height: 1.7;
}
// ── theme dialog ──────────────────────────────────────────────────────────
// The theme dialog's inner menu caps itself at 22rem and centers — sized
// for the account face's narrow sheet. The docs theme modal is wider, so
// the centered menu left a dead band on each side (user-reported, with the
// empty band circled). Let the docs instance use the modal's width.
.lagrange-docs-search-modal .s-theme-menu,
.hk-modal-content .s-theme-menu {
max-width: none;
width: 100%;
}
// ── header search ─────────────────────────────────────────────────────────
// The admin header's page title truncates at 8rem — a limit sized for the
// ACCOUNT-MENU nickname it was built for, not for page titles: a docs page
// title like "Welcome to celestia-island" needs ~11rem, and unlike the
// account face the docs header has no centre wing competing for the row.
// Widen the docs instance; hikari's account faces keep their 8rem.
// !important is load-bearing: the first draft used the selector
// `.s-admin-header .s-admin-header-title` — a class the header element does
// not wear (it is `s-glass-header s-balanced-header`) — so the rule sat in
// the stylesheet WITHOUT matching anything and the title stayed truncated at
// 8rem. Same-selector + important both wins the cascade and proves itself in
// the browser (measured: computed max-width 8rem before, 24rem after).
.s-admin-header-title {
max-width: 24rem !important;
}
// Both viewports are trigger-first (2026-11-24): a Search icon button in
// the header's action slot, its popup — an anchored panel on desktop, a
// bottom sheet on phones — carrying the field and results in normal flow
// (the popup is the surface: no absolute positioning, no own background).
// The FIELD is hikari's HkSearchInput (2026-11-25: the hand-rolled
// input+× pair retired — it was visibly not a library component); it
// paints its own box, glyph and clear ✕, so only the modal-width fit
// rules remain here.
.lagrange-docs-search {
position: relative;
display: inline-flex;
align-items: center;
}
// In-flight state: a CENTERED SPINNER, no text (2026-11-27 user direction —
// the old "Searching…" text row read as a random white block on the sheet).
.lagrange-docs-search-busy {
position: static;
display: flex;
align-items: center;
justify-content: center;
min-height: 96px;
}
.lagrange-docs-search-error {
padding: 0.6rem 0.7rem;
font-size: 0.85rem;
opacity: 0.8;
}
.lagrange-docs-search-results {
position: absolute;
top: calc(100% + 6px);
right: 0;
width: min(420px, 90vw);
max-height: 60vh;
overflow: auto;
z-index: 60;
display: flex;
flex-direction: column;
gap: 2px;
padding: 6px;
border-radius: var(--hk-radius-surface, 10px);
background: rgb(var(--hk-color-surface, 255 255 255));
border: 1px solid color-mix(in srgb, rgb(var(--hk-color-text, 30 30 30) / 0.12), transparent);
box-shadow: 0 8px 28px rgb(0 0 0 / 0.18);
}
.lagrange-docs-search-empty {
padding: 0.6rem 0.7rem;
font-size: 0.85rem;
opacity: 0.7;
}
.lagrange-docs-search-hit {
display: flex;
flex-direction: column;
gap: 2px;
padding: 0.5rem 0.6rem;
border-radius: var(--hk-radius-control, 8px);
text-decoration: none;
color: inherit;
&:hover,
&:focus-visible {
background: color-mix(in srgb, rgb(var(--hk-color-primary, 60 120 220) / 0.1), transparent);
}
}
.lagrange-docs-search-hit-title {
font-weight: 600;
font-size: 0.88rem;
}
.lagrange-docs-search-hit-heading {
font-size: 0.75rem;
opacity: 0.75;
}
// The magnifier snippet: markdown-rendered chunk window (tables render as
// tables), matches underlined in place, and a directional fade on each edge
// where the section text continues beyond the window — no fade at the
// section's true start/end (2026-11-27 user direction; the old one-line
// ellipsis cut showed raw pipe rows and hid deeper matches entirely).
.lagrange-docs-search-hit-snippet {
position: relative;
font-size: 0.78rem;
opacity: 0.72;
overflow: hidden;
max-height: 13rem;
> :first-child { margin-top: 0; }
> :last-child { margin-bottom: 0; }
// Rendered markdown tables inside the window: never widen the hit card.
table {
display: block;
max-width: 100%;
overflow-x: auto;
font-size: 0.72rem;
}
// An excerpt is not a page: markdown structure is kept, page-scale type is
// not. The leading heading is dropped in `snippet.ts`; this covers the ones
// that stay. Where these rules do not out-specify the content sheet's own
// heading selectors, the wrapper's 0.78rem still keeps the card's scale —
// the excerpt never reaches display size either way.
:is(h1, h2, h3, h4, h5, h6) {
font-size: 0.85rem;
font-weight: 600;
margin: 0 0 0.2em;
}
p,
ul,
ol,
blockquote {
margin: 0.2em 0;
}
ul,
ol {
padding-inline-start: 1.2em;
}
pre,
code {
font-size: 0.72rem;
}
&.has-fade-above,
&.has-fade-below {
// mask = the TEXT dissolves toward the edge (an overlay tint would not
// read as "there is more of the same content here").
-webkit-mask-image: linear-gradient(
to bottom,
transparent 0,
black var(--fade-top, 0%),
black calc(100% - var(--fade-bottom, 0%)),
transparent 100%
);
mask-image: linear-gradient(
to bottom,
transparent 0,
black var(--fade-top, 0%),
black calc(100% - var(--fade-bottom, 0%)),
transparent 100%
);
}
&.has-fade-above { --fade-top: 14%; }
&.has-fade-below { --fade-bottom: 14%; }
}
.lagrange-docs-search-mark {
background: none;
color: inherit;
font-weight: 600;
text-decoration: underline;
text-decoration-color: rgb(var(--color-primary) / 0.85);
text-decoration-thickness: 2px;
text-underline-offset: 3px;
}
// Mobile: the trigger is one icon slot, exactly like its neighbours.
.lagrange-docs-search[data-shape="sheet"] {
position: relative;
display: inline-flex;
align-items: center;
}
.lagrange-docs-search-panel {
display: flex;
flex-direction: column;
gap: 8px;
// The old min(360px, 86vw) cap was LEFT-ALIGNED inside the modal's
// content box, so phones showed 16px of air on the left and ~42px on the
// right. The modal owns the page gutter — the panel just fills it.
width: 100%;
.hk-search-input {
width: 100%;
}
.lagrange-docs-search-results {
// In flow inside the panel: the popover owns the surface.
position: static;
width: 100%;
max-height: 55vh;
background: transparent;
border: 0;
box-shadow: none;
padding: 0;
}
.lagrange-docs-search-busy {
position: static;
}
}
// ── markdown table scroll shell (build renders tables inside this host) ──
// A wide table must never widen the PAGE: the host clips it and the table
// keeps its natural width (min-width: max-content — cells stop collapsing
// into one-character columns on phones). The boot pass mounts the shared
// hk-edge-glow painter (hikari's ONE edge-glow painter — the same sheet the
// scroll containers use) on left/right and toggles the bands from sensed
// overflow: a band shows only while that edge hides content, and its ink is
// the theme primary — the "there is more beyond this edge" lamp.
.lagrange-docs-table-scroll {
position: relative;
max-width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
// 原本写在 table 上的上下外边距(裸 table: 1.5rem 0)随包壳移到宿主,
// 窄表不丢间距,宽表滚动时上下留白随宿主一起滚(可接受)。
margin: 1.5rem 0;
padding-bottom: 2px;
// `width: 100%`(.lagrange-docs-body table)会压过这里的 min-width 并把
// 宽表压进宿主——宿主规则必须赢:显式 width:auto + 表级特异性。
> table {
width: auto;
min-width: max-content;
max-width: none;
margin: 0;
}
.hk-edge-glow {
position: absolute;
inset: 0;
z-index: 2;
pointer-events: none;
}
}
// ── theme dialog: mode-extra strip (DPI block) ───────────────────────────
// The mode-extra strip is ONE menu column directly under the 主题模式
// group (the placement chest's settings window established); the DPI
// collapsible panel is its only child on docs faces. The styles port
// chest's useThemePanelSlots DPI sheet under the lagrange namespace —
// the anatomy (title+live value on the collapsed header, slider/actions/
// hints/warning in the body) is the copied contract.
.lagrange-docs-mode-extra {
display: flex;
flex-direction: column;
gap: var(--space-8, 0.5rem);
}
.lagrange-dpi-panel {
width: 100%;
}
// Auto state reads slightly emphasized on the header's subtitle (the
// live value "自动" is the state the user is back to, not a stale notch).
.lagrange-dpi-panel[data-auto] .hk-expansion-panel-subtitle {
color: rgb(var(--color-text));
}
.lagrange-dpi-body {
display: flex;
flex-direction: column;
gap: var(--space-8, 0.5rem);
}
.lagrange-dpi-actions {
display: flex;
align-items: center;
gap: var(--space-8, 0.5rem);
}
.lagrange-dpi-panel[data-auto] .lagrange-dpi-slider {
opacity: 0.55;
}
.lagrange-dpi-warning {
margin: 0;
font-size: var(--text-xs, 0.75rem);
color: rgb(var(--color-error));
background: rgb(var(--color-error) / 8%);
border: 1px solid rgb(var(--color-error) / 20%);
border-radius: var(--radius-sm);
padding: var(--space-8) var(--space-10);
}
.lagrange-dpi-hint {
margin: 0;
font-size: var(--text-xs, 0.75rem);
opacity: 0.7;
}
// ── header end cluster ────────────────────────────────────────────────────
.lagrange-docs-header-end {
display: inline-flex;
align-items: center;
gap: 4px;
}
// ── mermaid sub-app host ──────────────────────────────────────────────────
.lagrange-docs-mermaid {
width: 100%;
min-height: 120px;
}