/* ============================================================
   共享 Markdown 排版基座（对齐 GitHub / github-markdown-css@5，line-height 取 1.6）
   作用域：中立类 .md —— 编辑器内容根（.ProseMirror 运行时注入 md/md-live，见 MarkdownEditor.vue）
   与只读 v-html（.md）共用。本文件不含任何编辑器内部实现类（.milkdown/.ProseMirror）。
   Crepe 自带主题经 crepe-layer.css 降到 @layer(crepe)，故此处未分层的 .md 靠层叠层级稳压 Crepe。
   两路径 marker/竖条等机制差异收在末尾「路径特例」小节，用 .md-live / .md:not(.md-live) 表达。
   ============================================================ */
@layer crepe;
.md {
  --md-body-size: 16px;
  --md-line-height: 1.6;
  --md-heading-margin: 24px 0 16px;
  --md-paragraph-margin: 0 0 16px;
  --md-list-margin: 0 0 16px;
  --md-block-margin: 16px 0;
  font-size: var(--md-body-size);
  line-height: var(--md-line-height);
  color: var(--fg);
  text-align: left;
  word-break: break-word;
}

.md :is(h1, h2, h3, h4, h5, h6) {
  line-height: 1.25;
  font-weight: 600;
  color: var(--fg);                 /* GitHub 标题用默认正文色，非加粗特殊色 */
  margin: var(--md-heading-margin);
  padding: 0;                        /* 压 Crepe reset 的 h*{padding:2px 0} */
  font-family: var(--font-body);    /* 统一 sans + 压 theme.css 裸标签 --font-display 渗色 */
  letter-spacing: normal;           /* 压 theme.css 裸标签负字距渗色 */
}
/* h1/h2 GitHub 下边框分隔线 */
.md h1 { font-size: 2em;   padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.md h2 { font-size: 1.5em; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.md h3 { font-size: 1.25em; }
.md h4 { font-size: 1em; }
.md h5 { font-size: .875em; }
.md h6 { font-size: .85em; color: var(--muted); }

.md p {
  margin: var(--md-paragraph-margin);
  text-indent: 0;
  padding: 0;
  line-height: var(--md-line-height);  /* 显式写回：Crepe 分层里 p{line-height:24px} 直接命中 p，会压过容器 1.6 的继承 */
}
/* 列表：块间距 + 项内段距共享；水平缩进 / 项距因 marker 机制不同，见文末「路径特例」。 */
.md :is(ul, ol) { margin: var(--md-list-margin); }
.md li > p { margin-top: 16px; }
.md :is(ul, ol) :is(ul, ol) { margin-top: .25em; margin-bottom: 0; }   /* 嵌套列表顶距 .25em：与同级项距同节奏（父→首子项 = 兄弟项），视觉均匀 */

.md blockquote { margin: var(--md-paragraph-margin); color: var(--muted); }   /* 与段落同一段距变量（缺省 0 0 16px） */          /* 竖条/内距见「路径特例」 */

.md hr { height: .25em; margin: 24px 0; padding: 0; background: var(--border); border: 0; }  /* GitHub 色块非细线 */
.md figcaption { font-size: 14px; color: var(--faint); text-align: center; margin-top: 8px; }
.md code {
  font-family: var(--font-mono);
  font-size: 85%;                 /* GitHub 行内 code 85% */
  background: var(--surface-2);
  border-radius: 6px;
  padding: .2em .4em;
}
.md pre {
  background: var(--surface-2);
  padding: 16px;
  border-radius: 6px;
  overflow: auto;
  margin: 0 0 16px;
  line-height: 1.45;
}
.md pre code { background: none; padding: 0; font-size: 100%; }
.md img { max-width: 100%; border-radius: var(--r-md); }           /* 图片圆角：项目改造件，保留 */
/* 块级图片（单独成段）：对齐 / 宽度写在 alt 里（见 data/imageLayout.ts），渲染成 p.md-img-block[data-align][data-w]。
   渲染器同时给 inline style（复制到公众号保留版式），这里按属性再写一遍：宿主 CSP 禁行内样式（miramiao.com）时版式照样生效。
   没写宽度 = 原图大小（小图不放大，大图缩到版心）；窄屏上小于一半的图改回原图大小，免得手机上缩成一小块。 */
.md p.md-img-block img { vertical-align: top; }
.md p.md-img-block[data-align="left"] { text-align: left; }
.md p.md-img-block[data-align="center"] { text-align: center; }
.md p.md-img-block[data-align="right"] { text-align: right; }
.md p.md-img-block[data-w="10"] img { width: 10%; }
.md p.md-img-block[data-w="11"] img { width: 11%; }
.md p.md-img-block[data-w="12"] img { width: 12%; }
.md p.md-img-block[data-w="13"] img { width: 13%; }
.md p.md-img-block[data-w="14"] img { width: 14%; }
.md p.md-img-block[data-w="15"] img { width: 15%; }
.md p.md-img-block[data-w="16"] img { width: 16%; }
.md p.md-img-block[data-w="17"] img { width: 17%; }
.md p.md-img-block[data-w="18"] img { width: 18%; }
.md p.md-img-block[data-w="19"] img { width: 19%; }
.md p.md-img-block[data-w="20"] img { width: 20%; }
.md p.md-img-block[data-w="21"] img { width: 21%; }
.md p.md-img-block[data-w="22"] img { width: 22%; }
.md p.md-img-block[data-w="23"] img { width: 23%; }
.md p.md-img-block[data-w="24"] img { width: 24%; }
.md p.md-img-block[data-w="25"] img { width: 25%; }
.md p.md-img-block[data-w="26"] img { width: 26%; }
.md p.md-img-block[data-w="27"] img { width: 27%; }
.md p.md-img-block[data-w="28"] img { width: 28%; }
.md p.md-img-block[data-w="29"] img { width: 29%; }
.md p.md-img-block[data-w="30"] img { width: 30%; }
.md p.md-img-block[data-w="31"] img { width: 31%; }
.md p.md-img-block[data-w="32"] img { width: 32%; }
.md p.md-img-block[data-w="33"] img { width: 33%; }
.md p.md-img-block[data-w="34"] img { width: 34%; }
.md p.md-img-block[data-w="35"] img { width: 35%; }
.md p.md-img-block[data-w="36"] img { width: 36%; }
.md p.md-img-block[data-w="37"] img { width: 37%; }
.md p.md-img-block[data-w="38"] img { width: 38%; }
.md p.md-img-block[data-w="39"] img { width: 39%; }
.md p.md-img-block[data-w="40"] img { width: 40%; }
.md p.md-img-block[data-w="41"] img { width: 41%; }
.md p.md-img-block[data-w="42"] img { width: 42%; }
.md p.md-img-block[data-w="43"] img { width: 43%; }
.md p.md-img-block[data-w="44"] img { width: 44%; }
.md p.md-img-block[data-w="45"] img { width: 45%; }
.md p.md-img-block[data-w="46"] img { width: 46%; }
.md p.md-img-block[data-w="47"] img { width: 47%; }
.md p.md-img-block[data-w="48"] img { width: 48%; }
.md p.md-img-block[data-w="49"] img { width: 49%; }
.md p.md-img-block[data-w="50"] img { width: 50%; }
.md p.md-img-block[data-w="51"] img { width: 51%; }
.md p.md-img-block[data-w="52"] img { width: 52%; }
.md p.md-img-block[data-w="53"] img { width: 53%; }
.md p.md-img-block[data-w="54"] img { width: 54%; }
.md p.md-img-block[data-w="55"] img { width: 55%; }
.md p.md-img-block[data-w="56"] img { width: 56%; }
.md p.md-img-block[data-w="57"] img { width: 57%; }
.md p.md-img-block[data-w="58"] img { width: 58%; }
.md p.md-img-block[data-w="59"] img { width: 59%; }
.md p.md-img-block[data-w="60"] img { width: 60%; }
.md p.md-img-block[data-w="61"] img { width: 61%; }
.md p.md-img-block[data-w="62"] img { width: 62%; }
.md p.md-img-block[data-w="63"] img { width: 63%; }
.md p.md-img-block[data-w="64"] img { width: 64%; }
.md p.md-img-block[data-w="65"] img { width: 65%; }
.md p.md-img-block[data-w="66"] img { width: 66%; }
.md p.md-img-block[data-w="67"] img { width: 67%; }
.md p.md-img-block[data-w="68"] img { width: 68%; }
.md p.md-img-block[data-w="69"] img { width: 69%; }
.md p.md-img-block[data-w="70"] img { width: 70%; }
.md p.md-img-block[data-w="71"] img { width: 71%; }
.md p.md-img-block[data-w="72"] img { width: 72%; }
.md p.md-img-block[data-w="73"] img { width: 73%; }
.md p.md-img-block[data-w="74"] img { width: 74%; }
.md p.md-img-block[data-w="75"] img { width: 75%; }
.md p.md-img-block[data-w="76"] img { width: 76%; }
.md p.md-img-block[data-w="77"] img { width: 77%; }
.md p.md-img-block[data-w="78"] img { width: 78%; }
.md p.md-img-block[data-w="79"] img { width: 79%; }
.md p.md-img-block[data-w="80"] img { width: 80%; }
.md p.md-img-block[data-w="81"] img { width: 81%; }
.md p.md-img-block[data-w="82"] img { width: 82%; }
.md p.md-img-block[data-w="83"] img { width: 83%; }
.md p.md-img-block[data-w="84"] img { width: 84%; }
.md p.md-img-block[data-w="85"] img { width: 85%; }
.md p.md-img-block[data-w="86"] img { width: 86%; }
.md p.md-img-block[data-w="87"] img { width: 87%; }
.md p.md-img-block[data-w="88"] img { width: 88%; }
.md p.md-img-block[data-w="89"] img { width: 89%; }
.md p.md-img-block[data-w="90"] img { width: 90%; }
.md p.md-img-block[data-w="91"] img { width: 91%; }
.md p.md-img-block[data-w="92"] img { width: 92%; }
.md p.md-img-block[data-w="93"] img { width: 93%; }
.md p.md-img-block[data-w="94"] img { width: 94%; }
.md p.md-img-block[data-w="95"] img { width: 95%; }
.md p.md-img-block[data-w="96"] img { width: 96%; }
.md p.md-img-block[data-w="97"] img { width: 97%; }
.md p.md-img-block[data-w="98"] img { width: 98%; }
.md p.md-img-block[data-w="99"] img { width: 99%; }
.md p.md-img-block[data-w="100"] img { width: 100%; }
@media (max-width: 600px) { .md p.md-img-block[data-narrow] img { width: auto !important; } }
.md a { color: var(--accent-strong); text-underline-offset: 2px; } /* 链接：项目样式，保留 */
/* 文字链带细下划线（宿主的全局 a 重置常把下划线去掉，正文里就看不出能点）；卡片与站内笔记引用图标照旧 */
.md a:not(.md-link-card) { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.md a:not(.md-link-card):hover { text-decoration-color: currentColor; }
/* 只读渲染的外部链接卡片：外观同编辑器 .link-card（有标题显示标题，无标题显示域名；文字用链接色）。
   宿主用 setInternalLinkHosts 声明的站内域名不做卡片，渲染成普通文字链 */
.md a.md-link-card {
  display: inline-flex; align-items: center; max-width: min(340px, 100%); padding: 1px 8px; margin: 0 2px;
  border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--accent-strong); text-decoration: none; vertical-align: middle; line-height: 1.5;   /* 标题用链接色：一眼看出能点 */
  transition: background .15s, border-color .15s;
}
.md a.md-link-card:hover { background: var(--surface); border-color: var(--accent); }
.md .md-link-card-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.md .md-link-card-url { color: var(--accent-strong); }
/* 只读渲染的有序列表：序号由渲染器写进 .md-ol-n（层级编号 2、2.1），不用浏览器的 decimal */
.md:not(.md-live) ol { list-style: none; }
.md:not(.md-live) ol > li { position: relative; }
.md .md-ol-n { position: absolute; right: 100%; margin-right: .45em; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 站内笔记引用（关联笔记，href 恒为相对链接 /?note=<id>，见 editor/noteLink.ts）：
   链接文本前缀一个「文档页」icon 以区分外链。mask + currentColor 随链接色与 4 套主题；
   伪元素不进 DOM，公众号导出的 flatten 管线天然不受影响。 */
.md a[href^="/?note="]::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: .2em;
  vertical-align: -0.125em;
  background-color: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/><path d="M9 13h6"/><path d="M9 17h6"/></svg>') no-repeat center / contain;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/><path d="M9 13h6"/><path d="M9 17h6"/></svg>') no-repeat center / contain;
}

/* ===== 路径特例：编辑器(.md-live) 与 只读(.md:not(.md-live)) 机制不同，最小分设 ===== */
/* 列表水平缩进：只读用原生 ::marker（落 padding 内，2em=GitHub）；编辑器 marker 由 Crepe
   flex .label-wrapper 单独成列已含一级缩进，ul/ol 不再叠 padding（否则每级≈4.1em 过大）。 */
.md:not(.md-live) :is(ul, ol) { padding-left: 2em; }
.md-live :is(ul, ol) { padding-left: 0; }
/* 项距：只读原生 li 用 GitHub 的 li+li .25em；编辑器项距由组件 .milkdown-list-item-block 维护。 */
.md:not(.md-live) li { margin: 0; }
.md:not(.md-live) li + li { margin-top: .25em; }
/* blockquote 竖条：只读用真 border-left（.25em=GitHub）；编辑器竖条走 Crepe ::before，样式在 MarkdownEditor.vue。 */
.md:not(.md-live) blockquote { padding: 0 1em; border-left: .25em solid var(--border-2); }
/* 首/末子节点归零：仅只读安全；编辑器会被 Crepe 运行时 widget 改子序，禁用。 */
.md:not(.md-live) > :first-child { margin-top: 0; }
.md:not(.md-live) > :last-child { margin-bottom: 0; }
.md:not(.md-live) blockquote > :last-child { margin-bottom: 0; }   /* 多段引用：末段不再叠 blockquote 自己的下距（GitHub 同） */

/* 只读表格与任务列表的默认外观（宿主没给样式时也能看）。选择器全包在 :where 里、特异性最低，
   宿主自己的表格主题（如 ainote 的 html[data-table] 四套）照常盖过；编辑器（.md-live）走 Crepe，不受影响。 */
:where(.md:not(.md-live)) table { border-collapse: collapse; margin: 0 0 16px; max-width: 100%; }
:where(.md:not(.md-live)) :is(th, td) { padding: 6px 13px; border: 1px solid var(--border-2); vertical-align: middle; }
:where(.md:not(.md-live)) th { background: var(--surface-2); color: var(--fg-strong); font-weight: 600; white-space: nowrap; }
/* 窄屏：表格自身横向滚动，列不被挤成一字一行、也不撑破版心 */
@media (max-width: 600px) { :where(.md:not(.md-live)) table { display: block; overflow-x: auto; } }
:where(.md:not(.md-live)) :is(th, td) > :first-child { margin-top: 0; }
:where(.md:not(.md-live)) :is(th, td) > :last-child { margin-bottom: 0; }
/* 任务项：渲染器输出 div.task > span.box > svg + span。勾框与编辑器同为 1em 方框，完成后强调色实底、文字划线 */
:where(.md:not(.md-live)) .task { display: flex; align-items: flex-start; gap: .5em; margin: 0 0 .25em; line-height: var(--md-line-height); }
:where(.md:not(.md-live)) .task .box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; margin-top: calc((var(--md-line-height) * 1em - 1em) / 2); border: 1.5px solid var(--border-2); border-radius: 3px; color: transparent; box-sizing: border-box; }
:where(.md:not(.md-live)) .task .box svg { width: .75em; height: .75em; }
:where(.md:not(.md-live)) .task.done .box { background: var(--accent); border-color: var(--accent); color: #fff; }
:where(.md:not(.md-live)) .task.done > span:last-child { color: var(--faint); text-decoration: line-through; }
:where(.md:not(.md-live)) .task + :not(.task) { margin-top: 16px; }   /* 任务组与下一块之间留段距（任务项本身只隔 .25em） */

/* md-aside shares markdown typography; card appearance comes from inline config. */
.md .md-aside {
  display: block;
  position: relative;
  margin: var(--md-block-margin);
}
/* 批注列表点击卡片跳转后的短暂高亮（scrollToAnno 加 .anno-flash）：柔和描边脉冲，随主题色。 */
.md-aside.anno-flash {
  animation: anno-flash 1.6s var(--ease, ease) 1;
  border-radius: 12px;
}
@keyframes anno-flash {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  30%  { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
.md .md-aside-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.md .md-aside-body,
.md .md-aside-note {
  position: relative;
  z-index: 1;
  border-radius: 10px;
}
.md .md-aside-body > :first-child,
.md .md-aside-note-body > :first-child,
.md .md-aside-note-tail + :is(h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote,pre,table) {
  margin-top: 0;
}
.md .md-aside-body > :last-child,
.md .md-aside-note-body > :last-child,
.md .md-aside-note > :last-child {
  margin-bottom: 0;
}
.md .md-aside-body :where(h1,h2,h3,h4,h5,h6,p,li,blockquote,td,th),
.md .md-aside-note :where(h1,h2,h3,h4,h5,h6,p,li,blockquote,td,th) {
  color: inherit;
}
.md .md-aside-body.has-img::before,
.md .md-aside-note.has-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--aside-img);
  background-size: cover;
  background-position: center;
  filter: blur(var(--aside-blur));
  opacity: var(--aside-opacity);
  z-index: 0;
  border-radius: inherit;
}
.md .md-aside-note-body,
.md .md-aside-body > :is(h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote,pre,table,figure),
.md .md-aside-note > :is(h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote,pre,table,figure) {
  position: relative;
  z-index: 1;
}
.md .md-aside.note-collapsed .md-aside-note {
  display: none;
}
.md .md-aside-note-tail {
  position: absolute;
  left: 22px;
  top: 0;
  width: 0;
  height: 0;
  z-index: 2;
  pointer-events: none;
  display: var(--note-tail-display, block);
}
.md .md-aside-note-tail::before,
.md .md-aside-note-tail::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-color: transparent;
  border-width: 0 9px 9px;
}
.md .md-aside-note-tail::before {
  border-bottom-color: var(--note-line, var(--border-2));
  transform: translateX(-50%);
}
.md .md-aside-note-tail::after {
  border-bottom-color: var(--note-bg, transparent);
  transform: translate(-50%, calc(var(--note-bw, 1px) * 1.42));
}
.md .md-aside-mark {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .3px;
  vertical-align: super;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  color: var(--aside-mark-color, #fff);
  background: var(--aside-mark-bg, #8aa0ff);
  transition: opacity .12s, filter .12s;
}

/* ---------- md-callout 高亮块（飞书式）：emoji 图标 + 填充/边框/文字三色 ----------
   通用结构 + token 配色镜像（与 data/colorTokens.ts 的 COLOR_TOKENS 对齐，含 [data-base="dark"] 暗色变体）。
   自定义 hex 走元素 inline style（calloutChrome 生成），不经这些类。编辑器交互样式在 MarkdownEditor.vue。 */
.md .md-callout {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid transparent; /* 占位：加边框(has-bd)时不跳 1px */
  border-radius: 10px;
}
.md .md-callout-emoji {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  padding: 0;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 17px;
  line-height: 1;
  user-select: none;
}
button.md-callout-emoji { cursor: pointer; }
button.md-callout-emoji:hover { background: color-mix(in oklch, var(--fg) 10%, transparent); }
.md .md-callout-body { flex: 1; min-width: 0; }
.md .md-callout-body > :first-child { margin-top: 0; }
.md .md-callout-body > :last-child { margin-bottom: 0; }
.md .md-callout-body :where(h1,h2,h3,h4,h5,h6,p,li,blockquote,td,th) { color: inherit; }
/* 填充色（浅底，暗色降亮度提透明），accent/muted 语义色随主题 var */
.md .md-callout.co-bg-accent { background: color-mix(in oklch, var(--accent) 16%, transparent); }
.md .md-callout.co-bg-rose   { background: oklch(94% .045 14); }
.md .md-callout.co-bg-amber  { background: oklch(95% .05 85); }
.md .md-callout.co-bg-green  { background: oklch(94% .04 175); }
.md .md-callout.co-bg-teal   { background: oklch(94% .04 195); }
.md .md-callout.co-bg-blue   { background: oklch(94% .04 232); }
.md .md-callout.co-bg-violet { background: oklch(94% .045 292); }
.md .md-callout.co-bg-muted  { background: color-mix(in oklch, var(--muted) 14%, transparent); }
[data-base="dark"] .md .md-callout.co-bg-rose   { background: oklch(31% .055 14); }
[data-base="dark"] .md .md-callout.co-bg-amber  { background: oklch(32% .055 85); }
[data-base="dark"] .md .md-callout.co-bg-green  { background: oklch(31% .05 175); }
[data-base="dark"] .md .md-callout.co-bg-teal   { background: oklch(31% .05 195); }
[data-base="dark"] .md .md-callout.co-bg-blue   { background: oklch(31% .05 232); }
[data-base="dark"] .md .md-callout.co-bg-violet { background: oklch(31% .055 292); }
/* 边框色（has-bd 由 calloutChrome 一并加上；hex 自定义只有 has-bd + inline border-color） */
.md .md-callout.co-bd-accent { border-color: var(--accent); }
.md .md-callout.co-bd-rose   { border-color: oklch(66% .13 14); }
.md .md-callout.co-bd-amber  { border-color: oklch(70% .12 85); }
.md .md-callout.co-bd-green  { border-color: oklch(66% .09 175); }
.md .md-callout.co-bd-teal   { border-color: oklch(66% .1 195); }
.md .md-callout.co-bd-blue   { border-color: oklch(66% .11 232); }
.md .md-callout.co-bd-violet { border-color: oklch(66% .12 292); }
.md .md-callout.co-bd-muted  { border-color: var(--muted); }
[data-base="dark"] .md .md-callout.co-bd-rose   { border-color: oklch(58% .12 14); }
[data-base="dark"] .md .md-callout.co-bd-amber  { border-color: oklch(60% .11 85); }
[data-base="dark"] .md .md-callout.co-bd-green  { border-color: oklch(58% .09 175); }
[data-base="dark"] .md .md-callout.co-bd-teal   { border-color: oklch(58% .09 195); }
[data-base="dark"] .md .md-callout.co-bd-blue   { border-color: oklch(58% .1 232); }
[data-base="dark"] .md .md-callout.co-bd-violet { border-color: oklch(58% .11 292); }
/* 文字色（与 .mdw-fg-* 同值域：亮色 50%、暗色 72-74% 提亮） */
.md .md-callout.co-fg-accent { color: var(--accent-strong); }
.md .md-callout.co-fg-rose   { color: oklch(50% .15 14); }
.md .md-callout.co-fg-amber  { color: oklch(50% .13 70); }
.md .md-callout.co-fg-green  { color: oklch(50% .097 175); }
.md .md-callout.co-fg-teal   { color: oklch(50% .11 195); }
.md .md-callout.co-fg-blue   { color: oklch(50% .12 232); }
.md .md-callout.co-fg-violet { color: oklch(50% .13 292); }
.md .md-callout.co-fg-muted  { color: var(--muted); }
[data-base="dark"] .md .md-callout.co-fg-rose   { color: oklch(72% .15 14); }
[data-base="dark"] .md .md-callout.co-fg-amber  { color: oklch(74% .13 70); }
[data-base="dark"] .md .md-callout.co-fg-green  { color: oklch(74% .097 175); }
[data-base="dark"] .md .md-callout.co-fg-teal   { color: oklch(74% .11 195); }
[data-base="dark"] .md .md-callout.co-fg-blue   { color: oklch(72% .12 232); }
[data-base="dark"] .md .md-callout.co-fg-violet { color: oklch(72% .13 292); }

.mdw-search-hit {
  border-radius: 4px;
  padding: 0 .08em;
  background: color-mix(in oklch, var(--accent) 30%, transparent);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent) 28%, transparent);
}
.mdw-search-hit.active {
  color: #fff;
  background: var(--accent-strong);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 30%, transparent);
}

/* ===== 行内着色 / 高亮 / 下划线·上下标（编辑态 .milkdown + 只读态 .md 共用全局类；随包走，宿主 [data-base="dark"] 时用暗色档）=====
   token 配色镜像 data/colorTokens.ts（改色需同步）；自定义 hex 走 inline style（见 colorMark.ts / markdown.ts）。
   废弃的 ==高亮== 已由这里的多色高亮取代。 */
.mdw-fg-accent { color: var(--accent-strong); }
/* 颜色面板色板（飞书式 8 列：灰 红 橙 黄 绿 蓝 紫）：值与 colorTokens.ts 的 FG_PICKER / HL_LIGHT / HL_DEEP 同步。
   accent / teal 等旧 token 不在面板里，下方保留原值供旧正文渲染。 */
.mdw-fg-muted { color: #8f959e; }
.mdw-fg-rose { color: #d83931; }
.mdw-fg-orange { color: #de7802; }
.mdw-fg-amber { color: #dc9b04; }
.mdw-fg-green { color: #2ea121; }
.mdw-fg-blue { color: #245bdb; }
.mdw-fg-violet { color: #6425d0; }
[data-base="dark"] .mdw-fg-muted { color: #a6abb3; }
[data-base="dark"] .mdw-fg-rose { color: #f76964; }
[data-base="dark"] .mdw-fg-orange { color: #ffa53d; }
[data-base="dark"] .mdw-fg-amber { color: #ffc60a; }
[data-base="dark"] .mdw-fg-green { color: #62d256; }
[data-base="dark"] .mdw-fg-blue { color: #6a9bff; }
[data-base="dark"] .mdw-fg-violet { color: #a47eff; }
.mdw-hl-muted { background: linear-gradient(transparent 55%, #eff0f1 55%); }
.mdw-hl-rose { background: linear-gradient(transparent 55%, #fbbfbc 55%); }
.mdw-hl-orange { background: linear-gradient(transparent 55%, #fed4a4 55%); }
.mdw-hl-amber { background: linear-gradient(transparent 55%, #fff67a 55%); }
.mdw-hl-green { background: linear-gradient(transparent 55%, #b7edb1 55%); }
.mdw-hl-blue { background: linear-gradient(transparent 55%, #bacefd 55%); }
.mdw-hl-violet { background: linear-gradient(transparent 55%, #ddd0fa 55%); }
.mdw-hl-gray { background: linear-gradient(transparent 55%, #dee0e3 55%); }
.mdw-hl-deepmuted { background: linear-gradient(transparent 55%, #bbbfc4 55%); }
.mdw-hl-deeprose { background: linear-gradient(transparent 55%, #f76964 55%); }
.mdw-hl-deeporange { background: linear-gradient(transparent 55%, #ffa53d 55%); }
.mdw-hl-deepamber { background: linear-gradient(transparent 55%, #ffe928 55%); }
.mdw-hl-deepgreen { background: linear-gradient(transparent 55%, #62d256 55%); }
.mdw-hl-deepblue { background: linear-gradient(transparent 55%, #9fb9fc 55%); }
.mdw-hl-deepviolet { background: linear-gradient(transparent 55%, #c5a9f9 55%); }
[data-base="dark"] .mdw-hl-muted { background: linear-gradient(transparent 55%, color-mix(in srgb, #8f959e 28%, transparent) 55%); }
[data-base="dark"] .mdw-hl-rose { background: linear-gradient(transparent 55%, color-mix(in srgb, #f76964 32%, transparent) 55%); }
[data-base="dark"] .mdw-hl-orange { background: linear-gradient(transparent 55%, color-mix(in srgb, #ffa53d 32%, transparent) 55%); }
[data-base="dark"] .mdw-hl-amber { background: linear-gradient(transparent 55%, color-mix(in srgb, #ffe928 30%, transparent) 55%); }
[data-base="dark"] .mdw-hl-green { background: linear-gradient(transparent 55%, color-mix(in srgb, #62d256 32%, transparent) 55%); }
[data-base="dark"] .mdw-hl-blue { background: linear-gradient(transparent 55%, color-mix(in srgb, #6a9bff 32%, transparent) 55%); }
[data-base="dark"] .mdw-hl-violet { background: linear-gradient(transparent 55%, color-mix(in srgb, #a47eff 32%, transparent) 55%); }
[data-base="dark"] .mdw-hl-gray { background: linear-gradient(transparent 55%, color-mix(in srgb, #8f959e 45%, transparent) 55%); }
[data-base="dark"] .mdw-hl-deepmuted { background: linear-gradient(transparent 55%, color-mix(in srgb, #8f959e 65%, transparent) 55%); }
[data-base="dark"] .mdw-hl-deeprose { background: linear-gradient(transparent 55%, color-mix(in srgb, #f76964 60%, transparent) 55%); }
[data-base="dark"] .mdw-hl-deeporange { background: linear-gradient(transparent 55%, color-mix(in srgb, #ffa53d 60%, transparent) 55%); }
[data-base="dark"] .mdw-hl-deepamber { background: linear-gradient(transparent 55%, color-mix(in srgb, #ffe928 55%, transparent) 55%); }
[data-base="dark"] .mdw-hl-deepgreen { background: linear-gradient(transparent 55%, color-mix(in srgb, #62d256 60%, transparent) 55%); }
[data-base="dark"] .mdw-hl-deepblue { background: linear-gradient(transparent 55%, color-mix(in srgb, #6a9bff 60%, transparent) 55%); }
[data-base="dark"] .mdw-hl-deepviolet { background: linear-gradient(transparent 55%, color-mix(in srgb, #a47eff 60%, transparent) 55%); }
.mdw-fg-teal   { color: oklch(50% .11 195); }
[data-base="dark"] .mdw-fg-teal   { color: oklch(74% .11 195); }

/* 高亮：下半截荧光观感（沿用原 == 黄高亮风格）。基础类管内距/圆角，token 类管背景色 */
.mdw-hl { padding: 0 1px; border-radius: 2px; color: inherit; }
.mdw-hl-accent { background: linear-gradient(transparent 55%, color-mix(in oklch, var(--accent) 30%, transparent) 55%); }
.mdw-hl-teal   { background: linear-gradient(transparent 55%, oklch(88% .1 195 / .6) 55%); }
[data-base="dark"] .mdw-hl-accent { background: linear-gradient(transparent 55%, color-mix(in oklch, var(--accent) 42%, transparent) 55%); }
[data-base="dark"] .mdw-hl-teal   { background: linear-gradient(transparent 55%, oklch(70% .12 195 / .45) 55%); }

/* 下划线 / 上标 / 下标 */
.mdw-u { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.mdw-sup { vertical-align: super; font-size: .72em; line-height: 0; }
.mdw-sub { vertical-align: sub; font-size: .72em; line-height: 0; }
