:root {
  color-scheme: light;
  --canvas: #f3f5f5;
  --paper: #fff;
  --sidebar: #edf1f0;
  --panel: #f7f9f8;
  --ink: #263b3b;
  --muted: #7b8b8a;
  --line: #e6ecea;
  --accent: #248b81;
  --accent-soft: #e6f2ef;
  --button-bg: #278b81;
  --button-ink: #fff;
  --draft: #a47b3b;
  --shadow: 0 16px 50px rgb(30 55 49 / 12%);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #151e21;
  --paper: #202c2f;
  --sidebar: #1a272a;
  --panel: #1c282b;
  --ink: #e0eae7;
  --muted: #93a8a3;
  --line: #304043;
  --accent: #7dcec0;
  --accent-soft: #293f3c;
  --button-bg: #78c9bc;
  --button-ink: #17332d;
  --draft: #d9b577;
  --shadow: 0 16px 50px rgb(0 0 0 / 28%);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
a { color: var(--accent); }
button, input, textarea, select, a { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); }
button, a, input, .topbar, .sidebar, .inspector, .editor-panel, body { transition: background-color .22s, color .22s, border-color .22s, box-shadow .22s; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { height: 72px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: var(--ink); border-radius: 12px 12px 12px 4px; color: var(--paper); font-size: 21px; font-weight: 600; font-family: "LXGW WenKai Screen", "KaiTi", serif; }
.brand strong { font-size: 17px; letter-spacing: 1px; }
.brand-divider { height: 16px; width: 1px; margin: 0 3px; background: var(--line); }
.brand-caption { color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; gap: 18px; align-items: center; }
.text-link, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; padding: 5px 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: none; }
.text-link:hover, .text-button:hover { color: var(--accent); }
.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--accent); background: var(--accent-soft); }
#theme-button { background: var(--paper); border: 1px solid var(--line); border-radius: 50%; }
.user-badge { font-size: 12px; color: var(--ink); }
.demo-badge { padding: 5px 10px; border-radius: 20px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.primary { color: var(--button-ink); background: var(--button-bg); }
.primary:hover { box-shadow: 0 4px 12px color-mix(in srgb, var(--button-bg) 22%, transparent); filter: brightness(1.06); }
.secondary { color: var(--ink); background: var(--paper); border-color: var(--line); }
.secondary:hover { border-color: var(--accent); background: var(--panel); }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 1.4px; }
.loading-view { height: calc(100dvh - 72px); display: grid; place-items: center; color: var(--muted); }
.workspace { display: grid; grid-template-columns: 244px minmax(0, 1fr); height: calc(100dvh - 72px); padding: 0 18px 18px 0; gap: 6px; }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 20px 18px 8px; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; margin-bottom: 16px; }
.count { display: inline-grid; place-items: center; min-width: 24px; padding: 3px 7px; border-radius: 6px; color: var(--muted); background: var(--panel); font: 11px/1.4 system-ui, sans-serif; }
.library-nav { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin-bottom: 12px; border: 0; border-radius: 12px; color: var(--ink); background: transparent; text-align: left; font-size: 13px; font-weight: 600; }
.library-nav .count { margin-left: auto; }
.library-nav:hover, .library-nav[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.library-nav[aria-current="page"] .count { color: var(--accent); background: var(--paper); }
.new-button { margin-bottom: 22px; width: 100%; }
.search-box { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 39px; padding: 0 12px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.search-box .icon { width: 15px; height: 15px; }
.search-box input { width: 100%; min-width: 0; padding: 10px 0; border: 0; color: var(--ink); background: transparent; outline: none; font-size: 11px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
.post-tabs { display: flex; align-items: center; gap: 2px; margin: 16px 0 12px; }
.post-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 33px; padding: 6px 3px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; white-space: nowrap; }
.post-tabs button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.post-tabs span { font: 10px system-ui, sans-serif; }
.post-list { flex: 1; min-height: 0; overflow-y: auto; padding: 3px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.post-item { width: 100%; display: flex; flex-direction: column; gap: 9px; padding: 14px 12px; margin-bottom: 4px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; }
.post-item:hover { background: var(--paper); }
.post-item.active { background: var(--paper); border-color: var(--line); box-shadow: 0 3px 9px rgb(25 50 44 / 3%); }
.post-item strong { font-size: 12px; line-height: 1.8; font-weight: 500; overflow-wrap: anywhere; }
.post-item.active strong { color: var(--accent); }
.post-item small { font-size: 10px; color: var(--muted); line-height: 1.6; }
.post-item .post-date { font-size: 9px; font-variant-numeric: tabular-nums; }
.draft-label { color: var(--draft); }
.local-label { color: var(--accent); }
.list-empty { padding: 25px 10px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.8; }
.sidebar-footer { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding: 17px 8px 0; margin-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.sidebar-footer .text-button { margin-left: auto; font-size: 10px; }
.connection-dot, .status-dot, .stat-dot { display: inline-block; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--muted); }
.connected, .saved, .published-dot { background: var(--accent); }
.pending, .dirty, .draft-dot { background: var(--draft); }
.sidebar-tips { display: none; margin-top: auto; padding: 24px 12px 12px; }
.sidebar-tips p { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); margin: 13px 0; gap: 8px; }
.sidebar-tips small { display: block; margin-top: 20px; font-size: 10px; color: var(--muted); }
kbd { font: 10px/1.5 ui-monospace, Consolas, monospace; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.workspace[data-page="library"] .sidebar > .search-box, .workspace[data-page="library"] .post-list { display: none; }
.workspace[data-page="library"] .sidebar-tips { display: block; }
.workspace[data-page="library"] .post-tabs { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 2px; }
.workspace[data-page="library"] .post-tabs button { justify-content: flex-start; gap: 12px; min-height: 42px; padding: 10px 14px; font-size: 12px; }
.workspace[data-page="library"] .post-tabs span { margin-left: auto; }
.editor-panel { min-height: 0; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 24px rgb(35 57 51 / 3%); }
.empty-editor { height: 100%; overflow-y: auto; padding: 40px clamp(24px, 3vw, 48px) 24px; scrollbar-width: thin; }
.library-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.library-heading h1 { margin: 12px 0 8px; font-size: 34px; font-weight: 600; letter-spacing: -1px; }
.heading-period { color: var(--accent); margin-left: 3px; }
.library-heading p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.8; }
.library-heading-actions { display: flex; align-items: center; gap: 8px; }
.library-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px 0; padding: 21px 26px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.library-stats > div { display: flex; align-items: center; gap: 20px; padding-right: 16px; border-right: 1px solid var(--line); }
.library-stats > div:last-child { border: 0; }
.library-stats span { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.library-stats strong { margin-left: auto; font: 600 25px/1.3 system-ui, sans-serif; letter-spacing: -1px; }
.library-demo { margin: -8px 0 24px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.library-demo a { text-decoration: none; margin-left: 6px; }
.library-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.library-section-title, .library-controls { display: flex; gap: 10px; align-items: center; min-width: 0; }
.library-section-title h2 { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.library-controls .search-box { width: 230px; background: var(--panel); }
.library-view-tabs { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; }
.library-view-tabs .icon-button { width: 29px; height: 29px; border-radius: 6px; }
.library-view-tabs [aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.library-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.article-card { min-width: 0; display: flex; flex-direction: column; align-items: stretch; min-height: 207px; padding: 22px; text-align: left; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.article-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 8px 22px rgb(30 70 57 / 7%); transform: translateY(-3px); }
.article-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 19px; }
.article-file-icon { display: grid; place-items: center; width: 38px; height: 38px; background: var(--panel); color: var(--muted); border-radius: 10px; }
.article-file-icon .icon { width: 21px; height: 21px; }
.article-status { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 10px; }
.article-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.article-status.draft-label { color: var(--draft); }
.article-card > strong { font-size: 15px; line-height: 1.75; font-weight: 600; overflow-wrap: anywhere; }
.article-filename { margin: 8px 0 12px; color: var(--muted); font: 10px/1.8 ui-monospace, "Microsoft YaHei", monospace; overflow-wrap: anywhere; }
.article-date { margin-bottom: 17px; font-size: 11px; line-height: 1.8; color: var(--muted); font-variant-numeric: tabular-nums; }
.article-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.article-card-bottom .icon { width: 15px; height: 15px; }
.article-card:hover .article-card-bottom { color: var(--accent); }
.library-list[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.library-list[data-layout="list"] .article-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) 172px; gap: 4px 18px; min-height: 108px; padding: 18px 22px; align-items: center; }
.library-list[data-layout="list"] .article-card-top { display: contents; }
.library-list[data-layout="list"] .article-file-icon { grid-row: 1 / 4; }
.library-list[data-layout="list"] .article-status { grid-column: 3; grid-row: 1; justify-self: end; }
.library-list[data-layout="list"] .article-card > strong { grid-column: 2; grid-row: 1; font-size: 14px; }
.library-list[data-layout="list"] .article-filename { grid-column: 2; grid-row: 2; margin: 0; }
.library-list[data-layout="list"] .article-date { grid-column: 3; grid-row: 2; justify-self: end; margin: 0; font-size: 10px; }
.library-list[data-layout="list"] .article-card-bottom { grid-column: 3; grid-row: 3; margin: 0; padding: 0; border: 0; }
.library-list > .list-empty { grid-column: 1 / -1; display: grid; place-items: center; gap: 10px; min-height: 180px; border: 1px dashed var(--line); border-radius: 14px; }
.library-list > .list-empty .icon { width: 26px; height: 26px; }
.library-footnote { display: flex; justify-content: space-between; gap: 15px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.8; }
.editor { height: 100%; display: flex; flex-direction: column; }
.editor-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 70px; padding: 14px 25px; border-bottom: 1px solid var(--line); }
.document-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
#back-library-button { margin-right: 4px; border: 1px solid var(--line); }
.editor-actions { display: flex; align-items: center; gap: 9px; }
.editor-actions .text-button { margin-right: 8px; }
.editor-actions [aria-pressed="true"] { color: var(--accent); }
.editor-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: 0; }
.writing-area { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.document-heading { flex-shrink: 0; display: flex; flex-direction: column; gap: 11px; padding: 28px 34px 24px; }
.document-heading .eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .7px; }
.title-input { width: 100%; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: clamp(22px, 2vw, 30px); font-weight: 600; line-height: 1.5; outline: none; }
.title-input::placeholder { color: var(--muted); opacity: .6; }
.path-label { color: var(--muted); font: 10px/1.8 ui-monospace, Consolas, "Microsoft YaHei", monospace; overflow-wrap: anywhere; }
.format-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; flex-shrink: 0; padding: 8px; margin: 0 24px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.format-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 0; min-width: 0; }
.tool-group { display: flex; align-items: center; padding: 0 6px; border-right: 1px solid var(--line); }
.tool-group:first-child { padding-left: 0; }
.tool-group:last-child { border: 0; padding-right: 0; }
.format-tools button { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font: 13px Georgia, serif; }
.format-tools button:hover { background: var(--paper); color: var(--accent); box-shadow: 0 2px 6px rgb(0 0 0 / 3%); }
.format-tools .icon { width: 16px; height: 16px; }
.format-tools select { max-width: 65px; height: 30px; padding: 0 3px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; font-size: 11px; }
.format-tools option { background: var(--paper); }
.format-options { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.view-tabs { display: flex; gap: 2px; padding: 3px; background: var(--canvas); border-radius: 7px; }
.view-tabs button { padding: 5px 9px; min-height: 28px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; }
.view-tabs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgb(0 0 0 / 5%); }
.writing-content { flex: 1; min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
.writing-content[data-view="split"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.writing-content[data-view="split"] .markdown-preview { border-left: 1px solid var(--line); padding-left: 24px; padding-right: 24px; }
.writing-content[data-view="split"] textarea { padding-left: 24px; padding-right: 24px; font-size: 13px; }
.writing-content[data-view="preview"] .source-pane { display: none; }
.source-pane { display: flex; position: relative; min-height: 0; min-width: 0; }
.source-pane textarea { width: 100%; height: 100%; min-height: 120px; padding: 20px 34px 60px; resize: none; border: 0; background: transparent; color: var(--ink); outline: none; font: 14px/2.1 "LXGW WenKai Screen", "Microsoft YaHei", ui-monospace, Consolas, monospace; scrollbar-width: thin; tab-size: 2; }
.drop-hint { display: none; position: absolute; inset: 12px; align-items: center; justify-content: center; gap: 12px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--accent); pointer-events: none; }
.source-pane.dragging .drop-hint { display: flex; }
.upload-feedback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--accent); }
.transfer-spinner { display: block; width: 24px; height: 24px; flex-shrink: 0; border: 2px solid color-mix(in srgb, var(--accent) 20%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: transfer-spin .8s linear infinite; }
.transfer-details { display: flex; flex-direction: column; gap: 5px; min-width: 0; max-width: 100%; text-align: center; }
.transfer-details strong { font-size: 11px; font-weight: 500; }
.transfer-details small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.transfer-track { display: block; position: relative; width: 76px; height: 3px; flex-shrink: 0; overflow: hidden; border-radius: 3px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.transfer-track::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 32px; border-radius: inherit; background: var(--accent); animation: transfer-sweep 1.3s ease-in-out infinite; }
.upload-inline { position: absolute; z-index: 3; flex-direction: row; gap: 10px; max-width: min(260px, calc(100% - 24px)); padding: 11px 13px 13px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 10px; background: var(--paper); box-shadow: 0 4px 14px rgb(25 50 44 / 8%); pointer-events: none; }
.upload-inline .transfer-spinner { width: 17px; height: 17px; }
.upload-inline .transfer-details { text-align: left; gap: 3px; }
.upload-inline .transfer-track { position: absolute; left: 13px; right: 13px; bottom: 4px; width: auto; height: 2px; }
.upload-inline .transfer-track::after { width: 30%; animation-name: transfer-sweep-inline; }
.upload-caret-mirror { position: fixed; top: 0; left: 0; visibility: hidden; pointer-events: none; white-space: pre-wrap; overflow-wrap: break-word; }
@keyframes transfer-spin { to { transform: rotate(360deg); } }
@keyframes transfer-sweep { from { transform: translateX(-32px); } to { transform: translateX(76px); } }
@keyframes transfer-sweep-inline { from { left: -30%; } to { left: 100%; } }
.editor-footer { flex-shrink: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 42px; padding: 11px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.7; }
.footer-spacer { flex: 1; }
.editor-upload-status { color: var(--muted); font-size: 9px; }
.editor-upload-status.uploading { color: var(--accent); }
.inspector { min-height: 0; overflow-y: auto; padding: 24px 16px; border-left: 1px solid var(--line); background: var(--panel); scrollbar-width: thin; }
.inspector-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 7px 23px; }
.inspector-heading h3 { font-size: 16px; font-weight: 600; margin: 8px 0 0; }
.inspector-close { display: inline-grid; }
.inspector-card { margin-bottom: 14px; padding: 18px 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.inspector-card h4 { margin: 0 0 18px; font-size: 12px; font-weight: 600; }
.field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; font-size: 11px; }
.field:last-child { margin-bottom: 0; }
.field-note { color: var(--muted); font-size: 9px; }
.field input { width: 100%; min-width: 0; padding: 10px 9px; height: 38px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); font-size: 11px; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.suggest-field { width: 100%; position: relative; }
.field-help { width: 100%; color: var(--muted); font-size: 9px; line-height: 1.7; }
.suggest-options { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 5; max-height: 200px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: var(--shadow); scrollbar-width: thin; }
.suggest-options button { display: block; width: 100%; padding: 9px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; font-size: 11px; overflow-wrap: anywhere; }
.suggest-options button:hover, .suggest-options button[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); }
.field-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.field-heading h3 { margin: 0; font-size: 12px; font-weight: 600; }
.field-heading .text-button, .field-heading .text-link { font-size: 10px; color: var(--accent); }
.cover-preview { display: flex; position: relative; flex-direction: column; justify-content: center; align-items: center; gap: 12px; aspect-ratio: 1.75; margin-bottom: 12px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); background: var(--panel); overflow: hidden; font-size: 10px; }
.cover-image { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 100%; min-height: 0; }
.upload-cover { position: absolute; inset: 0; padding: 16px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(3px); }
.cover-preview .icon { width: 25px; height: 25px; opacity: .6; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 124px; padding: 15px 8px; border: 1px dashed color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 9px; color: var(--accent); background: var(--panel); }
.upload-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone strong { font-size: 11px; font-weight: 500; }
.upload-zone span { font-size: 9px; color: var(--muted); }
.upload-idle { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.upload-idle > .icon, .upload-idle > strong, .upload-media .transfer-details strong { color: var(--accent); }
.upload-media { width: 100%; padding: 4px 10px; }
.upload-zone[aria-busy="true"] { opacity: 1; cursor: progress; border-color: var(--accent); background: var(--accent-soft); }
.upload-zone[aria-busy="true"] .upload-idle { display: none; }
.upload-status { color: var(--muted); font-size: 10px; line-height: 1.8; }
.upload-status:empty { display: none; }
.media-list { display: grid; gap: 12px; margin-top: 14px; }
.media-list:empty { display: none; }
.media-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 9px; row-gap: 4px; }
.media-item img { width: 44px; height: 44px; grid-row: span 2; object-fit: cover; border-radius: 7px; background: var(--line); }
.media-name { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.media-actions { display: flex; gap: 12px; }
.media-actions button { font-size: 10px; color: var(--accent); }
.inspector-note { display: flex; align-items: center; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 9px; }
.editor-notice, .recovery-notice { flex-shrink: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 13px; padding: 11px 28px; background: var(--accent-soft); color: var(--accent); font-size: 11px; line-height: 1.7; }
.recovery-notice { background: color-mix(in srgb, var(--draft) 10%, var(--paper)); color: var(--ink); }
.recovery-notice span { flex: 1; }
.recovery-notice button { color: var(--accent); font-size: 11px; }
.markdown-preview { min-height: 0; min-width: 0; overflow-y: auto; padding: 20px 34px 60px; font-size: 14px; line-height: 2; overflow-wrap: anywhere; scrollbar-width: thin; }
.markdown-preview > :first-child { margin-top: 0; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { line-height: 1.5; font-weight: 600; margin-top: 1.5em; }
.markdown-preview h1 { font-size: 26px; }
.markdown-preview h2 { font-size: 22px; }
.markdown-preview h3 { font-size: 18px; }
.markdown-preview a { text-underline-offset: 3px; }
.markdown-preview img { max-width: 100%; height: auto; border-radius: 10px; }
.markdown-preview pre { overflow-x: auto; padding: 16px 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font: 12px/1.85 ui-monospace, Consolas, monospace; }
.markdown-preview code { padding: 2px 5px; border-radius: 4px; background: var(--accent-soft); font: .9em/1.8 ui-monospace, Consolas, monospace; }
.markdown-preview pre code { padding: 0; background: transparent; }
.markdown-preview blockquote { margin: 20px 0; padding: 1px 20px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; color: var(--muted); background: var(--panel); }
.markdown-preview table { display: block; overflow-x: auto; border-collapse: collapse; max-width: 100%; }
.markdown-preview td, .markdown-preview th { border: 1px solid var(--line); padding: 8px 12px; min-width: 70px; }
.markdown-preview hr { border: 0; border-top: 1px solid var(--line); margin: 25px 0; }
.markdown-preview .task-checkbox { color: var(--accent); }
.workspace.focus-mode { grid-template-columns: minmax(0, 1fr); padding-left: 18px; }
.focus-mode .sidebar, .focus-mode .inspector { display: none; }
.focus-mode .editor-body, .editor.settings-hidden .editor-body { grid-template-columns: minmax(0, 1fr); }
.editor.settings-hidden .inspector { display: none; }
.focus-mode .writing-area { width: min(100%, 1100px); margin: 0 auto; }
.mobile-only, .drawer-backdrop { display: none; }
dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 35px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(14 30 27 / 35%); backdrop-filter: blur(4px); }
dialog h2 { margin: 18px 0 12px; font-size: 23px; font-weight: 600; }
dialog p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.dialog-close { position: absolute; top: 14px; right: 14px; }
.publish-summary { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 16px 10px; padding: 20px; margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 12px; overflow-wrap: anywhere; }
.publish-summary span { color: var(--muted); }
.publish-summary strong { font-weight: 500; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.build-item { display: flex; flex-direction: column; gap: 7px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.build-item strong { font-size: 12px; font-weight: 500; }
.build-item span { font-size: 11px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; width: max-content; max-width: calc(100vw - 32px); padding: 13px 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink); font-size: 12px; line-height: 1.8; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: #c78080; }
.login-view { display: grid; grid-template-columns: 1.2fr 1fr; min-height: calc(100dvh - 120px); max-width: 1000px; margin: 10px auto 30px; padding: 70px; align-items: center; gap: 70px; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; }
.large-mark { width: 48px; height: 48px; font-size: 28px; margin-bottom: 30px; }
.login-card h1 { font-size: clamp(28px, 3vw, 36px); line-height: 1.65; font-weight: 600; margin: 18px 0; }
.login-description { color: var(--muted); font-size: 13px; margin-bottom: 32px; }
.login-card > small { display: block; margin-top: 16px; color: var(--muted); font-size: 10px; }
.login-decoration { padding: 35px; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; transform: rotate(-3deg); color: var(--muted); }
.login-decoration > .icon { width: 32px; height: 32px; color: var(--accent); }
.paper-line { width: 100%; height: 170px; margin-bottom: 30px; background: repeating-linear-gradient(transparent 0 33px, var(--line) 33px 34px); }
.login-decoration span { font-size: 10px; letter-spacing: 2px; }
.error-message { color: #b96f60; font-size: 12px; line-height: 1.8; }
@media (min-width: 1101px) { .editor:not(.settings-hidden) #settings-button { color: var(--accent); background: var(--accent-soft); } }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .editor-body { grid-template-columns: minmax(0, 1fr); }
  .inspector { display: none; position: fixed; top: 82px; bottom: 18px; right: 18px; z-index: 32; width: 310px; max-width: calc(100vw - 28px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
  .workspace[data-drawer="settings"] .inspector { display: block; }
  .drawer-backdrop { position: fixed; inset: 72px 0 0; z-index: 30; display: block; border: 0; background: rgb(14 30 27 / 25%); }
  .empty-editor { padding: 30px 28px 22px; }
  .library-toolbar { flex-wrap: wrap; }
  .library-controls { margin-left: auto; }
  .library-controls .search-box { width: 190px; }
  .library-stats { padding: 18px; gap: 10px; }
  .library-stats > div { gap: 10px; padding-right: 10px; }
  .library-stats strong { font-size: 22px; }
  .document-heading { padding: 27px 30px 23px; }
  .source-pane textarea, .markdown-preview { padding-left: 30px; padding-right: 30px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 18px; height: 60px; }
  .brand { gap: 10px; }
  .brand-mark { width: 32px; height: 32px; font-size: 19px; }
  .brand strong { font-size: 15px; }
  .topbar-actions { gap: 12px; }
  .brand-divider, .brand-caption, .blog-link, .user-badge, .demo-badge { display: none; }
  .workspace, .workspace.focus-mode { height: calc(100dvh - 60px); padding: 0 10px 10px; grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; position: fixed; left: 10px; top: 70px; bottom: 10px; z-index: 32; width: min(300px, calc(100vw - 30px)); padding: 20px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--canvas); box-shadow: var(--shadow); }
  .workspace[data-drawer="list"] .sidebar { display: flex; }
  .mobile-only { display: inline-flex; }
  .icon-button.mobile-only { display: inline-grid; }
  .inspector { top: 70px; bottom: 10px; right: 10px; }
  .drawer-backdrop { top: 60px; }
  .editor-panel { border-radius: 15px; }
  .empty-editor { padding: 26px 20px 22px; }
  .library-heading { align-items: flex-start; gap: 12px; }
  .library-heading .eyebrow { font-size: 9px; }
  .library-heading h1 { font-size: 28px; margin-top: 11px; }
  .library-heading p { font-size: 11px; max-width: 200px; }
  .library-heading-actions { flex-direction: column; align-items: flex-end; gap: 10px; }
  .library-heading-actions .button { padding: 8px 12px; font-size: 11px; min-height: 36px; }
  .library-heading-actions .mobile-only { background: var(--panel); border: 1px solid var(--line); }
  .library-stats { margin: 25px 0; padding: 18px 12px; gap: 12px; }
  .library-stats > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-right: 10px; }
  .library-stats span { font-size: 10px; gap: 5px; }
  .library-stats strong { font-size: 24px; margin: 0; }
  .library-toolbar { gap: 14px; }
  .library-controls { width: 100%; margin: 0; gap: 6px; }
  .library-controls .search-box { width: auto; flex: 1; }
  .library-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .article-card { min-height: 185px; padding: 20px; }
  .article-card-top { margin-bottom: 15px; }
  .library-list[data-layout="list"] .article-card { padding: 16px 14px; grid-template-columns: 34px minmax(0, 1fr) 65px; gap: 5px 10px; }
  .library-list[data-layout="list"] .article-file-icon { width: 34px; height: 36px; }
  .library-list[data-layout="list"] .article-card-bottom { justify-content: flex-end; }
  .library-list[data-layout="list"] .article-card-bottom > span { display: none; }
  .library-list[data-layout="list"] .article-date { grid-column: 2; grid-row: 3; justify-self: start; font-size: 9px; }
  .library-footnote { flex-direction: column; gap: 4px; }
  .editor-header { padding: 12px; gap: 8px; min-height: 65px; }
  .document-status { gap: 6px; font-size: 9px; min-width: 0; }
  .document-status > .icon-button { width: 29px; height: 29px; flex-shrink: 0; }
  #back-library-button { margin-right: 0; }
  #editor-state-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .editor-actions { gap: 6px; flex-shrink: 0; }
  .editor-actions .button { padding: 8px 10px; min-height: 34px; font-size: 10px; }
  .editor-actions .text-button { margin-right: 0; font-size: 10px; }
  .editor-actions .icon { display: none; }
  .document-heading { padding: 23px 20px 20px; gap: 9px; }
  .title-input { font-size: 23px; }
  .path-label { font-size: 9px; }
  .format-bar { padding: 7px; margin: 0 14px; gap: 8px; }
  .format-tools { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .format-tools::-webkit-scrollbar { display: none; }
  .tool-group { flex-shrink: 0; padding-left: 4px; padding-right: 4px; }
  .format-tools button { width: 28px; }
  .format-options { width: 100%; justify-content: space-between; margin: 0; border-top: 1px solid var(--line); padding-top: 7px; }
  .source-pane textarea, .markdown-preview { padding: 16px 20px 40px; font-size: 14px; }
  .editor-footer { gap: 6px 10px; padding: 10px 16px; font-size: 9px; }
  .editor-footer .editor-upload-status { width: 100%; order: 1; font-size: 9px; }
  .writing-content[data-view="split"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .writing-content[data-view="split"] .markdown-preview { border-left: 0; border-top: 1px solid var(--line); }
  .editor-notice, .recovery-notice { padding: 10px 20px; font-size: 10px; }
  .focus-mode .sidebar { display: none; }
  .login-view { display: block; margin: 10px 16px; padding: 40px 28px; min-height: calc(100dvh - 100px); }
  .login-decoration { display: none; }
  .loading-view { height: calc(100dvh - 60px); }
}
@media (max-width: 480px) {
  .editor-actions #focus-button { display: none; }
  .editor-actions #save-button { max-width: 94px; white-space: normal; line-height: 1.4; }
  .editor-footer .footer-spacer { display: none; }
  #local-status { margin-left: auto; }
}
@media (max-width: 350px) {
  .empty-editor { padding-left: 14px; padding-right: 14px; }
  .library-heading h1 { font-size: 25px; }
  .library-heading p { font-size: 10px; }
  .library-stats { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .document-status > .status-dot { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
