:root {
  color-scheme: light;
  /* Notion 设计变量 */
  --paper: #ffffff; --wash: #f7f6f3; --ink: #37352f;
  --muted: rgba(55,53,47,.65); --faint: rgba(55,53,47,.45);
  --line: #e9e9e7; --line-strong: #dededa;
  --hover: rgba(55,53,47,.06); --active: rgba(55,53,47,.10);
  --accent: #2383e2; --accent-dark: #1a6fc4; --accent-wash: rgba(35,131,226,.09);
  --code-red: #eb5757; --code-wash: rgba(135,131,120,.15);
  /* 兼容后台 admin.css 引用的旧变量名 */
  --green: #2383e2; --green-wash: #f1f1ef;
  --body: ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --heading: ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-family: var(--body); color: var(--ink); background: var(--paper);
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.75; }
a { color: inherit; text-decoration-color: rgba(55,53,47,.4); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
button, a { touch-action: manipulation; }
button, input, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 20; background: var(--ink); color: white; padding: 10px 16px; border-radius: 6px; text-decoration: none; }
.skip-link:focus { top: 8px; }
.site-header { height: 56px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.site-nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-wash); }
.catalog-home { max-width: 920px; margin: 0 auto; padding: 80px 32px 100px; }
.catalog-home-label { margin: 0 0 12px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.catalog-home h1 { font-size: clamp(28px,4vw,40px); }
.catalog-home-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 38px; }
.catalog-home-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 220px; padding: 26px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.catalog-home-card:hover { border-color: var(--accent); background: var(--accent-wash); }
.catalog-card-type { color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }
.catalog-home-card strong { margin: 22px 0 8px; font-size: 23px; }
.catalog-home-card > span:nth-of-type(2) { color: var(--muted); font-size: 14px; }
.catalog-card-action { margin-top: auto; padding-top: 24px; color: var(--accent); font-size: 13px; font-weight: 600; }
@media (max-width: 640px) { .catalog-home { padding: 44px 20px 70px; } .catalog-home-grid { grid-template-columns: 1fr; margin-top: 26px; } .catalog-home-card { min-height: 180px; padding: 22px; } }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap; }
.brand strong { font-weight: 600; }
.brand-text { display: inline-flex; align-items: center; gap: 9px; }
/* 站点 logo：小宇Boi 头像（整张等比缩放，圆形显示）。所有页面都用 span.brand-dot，改这里即全站生效 */
.brand-dot { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--wash) url("/logo.jpg") center / cover no-repeat; box-shadow: 0 0 0 1px var(--line); }
.brand-separator { color: var(--faint); }
/* 导航链接可在页面里用 Markdown 改写，存下来的 <a> 不带 class，按位置套同一样式 */
.header-link, .site-nav a { color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; padding: 6px 8px; border-radius: 6px; }
.header-link:hover, .site-nav a:hover { background: var(--hover); color: var(--ink); }
.shop-promo { background: var(--wash); color: var(--ink); border-bottom: 1px solid var(--line); }
.shop-promo-inner { max-width: 1340px; margin: 0 auto; padding: 11px 36px; display: flex; align-items: center; gap: 14px; }
.shop-promo-mark { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--ink); font-weight: 600; font-size: 17px; line-height: 1; }
/* 文案区每行一块（可用 Markdown 编辑）：首行主文案，其后各行为弱化说明；旧版 <strong>/<span> 并排结构同样适用 */
.shop-promo-copy { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; line-height: 1.4; }
.shop-promo-copy > * { margin: 0; font-size: 14px; }
.shop-promo-copy > * + * { color: var(--muted); font-size: 13px; }
.shop-promo-copy > :is(ul, ol) { padding-left: 1.2em; }
.shop-promo-copy strong { font-weight: 600; }
.shop-promo-link { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 5px 12px; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; font-size: 13px; font-weight: 500; }
.shop-promo-link:hover { background: var(--accent-dark); }
.shop-promo-link:focus-visible { outline-color: var(--accent); }
.document-layout { display: grid; grid-template-columns: 240px minmax(0, 900px); gap: 56px; max-width: 1340px; margin: 0 auto; padding: 0 36px; }
.sidebar { min-width: 0; padding: 28px 18px 24px 0; border-right: 1px solid var(--line); position: sticky; top: 56px; align-self: start; max-height: calc(100dvh - 56px); overflow-y: auto; scrollbar-width: thin; }
.follow-card { padding: 14px 14px 12px; margin: 0 0 20px; border-radius: 8px; background: var(--wash); }
.follow-card-title { margin: 0 0 8px; font-size: 13px; line-height: 1.5; font-weight: 600; }
.follow-card-links { display: grid; gap: 1px; }
.follow-card-links a, .follow-card-links button { display: block; width: 100%; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.6; text-align: left; text-decoration: none; }
.follow-card-links a:hover, .follow-card-links button:hover { background: var(--hover); }
/* 卡片内容每行一块（可用 Markdown 编辑）：段落为标题/说明，无序列表每项一行链接；旧版 div 链接结构样式保留在上方 */
.follow-card > :is(p, h2, h3, h4):not(.follow-card-status) { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.follow-card > :is(p, h2, h3, h4) :is(strong, b) { font-weight: 600; }
.follow-card > :is(ul, ol) { margin: 0; font-size: 13px; line-height: 1.6; }
.follow-card > :is(ul, ol) + :is(p, h2, h3, h4) { margin-top: 8px; }
.follow-card > ol { padding-left: 1.4em; }
.follow-card > ul { display: grid; gap: 1px; padding: 0; list-style: none; }
.follow-card > ul > li { min-height: 36px; padding: 6px 8px; border-radius: 6px; }
.follow-card > ul > li:has(> a:only-child, > button:only-child) { padding: 0; }
.follow-card > ul > li > a, .follow-card > ul > li > button { display: block; width: 100%; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; font: inherit; text-align: left; text-decoration: none; }
.follow-card > ul > li > a:hover, .follow-card > ul > li > button:hover { background: var(--hover); }
.follow-card-status { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#directory > summary { list-style: none; font-size: 14px; font-weight: 600; padding: 4px 8px 14px; cursor: pointer; }
#directory > summary::-webkit-details-marker { display: none; }
.directory-hint { display: block; color: var(--faint); font-size: 12px; font-weight: 400; margin-top: 2px; }
.nav-year { margin-bottom: 10px; }
.nav-year-link { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 600; padding: 5px 8px; border-radius: 6px; }
.nav-year-link small { font-weight: 400; color: var(--faint); font-size: 12px; }
.nav-months { margin-left: 12px; padding-left: 10px; border-left: 1px solid var(--line); display: grid; gap: 1px; }
.nav-month { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; min-height: 32px; padding: 4px 8px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.nav-month small { font-size: 11px; font-weight: 400; color: var(--faint); }
.nav-month[aria-current="location"] { color: var(--ink); background: var(--active); }
.nav-month:hover, .nav-year-link:hover { color: var(--ink); background: var(--hover); }
.about-link { color: var(--faint); display: block; border-top: 1px solid var(--line); padding: 14px 8px 0; margin-top: 18px; text-decoration: none; font-size: 12px; }
.about-link:hover { color: var(--ink); }
.nav-loading { font-size: 12px; color: var(--muted); }
main { min-width: 0; padding: 32px 0 0; }
main:focus { outline: none; }
#about, .year-group, .month-group, .resource-entry { scroll-margin-top: 80px; }
h1 { font-family: var(--heading); font-weight: 700; font-size: 32px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -.01em; }
.intro-description { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.65; font-weight: 500; }
.document-tools { margin-top: 22px; }
.search-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.search-form { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--faint); padding: 0 12px; background: var(--paper); }
.search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search-form svg { flex-shrink: 0; }
.search-form input { border: 0; background: transparent; width: 100%; min-width: 0; padding: 9px 0; color: var(--ink); outline: none; font-size: 14px; }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-form input::placeholder { color: var(--faint); }
.text-button { border: 0; background: none; color: var(--accent); font-size: 12px; white-space: nowrap; min-height: 36px; padding: 6px; border-radius: 6px; }
.text-button:hover { background: var(--accent-wash); }
.results-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--faint); padding: 12px 0 18px; }
.results-header p { margin: 0; }
.year-group { border-top: 1px solid var(--line); margin-bottom: 24px; }
.year-heading { display: flex; align-items: center; gap: 10px; padding: 16px 0; cursor: pointer; list-style: none; }
.year-heading::-webkit-details-marker { display: none; }
.year-heading::before { content: "›"; font-size: 20px; line-height: 1; color: var(--faint); width: 12px; transition: transform .15s; }
.year-group[open] > .year-heading::before { transform: rotate(90deg); }
.year-heading h2 { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 0; }
.year-count { font-size: 12px; color: var(--faint); font-weight: 400; }
.year-label { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--wash); padding: 2px 8px; border-radius: 10px; }
.month-heading { font-size: 14px; color: var(--muted); font-weight: 600; margin: 12px 0 0; display: flex; align-items: center; gap: 10px; }
.month-heading::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.resource-entry { padding: 22px 0 28px; min-width: 0; }
.resource-entry + .resource-entry { border-top: 1px solid var(--line); }
.entry-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; min-height: 32px; flex-wrap: wrap; }
.entry-meta time { font-family: var(--mono); color: var(--accent-dark); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.entry-meta .removed-label { color: var(--muted); font-size: 12px; background: var(--wash); padding: 2px 8px; border-radius: 10px; }
.entry-meta .pending-label { color: var(--accent); font-size: 12px; font-weight: 500; background: var(--accent-wash); padding: 2px 8px; border-radius: 10px; }
.entry-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.copy-link { font-size: 12px; color: var(--faint); background: none; border: 0; padding: 6px 8px; min-height: 32px; border-radius: 6px; }
.copy-link:hover { color: var(--ink); background: var(--hover); }
/* 吸在顶栏下方（顶栏自身也吸顶），滚动时两条不叠在一起 */
.edit-mode-bar { position: sticky; top: 56px; z-index: 4; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 9px max(20px,calc((100vw - 1268px)/2)); background: linear-gradient(var(--accent-wash), var(--accent-wash)), var(--paper); border-bottom: 1px solid var(--line); font-size: 12px; }
.edit-mode-bar strong { color: var(--accent); }
.edit-mode-bar a { text-decoration: none; color: var(--ink); }
.edit-mode-bar a:hover { text-decoration: underline; }
.edit-mode-bar .edit-exit { margin-left: auto; color: var(--muted); }
/* 「发布全部修改（N）」：靠右放在「退出编辑」前（edit-registry.js） */
.edit-mode-bar .publish-all { margin-left: auto; padding: 5px 12px; border-radius: 5px; background: var(--accent); color: #fff; font-weight: 500; }
.edit-mode-bar .publish-all:hover { background: var(--accent-dark); text-decoration: none; }
.edit-mode-bar .publish-all:disabled { background: transparent; color: var(--faint); cursor: default; }
.edit-mode-bar .publish-all + .edit-exit { margin-left: 0; }
.edit-mode-bar button { border: 0; background: none; color: var(--ink); font-size: 12px; padding: 4px 0; }
.edit-mode-bar button:hover { text-decoration: underline; }
.inline-article-list { position: relative; }
.inline-article-list summary { cursor: pointer; }
.inline-article-links { position: absolute; z-index: 10; top: 100%; left: 0; display: grid; gap: 2px; width: min(360px,calc(100vw - 32px)); max-height: 320px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); box-shadow: 0 8px 24px rgba(0,0,0,.10); }
.inline-article-list:not([open]) .inline-article-links { display: none; }
.inline-article-links a { padding: 6px 8px; border-radius: 4px; }
.inline-article-links a:hover { background: var(--wash); text-decoration: none; }
.inline-title-input { display: block; width: 100%; min-width: 0; padding: 2px 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-weight: inherit; line-height: inherit; }
.inline-date-input { width: 145px; max-width: 100%; min-height: 32px; padding: 1px 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--faint); font-family: var(--mono); font-size: 13px; }
.inline-title-input:hover,.inline-date-input:hover,.source-content[contenteditable="true"]:hover { background: var(--wash); }
.inline-title-input:focus,.inline-date-input:focus,.source-content[contenteditable="true"]:focus { outline: 2px solid var(--accent); outline-offset: 3px; background: var(--paper); }
/* 资料 / 公众号资源的富文本标题（编辑态）：沿用标题大字，链接显示淡下划线便于辨认 */
.inline-title-rich { min-height: 1.5em; cursor: text; overflow-wrap: anywhere; }
.inline-title-rich:empty::before { content: attr(data-placeholder); color: var(--faint); }
.inline-title-rich a { color: inherit; text-decoration: underline; text-decoration-color: rgba(35,131,226,.55); text-underline-offset: 4px; }
/* 访客态富文本标题：链接不加下划线，悬停时出现（与原整行标题链接一致） */
.entry-title-rich a { color: inherit; text-decoration: none; }
.entry-title-rich a:hover { text-decoration: underline; text-decoration-color: rgba(55,53,47,.4); text-underline-offset: 4px; }
.entry-title-rich + .destination-label { text-decoration: none; }
.entry-title-rich + .destination-label:hover { color: var(--muted); text-decoration: underline; }
.source-content[contenteditable="true"] { min-height: 44px; border-radius: 4px; cursor: text; }
.source-content[contenteditable="true"]:empty::before { content: attr(data-placeholder); color: var(--faint); }
.inline-editor-panel { display: none; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.resource-entry:focus-within .inline-editor-panel,.resource-entry.inline-active .inline-editor-panel,.article-layout main:focus-within .inline-editor-panel,.article-layout main.inline-active .inline-editor-panel { display: block; }
.inline-toolbar { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 10px; }
.inline-toolbar button { border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; padding: 6px 8px; }
.inline-toolbar button:hover { background: var(--wash); color: var(--ink); }
.inline-color-select { min-height: 30px; max-width: 110px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.inline-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-save-state { margin-right: auto; color: var(--muted); font-size: 12px; }
.inline-controls button { min-height: 34px; border-radius: 5px; padding: 5px 10px; font-size: 12px; }
.inline-save { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); }
.inline-publish { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.inline-options { margin-top: 8px; color: var(--muted); font-size: 12px; }
.inline-options summary { cursor: pointer; width: fit-content; padding: 5px 0; }
.inline-option-fields { display: grid; gap: 8px; padding: 8px 0; }
.inline-option-fields label { display: grid; gap: 3px; }
.inline-option-fields input:not([type="checkbox"]) { width: 100%; max-width: 540px; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 6px 8px; background: var(--paper); color: var(--ink); font-size: 14px; }
.inline-option-fields .inline-check { display: flex; align-items: center; gap: 7px; }
.inline-delete { width: fit-content; min-height: 34px; margin-top: 5px; border: 1px solid #d44; border-radius: 5px; padding: 5px 10px; background: var(--paper); color: #b42318; font-size: 12px; }
.inline-delete-hint, .inline-field-hint { margin: 2px 0 0; color: var(--faint); font-size: 12px; }
.inline-unpublish { width: fit-content; min-height: 34px; margin-top: 5px; border: 1px solid #d44; border-radius: 5px; padding: 5px 10px; background: var(--paper); color: #b42318; font-size: 12px; }
.source-content[contenteditable="true"] th,.source-content[contenteditable="true"] td { position: relative; }
.column-resize-handle { position: absolute; z-index: 2; top: 0; right: -8px; width: 16px; height: 100%; min-height: 32px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
.column-resize-handle::after { content: ""; position: absolute; top: 20%; bottom: 20%; left: 7px; width: 2px; border-radius: 2px; background: var(--line-strong); }
.column-resize-handle:hover::after { background: var(--accent); }
.entry-title { font-family: var(--heading); font-size: 20px; font-weight: 600; line-height: 1.5; margin: 0 0 12px; overflow-wrap: anywhere; }
.video-link { color: var(--ink); text-decoration: none; }
.video-link:hover .entry-title-text { text-decoration: underline; text-decoration-color: rgba(55,53,47,.4); text-underline-offset: 4px; }
.destination-label { display: inline-block; margin-left: 8px; color: var(--faint); font-family: var(--body); font-size: 12px; font-weight: 400; letter-spacing: 0; white-space: nowrap; vertical-align: 2px; }
.video-link:hover .destination-label { color: var(--muted); text-decoration: underline; }
.resource-entry[data-status="removed"] .entry-title { color: var(--faint); }
.resource-entry[data-status="removed"] .video-link { color: inherit; }
.source-content { min-width: 0; overflow-wrap: anywhere; font-size: 16px; line-height: 1.8; }
.source-content .text-color-default, .page-chrome-region .text-color-default, .entry-title .text-color-default { color: #37352f; }
.source-content .text-color-red, .page-chrome-region .text-color-red, .entry-title .text-color-red { color: #b42318; }
.source-content .text-color-orange, .page-chrome-region .text-color-orange, .entry-title .text-color-orange { color: #b54708; }
.source-content .text-color-green, .page-chrome-region .text-color-green, .entry-title .text-color-green { color: #067647; }
.source-content .text-color-blue, .page-chrome-region .text-color-blue, .entry-title .text-color-blue { color: #175cd3; }
.source-content .text-color-purple, .page-chrome-region .text-color-purple, .entry-title .text-color-purple { color: #6941c6; }
.source-content > :first-child { margin-top: 0; }
.source-content > :last-child { margin-bottom: 0; }
.source-content p { margin: 8px 0; }
.source-content h2 { font-size: 22px; font-weight: 600; line-height: 1.4; margin: 26px 0 8px; }
.source-content h3 { font-size: 18px; font-weight: 600; line-height: 1.4; margin: 20px 0 6px; }
.source-content h4, .source-content h1 { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 16px 0 4px; }
.source-content ul, .source-content ol { padding-left: 24px; margin: 6px 0; }
.source-content li { margin: 2px 0; }
.source-content blockquote { border-left: 3px solid var(--ink); padding: 2px 0 2px 14px; margin: 12px 0; color: var(--ink); }
.source-content pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px 16px; background: var(--wash); border-radius: 6px; margin: 10px 0; }
.source-content pre code { color: var(--ink); background: transparent; padding: 0; }
.source-content code { font-family: var(--mono); font-size: .85em; color: var(--code-red); background: var(--code-wash); border-radius: 4px; padding: .15em .35em; }
.source-content table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 12px 0; font-size: 14px; }
.source-content .table-scroll { max-width: 100%; overflow-x: auto; margin: 12px 0; }
.source-content .table-scroll table { margin: 0; }
.source-content th, .source-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; overflow-wrap: anywhere; min-width: 0; }
.source-content th { font-weight: 500; background: var(--wash); }
.source-content tr > :first-child:not(:only-child) { width: 25%; }
.source-content .resized-table tr > :first-child:not(:only-child) { width: auto; }
.source-content .source-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 14px 0; }
.source-grid > * { min-width: 0; }
.source-content img { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 6px; }
.source-content .source-grid:has(> :only-child) { grid-template-columns: minmax(0,1fr); }
.image-zoom { display: block; max-width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: zoom-in; }
.image-zoom img { margin: 8px 0; }
.source-content figure { margin: 14px 0; max-width: 100%; }
.source-content figcaption { font-size: 12px; color: var(--muted); }
.source-content .attachment-link { display: inline-flex; align-items: center; padding: 6px 12px; margin: 3px 0; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; max-width: 100%; color: var(--ink); text-decoration: none; font-size: 14px; }
.source-content .attachment-link:hover { background: var(--wash); }
.source-content .attachment-link::before { content: "↓"; margin-right: 7px; color: var(--faint); }
.source-content blockquote.callout { border-left: 0; background: var(--wash); color: var(--ink); padding: 14px 16px; border-radius: 8px; margin: 12px 0; }
.source-content blockquote.callout::before { content: "💡 " attr(data-callout); display: block; font-weight: 600; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.source-content .task-list-item { list-style: none; margin-left: -24px; display: flex; align-items: baseline; }
.source-content .task-list-item::before { content: ""; flex: 0 0 auto; width: 15px; height: 15px; border: 1.5px solid var(--line-strong); border-radius: 3px; margin-right: 9px; align-self: center; background: var(--paper); }
.source-content .task-list-item[data-checked="true"]::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 11px; line-height: 15px; text-align: center; }
.source-content details { border: 0; border-radius: 6px; padding: 4px 0 4px 4px; margin: 8px 0; }
.source-content details summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 2px; border-radius: 6px; }
.source-content details summary::-webkit-details-marker { display: none; }
.source-content details summary::before { content: "›"; color: var(--faint); font-size: 18px; line-height: 1; transition: transform .15s; }
.source-content details[open] > summary::before { transform: rotate(90deg); }
.source-content details summary:hover { background: var(--hover); }
.source-content details > :not(summary) { margin-left: 18px; }
.feishu-note { color: var(--faint); font-size: 12px; margin: 12px 0 0; }
.state-panel { padding: 30px 20px; text-align: center; background: var(--wash); border: 0; border-radius: 8px; }
.state-panel h2 { font-size: 17px; margin: 0 0 8px; }
.state-panel p { color: var(--muted); font-size: 13px; }
.primary-button { min-height: 36px; border: 0; background: var(--accent); color: #fff; padding: 7px 14px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.primary-button:hover { background: var(--accent-dark); }
.document-footer { margin-top: 36px; padding: 22px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--faint); font-size: 12px; }
.document-footer a { color: var(--faint); text-decoration: none; }
.document-footer a:hover { color: var(--ink); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 13px; padding: 10px 18px; max-width: calc(100% - 32px); z-index: 10; pointer-events: none; }
.toast:empty { display: none; }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; color: var(--ink); background: var(--paper); max-height: calc(100dvh - 32px); width: min(1100px, calc(100% - 32px)); overflow: auto; box-shadow: 0 14px 40px rgba(15,15,15,.12); }
dialog::backdrop { background: rgba(15,15,15,.35); }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.dialog-toolbar h2 { font-size: 15px; margin: 0; }
.close-button { width: 32px; height: 32px; font-size: 20px; line-height: 1; border: 0; border-radius: 6px; color: var(--muted); background: transparent; flex-shrink: 0; }
.close-button:hover { background: var(--hover); }
.image-stage { display: grid; place-items: center; min-height: 120px; background: var(--wash); border-radius: 8px; }
.image-stage img { display: block; max-width: 100%; max-height: 70dvh; object-fit: contain; }
#image-caption { font-size: 12px; color: var(--muted); margin: 10px 0 3px; overflow-wrap: anywhere; }
#original-image-link { font-size: 12px; }
#share-dialog { width: min(530px,calc(100% - 32px)); }
/* 侧栏「复制公众号名」弹出的公众号二维码（promo.js） */
.wechat-qr-dialog { width: min(320px, calc(100% - 32px)); text-align: center; }
.wechat-qr-dialog .dialog-toolbar { text-align: left; }
.wechat-qr-image { display: block; width: 215px; max-width: 100%; height: auto; margin: 4px auto 12px; }
.wechat-qr-tip { margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.wechat-qr-status { margin: 0; color: var(--faint); font-size: 12px; line-height: 1.6; }
#share-dialog p { font-size: 13px; color: var(--muted); }
#share-url { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-family: var(--mono); font-size: 13px; }
@media (max-width: 1080px) {
  .document-layout { grid-template-columns: 190px minmax(0,1fr); gap: 32px; padding: 0 26px; }
  .shop-promo-inner { padding-inline: 26px; }
}
@media (max-width: 760px) {
  .site-header { height: 52px; padding: 0 18px; gap: 10px; }
  .edit-mode-bar { top: 52px; }
  .shop-promo-inner { padding: 10px 20px; gap: 10px; }
  .shop-promo-mark { display: none; }
  .shop-promo-copy { display: grid; gap: 1px; }
  .shop-promo-copy > * { font-size: 13px; }
  .shop-promo-copy > * + * { font-size: 11px; }
  .shop-promo-link { min-height: 36px; padding: 5px 10px; font-size: 12px; }
  .brand, .brand-text { font-size: 13px; gap: 6px; }
  .brand-dot { width: 28px; height: 28px; }
  .header-link, .site-nav a { font-size: 11px; }
  .document-layout { display: block; padding: 0 20px; }
  .sidebar { position: static; border: 0; border-bottom: 1px solid var(--line); max-height: none; padding: 7px 0; }
  .follow-card { padding: 0; margin: 0; border-radius: 0; background: transparent; }
  .follow-card-title { display: none; }
  .follow-card-links { display: flex; flex-wrap: wrap; gap: 2px 13px; }
  .follow-card-links a, .follow-card-links button { width: auto; min-height: 40px; padding: 8px 0; }
  .follow-card > p:first-child { display: none; }
  .follow-card > ul { display: flex; flex-wrap: wrap; gap: 2px 13px; }
  .follow-card > ul > li { min-height: 40px; padding: 8px 0; }
  .follow-card > ul > li > a, .follow-card > ul > li > button { width: auto; min-height: 40px; padding: 8px 0; }
  #directory > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; }
  #directory > summary::after { content: "+"; margin-left: auto; color: var(--faint); }
  #directory[open] > summary::after { content: "−"; }
  .directory-hint { display: inline; margin-top: 0; }
  #timeline-nav { display: flex; flex-wrap: wrap; gap: 10px 20px; padding-top: 12px; }
  .nav-year { flex: 1 1 120px; margin-bottom: 0; }
  .nav-months { display: flex; flex-wrap: wrap; gap: 4px; border: 0; margin: 0; padding: 3px 0; }
  .nav-month { gap: 7px; min-height: 36px; padding: 5px 9px; background: var(--wash); }
  .about-link { margin-top: 12px; padding-top: 12px; }
  main { padding-top: 18px; }
  h1 { font-size: 26px; margin-bottom: 6px; }
  .intro-description { font-size: 14px; }
  .document-tools { margin-top: 14px; }
  .search-form input { font-size: 16px; }
  .results-header { font-size: 11px; padding-bottom: 14px; }
  .entry-title { font-size: 18px; margin-bottom: 10px; }
  .resource-entry { padding: 18px 0 24px; }
  .entry-meta { gap: 7px; }
  .entry-actions { gap: 0; }
  .copy-link { min-height: 40px; padding: 7px; }
  .source-content { font-size: 16px; }
  .source-content th, .source-content td { padding: 8px; font-size: 14px; }
  .source-content .table-scroll table { min-width: 560px; }
  .source-content .table-scroll::before { content: "左右滑动查看完整表格 →"; display: block; padding: 0 0 7px; color: var(--muted); font-size: 12px; }
  .resource-entry .source-content .table-scroll table { min-width: 0; }
  .resource-entry .source-content .table-scroll::before { display: none; }
  .resource-entry .source-content .table-scroll colgroup { display: none; }
  .resource-entry .source-content .column-resize-handle { display: none; }
  .resource-entry .source-content table, .resource-entry .source-content thead, .resource-entry .source-content tbody, .resource-entry .source-content tr, .resource-entry .source-content th, .resource-entry .source-content td { display: block; width: 100%; }
  .resource-entry .source-content tr + tr { margin-top: 10px; }
  .resource-entry .source-content tr > :first-child:not(:only-child) { background: var(--wash); padding: 7px 11px 4px; color: var(--muted); font-size: 12px; }
  .resource-entry .source-content tr > :not(:first-child) { border-top: 0; background: var(--paper); padding: 7px 11px 10px; color: var(--ink); font-size: 14px; }
  .resource-entry .source-content tr > :first-child:not(:only-child) { width: 100%; }
  .source-content .source-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .source-content .task-list-item { margin-left: 0; }
  .year-heading { padding: 14px 0; }
  .year-heading h2 { font-size: 20px; }
  .year-label { font-size: 11px; }
  dialog { padding: 12px 14px; }
  #about, .year-group, .month-group, .resource-entry { scroll-margin-top: 68px; }
}
@media (max-width: 360px) {
  .document-layout { padding: 0 15px; }
  .site-header { padding: 0 15px; }
  .shop-promo-inner { padding-inline: 15px; }
  .shop-promo-copy > * + * { display: none; }
  .brand, .brand-text { font-size: 12px; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.wechat-action { margin-top: 14px; padding: 14px 16px; background: var(--wash); border-radius: 8px; }
.wechat-instruction { margin: 0 0 10px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.wechat-button { font-size: 14px; font-weight: 500; min-height: 40px; }
.wechat-hint, .wechat-status { margin: 10px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.wechat-feedback { margin-top: 12px; padding-top: 2px; border-top: 1px solid var(--line); }
.wechat-copy-label { display: block; font-size: 12px; margin-top: 10px; color: var(--muted); }
.wechat-copy-value { display: block; width: 100%; max-width: 350px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 16px; }
.wechat-retry { display: inline-block; font-size: 13px; padding: 10px 0; min-height: 44px; }

/* 选中文字弹出的格式浮条（format-toolbar.js）：fixed 定位挂在 document.body，不进保存的 HTML */
.format-toolbar { position: fixed; z-index: 40; display: grid; gap: 4px; max-width: calc(100vw - 16px); padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 8px 28px rgba(15,15,15,.14); color: var(--ink); line-height: 1; user-select: none; -webkit-user-select: none; }
.format-toolbar-row, .format-toolbar-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.format-toolbar-palette { padding-top: 5px; border-top: 1px solid var(--line); }
.format-toolbar button { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 15px; line-height: 1; }
.format-toolbar button:hover { background: var(--hover); }
.format-toolbar-row button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent); }
.format-toolbar-sep { align-self: stretch; width: 1px; margin: 5px 3px; background: var(--line); }
.format-toolbar sub { font-size: .6em; }
.format-size-button { font-size: 13px !important; }
.format-color-button { grid-template-rows: auto 3px; gap: 2px; border: 1px solid var(--line-strong) !important; }
.format-color-letter { font-weight: 600; }
.format-color-bar { width: 14px; height: 3px; border-radius: 2px; background: var(--ink); }
.format-color-button[data-color="red"] .format-color-bar { background: #b42318; }
.format-color-button[data-color="orange"] .format-color-bar { background: #b54708; }
.format-color-button[data-color="green"] .format-color-bar { background: #067647; }
.format-color-button[data-color="blue"] .format-color-bar { background: #175cd3; }
.format-color-button[data-color="purple"] .format-color-bar { background: #6941c6; }
.format-toolbar-palette button { font-weight: 700; color: var(--ink); }
.format-toolbar-palette [data-value="red"] { color: #b42318; }
.format-toolbar-palette [data-value="orange"] { color: #b54708; }
.format-toolbar-palette [data-value="green"] { color: #067647; }
.format-toolbar-palette [data-value="blue"] { color: #175cd3; }
.format-toolbar-palette [data-value="purple"] { color: #6941c6; }
.format-toolbar-palette button[aria-pressed="true"] { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

/* Notion 风格块编辑器 UI：全部 fixed 定位挂在 document.body，不进保存的 HTML */
.block-handle { position: fixed; z-index: 20; display: flex; gap: 1px; user-select: none; }
.block-handle button { width: 20px; height: 22px; border: 0; border-radius: 4px; background: transparent; color: var(--faint); font-size: 13px; line-height: 1; padding: 0; cursor: grab; display: grid; place-items: center; }
.block-handle button:hover { background: var(--hover); color: var(--ink); }
.block-handle-plus { font-size: 15px !important; }
.block-dragging { opacity: .45; }
.block-drop-indicator { position: fixed; z-index: 21; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; }
.block-menu { position: fixed; z-index: 30; display: grid; gap: 1px; min-width: 190px; max-width: calc(100vw - 16px); max-height: min(380px, calc(100dvh - 16px)); overflow: auto; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 8px 24px rgba(0,0,0,.10); font-size: 13px; }
.block-menu-item { display: flex; align-items: baseline; gap: 8px; width: 100%; min-height: 32px; padding: 6px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.block-menu-item:hover, .block-menu-item.active { background: var(--wash); }
.block-menu-item:disabled { color: var(--faint); cursor: default; background: transparent; }
.block-menu-item strong { font-weight: 500; }
.block-menu-hint { color: var(--faint); font-size: 12px; margin-left: auto; padding-left: 12px; }
.block-menu-empty { margin: 6px 10px; color: var(--faint); font-size: 12px; }
@media (max-width: 760px) {
  .block-handle { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
  .block-handle button { width: 26px; height: 30px; font-size: 15px; }
  .block-menu-item { min-height: 38px; }
}
@media (pointer: coarse) {
  .block-handle button { cursor: default; }
}

/* === 条目块化 === */
/* 条目特殊块（打开原文 / 公众号领取 / 复制本条链接）存储为无 class 的
   <blockquote data-callout="…">，落在服务端清洗白名单内；阅读态由 app.js 增强成交互 UI */
.source-content blockquote[data-callout="打开原文"],
.source-content blockquote[data-callout="公众号领取"],
.source-content blockquote[data-callout="复制本条链接"] { border-left: 0; background: var(--wash); color: var(--ink); padding: 14px 16px; border-radius: 8px; margin: 12px 0; }
.source-content blockquote[data-callout="打开原文"]::before,
.source-content blockquote[data-callout="公众号领取"]::before,
.source-content blockquote[data-callout="复制本条链接"]::before { display: block; font-weight: 600; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.source-content blockquote[data-callout="打开原文"]::before { content: "🔗 打开原文"; }
.source-content blockquote[data-callout="公众号领取"]::before { content: "📮 公众号领取"; }
.source-content blockquote[data-callout="复制本条链接"]::before { content: "📋 复制本条链接"; }
.source-content blockquote[data-callout="打开原文"] > p,
.source-content blockquote[data-callout="公众号领取"] > p,
.source-content blockquote[data-callout="复制本条链接"] > p { margin: 0; overflow-wrap: anywhere; }
.source-content .entry-copy-action { margin: 12px 0; }
.source-content .entry-copy-action .copy-link { font-size: 13px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); padding: 8px 14px; min-height: 36px; }
.source-content .entry-copy-action .copy-link:hover { background: var(--wash); }
.source-content .wechat-action { margin: 12px 0; }

/* === Markdown 输入与字号 === */
/* 块编辑器 Markdown 键入即转（public/markdown-input.js）：{big}文字{/big}、{small}文字{/small}
   产出的字号 span，class 已加入 worker/content.js 清洗白名单；颜色沿用上方 text-color-* 规则 */
.source-content .text-size-large, .page-chrome-region .text-size-large, .entry-title .text-size-large { font-size: 1.15em; }
.source-content .text-size-small, .page-chrome-region .text-size-small, .entry-title .text-size-small { font-size: 0.85em; }
.page-chrome-region code, .entry-title code { font-family: var(--mono); font-size: .85em; color: var(--code-red); background: var(--code-wash); border-radius: 4px; padding: .15em .35em; }
