@charset "utf-8";
/* 界面与 Markdown 排版共用主题变量。 */
:root {
  color-scheme: dark;
  --accent: #8dc9a7;
  --canvas: color-mix(in srgb, var(--accent) 7%, #080b0a);
  --sidebar: color-mix(in srgb, var(--accent) 4%, #080b0a);
  --surface: color-mix(in srgb, var(--accent) 8%, #080b0a);
  --panel: color-mix(in srgb, var(--accent) 12%, #080b0a);
  --active: color-mix(in srgb, var(--accent) 20%, #080b0a);
  --line: color-mix(in srgb, var(--accent) 22%, #101612);
  --line-strong: color-mix(in srgb, var(--accent) 34%, #101612);
  --text: color-mix(in srgb, var(--accent) 12%, #c9cfcc);
  --heading: color-mix(in srgb, var(--accent) 12%, #e5e9e7);
  --muted: color-mix(in srgb, var(--accent) 18%, #87938d);
  --subtle: color-mix(in srgb, var(--accent) 28%, #526158);
  --accent-soft: color-mix(in srgb, var(--accent) 60%, #cbd1ce);
  --accent-hover: color-mix(in srgb, var(--accent) 65%, white);
  --button-ink: color-mix(in srgb, var(--accent) 20%, #080b0a);
  --selection: color-mix(in srgb, var(--accent) 40%, #101612);
  --search-bg: color-mix(in srgb, var(--accent) 35%, #25302a);
  --danger-text: #e5a6a0;
  --danger-line: #68423d;
  --danger-bg: #32221f;
  --search-text: color-mix(in srgb, var(--accent) 15%, #f1e8cc);
}
:root[data-theme="blue"] { --accent: #8eafcf; }
:root[data-theme="teal"] { --accent: #86c5c5; }
:root[data-theme="violet"] { --accent: #b4a0d0; }
:root[data-theme="rose"] { --accent: #ce9eaf; }
:root[data-theme="amber"] { --accent: #cbb082; }
:root[data-theme="graphite"] { --accent: #b3bac1; }
/* 光明系沿用同一配色键，文字重新计算为适合浅底的深色。 */
:root[data-appearance="light"] {
  color-scheme: light;
  --canvas: #fafbf9;
  --sidebar: #f2f4f1;
  --surface: #ffffff;
  --panel: color-mix(in srgb, var(--accent) 12%, #f4f6f3);
  --active: color-mix(in srgb, var(--accent) 24%, #ffffff);
  --line: #dce2dc;
  --line-strong: #bbc8bd;
  --text: #34413a;
  --heading: #182a20;
  --muted: #65736a;
  --subtle: #85968b;
  --accent-soft: color-mix(in srgb, var(--accent) 40%, #173a29);
  --accent-hover: color-mix(in srgb, var(--accent) 45%, #203f2d);
  --button-ink: #14271b;
  --selection: #d5e6d9;
  --search-bg: #f2df9d;
  --search-text: #433316;
  --danger-text: #b42318;
  --danger-line: #f4b8b2;
  --danger-bg: #fff0ee;
}
:root[data-appearance="light"] ::selection { color: var(--heading); background: var(--selection); }
:root[data-appearance="light"] .section-text { caret-color: var(--heading); }
:root[data-appearance="light"] .section-text::selection,
:root[data-appearance="light"] .section-text *::selection { color: var(--heading); -webkit-text-fill-color: var(--heading); background: var(--selection); }
body { margin: 0; padding: 0; color: var(--text); background: var(--canvas); font-size: 14px;}
* { box-sizing: border-box; font-family: "Cascadia Code", "Consolas", "Microsoft YaHei", "微软雅黑", monospace; }
*::selection { color: #fff; background-color: var(--line-strong); }
*::-webkit-scrollbar { height: 7px; width: 7px; }
*::-webkit-scrollbar-track { background-color: transparent; }
*::-webkit-scrollbar-thumb { background-color: var(--line-strong); border-radius: 7px; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--muted); cursor: default; }
*::placeholder { color: var(--muted); font-weight: normal; }

.main { display: flex; height: 100vh; height: 100dvh; }
.content { flex: 1; min-width: 325px; }
.box { display: flex; flex-direction: column; position: relative; }
.box-title { flex: 0 0 auto; background: var(--panel); font-size: 14px; padding: 4px 10px; display: flex; align-items: center; min-height: 37px; gap: 8px; flex-wrap: wrap; }
.box-title>div { display: flex; align-items: center; }
.box-content { padding: 10px; position: relative; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; }
.drag { position: absolute; width: 7px; height: 100%; background: transparent; top: 0; right: -4px; cursor: col-resize; z-index: 10; }
.menu>div { cursor: pointer; background: var(--canvas); border-radius: 2px; padding: 0 8px; margin-left: 5px; display: none; align-items: center; height: 23px; }
.menu>div:hover { color: var(--accent); }

/* 文章内容 */
.article { display: flex; flex-direction: column; }
#content-title { margin-right: auto; }
#article-info { font-size: 13px; color: var(--muted); text-align: center; }
#article-empty { display: none; text-align: center; color: var(--muted); letter-spacing: 2px; }
.article-empty-icon { margin-top: 40vh; font-size: 38px; font-weight: normal; }
.article-empty-title { display: inline-block; padding-top: 10px; }

/* 文章列表 */
#list { order: -1; border-right: 1px solid var(--line); min-width: 220px; width: 280px; flex-shrink: 0; }
.list-box { overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; }
.list-item { font-size: 14px; padding: 5px 10px; cursor: pointer; display: flex; align-items: center; margin-bottom: 1px; }
.list-item:hover { background: var(--panel); border-radius: 5px; }
.list-item.active { color: var(--accent); background: var(--panel); border-radius: 5px; }
.list-item span { margin-right: 8px; color: var(--accent); flex-shrink: 0; }
.list-item .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item[style*="display: none"] { display: none!important; }

/* 弹窗 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 1000; justify-content: center; align-items: center; }
.modal-bg { background: var(--sidebar); }
.modal-content { background-color: var(--panel); border-radius: 5px; width: 350px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); overflow: hidden; }
.modal-title { font-size: 18px; color: var(--text); text-align: center; padding: 20px 20px 0; letter-spacing: 2px; }
.modal-message { color: var(--text); line-height: 1.5; padding: 30px; font-size: 15px; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 15px; padding: 8px 10px; background: var(--panel); }
.modal-button { padding: 4px 12px; background-color: var(--line-strong); border: none; border-radius: 3px; color: var(--text); cursor: pointer; font-size: 14px; transition: background-color 0.2s; }
.modal-button:hover { background-color: var(--line-strong); }
.modal-button.confirm { background-color: var(--accent); color: #fff; }
.modal-button.confirm:hover { background-color: var(--accent-hover); }
.modal-button.danger { background-color: #d32f2f; }
.modal-button.danger:hover { background-color: #f44336; }
.modal-buttons.single { justify-content: center; }
.modal-input { width: calc(100% - 60px); padding: 7px 10px; margin: 30px; background: var(--canvas); border: 1px solid var(--canvas); border-radius: 3px; color: var(--text); font-size: 14px; box-shadow: inset 0 0 15px rgb(0 0 0 / 30%); }
.modal-input:focus { outline: none; border-color: var(--accent); }

/* 单选按钮组样式 */
.radio-group { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.radio-label { display: flex; padding: 0 12px; cursor: pointer; transition: all 0.2s ease; align-items: center; }
.radio-label input[type="radio"] { margin-right: 10px; width: 16px; height: 16px; cursor: pointer; appearance: none; -webkit-appearance: none; border: 2px solid #ccc; border-radius: 50%; outline: none; transition: all 0.2s ease; position: relative; }
.radio-label input[type="radio"]:checked { border-color: var(--accent); background: var(--accent); }
.radio-label input[type="radio"]:checked::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 6px; height: 6px; background: #fff; border-radius: 50%; }
.radio-label input[type="radio"]:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.radio-text { display: block; margin-right: 10px; font-size: 14px; }
.radio-desc { font-size: 12px; line-height: 1.4; display: block; color: var(--muted); }

/* 设置表单样式 */
#setting-panel { display: none; }
.setting-form { padding: 20px; }
.form-group { margin-bottom: 20px; }
.form-group .radio-group { margin-top: 4px; }
.form-label { display: block; margin-bottom: 8px; color: var(--text); font-size: 14px; }
.form-input { width: 100%; padding: 7px 10px; background: var(--canvas); border: 1px solid var(--line-strong); border-radius: 3px; color: var(--text); font-size: 14px; }
.form-input:focus { outline: none; border-color: var(--accent); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.setting-buttons { display: flex; gap: 10px; margin-top: 30px; }
.setting-button { padding: 8px 20px; background: var(--line-strong); border: none; border-radius: 3px; color: #fff; cursor: pointer; font-size: 14px; }
.setting-button:hover { background: var(--line-strong); }
.setting-button.primary { background: var(--accent); color: #fff; }
.setting-button.primary:hover { background: var(--accent-hover); }

/* 搜索 */
.search-box { padding-bottom: 10px; flex: 0 0 auto; }
.search-input { width: 100%; padding: 5px 12px; background: var(--canvas); border: 1px solid var(--line-strong); color: var(--text); border-radius: 3px; }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent); }
.search-input::placeholder { color: var(--muted); }

/* 移动端适配 */
@media (max-width: 768px) {
  .content { min-width: 0; width: 100%; }
  #list { display: none; position: fixed; inset: 0 auto 0 0; width: min(85vw, 340px)!important; min-width: 0; z-index: 100; background: var(--canvas); box-shadow: 8px 0 24px #0006; }
  .main.directory-open #list { display: flex; }
  .main.directory-open #directory-backdrop { display: block; }
  .drag { display: none; }
  .box-title { font-size: 12px; padding: 6px; }
  .menu>div { font-size: 12px; padding: 4px 6px; min-height: 30px; }
}

.plain-button { color: var(--text); background: var(--canvas); border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 8px; cursor: pointer; }
.plain-button:hover { color: var(--accent-soft); border-color: var(--accent-soft); }
.plain-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.directory-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 0; box-shadow: none; font: inherit; line-height: 1; cursor: pointer; transition: color .15s ease, background-color .15s ease; }
.directory-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#directory-toggle { gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 7px; color: var(--text); background: #ffffff0d; }
#directory-toggle:hover, #directory-toggle:focus-visible { color: var(--accent-hover); background: #ffffff18; }
#directory-toggle:active { background: #ffffff22; }
.directory-close { margin-left: auto; width: 28px; height: 28px; padding: 0; color: var(--muted); background: transparent; }
.directory-close:hover, .directory-close:focus-visible { color: var(--accent-hover); background: transparent; }
.directory-button:focus-visible { outline: none; }
#article-count { color: var(--muted); font-size: 12px; }
#save-status { color: var(--muted); font-size: 12px; }
.menu { flex-wrap: wrap; gap: 3px; }
.menu.busy { pointer-events: none; opacity: .6; }
#draft-control { flex-shrink: 0; }
#draft-toggle { gap: 6px; min-height: 29px; }
#draft-count { min-width: 15px; color: var(--muted); font-size: 11px; }
#draft-banner { position: fixed; inset: 62px 20px auto auto; width: min(400px, calc(100vw - 32px)); margin: 0; padding: 20px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); }
#draft-banner:not(:popover-open) { display: none; }
#draft-banner:popover-open { display: flex; flex-wrap: wrap; gap: 14px; }
#draft-banner label { width: 100%; font-size: 13px; color: var(--heading); }
#draft-select { width: 100%; min-width: 0; color: var(--text); background: var(--canvas); border: 1px solid var(--line); padding: 8px; font-size: 12px; }
.draft-actions { display: flex; justify-content: flex-end; width: 100%; gap: 8px; }
.search-option { display: flex; align-items: center; gap: 4px; padding-top: 7px; color: var(--muted); font-size: 12px; }
#search-status { font-size: 12px; color: var(--muted); padding-top: 7px; line-height: 1.5; }
#search-status:empty { display: none; }
#directory-backdrop { display: none; position: fixed; inset: 0; z-index: 90; border: 0; background: #0008; }
.modal-content { max-width: calc(100vw - 24px); }
.drag { touch-action: none; }
@media (min-width: 769px) {
  .main.directory-collapsed #list { display: none; }
}

/* 备忘录保持双栏布局，统一使用低饱和终端配色。 */
[hidden] { display: none!important; }
button, input, textarea { font: inherit; }
button:disabled { opacity: .35; cursor: default; }
#memo-body { max-width: 1120px; padding: 22px 30px 70px; margin: 0 auto; }
#memo-title { width: 100%; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; color: var(--heading); font-size: 25px; padding: 8px 0 15px; outline: none; }
#memo-title:focus { border-color: var(--accent); }
#memo-heading { font-size: 25px; font-weight: 500; color: var(--heading); margin: 8px 0 24px; overflow-wrap: anywhere; }
#article-info { text-align: left; padding: 10px 30px 0; max-width: 1120px; margin: auto; font-size: 12px; }
.memo-section { border-bottom: 1px solid var(--line); padding: 22px 0 28px; }
.memo-section:first-child { padding-top: 6px; }
.section-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-bar h2 { font-size: 18px; color: var(--accent); font-weight: 500; margin: 0; overflow-wrap: anywhere; }
.section-title { flex: 1; width: 0; min-width: 0; background: transparent; color: var(--accent-soft); border: 1px solid transparent; border-radius: 4px; font-size: 16px; padding: 7px; outline: none; }
.section-title:focus { border-color: var(--line-strong); }
.section-handle, .note-handle { border: 0; background: transparent; color: var(--muted); cursor: grab; font-size: 20px; line-height: 1; padding: 4px; flex-shrink: 0; touch-action: none; }
.section-handle:hover, .note-handle:hover { color: var(--accent); }
.note-handle { font-size: 17px; margin-right: 6px; opacity: .4; }
.list-item:hover .note-handle, .note-handle:focus { opacity: 1; }
.section-text { width: 100%; min-height: 130px; resize: vertical; border: 1px solid var(--line); border-radius: 5px; background: var(--canvas); color: var(--text); outline: none; padding: 15px; line-height: 1.9; tab-size: 4; }
.section-text:focus { border-color: var(--accent); }
.section-text::placeholder { color: var(--muted); font-size: 13px; }
.section-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.section-tools span { color: var(--muted); font-size: 12px; }
.section-preview { white-space: pre-wrap; line-height: 1.95; overflow-wrap: anywhere; }
.section-preview a { color: var(--accent-soft); }
.section-preview pre { margin: 15px 0; padding: 16px; background: var(--sidebar); border: 1px solid var(--line); border-radius: 5px; overflow-x: auto; white-space: pre; }
.section-preview code { font-family: Consolas, monospace; font-size: 13px; }
.section-preview.editing-preview { margin-top: 14px; padding: 14px; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 5px; }
.empty-section { color: var(--muted); }
#add-section { margin-top: 22px; padding: 9px 16px; border-style: dashed; color: var(--accent); }
#upload-status { color: var(--accent-soft); font-size: 12px; margin-top: 12px; }
.sorting { opacity: .45; background: var(--active); outline: 1px dashed var(--accent); }
.file-card { position: relative; display: inline-flex; vertical-align: middle; flex-direction: column; gap: 4px; max-width: min(100%, 300px); min-width: 180px; padding: 12px 14px; margin: 8px 8px 8px 0; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; line-height: 1.5; white-space: normal; }
.file-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); max-width: 100%; }
.file-card small { color: var(--muted); }
.file-card.image-card { padding: 8px; max-width: min(100%, 240px); }
.image-card img { width: 100%; height: 150px; object-fit: cover; border-radius: 3px; cursor: zoom-in; background: var(--sidebar); }
.file-actions { display: flex; flex-wrap: wrap; gap: 6px; opacity: 0; transition: opacity .15s; }
.file-card:hover .file-actions, .file-card:focus-within .file-actions { opacity: 1; }
.file-actions .plain-button { font-size: 12px; padding: 3px 8px; color: var(--text); text-decoration: none; }
.plain-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; line-height: 1.5; }
#file-viewer { width: min(1250px, 96vw); height: min(940px, 94dvh); padding: 0; color: var(--text); background: var(--sidebar); border: 1px solid var(--line-strong); border-radius: 8px; }
#file-viewer[open] { display: flex; flex-direction: column; }
#file-viewer::backdrop { background: #000c; }
.viewer-bar { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--panel); }
#viewer-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#viewer-content { min-height: 0; flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 14px; }
#viewer-content>img { max-width: 100%; max-height: 100%; object-fit: contain; }
#viewer-content>iframe { width: 100%; height: 100%; border: 0; background: #fff; }
#viewer-content>pre, #viewer-content>p { margin: 0; padding: 16px; align-self: flex-start; width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.viewer-navigation { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 12px; }
.form-hint, .radio-desc { color: var(--muted); }
@media (hover: none) { .file-actions { opacity: 1; } }
@media (max-width: 768px) {
  #memo-body { padding: 18px 4px 50px; }
  #memo-title, #memo-heading { font-size: 21px; }
  #article-info { padding: 8px 4px; }
  .section-bar { flex-wrap: wrap; gap: 4px; }
  .section-title { font-size: 15px; }
  .section-bar .plain-button { padding: 3px 6px; font-size: 12px; }
  .section-text { padding: 10px; }
  .file-actions { opacity: 1; }
  .file-card { min-width: 150px; max-width: 100%; }
  .file-card.image-card { width: min(210px, 100%); }
}

/* 分区和附件区仅以直角细边框区分，阅读和编辑共用同一套内容布局。 */
#memo-title, #memo-heading { font-size: 25px; font-weight: 500; color: var(--heading); margin: 8px 0 24px; padding: 0; line-height: 1.5; border: 0; border-radius: 0; }
.memo-section, .memo-section:first-child { border: 1px solid var(--line); border-radius: 0; background: var(--surface); box-shadow: none; padding: 20px 24px; margin: 0 0 18px; }
.section-bar { position: relative; display: flex; align-items: start; min-height: 32px; margin-bottom: 12px; gap: 8px; }
.section-title, .section-bar h2 { display: block; flex: 1; min-width: 0; width: auto; margin: 0; padding: 2px 0; border: 0; outline: 0; font-size: 17px; line-height: 1.7; color: var(--accent); font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; }
.editing .section-title:empty::before { content: attr(data-placeholder); color: var(--muted); }
.section-title:focus { border: 0; }
.section-controls { display: flex; flex-shrink: 0; gap: 5px; align-items: center; }
.section-controls .plain-button { background: transparent; border: 0; padding: 3px 6px; font-size: 12px; }
.section-handle { font-size: 18px; }
.edit-control { visibility: hidden; }
.editing .edit-control { visibility: visible; }
.section-body { line-height: 1.95; }
.text-block { position: relative; min-height: 1.95em; overflow-wrap: anywhere; min-width: 0; }
.text-block.empty-text { min-height: 1.95em; }
.section-text { display: block; width: 100%; min-height: 7em; margin: 0; padding: 0; border: 0; border-radius: 0; color: var(--text); background: transparent; caret-color: var(--heading); outline: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: inherit; tab-size: 4; }
.section-text:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.section-text:focus { border: 0; }
.section-text::selection, .section-text *::selection { color: #fff; -webkit-text-fill-color: #fff; background: var(--selection); }
.attachment-area { display: block; border: 1px solid var(--line); border-radius: 0; padding: 0 12px; margin: 12px 0; background: transparent; }
.attachment-bar { display: flex; align-items: center; justify-content: space-between; min-height: 35px; gap: 8px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.attachment-bar .plain-button { border: 0; background: transparent; color: var(--accent-soft); font-size: 12px; padding: 2px 0 2px 8px; }
.file-row { display: flex; align-items: center; width: 100%; min-width: 0; gap: 10px; min-height: 42px; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent); line-height: 1.6; }
.file-row:last-child { border-bottom: 0; }
.file-icon { color: var(--muted); flex-shrink: 0; }
.file-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: 0; color: var(--text); text-align: left; cursor: pointer; }
.file-title:hover { color: var(--accent-hover); }
.file-size { color: var(--muted); font-size: 12px; width: 68px; text-align: right; flex-shrink: 0; }
.file-row .file-actions { display: flex; flex-shrink: 0; gap: 3px; opacity: 0; }
.file-row:hover .file-actions, .file-row:focus-within .file-actions { opacity: 1; }
.file-row .file-actions .plain-button { border: 0; border-radius: 0; background: none; padding: 2px 5px; color: var(--accent-soft); font-size: 12px; }
.file-row .file-actions .plain-button:hover { color: var(--accent-hover); }
.drop-target { border-color: var(--accent); }
.missing-file { color: #b59a83; }
@media (hover: none) { .file-row .file-actions { opacity: 1; } }
@media (max-width: 768px) {
  #memo-title, #memo-heading { font-size: 21px; }
  .memo-section, .memo-section:first-child { padding: 12px; margin-bottom: 12px; }
  .section-bar { flex-wrap: wrap; }
  .section-title { flex-basis: 100%; font-size: 16px; }
  .section-controls { min-height: 29px; }
  .attachment-area { padding: 0 8px; }
  .file-row { gap: 6px; }
  .file-size { display: none; }
  .file-row .file-actions { opacity: 1; gap: 0; }
  .file-row .file-actions .plain-button { padding: 2px 4px; }
}

/* 终端风格工作区：克制的强调色、直角边框，以及清晰的阅读层级。 */
body { background: var(--canvas); -webkit-font-smoothing: antialiased; }
*::selection { color: var(--heading); background: var(--selection); }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 0; }
.box-title { min-height: 54px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); gap: 10px; }
.content > .box-title { padding-left: 22px; }
.content > .box-content { padding: 0 18px; background: var(--canvas); }
#content-title { color: var(--muted); font-size: 12px; letter-spacing: .06em; }
#content-title::before { content: '/ '; color: var(--subtle); }
#list { background: var(--sidebar); border-color: var(--line); }
#list > .box-title { background: var(--sidebar); }
#list > .box-content { padding: 20px 12px 12px; overflow: hidden; }
.terminal-symbol { font-family: Consolas, monospace; font-weight: 600; color: var(--accent); }
#article-count { padding: 2px 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); }
.directory-close { width: 26px; height: 26px; }
#directory-toggle { min-height: 28px; border-radius: 0; background: transparent; color: var(--accent-soft); padding: 0; margin-right: 12px; }
#directory-toggle:hover, #directory-toggle:focus-visible { color: var(--accent); background: transparent; }
.directory-button:focus-visible, .note-handle:focus-visible, .section-handle:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.menu { gap: 6px; }
.menu > div { height: 29px; margin: 0; padding: 0 9px; background: transparent; border: 1px solid transparent; border-radius: 0; font-size: 12px; color: var(--text); }
.menu > div:hover { border-color: var(--line-strong); color: var(--accent-hover); background: var(--panel); }
.menu #menu-save, .menu #menu-create { border-color: var(--line-strong); background: var(--active); color: var(--accent-soft); }
.menu #menu-delete:hover { color: var(--danger-text); border-color: var(--danger-line); background: var(--danger-bg); }
#save-status { color: var(--muted); font-size: 11px; }
.search-box { padding: 0 0 18px; }
.search-field { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .15s; }
.search-field:focus-within { border-color: var(--accent); }
.search-field > svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.search-input { flex: 1; min-width: 0; width: 0; padding: 9px 0; border: 0; background: transparent; border-radius: 0; font-size: 12px; color: var(--heading); }
.search-input:focus { border: 0; box-shadow: none; outline: none; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
#search-shortcut { white-space: nowrap; font-size: 10px; color: var(--muted); border: 1px solid var(--line-strong); padding: 1px 4px; }
#search-clear { flex-shrink: 0; width: 24px; height: 26px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
#search-clear:hover { color: var(--accent-hover); }
#search-clear:focus-visible { outline: 1px solid var(--accent); }
.search-options { display: flex; align-items: center; gap: 2px; padding-top: 9px; min-height: 35px; }
.search-scope { position: relative; cursor: pointer; }
.search-scope input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.search-scope span { display: block; font-size: 11px; color: var(--muted); border: 1px solid transparent; padding: 3px 10px; line-height: 1.5; }
.search-scope:hover span { color: var(--heading); }
.search-scope input:checked + span { color: var(--accent-soft); background: var(--active); border-color: var(--line-strong); }
.search-scope input:focus-visible + span { outline: 1px solid var(--accent); outline-offset: 2px; }
.search-scope-hint { min-width: 0; margin-left: auto; padding-left: 6px; color: var(--muted); font-size: 10px; line-height: 1.5; }
#search-status { color: var(--accent-soft); padding: 12px 2px 0; font-size: 11px; line-height: 1.8; }
.list-box { min-height: 0; scrollbar-gutter: stable; }
#article-list[aria-busy="true"] { opacity: .5; }
.list-item { position: relative; min-height: 40px; padding: 8px 9px; margin: 2px 0; border: 1px solid transparent; border-left: 2px solid transparent; font-size: 13px; color: var(--text); line-height: 1.6; gap: 2px; }
.list-item:hover { background: var(--panel); color: var(--heading); border-radius: 0; }
.list-item.active { color: var(--accent-soft); border-color: var(--line); border-left-color: var(--accent); background: var(--active); border-radius: 0; }
.note-handle { font-size: 16px; padding: 2px; margin-right: 6px; color: var(--muted); opacity: .35; }
.list-item mark { padding: 0; background: var(--search-bg); color: var(--search-text); }
.search-hit { padding: 0; color: var(--search-text); background: var(--search-bg); font: inherit; line-height: inherit; }
.directory-footer { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.directory-footer .terminal-symbol { color: var(--subtle); }
.drag:hover { background: color-mix(in srgb, var(--accent) 33%, transparent); }
#memo-body { max-width: 1080px; padding: 28px 28px 80px; }
#memo-heading, #memo-title { margin: 0 0 27px; font-size: 26px; font-weight: 600; letter-spacing: -.03em; color: var(--heading); }
#memo-title:focus { outline: none; }
#article-info { max-width: 1080px; padding: 26px 28px 0; color: var(--muted); font-size: 11px; }
.memo-section, .memo-section:first-child { border-color: var(--line); padding: 22px 24px; margin-bottom: 18px; }
.section-title, .section-bar h2 { color: var(--accent-soft); font-size: 15px; font-weight: 500; }
.section-bar { margin-bottom: 16px; }
.section-body { font-size: 13px; line-height: 2; }
.attachment-area { border-color: var(--line); }
.attachment-bar { border-color: var(--line); color: var(--muted); }
.file-row { border-bottom-color: color-mix(in srgb, var(--line) 50%, transparent); }
.plain-button, .setting-button, .form-input, .modal-input, .modal-button, .section-title, #draft-banner, #file-viewer { border-radius: 0; box-shadow: none; }
.plain-button { background: transparent; border-color: var(--line-strong); font-size: 12px; color: var(--accent-soft); }
.section-controls .plain-button { color: var(--muted); }
.section-controls .plain-button:hover, .attachment-bar .plain-button:hover { color: var(--accent-hover); background: var(--panel); }
#add-section { padding: 8px 12px; margin-top: 4px; }
#article-empty { padding: 0 18px; }
.article-empty-icon { margin-top: 30vh; font-size: 42px; color: var(--subtle); font-family: Consolas, monospace; }
.article-empty-title { padding-top: 18px; color: var(--accent-soft); font-size: 16px; letter-spacing: 1px; }
.article-empty-hint { margin-top: 12px; font-size: 12px; color: var(--muted); letter-spacing: 0; line-height: 1.8; }
.modal-content { border: 1px solid var(--line-strong); border-radius: 0; box-shadow: 0 16px 60px #0005; }
.modal-bg { background: var(--sidebar); }
.modal-title { padding-top: 28px; font-size: 17px; }
.modal-input { background: var(--surface); border-color: var(--line-strong); padding: 11px 12px; }
.modal-buttons { padding: 12px 18px; gap: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.modal-button { padding: 6px 16px; background: var(--active); }
.modal-button.confirm, .setting-button.primary { background: var(--accent); color: var(--button-ink); }
.modal-button.confirm:hover, .setting-button.primary:hover, .share-primary:hover,
.modal-button.confirm:focus-visible, .setting-button.primary:focus-visible, .share-primary:focus-visible {
  background: color-mix(in srgb, var(--accent) 86%, white);
  color: var(--button-ink);
  border-color: var(--accent-soft);
}
.setting-form { max-width: 720px; margin: 12px auto; padding: 28px; }
.form-input { background: var(--surface); border-color: var(--line-strong); padding: 10px; }
.viewer-bar { background: var(--panel); border-bottom: 1px solid var(--line); }
.sorting { background: var(--active); outline-color: var(--accent); }
@media (max-width: 768px) {
  .box-title, .content > .box-title { padding: 10px 12px; min-height: 52px; gap: 8px; }
  .content > .box-content { padding: 0 12px; }
  #list { background: var(--sidebar); }
  #list > .box-content { padding-top: 16px; }
  #directory-toggle { margin-right: 4px; }
  .menu { gap: 2px; }
  .menu > div { padding: 0 6px; min-height: 30px; }
  #memo-body { padding: 22px 0 50px; }
  #article-info { padding: 20px 0 0; line-height: 1.8; }
  #memo-heading, #memo-title { font-size: 22px; margin-bottom: 20px; }
  .memo-section, .memo-section:first-child { padding: 14px; }
  .section-bar { margin-bottom: 12px; }
  .setting-form { padding: 20px 4px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 色块始终保持一排，原生单选支持键盘切换，勾选与边框同时标明当前主题。 */
.theme-options { display: flex; gap: 12px; padding: 5px; margin: 0 -5px 12px; max-width: 430px; }
.theme-option { position: relative; flex: 1; min-width: 0; max-width: 48px; cursor: pointer; text-align: center; }
.theme-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.theme-swatch { display: flex; align-items: center; justify-content: center; height: 36px; background: var(--swatch); border: 1px solid #ffffff18; outline: 1px solid transparent; outline-offset: 3px; transition: outline-color .15s; }
.theme-name { display: block; margin-top: 9px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.theme-option:hover .theme-swatch { outline-color: var(--muted); }
.theme-option input:checked + .theme-swatch { outline-color: var(--swatch); }
.theme-option input:checked + .theme-swatch::after { content: '✓'; color: #111713; font-size: 19px; font-weight: bold; }
.theme-option input:checked ~ .theme-name { color: var(--heading); }
.theme-option input:focus-visible + .theme-swatch { outline: 2px solid var(--heading); }
.theme-option:has(input:disabled) { cursor: default; opacity: .5; }
.theme-preview { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); color: var(--text); font-size: 12px; line-height: 2; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .theme-options { gap: 10px; }
  .theme-swatch { height: 32px; }
  .theme-preview { padding: 12px; font-size: 11px; }
}

.appearance-options { display: flex; gap: 22px; padding: 8px 0; }
.appearance-options label { cursor: pointer; }
.appearance-options input { accent-color: var(--accent-soft); }
.gate-theme { position: absolute; top: 20px; right: 24px; }
.share-card { padding: 32px; max-width: 100%; }
.share-card h1, .share-card h2 { margin: 14px 0; color: var(--heading); font-size: 23px; }
.share-card p { color: var(--muted); line-height: 1.8; font-size: 12px; }
#share-dialog { width: 480px; max-width: calc(100vw - 24px); padding: 0; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
#share-dialog::backdrop { background: #0008; }
#share-link-group { margin-top: 22px; }
#share-copy { margin-top: 8px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.share-buttons .setting-button { padding: 7px 14px; }
.share-primary { background: var(--accent); color: var(--button-ink); padding: 7px 14px; }
.share-reading #list, .share-reading #directory-toggle { display: none!important; }
.share-reading .content { min-width: 0; }
/* 分享阅读页以固定目录和实心正文卡片构成，排版尺寸针对长文档阅读。 */
.share-reading { --reader-code-bg: var(--canvas); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
.share-reading * { font-family: inherit; }
:root[data-appearance="light"] .share-reading {
  --canvas: #f3f5f8;
  --sidebar: #f8fafc;
  --surface: #ffffff;
  --panel: #f5f7fa;
  --line: #e4e9f0;
  --line-strong: #cfd8e3;
  --text: #3b485b;
  --heading: #18273b;
  --muted: #778396;
  --reader-code-bg: #f7f9fc;
}
.share-reading .content { margin-left: 280px; }
.share-reading .content > .box-title { min-height: 64px; padding: 12px 32px; flex-wrap: nowrap; gap: 16px; }
.share-reading #content-title, .share-reading .menu, .share-reading #save-status { display: none; }
.reader-breadcrumb { min-width: 0; margin-right: auto; gap: 12px; font-size: 13px; color: var(--muted); }
.reader-breadcrumb svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: var(--accent-soft); stroke-width: 1.5; stroke-linejoin: round; }
.reader-breadcrumb > span { white-space: nowrap; }
.reader-divider { color: var(--line-strong); }
#share-document-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.share-reading [data-appearance-toggle] { min-height: 32px; padding: 5px 13px; flex-shrink: 0; background: var(--surface); color: var(--text); border-color: var(--line); }
.share-reading .content > .box-content { padding: 0 36px; scrollbar-gutter: stable; }
.share-reading #memo-body { width: 100%; max-width: 1120px; padding: 42px 0 80px; }
.share-reading #memo-heading { font-size: 32px; line-height: 1.5; font-weight: 700; letter-spacing: -.025em; margin: 0 0 12px; }
.share-reading #article-info { max-width: none; padding: 0; margin: 0 0 30px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.share-reading .memo-section { background: var(--surface); border: 1px solid var(--line); padding: 36px 40px; margin-bottom: 24px; }
.share-reading .section-bar { min-height: 0; margin-bottom: 24px; }
.share-reading .section-title { font-size: 20px; color: var(--heading); font-weight: 600; }
.share-reading .section-controls { display: none; }
.share-reading .text-block.empty-text { display: none; }
.share-reading .attachment-area { margin: 24px 0; background: var(--reader-code-bg); }
.share-reading :is(h1,h2,h3,h4,h5,h6) { scroll-margin-top: 28px; }
#share-toc { position: fixed; inset: 0 auto 0 0; width: 280px; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.toc-bar { padding: 0 26px; min-height: 64px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); color: var(--heading); font-size: 14px; font-weight: 600; }
#share-toc-links { overflow: auto; padding: 22px 16px 28px; min-height: 0; scrollbar-gutter: stable; }
#share-toc-links a { display: block; padding: 9px 12px 9px calc(14px + var(--toc-depth) * 13px); margin: 2px 0; color: var(--muted); font-size: 13px; line-height: 1.65; border-left: 2px solid transparent; text-decoration: none; overflow-wrap: anywhere; transition: background .15s, color .15s; }
#share-toc-links a:hover { background: var(--panel); color: var(--heading); }
#share-toc-links a.active { border-left-color: var(--accent-soft); color: var(--accent-soft); background: var(--active); font-weight: 600; }
#share-toc-links a:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: -2px; }
.toc-empty { color: var(--muted); padding: 0 14px; font-size: 13px; }
.toc-close, #toc-toggle, #toc-backdrop { display: none; }
.share-reading .markdown-body { font-size: 15px; line-height: 1.9; }
.share-reading .markdown-body :is(h1,h2,h3,h4,h5,h6) { color: var(--heading); font-weight: 650; letter-spacing: -.015em; }
.share-reading .markdown-body h1 { font-size: 27px; margin: 42px 0 22px; padding-bottom: 14px; }
.share-reading .markdown-body h2 { font-size: 23px; margin: 38px 0 20px; padding-bottom: 12px; }
.share-reading .markdown-body h3 { font-size: 18px; margin: 28px 0 16px; }
.share-reading .markdown-body > :first-child { margin-top: 0; }
.share-reading .markdown-body p { margin-bottom: 18px; }
.share-reading .markdown-body a { text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); }
.share-reading .markdown-body a:hover { text-decoration-color: currentColor; }
.share-reading .markdown-table { margin: 24px 0; }
.share-reading .markdown-body table { min-width: 560px; font-size: 13px; line-height: 1.75; }
.share-reading .markdown-body th { padding: 13px 16px; font-weight: 600; background: var(--panel); white-space: nowrap; }
.share-reading .markdown-body td { padding: 12px 16px; border-color: var(--line); }
.share-reading .markdown-body th { border-color: var(--line); }
.share-reading .markdown-body tr:nth-child(even) { background: var(--reader-code-bg); }
.share-reading .markdown-body code, .share-reading .markdown-body code * { font-family: "Cascadia Code", Consolas, monospace; }
.share-reading .markdown-body :not(pre) > code { padding: 3px 6px; background: var(--panel); font-size: .88em; }
.reader-code { border: 1px solid var(--line); background: var(--reader-code-bg); margin: 24px 0; }
.reader-code-bar { display: flex; justify-content: space-between; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.reader-copy { font-size: 12px; border: 0; background: transparent; color: var(--muted); padding: 2px 0 2px 14px; cursor: pointer; }
.reader-copy:hover { color: var(--accent-soft); }
.reader-copy:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
.share-reading .markdown-body .reader-code pre { padding: 18px 20px; margin: 0; border: 0; background: transparent; }
.share-reading .markdown-body pre code { font-size: 13px; line-height: 1.8; }
@media (min-width: 769px) and (max-width: 1150px) {
  #share-toc { width: 240px; }
  .share-reading .content { margin-left: 240px; }
  .share-reading .content > .box-content { padding: 0 24px; }
  .share-reading .memo-section { padding: 28px; }
}
@media (max-width: 768px) {
  .share-reading .content { margin-left: 0; }
  .share-reading .content > .box-title { min-height: 58px; padding: 10px 16px; gap: 12px; }
  .reader-breadcrumb { gap: 8px; }
  .reader-breadcrumb > span:first-of-type, .reader-divider { display: none; }
  .reader-breadcrumb svg { display: none; }
  .share-reading .content > .box-content { padding: 0 16px; scrollbar-gutter: auto; }
  .share-reading #memo-body { padding: 26px 0 48px; }
  .share-reading #memo-heading { font-size: 25px; line-height: 1.5; }
  .share-reading #article-info { margin-bottom: 22px; line-height: 1.8; }
  .share-reading .memo-section { padding: 24px 20px; }
  .share-reading .markdown-body { font-size: 14px; }
  .share-reading .markdown-body h1 { font-size: 24px; }
  .share-reading .markdown-body h2 { font-size: 21px; }
  .share-reading .markdown-body h3 { font-size: 17px; }
  .share-reading .markdown-body th, .share-reading .markdown-body td { padding: 10px 12px; }
  .share-reading .markdown-body .reader-code pre { padding: 16px; }
  #share-toc { display: none; inset: 0 auto 0 0; width: min(85vw, 320px); z-index: 110; }
  .toc-open #share-toc { display: flex; }
  .toc-close, #toc-toggle { display: inline-flex; }
  .toc-open #toc-backdrop { display: block; position: fixed; inset: 0; background: #0006; border: 0; z-index: 100; }
}
.login-theme { z-index: 1001; }
/* Markdown 阅读排版与两系主题共用颜色变量，代码块只展示原文。 */
.markdown-body { white-space: normal; color: var(--text); line-height: 1.85; overflow-wrap: anywhere; min-width: 0; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { color: var(--heading); font-weight: 600; line-height: 1.5; margin: 1.5em 0 .7em; }
.markdown-body h1 { font-size: 1.85em; border-bottom: 1px solid var(--line); padding-bottom: .4em; }
.markdown-body h2 { font-size: 1.5em; border-bottom: 1px solid var(--line); padding-bottom: .3em; }
.markdown-body h3 { font-size: 1.2em; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote, .markdown-body pre, .markdown-body table { margin: 0 0 1.1em; }
.markdown-body ul, .markdown-body ol { padding-left: 2em; }
.markdown-body li + li { margin-top: .25em; }
.markdown-body li > p { margin-bottom: .4em; }
.markdown-body a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body blockquote { padding: .3em 1em; margin-left: 0; margin-right: 0; color: var(--muted); border-left: 3px solid var(--line-strong); background: var(--surface); }
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body code { padding: .15em .4em; background: var(--panel); color: var(--heading); font-size: .95em; }
.markdown-body pre { padding: 16px; background: var(--surface); border: 1px solid var(--line); overflow: auto; white-space: pre; overflow-wrap: normal; tab-size: 4; }
.markdown-body pre code { padding: 0; background: transparent; font-size: 12px; line-height: 1.7; }
.markdown-table { max-width: 100%; overflow-x: auto; margin: 0 0 1.1em; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 0; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line-strong); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--panel); color: var(--heading); }
.markdown-body tr:nth-child(even) { background: var(--surface); }
.markdown-body hr { border: 0; border-top: 1px solid var(--line-strong); margin: 1.7em 0; }
.markdown-body img { max-width: 100%; height: auto; }
@media (max-width: 480px) {
  .share-card { padding: 24px; }
}
