/* Quiet, paper-like blog. Component behavior lives in the existing sheets. */
:root {
    --bg: #fafaf9;
    --bg-secondary: #f5f5f4;
    --bg-sidebar: #fafaf9;
    --surface: #fafaf9;
    --surface-strong: #fafaf9;
    --text: #1c1917;
    --text-secondary: #78716c;
    --text-muted: #78716c;
    --border: #e7e5e4;
    --primary: #44403c;
    --primary-hover: #1c1917;
    --primary-light: #efeeec;
    --primary-ghost: #f5f5f4;
    --accent: #44403c;
    --accent-light: #f5f5f4;
    --code-bg: #f0efed;
    --sidebar-surface-rgb: 250, 250, 249;
    --surface-on-bg: rgba(250,250,249,.94);
    --surface-on-bg-strong: rgba(250,250,249,.98);
    --surface-on-bg-hover: rgba(68,64,60,.05);
    --surface-on-bg-active: rgba(68,64,60,.09);
    --font-sans: system-ui, -apple-system, 'Microsoft YaHei', sans-serif;
    --font-display: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', Georgia, 'Times New Roman', serif;
    --navbar-height: 84px;
    --sidebar-width: 224px;
    --radius: 3px;
    --radius-sm: 3px;
    --radius-lg: 4px;
    --card-shadow: none;
    --card-hover-shadow: none;
    --focus-ring: 0 0 0 3px rgba(120,113,108,.15);
}
[data-theme="dark"] {
    --bg: #1c1917; --bg-secondary: #262220; --bg-sidebar: #1c1917;
    --surface: #211e1b; --surface-strong: #262220;
    --text: #e7e5e4; --text-secondary: #a8a29e; --text-muted: #a8a29e;
    --border: #3e3833; --primary: #d6d3d1; --primary-hover: #fafaf9;
    --primary-light: #302b27; --primary-ghost: #262220;
    --accent: #d6d3d1; --accent-light: #262220; --code-bg: #262220;
    --sidebar-surface-rgb: 28,25,23;
    --surface-on-bg: rgba(28,25,23,.94); --surface-on-bg-strong: rgba(28,25,23,.98);
    --surface-on-bg-hover: rgba(214,211,209,.05); --surface-on-bg-active: rgba(214,211,209,.1);
}
html { font-size: 17px; background: var(--bg); }
body { font-family: var(--font-display); line-height: 1.8; }
a { color: var(--text); }
a:hover { color: var(--text); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.navbar, [data-theme="dark"] .navbar {
    position: relative; height: auto; min-height: 84px;
    max-width: 100%; padding: 26px max(24px, calc((100% - 589px) / 2)) 20px;
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 20px;
    background: var(--bg); backdrop-filter: none; border-bottom: 1px solid var(--border);
}
.navbar .logo { margin: 0 auto 0 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: .08em; line-height: 1.8; white-space: nowrap; }
.navbar .logo-english, .navbar .logo-caption { display: none; }
.blog-nav { display: flex; gap: 24px; font-family: var(--font-sans); font-size: .85rem; }
.blog-nav a { color: var(--text-secondary); white-space: nowrap; border: 0; }
.blog-nav a:hover, .blog-nav a[aria-current="page"] { color: var(--text); }
.navbar .search-box { order: 10; width: 100%; max-width: none; margin: 8px 0 0; flex: 1 0 100%; }
.search-box input, [data-theme="dark"] .search-box input { border-radius: 0; border-width: 0 0 1px; background: transparent; }
.navbar .menu-toggle { margin: 0; }
.navbar .menu-toggle, .navbar .theme-toggle { width: 26px; min-width: 26px; height: 30px; padding: 3px; color: var(--text-secondary); border: 0; background: transparent; }
.header-login { padding: 0; min-height: 30px; color: var(--text-secondary); border: 0; background: transparent; font-size: .8rem; }
.header-login svg { display: none; }
.header-login:hover { background: transparent; color: var(--text); }
.navbar .btn-new-article, .navbar .btn-background { background: transparent; color: var(--text-secondary); border: 0; padding: 0; font-size: .8rem; }
.navbar .user-pill { background: transparent; width: 28px; height: 28px; }
.navbar .user-avatar { width: 26px; height: 26px; }
.layout { padding-top: 0; }
.main, body.sidebar-collapsed .main { margin-left: 0; min-height: calc(100svh - var(--navbar-height)); display: flex; flex-direction: column; }
.content, body[data-page="home"] .content, body[data-page="profile"] .content, body[data-page="article"] .content {
    width: 100%; max-width: 640px; margin: 0 auto; padding: 42px 24px 0;
}
.sidebar { top: 0; bottom: 0; z-index: 210; transform: translateX(-100%); background: var(--bg); }
.sidebar.open, body.desktop-nav-open .sidebar { transform: translateX(0); }
body.desktop-nav-open { overflow: hidden; }
.sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 205; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; visibility: hidden; pointer-events: none; background: rgba(28,25,23,.2); }
.sidebar.open ~ .sidebar-overlay { opacity: 1; visibility: visible; pointer-events: auto; }
body[data-page="home"] .sidebar, body[data-page="about"] .sidebar, body[data-page="profile"] .sidebar { display: none; }
body[data-page="home"] .menu-toggle, body[data-page="about"] .menu-toggle, body[data-page="profile"] .menu-toggle,
body[data-page="home"] .search-box, body[data-page="about"] .search-box, body[data-page="profile"] .search-box { display: none; }
body[data-page="home"] #sidebarLoginArea, body[data-page="about"] #sidebarLoginArea { display: block !important; }
/* Auth controls its own visibility after checking the session. */
body[data-page="home"] #sidebarLoginArea:has(#btnLogin[style*="none"]),
body[data-page="about"] #sidebarLoginArea:has(#btnLogin[style*="none"]) { display: none !important; }
.article-list { display: flex; flex-direction: column; gap: 0; }
.article-list li, .article-list li:hover, body.has-custom-background .article-list li {
    position: relative; display: block; padding: 25px 0; border: 0; border-bottom: 1px solid var(--border);
    border-radius: 0; background: transparent; box-shadow: none; transform: none;
}
.article-list li::before { display: none; }
.article-list li:first-child { padding-top: 0; }
.article-list li:last-child { border-bottom: 0; }
.article-list li > a { display: inline; padding: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; line-height: 1.5; border-bottom: 1px solid transparent; }
.article-list li > a:hover { border-color: var(--text); }
.post-date { display: block; margin-bottom: 5px; font-family: var(--font-sans); font-size: .8rem; color: var(--text-secondary); letter-spacing: .02em; }
.article-list .article-excerpt { margin: 7px 0 0; padding: 0; font-size: .92rem; line-height: 1.7; color: var(--text-secondary); max-height: none; }
.article-list .meta { margin-top: 12px; padding: 0; font-family: var(--font-sans); font-size: .75rem; }
.article-list .meta a { font-size: inherit; }
.article-list .tags { margin-left: 0; }
.blog-post-list .meta { display: none; }
.article-list .tag, .article-meta .tag { background: transparent; color: var(--text-secondary); padding: 0 5px 0 0; border: 0; }
.site-footer, body[data-page="home"] .site-footer, body[data-page="profile"] .site-footer {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
    width: 100%; padding: 48px 24px; margin: 34px 0 0; min-height: 0;
    border-top: 1px solid var(--border); background: transparent;
    color: var(--text-secondary); font-family: var(--font-sans); font-size: .8rem; text-align: center;
}
.footer-brand { font-weight: 400; letter-spacing: 0; }
#icpNumber:empty, .pagination:empty { display: none; }
.pagination { margin: 24px 0 0; gap: 8px; flex-wrap: wrap; font-family: var(--font-sans); }
.pagination button { border-radius: 0; background: transparent; }
.pagination button.active { background: var(--primary); color: var(--bg); }
.section-header { margin: 0 0 24px; }
.section-header h1 { font-size: 1.4rem; font-weight: 500; }
.section-header h2 { font-size: 1rem; font-weight: 500; }
.section-line, .home-topline time, .knowledge-card-icon { display: none; }
.home-topline { margin-bottom: 32px; font-family: var(--font-sans); }
.home-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-bottom: 40px; }
.knowledge-card, .knowledge-card:hover { padding: 16px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.knowledge-card strong { font-size: 1rem; font-weight: 500; }
.knowledge-card small { font-family: var(--font-sans); color: var(--text-secondary); }
.home-reading-grid { display: block; }
.home-aside { display: none; }
.home-empty { padding: 24px 0; background: transparent; border: 0; border-radius: 0; color: var(--text-secondary); }
.home-empty strong { color: var(--text); font-weight: 500; }
.home-empty p { font-size: .92rem; }
.text-button { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
#aboutPage .home-hero { display: block; margin: 0; padding: 0; border: 0; text-align: left; }
#aboutPage .home-intro { display: block; padding: 0; min-height: 0; border: 0; border-radius: 0; background: transparent; backdrop-filter: none; }
#aboutPage .home-author-label { display: block; font-family: var(--font-sans); font-size: .8rem; letter-spacing: 0; }
#aboutPage #homeTitle { font-size: 1.6rem; font-weight: 500; letter-spacing: .05em; margin: 0 0 24px; }
#aboutPage #homeAuthorBio { font-size: 1rem; line-height: 1.9; }
.home-author-avatar { width: 64px; height: 64px; }
.home-author-links { justify-content: flex-start; font-family: var(--font-sans); }
#aboutPage .hero-actions { display: flex; gap: 24px; padding: 0; margin-top: 36px; }
#aboutPage .hero-primary, #aboutPage .hero-secondary { display: inline; min-height: 0; padding: 0 0 3px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--text); font-size: .85rem; font-weight: 400; }
.breadcrumb, .article-meta, .article-source-actions, .toc-sidebar { font-family: var(--font-sans); }
.breadcrumb { margin-bottom: 28px; font-size: .8rem; }
.article-layout { display: block; }
.article-main { min-width: 0; padding: 0; }
.toc-sidebar { display: none; }
.article { font-family: var(--font-display); font-size: 1rem; line-height: 1.9; }
.article h1 { font-size: 1.7rem; font-weight: 500; line-height: 1.5; margin-bottom: 16px; }
.article h2 { font-size: 1.3rem; font-weight: 500; }
.article h3 { font-size: 1.1rem; font-weight: 500; }
.article-body a { border-bottom: 1px solid var(--border); }
.article-body a:hover { border-color: var(--text); }
.article blockquote { background: transparent; border-left: 2px solid var(--border); border-radius: 0; color: var(--text-secondary); }
.article pre { border-radius: 2px; box-shadow: none; font-size: .8rem; }
.article img { border-radius: 0; }
.profile-container { padding: 0; background: transparent; border: 0; border-radius: 0; }
.overview-stat, .overview-panel { border-radius: 0; box-shadow: none; }
.overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modal, .user-dropdown { border-radius: 4px; }
.editor-body { font-family: var(--font-sans); }
.back-to-top { border-radius: 0; box-shadow: none; background: var(--bg); color: var(--text-secondary); }
@media (min-width: 1200px) {
    body[data-page="article"] .toc-sidebar { display: block; position: fixed; top: 180px; right: calc((100vw - 1000px) / 2); width: 140px; }
    .toc-title { margin-left: 12px; font-size: .75rem; font-weight: 400; }
    .toc-item { font-size: .75rem; }
}
@media (max-width: 768px) {
    :root { --navbar-height: 84px; }
    .navbar, [data-theme="dark"] .navbar { min-height: 0; padding: 20px 24px 16px; gap: 10px 16px; }
    .navbar .logo { font-size: 1.2rem; }
    .blog-nav { gap: 18px; }
    .navbar .btn-new-article span, .navbar .btn-background span { display: none; }
    .sidebar { width: min(290px, 85vw); }
    .content, body[data-page="home"] .content, body[data-page="profile"] .content { padding: 32px 24px 0; }
    .site-footer { padding-inline: 24px; }
}
@media (max-width: 480px) {
    html { font-size: 16px; }
    .navbar, [data-theme="dark"] .navbar { gap: 10px 16px; }
    .navbar .logo { flex: 1 0 calc(100% - 160px); }
    .blog-nav { order: 8; flex: 1 0 100%; gap: 24px; }
    .navbar .theme-toggle { margin-left: auto; }
    .navbar .search-box { margin-top: 0; }
    .article h1 { font-size: 1.5rem; }
    .home-categories { gap: 0 16px; }
    .overview-stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Login and appearance settings: the same quiet type and paper as the blog. */
body:has(.modal-overlay.open) { overflow: hidden; }
.modal-overlay { padding: 24px; background: rgba(28,25,23,.25); backdrop-filter: blur(4px); }
.modal-overlay .modal { width: min(100%, 440px); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 44px 40px 32px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); box-shadow: 0 12px 60px rgba(28,25,23,.09); }
.modal-overlay .modal-close { top: 16px; right: 18px; width: 28px; height: 28px; font-size: 24px; color: var(--text-secondary); border-radius: 0; }
.panel-eyebrow { font-family: var(--font-sans); font-size: .72rem; color: var(--text-secondary); letter-spacing: .06em; margin: 0 0 18px; }
.modal-overlay .modal h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.55rem; font-weight: 500; letter-spacing: .04em; }
.panel-description { margin: 0 0 30px; font-size: .85rem; line-height: 1.8; color: var(--text-secondary); }
.modal .form-group { margin-bottom: 24px; }
.modal .form-group label { display: block; margin-bottom: 8px; color: var(--text); font-family: var(--font-sans); font-size: .78rem; font-weight: 400; }
.modal .form-group input:not([type="range"]):not([type="file"]) { width: 100%; height: 44px; padding: 8px 0; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; font-family: var(--font-sans); font-size: .85rem; }
.modal .form-group input:focus { border-color: var(--text-secondary); outline: none; }
.modal .form-group input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.password-field { position: relative; }
.modal .password-field input { padding-right: 54px !important; }
.password-field button { position: absolute; right: 0; top: 0; height: 44px; padding: 0 6px; background: transparent; border: 0; color: var(--text-secondary); font-size: .75rem; cursor: pointer; }
.modal .btn-submit, .modal .btn-secondary { min-height: 40px; border-radius: 2px; padding: 8px 18px; font-size: .82rem; font-weight: 400; box-shadow: none; }
.login-panel .btn-submit { width: 100%; margin-top: 2px; background: var(--primary); color: var(--bg); }
.login-note { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: .78rem; text-align: center; }
.modal .form-error { margin-bottom: 14px; font-family: var(--font-sans); font-size: .78rem; }
.modal .form-error:empty { display: none; }
.modal-overlay .background-modal { width: min(100%, 540px); }
.background-modal .panel-description { margin-bottom: 22px; }
.background-preview { position: relative; isolation: isolate; display: block; height: 142px; padding: 24px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 0; overflow: hidden; background: var(--bg-secondary); }
.background-preview-image { position: absolute; inset: -20px; z-index: -1; background-position: center; background-size: cover; }
.background-preview-copy { position: relative; color: var(--text); }
.background-preview-copy span, .background-preview.has-image .background-preview-copy span { display: block; padding: 0; background: transparent; color: var(--text-secondary); font: .7rem var(--font-sans); }
.background-preview-copy strong { display: block; margin: 14px 0 4px; font-size: 1.05rem; font-weight: 500; }
.background-preview-copy p { font-size: .78rem; color: var(--text-secondary); }
.background-modal input[type="file"] { width: 100%; font-size: .78rem; color: var(--text-secondary); }
.background-modal input[type="file"]::file-selector-button { padding: 8px 14px; margin-right: 12px; background: transparent; border: 1px solid var(--border); border-radius: 2px; font: inherit; color: var(--text); cursor: pointer; }
.field-hint { margin-top: 10px; font-family: var(--font-sans); font-size: .72rem; line-height: 1.8; color: var(--text-secondary); }
.background-controls { gap: 9px; margin: 0 0 18px; }
.background-controls label { margin-top: 8px; font-family: var(--font-sans); font-size: .78rem; font-weight: 400; }
.background-controls output { color: var(--text-secondary); font-family: var(--font-sans); font-size: .75rem; }
.background-controls input[type="range"] { accent-color: var(--primary); height: 16px; }
.background-actions { gap: 10px; padding-top: 22px; margin-top: 24px; border-top: 1px solid var(--border); }
#backgroundClear { border: 0; background: transparent; padding-left: 0; }
#backgroundError:not(:empty) { margin-top: 16px; }
.modal button:disabled { opacity: .5; cursor: wait; }
body.has-custom-background .navbar { background: var(--surface-on-bg-strong); }
body.has-custom-background .content { background: transparent; padding-bottom: 32px; }
body.has-custom-background .site-footer { position: relative; background: var(--surface-on-bg-strong); }

/* Writing desk, with a roomy title and unobtrusive document controls. */
.editor-body { height: 100dvh; min-height: 0; overflow: hidden; }
.editor-topbar, [data-theme="dark"] .editor-topbar {
    position: relative; inset: auto; width: 100%; height: auto; min-height: 78px;
    display: flex; padding: 20px max(24px, calc((100vw - 1200px) / 2)); gap: 16px; flex-flow: row wrap;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: none;
}
.editor-topbar .editor-back { display: inline-flex; align-items: center; gap: 10px; width: auto; min-width: 0; height: auto; margin-right: auto; font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; white-space: nowrap; }
.editor-back svg { width: 16px; height: 16px; }
.editor-back-caption { color: var(--text-secondary); font-family: var(--font-sans); font-size: .75rem; font-weight: 400; margin-left: 8px; }
.editor-topbar .editor-save-status { width: auto; height: auto; padding: 0; gap: 6px; border: 0; background: transparent; font-size: .72rem; font-weight: 400; color: var(--text-secondary); }
.editor-save-status.saved .status-icon { width: 14px; height: 14px; }
.editor-topbar .editor-save-status.error { color: #b4533a; }
.editor-topbar .editor-save-status.dirty { color: #96744b; }
.editor-attachments { display: flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid var(--border); }
.editor-topbar .editor-meta-btn, .editor-topbar .editor-theme-btn { width: 30px; height: 30px; justify-content: center; padding: 4px; background: transparent; border: 0; border-radius: 0; }
.editor-topbar .editor-meta-btn:hover, .editor-topbar .editor-theme-btn:hover { background: var(--bg-secondary); }
.editor-topbar .editor-save-btn { height: 34px; padding: 0 20px; border-radius: 2px; font-size: .8rem; font-weight: 400; }
.editor-topbar .editor-delete-btn { height: 30px; padding: 0 4px; background: transparent; border: 0; border-radius: 0; color: var(--text-secondary); font-size: .75rem; }
.editor-topbar .editor-delete-btn:hover { color: #b4533a; }
.editor-meta-bar {
    position: relative; inset: auto; width: 100%; height: auto; min-height: 0;
    padding: 32px max(24px, calc((100vw - 1200px) / 2)) 24px;
    display: flex; flex-flow: row wrap; align-items: center; gap: 18px 24px; overflow: visible;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: none;
}
.editor-heading { flex: 1 0 100%; min-width: 0; }
.editor-heading .editor-title-input { display: block; width: 100%; height: 50px; padding: 0; margin: 0 0 6px; border: 0; border-radius: 0; font-family: var(--font-display); font-size: 1.9rem; font-weight: 500; letter-spacing: .02em; background: transparent; }
.editor-heading .editor-title-input:focus { background: transparent; border: 0; box-shadow: none; }
.editor-meta-bar .editor-meta-field { gap: 10px; min-width: 0; }
.editor-meta-field label { color: var(--text-secondary); font-size: .72rem; font-weight: 400; }
.editor-meta-bar .editor-meta-field input, .editor-meta-bar .editor-meta-field select { width: 150px; max-width: 100%; height: 32px; padding: 0 0 3px; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; font-size: .75rem; }
.editor-meta-bar .editor-meta-field select { width: 120px; }
.editor-view-switch { display: flex; gap: 18px; margin-left: auto; }
.editor-view-switch button { height: 32px; padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--text-secondary); font-size: .78rem; cursor: pointer; }
.editor-view-switch button[aria-pressed="true"] { color: var(--text); border-color: var(--text); }
.editor-body .editor-main { left: max(24px, calc((100vw - 1200px) / 2)); right: max(24px, calc((100vw - 1200px) / 2)); bottom: 44px; flex-direction: row; gap: 0; }
.editor-body .editor-pane { display: flex; flex: 1; flex-direction: column; height: auto; min-height: 0; min-width: 0; background: transparent; }
.editor-pane-label { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 10px; height: 50px; padding: 0 28px; font-family: var(--font-sans); font-size: .72rem; color: var(--text-secondary); }
.editor-pane-label span { font-size: .65rem; }
.editor-body .editor-pane-left textarea { flex: 1; min-height: 0; width: 100%; height: auto; padding: 8px 28px 60px; background: transparent; color: var(--text); font-size: .88rem; line-height: 2; }
.editor-body .editor-pane-right { border: 0; }
.editor-body .editor-preview-content { flex: 1; min-height: 0; height: auto; width: 100%; max-width: 640px; padding: 8px 28px 60px; font-size: .95rem; line-height: 1.9; }
.editor-preview-content:empty::before { content: '写下的文字，会在这里慢慢成形。'; color: var(--text-secondary); font-size: .9rem; }
.editor-body .editor-divider { display: block; width: 1px; height: auto; flex-shrink: 0; border-left: 1px solid var(--border); background: transparent; }
.editor-divider::before { content: ''; position: absolute; inset: 0 -5px; }
.editor-body .editor-divider:hover, .editor-body .editor-divider.active { border-color: var(--text-secondary); }
.editor-body[data-editor-view="write"] .editor-pane-right, .editor-body[data-editor-view="preview"] .editor-pane-left,
.editor-body:not([data-editor-view="split"]) .editor-divider { display: none; }
.editor-body:not([data-editor-view="split"]) .editor-main { left: max(24px, calc((100vw - 800px) / 2)); right: max(24px, calc((100vw - 800px) / 2)); }
.editor-statusbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 44px; padding: 0 max(24px, calc((100vw - 1200px) / 2)); border-top: 1px solid var(--border); font-family: var(--font-sans); font-size: .68rem; color: var(--text-secondary); background: var(--bg); z-index: 5; }
.editor-body.has-custom-background .editor-topbar, .editor-body.has-custom-background .editor-meta-bar, .editor-body.has-custom-background .editor-statusbar { background: var(--surface-on-bg-strong); }
.editor-body.has-custom-background .editor-main { background: var(--surface-on-bg); }
.editor-body.has-custom-background .editor-pane { background: transparent; }
@media (max-width: 900px) {
    .editor-topbar { gap: 12px; }
    .editor-meta-bar { gap: 16px; }
    .editor-meta-bar .editor-meta-field { flex: 1 1 28%; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
    .editor-meta-bar .editor-meta-field input, .editor-meta-bar .editor-meta-field select { width: 100%; }
    .editor-view-switch { justify-content: flex-end; flex: 1 0 100%; gap: 24px; }
}
@media (max-width: 768px) {
    .editor-topbar, [data-theme="dark"] .editor-topbar { min-height: 0; padding: 16px 20px; gap: 10px; }
    .editor-topbar .editor-back { font-size: 1rem; }
    .editor-back-caption { display: none; }
    .editor-topbar .editor-save-status span { display: inline; }
    .editor-attachments { order: 10; flex: 1 0 100%; justify-content: flex-start; padding: 8px 0 0; border: 0; border-top: 1px solid var(--border); gap: 18px; }
    .editor-meta-bar { padding: 20px; gap: 14px; }
    .editor-heading .editor-title-input { height: 42px; font-size: 1.5rem; }
    .editor-body .editor-main, .editor-body:not([data-editor-view="split"]) .editor-main { left: 20px; right: 20px; }
    .editor-pane-label { height: 42px; padding: 0 4px; }
    .editor-body .editor-pane-left textarea, .editor-body .editor-preview-content { padding: 8px 4px 40px; font-size: .9rem; }
    .editor-body[data-editor-view="split"] .editor-main { flex-direction: column; }
    .editor-body[data-editor-view="split"] .editor-pane { flex: 1 !important; width: 100% !important; }
    .editor-body[data-editor-view="split"] .editor-divider { height: 1px; width: 100%; border: 0; border-top: 1px solid var(--border); pointer-events: none; }
    .editor-statusbar { padding-inline: 20px; font-size: .65rem; }
    .editor-statusbar > span:last-child { font-size: 0; }
    .editor-statusbar > span:last-child::after { content: '自动保存 · Ctrl / ⌘ + S'; font-size: .65rem; }
}
@media (max-width: 480px) {
    .modal-overlay { padding: 16px; }
    .modal-overlay .modal { padding: 36px 24px 24px; max-height: calc(100dvh - 32px); }
    .background-preview { padding: 20px; }
    .background-actions { gap: 8px; }
    .modal .background-actions button { padding: 8px 12px; }
    .editor-topbar .editor-save-btn { padding: 0 14px; }
    .editor-topbar .editor-delete-btn { font-size: .7rem; }
    .editor-topbar .editor-save-status { font-size: .65rem; }
    .editor-topbar .editor-save-status span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .editor-meta-bar .editor-meta-field { flex-basis: calc(50% - 14px); }
    .editor-meta-bar .editor-meta-field:nth-of-type(4) { flex-basis: 100%; }
    .editor-view-switch { justify-content: flex-start; }
}
