/* 湘铭简记统一专业工作区主题：桌面、移动、登录、分享与安装页共用。 */
:root {
    --app-bg: #f5f7f4;
    --app-surface: #ffffff;
    --app-surface-muted: #eef5ee;
    --app-text: #1f2a22;
    --app-text-muted: #68736b;
    --app-border: #dce7dd;
    --app-primary: #2f7d4a;
    --app-primary-hover: #25663d;
    --app-primary-soft: #ddf0e1;
    --app-info: #2878c8;
    --app-danger: #c84545;
    --app-warning: #b7791f;
    --app-radius-sm: 8px;
    --app-radius-md: 12px;
    --app-radius-lg: 16px;
    --app-shadow: 0 8px 24px rgba(31, 42, 34, .08);
    --app-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

button, input, select, textarea { font: inherit; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 3px solid rgba(47, 125, 74, .28);
    outline-offset: 2px;
}

/* 桌面端：双栏专业工作区 */
.app-desktop {
    background: var(--app-bg);
    color: var(--app-text);
    font-family: var(--app-font);
}

.app-desktop .container {
    max-width: 1440px;
    height: 100vh;
    max-height: none;
    padding: 20px;
}

.app-desktop .content-wrapper {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow);
}

.app-desktop #sidebar {
    width: 280px;
    padding: 22px 16px;
    border-radius: var(--app-radius-lg) 0 0 var(--app-radius-lg);
    border-right: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.app-desktop #sidebar h3 {
    margin: 0 8px 18px;
    color: var(--app-text);
    font-size: 16px;
    letter-spacing: .02em;
}

.app-desktop button {
    min-height: 40px;
    border-radius: var(--app-radius-md);
    background: var(--app-primary);
    box-shadow: none;
    font-weight: 600;
}

.app-desktop button:hover { background: var(--app-primary-hover); }

.app-desktop .search-box,
.app-desktop .form-group input,
.app-desktop .form-group select,
.app-desktop .custom-days-input,
.app-desktop .share-link-input {
    min-height: 40px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: rgba(255, 255, 255, .9);
    color: var(--app-text);
}

.app-desktop .search-box:focus,
.app-desktop .form-group input:focus,
.app-desktop .form-group select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(47, 125, 74, .12);
    outline: 0;
}

.app-desktop .note-item {
    min-height: 66px;
    margin: 0 0 6px;
    padding: 12px 38px 12px 14px;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    border-radius: var(--app-radius-md);
    background: transparent;
    color: var(--app-text);
}

.app-desktop .note-item:hover { background: rgba(255, 255, 255, .72); }

.app-desktop .note-item.selected {
    border-color: transparent;
    border-left-color: var(--app-primary);
    background: var(--app-primary-soft);
    box-shadow: none;
}

.app-desktop .note-item .action-icons { right: 10px; }
.app-desktop .action-icon { border: 1px solid var(--app-border); box-shadow: none; }

.app-desktop #main { background: var(--app-surface); }

.app-desktop .main-header {
    min-height: 76px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--app-border);
    background: rgba(255, 255, 255, .96);
}

.app-desktop .date-display-style { color: var(--app-text); font-size: 15px; }
.app-desktop .weather-style {
    margin-right: 12px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-primary);
}

.app-desktop .avatar-style {
    width: 38px;
    height: 38px;
    background: var(--app-primary);
    font-size: 13px;
    font-weight: 700;
}

.app-desktop #content { display: flex; min-height: 0; flex-direction: column; }
.app-desktop #welcome-message { padding: 10px 15px !important; color: var(--app-text-muted) !important; }
.app-desktop .news-container-style {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    margin: 0 20px 16px;
    padding: 16px 28px 14px;
    overflow: hidden;
}
.app-desktop .news-refresh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
    color: var(--app-text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .2s ease;
}
.app-desktop .news-refresh-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.app-desktop .news-refresh-button:hover { border-color: #b9ddc2; background: var(--app-primary-soft); color: var(--app-primary); transform: translateY(-1px); }
.app-desktop .news-refresh-button:active { transform: translateY(0); }
.app-desktop .news-filter-row { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-bottom: 14px; }
.app-desktop .news-source-style {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #fff;
    color: var(--app-text-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.app-desktop .news-source-style:hover { border-color: #b9ddc2; background: #f5faf6; color: var(--app-primary); }
.app-desktop .news-source-style.is-active { border-color: var(--app-primary); background: var(--app-primary); color: #fff; box-shadow: 0 4px 10px rgba(44, 126, 73, .17); }
.app-desktop .news-list { min-height: 0; max-height: min(440px, calc(100vh - 245px)); margin-top: 14px; padding-right: 6px; overflow-y: auto; scrollbar-color: #c9d8cc transparent; scrollbar-width: thin; }
.app-desktop .news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 4px; }
.app-desktop .news-item {
    display: flex;
    min-width: 0;
    min-height: 96px;
    flex-direction: column;
    justify-content: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(31, 42, 34, .03);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.app-desktop .news-item:hover { border-color: #b9ddc2; box-shadow: 0 9px 20px rgba(42, 74, 50, .08); transform: translateY(-2px); }
.app-desktop .news-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--app-text-muted); font-size: 11px; line-height: 1.3; }
.app-desktop .news-item-meta > span { display: inline-flex; align-items: center; gap: 6px; color: var(--app-text); font-weight: 700; }
.app-desktop .news-item-meta i { width: 7px; height: 7px; border-radius: 50%; background: var(--app-primary); }
.app-desktop .news-item--jinritoutiao .news-item-meta i { background: #df4c4c; }
.app-desktop .news-item--baidu .news-item-meta i { background: #3478da; }
.app-desktop .news-item--weibo .news-item-meta i { background: #cd8b16; }
.app-desktop .news-item-meta time { overflow: hidden; color: var(--app-text-muted); text-overflow: ellipsis; white-space: nowrap; }
.app-desktop .news-item > a { display: -webkit-box; overflow: hidden; margin: 0; color: var(--app-text); font-size: 15px; font-weight: 700; line-height: 1.5; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.app-desktop .news-item > a:hover { color: var(--app-primary); }
.app-desktop .news-item > a svg { width: 15px; height: 15px; margin-left: 5px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.app-desktop .news-pagination { position: static; flex: 0 0 auto; justify-content: center; gap: 7px; margin-top: 14px; padding-top: 14px; overflow: visible; }
.app-desktop .news-pagination-button {
    min-width: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
    color: var(--app-text-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.app-desktop .news-pagination-button:hover:not(:disabled) { border-color: #b9ddc2; background: var(--app-primary-soft); color: var(--app-primary); }
.app-desktop .news-pagination-button.is-active { border-color: var(--app-primary); background: var(--app-primary); color: #fff; }
.app-desktop .news-pagination-button:disabled { cursor: not-allowed; opacity: .45; }
.app-desktop .news-state { display: flex; min-height: 236px; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 24px; border: 1px dashed #c9d8cc; border-radius: 14px; color: var(--app-text-muted); text-align: center; }
.app-desktop .news-state svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-desktop .news-state p { margin: 0; font-size: 13px; }
.app-desktop .news-state--error { color: var(--app-danger); border-color: #efc7c3; background: #fffafa; }
.app-desktop .news-state button { min-height: 36px; padding: 0 12px; border: 1px solid #efc7c3; border-radius: 9px; background: #fff; color: var(--app-danger); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.app-desktop .news-skeleton-card { min-height: 96px; padding: 14px 16px; border: 1px solid var(--app-border); border-radius: 14px; background: #fff; }
.app-desktop .news-skeleton-card i, .app-desktop .news-skeleton-card b, .app-desktop .news-skeleton-card small { display: block; border-radius: 999px; background: linear-gradient(90deg, #eef2ee 25%, #f8faf8 45%, #eef2ee 65%); background-size: 220% 100%; animation: news-shimmer 1.4s ease-in-out infinite; }
.app-desktop .news-skeleton-card i { width: 54px; height: 9px; }
.app-desktop .news-skeleton-card b { width: 88%; height: 12px; margin-top: 17px; }
.app-desktop .news-skeleton-card b + b { width: 62%; margin-top: 10px; }
.app-desktop .news-skeleton-card small { width: 35%; height: 8px; margin-top: 14px; }
@keyframes news-shimmer { to { background-position: -220% 0; } }
@media (max-width: 900px) {
    .app-desktop .news-container-style { margin-right: 12px; margin-left: 12px; padding: 14px 20px 12px; }
    .app-desktop .news-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .app-desktop .news-container-style { margin: 0 8px 12px; padding: 12px 16px 10px; }
    .app-desktop .news-refresh-button span { display: none; }
    .app-desktop .news-refresh-button { width: 38px; padding: 0; }
    .app-desktop .news-source-style { min-height: 36px; padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .app-desktop .news-refresh-button, .app-desktop .news-source-style, .app-desktop .news-item, .app-desktop .news-pagination-button { transition: none; }
    .app-desktop .news-skeleton-card i, .app-desktop .news-skeleton-card b, .app-desktop .news-skeleton-card small { animation: none; }
}

.app-desktop .editor-content { background: #fbfcfb; }
.app-desktop .editor,
.app-desktop .preview {
    padding: 36px !important;
    background: #fbfcfb !important;
    color: var(--app-text);
    font-family: var(--app-font) !important;
    line-height: 1.78 !important;
}

.app-desktop .editor { font-size: 16px !important; }
.app-desktop .editor-footer {
    min-height: 64px;
    padding: 12px 24px;
    border-top-color: var(--app-border);
    background: rgba(255, 255, 255, .96);
}

.app-desktop .source-btn {
    min-height: 38px;
    border-color: var(--app-border);
    border-radius: 10px;
    background: var(--app-surface);
    color: var(--app-text-muted);
}

.app-desktop .source-btn:hover { border-color: var(--app-primary); color: var(--app-primary); background: var(--app-primary-soft); }
.app-desktop .share-btn { border-radius: 10px; background: var(--app-primary); border-color: var(--app-primary); }

.app-desktop .modal { background: rgba(20, 35, 24, .38); backdrop-filter: blur(5px); }
.app-desktop .modal-content {
    width: min(620px, calc(100% - 32px));
    margin: 16px auto;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: 0 20px 56px rgba(20, 35, 24, .2);
}

.app-desktop .button-group { border-top-color: var(--app-border); }
.app-desktop .close { color: var(--app-text-muted); }
.app-desktop .close:hover { color: var(--app-text); }

.app-desktop .music-player { right: 28px; bottom: 28px; }
.app-desktop .music-btn { border-radius: 14px; background: #1f6140; box-shadow: var(--app-shadow); }

/* 移动端：紧凑但保留明确层级和安全区域 */
.app-mobile {
    background: var(--app-bg);
    color: var(--app-text);
    font-family: var(--app-font);
}

.app-mobile .header {
    min-height: 72px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--app-border);
    background: rgba(255, 255, 255, .96);
    color: var(--app-text);
    box-shadow: none;
}

.app-mobile .date { color: var(--app-text); font-weight: 700; }
.app-mobile .weather { color: var(--app-text-muted); }
.app-mobile .logo { width: 40px; height: 40px; border: 1px solid var(--app-border); box-shadow: none; }

.app-mobile .main-content { padding: 16px 16px 108px; background: var(--app-bg); }
.app-mobile .welcome-page, .app-mobile .notes-page, .app-mobile .editor-page { background: transparent; }
.app-mobile .welcome-page h2 { color: var(--app-text); font-size: 21px; }

.app-mobile .news-section,
.app-mobile .notes-list,
.app-mobile .editor-area {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    box-shadow: 0 4px 16px rgba(31, 42, 34, .04);
}

.app-mobile .news-section { overflow: hidden; }
.app-mobile .news-tabs { padding: 8px; border-bottom: 1px solid var(--app-border); background: var(--app-surface-muted); }
.app-mobile .news-tab { border-radius: 999px; color: var(--app-text-muted); font-size: 12px; }
.app-mobile .news-tab.active { background: var(--app-primary); color: #fff; }
.app-mobile .news-item { border-bottom-color: var(--app-border); }

.app-mobile .search-bar { margin-bottom: 12px; }
.app-mobile .search-input {
    min-height: 44px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: 0 4px 16px rgba(31, 42, 34, .04);
}

.app-mobile .note-item { border-bottom-color: var(--app-border); padding: 14px 16px; }
.app-mobile .note-item:active { background: var(--app-primary-soft); }
.app-mobile .note-title { color: var(--app-text); font-weight: 650; }
.app-mobile .note-date { color: var(--app-text-muted) !important; }

.app-mobile .editor-toolbar {
    gap: 8px;
    padding: 0 0 12px;
    background: transparent;
}

.app-mobile .toolbar-btn,
.app-mobile .modal-btn {
    min-height: 40px;
    border-radius: 10px;
    background: var(--app-primary);
    font-weight: 650;
}

.app-mobile .toolbar-btn.secondary,
.app-mobile .modal-btn-secondary { border: 1px solid var(--app-border); background: var(--app-surface); color: var(--app-text-muted); }
.app-mobile .editor-area { overflow: hidden; }
.app-mobile .editor-textarea,
.app-mobile .preview-area { min-height: calc(100dvh - 240px); padding: 22px; background: var(--app-surface); color: var(--app-text); line-height: 1.75; }
.app-mobile .md-floating-toolbar { border: 1px solid var(--app-border); border-radius: 14px; box-shadow: var(--app-shadow); background: var(--app-surface); }
.app-mobile .md-btn { color: var(--app-primary); }

.app-mobile .bottom-nav {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    height: 68px;
    border: 1px solid var(--app-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--app-shadow);
}

.app-mobile .menu-btn { background: var(--app-primary); box-shadow: none; }
.app-mobile .nav-items { bottom: 68px; }
.app-mobile .nav-items li { border: 1px solid var(--app-border); background: var(--app-surface); box-shadow: 0 4px 14px rgba(31, 42, 34, .08); }

.app-mobile .modal { background: rgba(20, 35, 24, .38); backdrop-filter: blur(5px); }
.app-mobile .modal-content { width: calc(100% - 24px); border-radius: 18px; border: 1px solid var(--app-border); box-shadow: 0 20px 56px rgba(20, 35, 24, .2); }
.app-mobile .modal-header { border-bottom-color: var(--app-border); color: var(--app-text); }
.app-mobile .form-group label { color: var(--app-text-muted); }
.app-mobile .form-group input, .app-mobile .form-group select { border-color: var(--app-border); border-radius: 10px; }

/* 登录、分享和安装页：统一为可信赖的表单/阅读卡片 */
.app-auth,
.app-share,
.app-install {
    min-height: 100vh;
    color: var(--app-text);
    font-family: var(--app-font);
    background: radial-gradient(circle at top left, #e8f2e9 0, transparent 36%), var(--app-bg);
}

.app-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.app-auth .verify-container {
    max-width: 420px;
    padding: 34px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow);
    text-align: left;
}

.app-auth h1 { margin-bottom: 10px; color: var(--app-text); font-size: 24px; }
.app-auth h1::after { content: "请输入管理密码以继续"; display: block; margin-top: 8px; color: var(--app-text-muted); font-size: 14px; font-weight: 400; }
.app-auth .password-field { border-color: var(--app-border); border-radius: var(--app-radius-md); color: var(--app-text); text-align: left; font-size: 18px; }
.app-auth .password-field:focus { border-color: var(--app-primary); box-shadow: 0 0 0 3px rgba(47, 125, 74, .12); }
.app-auth .login-button { width: 100%; min-height: 44px; border: 0; border-radius: var(--app-radius-md); background: var(--app-primary); color: #fff; font-weight: 650; cursor: pointer; }
.app-auth .login-button:hover { background: var(--app-primary-hover); }
.app-auth .message.success { display: block; color: var(--app-primary); background: var(--app-primary-soft); border: 1px solid var(--app-border); }

.app-share { max-width: none; margin: 0; padding: 48px 24px; line-height: 1.75; }
.app-share .container { max-width: 900px; margin: 0 auto; padding: clamp(24px, 5vw, 56px); border: 1px solid var(--app-border); border-radius: var(--app-radius-lg); box-shadow: var(--app-shadow); }
.app-share .header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--app-border); }
.app-share .title { color: var(--app-text); font-size: clamp(26px, 4vw, 38px); letter-spacing: -.02em; }
.app-share .meta, .app-share .footer { color: var(--app-text-muted); }
.app-share .content { color: var(--app-text); font-size: 16px; }
.app-share .content h1, .app-share .content h2 { border-bottom-color: var(--app-border); color: var(--app-text); }
.app-share .content a { color: var(--app-info); }
.app-share .content blockquote { border-left-color: var(--app-primary); color: var(--app-text-muted); background: var(--app-surface-muted); border-radius: 0 8px 8px 0; padding: 12px 16px; }
.app-share .password-verification { max-width: 420px; margin: 24px auto; padding: 32px; border: 1px solid var(--app-border); border-radius: var(--app-radius-lg); background: var(--app-surface); box-shadow: var(--app-shadow); }
.app-share .password-input-group input { border-color: var(--app-border); border-radius: var(--app-radius-md); }
.app-share .password-input-group input:focus { border-color: var(--app-primary); box-shadow: 0 0 0 3px rgba(47, 125, 74, .12); }
.app-share .verify-password-btn { min-height: 42px; border-radius: var(--app-radius-md); background: var(--app-primary); }

.app-install { padding: 40px 20px; }
.app-install .install-container { max-width: 880px; border: 1px solid var(--app-border); border-radius: var(--app-radius-lg); box-shadow: var(--app-shadow); }
.app-install h1, .app-install h2, .app-install h3 { color: var(--app-text); }
.app-install input, .app-install select { min-height: 42px; border-color: var(--app-border); border-radius: var(--app-radius-md); }
.app-install input:focus, .app-install select:focus { border-color: var(--app-primary); box-shadow: 0 0 0 3px rgba(47, 125, 74, .12); }
.app-install button { min-height: 42px; border-radius: var(--app-radius-md); background: var(--app-primary); font-weight: 650; }

@media (max-width: 768px) {
    .app-desktop .container { padding: 0; }
    .app-share { padding: 16px; }
    .app-share .container { padding: 24px 20px; }
    .app-share .footer { margin-top: 28px; }
    .app-install { padding: 18px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* 专业工作区稿的桌面结构：侧栏分组、双模式顶栏与编辑命令条。 */
.app-desktop .container { max-width: none; padding: 0; }
.app-desktop .content-wrapper { border: 0; border-radius: 0; box-shadow: none; }
.app-desktop #sidebar {
    width: 288px;
    padding: 0;
    border-radius: 0;
    background: #f5f7f4;
}

.app-desktop .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 8px;
}

.app-desktop .sidebar-brand h1 {
    margin: 0;
    color: var(--app-primary);
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.03em;
}

.app-desktop .sidebar-create-btn {
    display: grid;
    width: 40px;
    min-height: 40px;
    padding: 0;
    place-items: center;
    border-radius: 12px;
    background: var(--app-primary);
    color: #fff;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(47, 125, 74, .2);
}

.app-desktop .sidebar-search-wrap {
    position: relative;
    margin: 10px 16px 2px;
}

.app-desktop .sidebar-search-wrap > span {
    position: absolute;
    z-index: 1;
    top: 9px;
    left: 12px;
    color: var(--app-text-muted);
    font-size: 20px;
    line-height: 1;
}

.app-desktop .sidebar-search-wrap .search-box {
    width: 100%;
    margin: 0;
    padding: 9px 12px 9px 38px;
    font-size: 13px;
}

.app-desktop .sidebar-nav {
    padding: 18px 10px 6px;
}

.app-desktop .sidebar-nav-title {
    margin: 0 14px 8px;
    color: var(--app-text-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .13em;
}

.app-desktop .sidebar-nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    gap: 12px;
    margin: 2px 0;
    padding: 8px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--app-text-muted);
    font-size: 14px;
    font-weight: 550;
    text-align: left;
}

.app-desktop .sidebar-nav-item:hover { background: var(--app-surface-muted); color: var(--app-text); }
.app-desktop .sidebar-nav-item.active { background: #fff; color: var(--app-text); box-shadow: 0 1px 3px rgba(31, 42, 34, .06); }
.app-desktop .sidebar-nav-item.active span { color: var(--app-primary); }
.app-desktop .sidebar-nav-count { min-width: 20px; margin-left: auto; color: var(--app-text-muted); font-size: 11px; font-weight: 700; text-align: right; }
.app-desktop .sidebar-nav-item.active .sidebar-nav-count { color: var(--app-text-muted); }
.app-desktop .sidebar-category-list { display: none; gap: 2px; margin: 3px 0 6px; padding: 0 4px; }
.app-desktop .sidebar-category-list.is-expanded { display: grid; }
.app-desktop .sidebar-nav-chevron { width: 16px; height: 16px; margin-left: auto; transition: transform .2s ease; }
.app-desktop #sidebarCategoriesToggle[aria-expanded="true"] .sidebar-nav-chevron { transform: rotate(180deg); }
.app-desktop .sidebar-category-item { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 34px; padding: 7px 10px 7px 39px; border: 0; border-radius: 9px; background: transparent; color: var(--app-text-muted); font-size: 12px; font-weight: 600; text-align: left; }
.app-desktop .sidebar-category-item:hover { background: var(--app-surface-muted); color: var(--app-text); }
.app-desktop .sidebar-category-item.active { background: var(--app-primary-soft); color: var(--app-primary); }
.app-desktop .sidebar-category-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-desktop .sidebar-category-item b { min-width: 20px; margin-left: 8px; color: var(--app-text-muted); font-size: 11px; font-weight: 700; text-align: right; }
.app-desktop .sidebar-category-empty { margin: 4px 10px 8px 39px; color: var(--app-text-muted); font-size: 12px; }

.app-desktop #notes-list {
    min-height: 0;
    max-height: none;
    padding: 0 10px;
}

.app-desktop .note-item {
    min-height: 74px;
    margin: 3px 0;
    padding: 11px 34px 11px 13px;
    border-left-width: 3px;
    border-radius: 12px;
}

.app-desktop .note-item.selected { background: var(--app-primary-soft); }

.app-desktop .sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 28px);
    margin: 14px;
    padding: 8px;
    border: 0;
    border-top: 1px solid var(--app-border);
    border-radius: 12px;
    background: transparent;
    color: var(--app-text);
    text-align: left;
}

.app-desktop .sidebar-profile:hover { background: var(--app-surface-muted); }
.app-desktop .sidebar-profile-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-hover));
    color: #fff;
    font-size: 12px;
    font-weight: 750;
}

.app-desktop .sidebar-profile strong,
.app-desktop .sidebar-profile small { display: block; }
.app-desktop .sidebar-profile strong { font-size: 13px; }
.app-desktop .sidebar-profile small { margin-top: 2px; color: var(--app-text-muted); font-size: 11px; }
.app-desktop .sidebar-profile b { margin-left: auto; color: var(--app-text-muted); }

.app-desktop .main-header {
    min-height: 64px;
    padding: 0 32px;
    background: #fff;
}

/* 欢迎页展示新闻时不保留笔记专属操作；打开笔记后会随新闻区隐藏而自动恢复。 */
.app-desktop #main:has(#news-container:not([style*="display: none"])) .header-actions { display: none; }

.app-desktop .header-context,
.app-desktop .header-actions,
.app-desktop .view-switcher {
    display: flex;
    align-items: center;
}

.app-desktop .header-context { gap: 14px; }
.app-desktop .header-actions { gap: 12px; }
.app-desktop .date-display-style { padding: 7px 10px; border-radius: 8px; background: var(--app-surface-muted); color: var(--app-primary); font-size: 12px; font-weight: 650; }
.app-desktop .weather-style { margin: 0; padding: 0; border: 0; background: transparent; color: var(--app-text-muted); font-size: 12px; }

.app-desktop .view-switcher {
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    background: var(--app-bg);
}

.app-desktop .view-switcher button {
    min-height: 30px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--app-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.app-desktop .view-switcher button:hover { background: rgba(255,255,255,.7); color: var(--app-primary); }
.app-desktop .view-switcher button.active { background: #fff; color: var(--app-primary); box-shadow: 0 1px 3px rgba(31, 42, 34, .1); }
.app-desktop .header-share-btn { min-height: 34px; padding: 7px 13px; border: 0; border-radius: 12px; font-size: 12px; }
.app-desktop .avatar-style { display: none; }

.app-desktop .editor-commandbar {
    display: flex;
    align-items: center;
    min-height: 48px;
    gap: 4px;
    padding: 0 32px;
    border-bottom: 1px solid var(--app-border);
    background: rgba(245, 247, 244, .62);
}

.app-desktop .editor-commandbar button {
    display: grid;
    width: 30px;
    min-height: 30px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--app-text-muted);
    font-size: 15px;
}

.app-desktop .editor-commandbar button:hover { background: #fff; color: var(--app-primary); }
.app-desktop .editor-save-state { margin-left: 14px; color: var(--app-text-muted); font-size: 12px; }
.app-desktop .editor-save-state::first-letter { color: var(--app-primary); }

.app-desktop .editor-content { height: auto !important; background: #fff; }
.app-desktop .editor,
.app-desktop .preview { padding: clamp(36px, 7vw, 76px) !important; background: #fff !important; font-size: 17px !important; }
.app-desktop .editor-footer { min-height: 46px; padding: 10px 32px; background: #fff; }
.app-desktop .editor-footer > div:last-child { display: none !important; }
.app-desktop .editor-stats { color: var(--app-text-muted); font-size: 12px; }

@media (max-width: 1023px) {
    .app-desktop #sidebar { width: 250px; }
    .app-desktop .main-header, .app-desktop .editor-commandbar { padding-left: 20px; padding-right: 20px; }
    .app-desktop .header-context { gap: 6px; }
    .app-desktop .weather-style { display: none; }
}

/* 收紧桌面画布：浏览器再宽，工作区和阅读列也保持稳定。 */
@media (min-width: 1024px) {
    .app-desktop {
        min-height: 100vh;
        padding: 16px;
        background: #edf2ed;
    }

    .app-desktop .container {
        width: min(1280px, 100%);
        height: calc(100vh - 32px);
        margin: 0 auto;
        padding: 0;
    }

    .app-desktop .content-wrapper {
        display: flex;
        height: 100%;
        overflow: hidden;
        border: 1px solid var(--app-border);
        border-radius: 18px;
        box-shadow: 0 18px 46px rgba(31, 42, 34, .10);
    }

    .app-desktop #sidebar {
        display: flex;
        height: 100%;
        flex: 0 0 288px;
        flex-direction: column;
    }

    .app-desktop #notes-list { flex: 1; overflow-y: auto; }
    .app-desktop #main { display: flex; min-width: 0; flex: 1; flex-direction: column; }
    .app-desktop #content { min-height: 0; flex: 1; overflow: hidden; }
    .app-desktop #editor-container { height: 100%; }

    .app-desktop .editor-content {
        position: relative;
        height: calc(100% - 48px) !important;
        padding: 24px;
        overflow: hidden;
        background: #f6f8f6;
    }

    .app-desktop .editor,
    .app-desktop .preview {
        width: min(100%, 760px) !important;
        height: 100% !important;
        margin: 0 auto;
        padding: 40px 48px !important;
        border: 1px solid #e3ebe3 !important;
        border-radius: 12px;
        background: #fff !important;
        box-shadow: 0 2px 8px rgba(31, 42, 34, .035);
    }

    .app-desktop .preview {
        right: 0;
        left: 0 !important;
    }
}

/* 编辑状态与分类都留在编辑器顶部，去掉会把画面拉到底部的旧页脚。 */
.app-desktop .editor-footer { display: none !important; }
.app-desktop .editor-commandbar { flex-wrap: wrap; }
.app-desktop .editor-commandbar svg,
.app-desktop .view-switcher svg,
.app-desktop .header-share-btn svg,
.app-desktop .sidebar-nav-item svg,
.app-desktop .sidebar-profile b svg,
.note-pin-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.app-desktop .view-switcher button,
.app-desktop .header-share-btn { display: inline-flex; align-items: center; gap: 6px; }
.app-desktop .sidebar-nav-item svg { flex: 0 0 16px; }
.app-desktop .sidebar-profile b svg { vertical-align: middle; }
.app-desktop .editor-commandbar button svg { width: 15px; height: 15px; }
.app-desktop .editor-category-trigger {
    display: inline-flex !important;
    width: auto !important;
    min-height: 28px !important;
    max-width: 156px;
    margin-left: 6px;
    padding: 0 9px !important;
    overflow: hidden;
    border: 1px solid var(--app-border) !important;
    color: var(--app-primary) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-desktop .editor-inline-stat { color: var(--app-text-muted); font-size: 11px; }
.app-desktop .editor-inline-stat + .editor-inline-stat::before { content: ""; display: inline-block; width: 1px; height: 12px; margin: 0 10px; vertical-align: -2px; background: var(--app-border); }
.app-desktop .editor-save-state { display: inline-flex; align-items: center; gap: 6px; }
.app-desktop .editor-save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--app-primary); }
.app-desktop .editor-save-state::first-letter { color: inherit; }
.note-pin-icon { display: inline-block; margin-right: 4px; vertical-align: -3px; color: var(--app-primary); }
.note-share-icon { display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.note-share-icon.is-active { color: var(--app-primary); }
.note-share-icon.is-expiring { color: #d88700; }
.note-share-icon.is-expired { color: var(--app-text-muted); }
.note-category-chip { display: inline-block; margin-left: 7px; padding: 2px 6px; border-radius: 999px; background: var(--app-primary-soft); color: var(--app-primary); font-size: 10px; font-weight: 650; }

/* 分享与设置：统一标题、字段、操作区层级，取消蓝绿混用。 */
.app-desktop .share-modal-content {
    width: min(510px, calc(100% - 32px));
    margin-top: 8vh;
    padding: 28px;
}
.app-desktop .share-modal-content h2,
.app-desktop #profileModal h2 { margin: 0 0 22px; color: var(--app-text); font-size: 24px; letter-spacing: -.02em; }
.app-desktop .share-modal-content .form-group { margin-bottom: 18px; }
.app-desktop .share-modal-content .form-group label,
.app-desktop #profileModal .form-group label { display: block; margin-bottom: 7px; color: var(--app-text-muted); font-size: 13px; font-weight: 700; }
.app-desktop .share-modal-content input,
.app-desktop .share-modal-content select,
.app-desktop #profileModal input {
    width: 100% !important;
    min-height: 42px !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--app-text) !important;
}
.app-desktop .share-modal-content input[readonly] { background: #f7f9f7 !important; }
.app-desktop .share-modal-content #currentShareStatus { border: 1px solid #cde7d4 !important; border-left: 3px solid var(--app-primary) !important; border-radius: 10px !important; background: #f4faf5 !important; }
.app-desktop .share-modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.app-desktop .share-modal-actions button { min-height: 42px; border: 0; border-radius: 10px; }
.app-desktop .share-modal-actions #copyBtn { background: #eef5ee !important; color: var(--app-primary) !important; }
.app-desktop .share-modal-actions #copyBtn:disabled { color: #98a39a !important; }
.app-desktop .share-modal-actions #cancelBtn { background: #fff2f1 !important; color: var(--app-danger) !important; }
.app-desktop .share-modal-content #togglePasswordBtn { background: #f4f6f4 !important; color: var(--app-text) !important; }
.app-desktop .share-modal-content #clearPasswordBtn { background: #fff2f1 !important; color: var(--app-danger) !important; }

.app-desktop #profileModal .profile-modal-content { display: flex; flex-direction: column; width: min(1080px, calc(100vw - 48px)) !important; max-width: none !important; max-height: min(88vh, 840px); margin-top: 5vh; padding: 0; overflow: hidden; }
.profile-modal-header { position: relative; flex: 0 0 auto; padding: 25px 30px 20px; border-bottom: 1px solid var(--app-border); background: linear-gradient(135deg, #fbfdfb, #f4f9f5); }
.profile-modal-header .modal-eyebrow { margin-bottom: 7px; }
.profile-modal-header h2 { margin: 0; }
.profile-modal-header > p:last-child { margin: 8px 0 0; color: var(--app-text-muted); font-size: 13px; }
.profile-close { position: absolute; top: 15px; right: 17px; width: 32px; min-height: 32px !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: transparent !important; color: var(--app-text-muted) !important; font-size: 25px; line-height: 1; }
.profile-close:hover { background: #e9f1eb !important; color: var(--app-text) !important; }
.profile-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 30px 22px; }
.profile-section { padding: 22px 0; border-bottom: 1px solid var(--app-border); }
.profile-section:last-child { border-bottom: 0; padding-bottom: 8px; }
.profile-section > h3 { margin: 0 0 15px; color: var(--app-text); font-size: 15px; letter-spacing: -.01em; }
.app-desktop #profileModal .form-row { gap: 16px; }
.app-desktop #profileModal .profile-form-grid--four { display: grid; grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(0, 1fr)); gap: 14px; }
.app-desktop #profileModal .form-group { margin-bottom: 14px; }
.app-desktop #profileModal .form-group:last-child { margin-bottom: 0; }
.app-desktop #profileModal .form-group small { display: block; margin-top: 7px; color: var(--app-text-muted); font-size: 12px; line-height: 1.55; }
.app-desktop #profileModal .form-group small a { color: var(--app-primary); font-weight: 650; text-decoration: none; }
.app-desktop #profileModal .form-group small a:hover { text-decoration: underline; }
.profile-section-title { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 17px; }
.profile-section-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; background: var(--app-primary-soft); color: var(--app-primary); }
.profile-section-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-section-title h3 { margin: 1px 0 3px; color: var(--app-text); font-size: 15px; }
.profile-section-title p { margin: 0; color: var(--app-text-muted); font-size: 12px; line-height: 1.5; }
.profile-ai-section { margin: 0 -12px; padding: 20px 12px; border: 1px solid #d7eadb; border-radius: 14px; background: linear-gradient(135deg, #f8fcf8, #f2f8f3); }
.profile-ai-section + .profile-external-api-section { margin-top: 20px; border-top: 1px solid var(--app-border); }
.profile-key-row { display: flex; align-items: stretch; gap: 8px; }
.profile-key-row input { box-sizing: border-box; min-width: 0; height: 42px !important; min-height: 42px !important; flex: 1; margin: 0 !important; line-height: 1.2; }
.profile-key-row .profile-secondary-button, .profile-key-row .profile-danger-button { box-sizing: border-box; align-self: stretch; height: 42px !important; min-height: 42px !important; margin: 0 !important; }
.profile-secondary-button, .profile-danger-button { flex: 0 0 auto; min-height: 42px !important; padding: 0 13px !important; border: 1px solid var(--app-border) !important; border-radius: 10px !important; background: #fff !important; color: var(--app-text) !important; font-size: 13px !important; }
.profile-secondary-button:hover { border-color: var(--app-primary) !important; background: var(--app-primary-soft) !important; color: var(--app-primary) !important; }
.profile-danger-button { border-color: #f0c5c2 !important; background: #fff5f4 !important; color: var(--app-danger) !important; }
.profile-danger-button:hover { background: #fee9e7 !important; }
.profile-secondary-button:disabled { cursor: wait; opacity: .65; }
.profile-key-status { min-height: 18px; margin: 7px 0 0; color: var(--app-primary); font-size: 12px; font-weight: 650; }
.profile-field-status { min-height: 18px; margin: 7px 0 0; color: var(--app-text-muted); font-size: 12px; }
.profile-field-status.is-loading { color: var(--app-text-muted); }
.profile-field-status.is-success { color: var(--app-primary); }
.profile-field-status.is-error { color: var(--app-danger); }
.profile-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; padding: 13px 30px 17px; border-top: 1px solid var(--app-border); background: #fff; }
.profile-save-status { min-height: 18px; margin: 0; color: var(--app-text-muted); font-size: 13px; }
.profile-save-status.is-success { color: var(--app-primary); }
.profile-save-status.is-error { color: var(--app-danger); }
.profile-save-status.is-loading { color: var(--app-text-muted); }
.app-desktop #profileModal .button-group { display: flex; justify-content: flex-end; gap: 10px; margin: 0; padding: 0; border: 0; }
.app-desktop #profileModal .button-group button { min-height: 42px; padding: 0 16px; border-radius: 10px; }
.app-desktop #profileModal .profile-logout-button { background: #fff3f2 !important; color: var(--app-danger) !important; border: 1px solid #f0c5c2 !important; }

/* 分类对话框使用选择芯片，推荐项只做视觉提示。 */
.app-desktop .category-modal-content { width: min(560px, calc(100% - 32px)); margin-top: 8vh; padding: 28px; }
.app-desktop .category-close { position: absolute; top: 16px; right: 18px; border: 0; background: transparent; color: var(--app-text-muted); font-size: 28px; line-height: 1; }
.modal-eyebrow { margin: 0 0 6px; color: var(--app-primary); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.category-modal-content h2 { margin: 0; color: var(--app-text); font-size: 24px; }
.category-modal-description { margin: 10px 0 18px; color: var(--app-text-muted); font-size: 13px; line-height: 1.65; }
.category-current-row { padding: 10px 12px; border-radius: 10px; background: #f4f7f4; color: var(--app-text-muted); font-size: 13px; }
.category-current-row strong { color: var(--app-primary); }
.category-section { margin-top: 20px; }
.category-section h3 { margin: 0 0 9px; color: var(--app-text); font-size: 14px; }
.category-suggestion-hint { min-height: 18px; margin: -3px 0 9px; color: var(--app-text-muted); font-size: 12px; line-height: 1.5; }
.category-options { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; }
.category-option { min-height: 32px !important; padding: 6px 11px !important; border: 1px solid var(--app-border) !important; border-radius: 999px !important; background: #fff !important; color: var(--app-text) !important; font-size: 12px !important; font-weight: 650 !important; }
.category-option:hover, .category-option.recommended { border-color: #b9ddc2 !important; background: var(--app-primary-soft) !important; color: var(--app-primary) !important; }
.category-empty { color: var(--app-text-muted); font-size: 12px; }
.category-create-row { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--app-border); }
.category-create-row label { display: block; margin-bottom: 8px; color: var(--app-text-muted); font-size: 13px; font-weight: 700; }
.category-create-row > div { display: flex; gap: 8px; }
.category-create-row input { min-width: 0; flex: 1; min-height: 40px; padding: 0 11px; border: 1px solid var(--app-border); border-radius: 10px; }
.category-create-row button, .category-clear-button { min-height: 40px; border-radius: 10px; }
.category-clear-button { margin-top: 14px; border: 0 !important; background: transparent !important; color: var(--app-text-muted) !important; font-size: 12px !important; }
.category-clear-button:hover { color: var(--app-danger) !important; }

@media (max-width: 1023px) {
    .app-desktop .container { height: 100vh; }
    .app-desktop .editor-footer { display: none !important; }
    .app-desktop .editor-inline-stat { display: none; }
    .app-desktop .editor-commandbar { padding: 8px 16px; }
    .app-desktop .editor-category-trigger { display: inline-flex !important; width: auto !important; }
    .app-desktop .share-modal-content, .app-desktop .category-modal-content { margin-top: 24px; padding: 24px 20px; }
}

@media (max-width: 720px) {
    .app-desktop #profileModal .profile-modal-content { width: calc(100% - 24px); max-height: 92vh; margin-top: 4vh; }
    .app-desktop #profileModal .profile-form-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-modal-header, .profile-modal-footer { padding-right: 20px; padding-left: 20px; }
    .profile-modal-body { padding-right: 20px; padding-left: 20px; }
    .profile-key-row { flex-wrap: wrap; }
    .profile-key-row input { flex-basis: 100%; }
    .profile-modal-footer { align-items: flex-end; flex-direction: column; }
    .profile-save-status { align-self: stretch; }
}

@media (max-width: 560px) {
    .app-desktop #profileModal .profile-form-grid--four { grid-template-columns: 1fr; }
}

/* 笔记纸编辑器：输入区和预览区共享纸张、线距与阅读节奏。 */
:root {
    --notebook-paper: #fffdf8;
    --notebook-line: rgba(141, 171, 150, .26);
    --notebook-margin: rgba(194, 115, 100, .20);
    --notebook-line-height: 32px;
}

@media (min-width: 1024px) {
    .app-desktop .editor-content {
        padding: 24px;
        background: #e9eeea;
    }

    .app-desktop .editor,
    .app-desktop .preview {
        padding: 31px 48px 40px 72px !important;
        border-color: #e8e1d4 !important;
        background-color: var(--notebook-paper) !important;
        background-image:
            linear-gradient(90deg, transparent 46px, var(--notebook-margin) 46px, var(--notebook-margin) 47px, transparent 47px),
            repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--notebook-line) 31px, var(--notebook-line) 32px) !important;
        background-position: 24px 0, 0 7px !important;
        background-size: 100% 100%, 100% var(--notebook-line-height) !important;
        background-attachment: local !important;
        color: #253128;
        line-height: var(--notebook-line-height) !important;
    }

    .app-desktop .preview p,
    .app-desktop .preview li {
        line-height: var(--notebook-line-height);
    }

    .app-desktop .preview h1,
    .app-desktop .preview h2,
    .app-desktop .preview h3 {
        margin-top: 0;
        padding-top: 0;
        line-height: 1.45;
    }
}

/* 手机端使用同样的线条纸，不因切换预览而改变书写感。 */
.app-mobile .editor-textarea,
.app-mobile .preview-area {
    padding: 31px 22px 40px 46px;
    background-color: var(--notebook-paper) !important;
    background-image:
        linear-gradient(90deg, transparent 28px, var(--notebook-margin) 28px, var(--notebook-margin) 29px, transparent 29px),
        repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--notebook-line) 31px, var(--notebook-line) 32px) !important;
    background-position: 16px 0, 0 7px !important;
    background-size: 100% 100%, 100% var(--notebook-line-height) !important;
    background-attachment: local !important;
    color: #253128;
    line-height: var(--notebook-line-height) !important;
}

.app-mobile .preview-area p,
.app-mobile .preview-area li { line-height: var(--notebook-line-height); }

/* 统一两种模式的版心，避免编辑时铺满、预览时却突然变窄。 */
:root { --editor-sheet-width: 760px; }

@media (min-width: 1024px) {
    .app-desktop .date-display-style:empty,
    .app-desktop .weather-style:empty { display: none; }

    .app-desktop .editor-content {
        display: flex;
        align-items: stretch;
        justify-content: center;
        padding: 24px 32px;
    }

    .app-desktop .editor,
    .app-desktop .preview {
        width: 100% !important;
        max-width: var(--editor-sheet-width) !important;
        min-width: 0;
        margin: 0 !important;
    }

    .app-desktop .preview {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
    }
}

.app-desktop .editor-commandbar {
    gap: 6px;
    box-shadow: inset 0 -1px 0 rgba(220, 231, 221, .75);
}

.app-desktop .editor-save-state { margin-left: 12px; }
.app-desktop .editor-inline-stat { padding: 0 2px; }

/* 满版稿纸：纸面贴齐编辑区，文字基线与每条横线对齐。 */
@media (min-width: 1024px) {
    .app-desktop .editor-content {
        padding: 0;
        background: var(--notebook-paper);
    }

    .app-desktop .editor,
    .app-desktop .preview {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 8px 40px 40px 64px !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background-image:
            linear-gradient(90deg, transparent 38px, var(--notebook-margin) 38px, var(--notebook-margin) 39px, transparent 39px),
            repeating-linear-gradient(to bottom, transparent 0, transparent 30px, var(--notebook-line) 30px, var(--notebook-line) 31px, transparent 31px, transparent 32px) !important;
        background-position: 0 0 !important;
        background-size: 100% 100%, 100% var(--notebook-line-height) !important;
        line-height: var(--notebook-line-height) !important;
    }

    .app-desktop .preview > :first-child { margin-top: 0 !important; }
    .app-desktop .preview p {
        min-height: var(--notebook-line-height);
        margin: 0 !important;
        line-height: var(--notebook-line-height) !important;
    }
}

.app-mobile .editor-textarea,
.app-mobile .preview-area {
    padding: 8px 20px 40px 42px;
    background-image:
        linear-gradient(90deg, transparent 24px, var(--notebook-margin) 24px, var(--notebook-margin) 25px, transparent 25px),
        repeating-linear-gradient(to bottom, transparent 0, transparent 30px, var(--notebook-line) 30px, var(--notebook-line) 31px, transparent 31px, transparent 32px) !important;
    background-position: 0 0 !important;
    background-size: 100% 100%, 100% var(--notebook-line-height) !important;
}

/* 纯净画布：Markdown 的段落与标题需要自然节奏，不再使用稿纸线条。 */
@media (min-width: 1024px) {
    .app-desktop .editor-content { background: #fff; }

    .app-desktop .editor,
    .app-desktop .preview {
        padding: 36px 48px 56px !important;
        background: #fff !important;
        background-image: none !important;
        background-attachment: scroll !important;
        color: var(--app-text);
        line-height: 1.78 !important;
    }

    .app-desktop .preview p,
    .app-desktop .preview li {
        min-height: 0;
        margin: 0 0 1.1em !important;
        line-height: 1.78 !important;
    }
}

.app-mobile .editor-textarea,
.app-mobile .preview-area {
    padding: 24px 20px 40px;
    background: #fff !important;
    background-image: none !important;
    background-attachment: scroll !important;
    color: var(--app-text);
    line-height: 1.75 !important;
}
