﻿/* ============================================================
   备忘笔记 - 全局样式
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-main: #f5f6f8;
    --bg-sidebar: #ffffff;
    --bg-editor: #ffffff;
    --bg-header: #1a1a2e;
    --border-color: #e0e3e8;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --font-mono: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-main);
    line-height: 1.5;
}

/* ---------- Auth Screen ---------- */
#auth-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    width: 400px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-card .subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.auth-card .form-group {
    margin-bottom: 16px;
}

.auth-card label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-card input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-btn {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.auth-btn:hover {
    background: var(--accent-hover);
}

.auth-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-toggle a {
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

.auth-error {
    color: var(--danger);
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    min-height: 18px;
}

/* ---------- Main App Layout ---------- */
#app-screen {
    display: none;
    height: 100vh;
    flex-direction: column;
}

/* ---------- Header ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    background: var(--bg-header);
    color: #fff;
    flex-shrink: 0;
    z-index: 100;
}

.app-header .logo {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.app-header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.app-header .user-info .nickname {
    color: #d1d5db;
}

.btn-logout {
    padding: 5px 12px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.22);
}

/* ---------- Content Area ---------- */
.app-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---------- Sidebar / Tree ---------- */
.sidebar {
    width: 280px;
    min-width: 200px;
    max-width: 400px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-actions {
    display: flex;
    gap: 4px;
}

.icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.tree-container {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

/* ---------- Tree Nodes ---------- */
.tree-node {
    user-select: none;
}

.tree-node-row {
    display: flex;
    align-items: center;
    padding: 4px 10px 4px 0;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 6px;
    transition: background 0.12s;
    font-size: 13px;
    gap: 4px;
}

.tree-node-row:hover {
    background: #f3f4f6;
}

.tree-node-row.active {
    background: #e8e9fc;
    color: var(--accent);
}

.tree-node-row .expand-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.15s;
}

.tree-node-row .expand-icon.expanded {
    transform: rotate(90deg);
}

.tree-node-row .node-icon {
    font-size: 15px;
    flex-shrink: 0;
    margin-right: 2px;
}

.tree-node-row .node-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-children {
    display: none;
}

.tree-children.open {
    display: block;
}

/* ---------- Editor Area ---------- */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    gap: 12px;
    min-height: 44px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
}

.breadcrumb span {
    white-space: nowrap;
}

.breadcrumb .sep {
    color: #d1d5db;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

.toolbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    color: var(--text-primary);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #fef2f2;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ---------- Split Editor ---------- */
.editor-split {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-pane + .editor-pane {
    border-left: 1px solid var(--border-color);
}

.pane-header {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.editor-textarea {
    flex: 1;
    width: 100%;
    padding: 16px;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-editor);
}

.preview-pane {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: var(--bg-editor);
    font-size: 14px;
    line-height: 1.7;
}

.preview-pane h1, .preview-pane h2, .preview-pane h3,
.preview-pane h4, .preview-pane h5, .preview-pane h6 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.preview-pane h1 { font-size: 22px; }
.preview-pane h2 { font-size: 18px; }
.preview-pane h3 { font-size: 16px; }

.preview-pane p {
    margin-bottom: 10px;
}

.preview-pane ul, .preview-pane ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.preview-pane code {
    background: #f3f4f6;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.preview-pane pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 14px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 12px;
}

.preview-pane pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 12px;
}

.preview-pane blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.preview-pane table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 12px;
}

.preview-pane th, .preview-pane td {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    text-align: left;
    font-size: 13px;
}

.preview-pane th {
    background: #f9fafb;
    font-weight: 600;
}

.preview-pane img {
    max-width: 100%;
    border-radius: var(--radius);
}

/* ---------- Empty State ---------- */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 8px;
}

.empty-state .empty-icon {
    font-size: 48px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

/* ---------- Context Menu ---------- */
.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 4px 0;
    z-index: 1000;
    min-width: 160px;
    display: none;
}

.context-menu .menu-item {
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    transition: background 0.1s;
}

.context-menu .menu-item:hover {
    background: #f3f4f6;
}

.context-menu .menu-item.danger {
    color: var(--danger);
}

.context-menu .menu-sep {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ---------- Modal / Dialog ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    width: 480px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---------- Version List ---------- */
.version-list {
    list-style: none;
}

.version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.version-item:hover {
    border-color: var(--accent);
    background: #f5f3ff;
}

.version-item .ver-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.version-item .ver-number {
    font-weight: 600;
    font-size: 13px;
}

.version-item .ver-date {
    font-size: 11px;
    color: var(--text-muted);
}

.version-item .ver-title {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Move Tree Selector ---------- */
.move-tree {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 0;
}

.move-tree-item {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    gap: 6px;
    transition: background 0.1s;
}

.move-tree-item:hover {
    background: #f3f4f6;
}

.move-tree-item.selected {
    background: #e8e9fc;
    color: var(--accent);
    font-weight: 500;
}

.move-tree-item .folder-icon {
    font-size: 15px;
}

/* ---------- Quick Save Panel ---------- */
.quick-save-panel {
    padding: 16px 20px;
}

.quick-save-panel h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.quick-save-panel input,
.quick-save-panel textarea {
    width: 100%;
    margin-bottom: 10px;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.25s ease;
    max-width: 320px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--accent); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ---------- Resize Handle ---------- */
.resize-handle {
    width: 4px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.15s;
    flex-shrink: 0;
}

.resize-handle:hover {
    background: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .sidebar {
        width: 220px;
        min-width: 180px;
    }
    .editor-split {
        flex-direction: column;
    }
    .editor-pane + .editor-pane {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

/* ============================================================
   富文本编辑器 + 模式切换 新增样式
   ============================================================ */

/* ---------- 编辑器外层 ---------- */
.editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---------- 模式切换栏 ---------- */
.editor-mode-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    flex-shrink: 0;
}

.editor-title-input {
    flex: 1;
    padding: 6px 0;
    border: none;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    background: transparent;
}

.editor-title-input::placeholder {
    color: var(--text-muted);
}

.mode-switch {
    display: flex;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
}

.mode-btn {
    padding: 5px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.mode-btn.active {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mode-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* ---------- 富文本编辑器 ---------- */
.richtext-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---------- 工具栏 ---------- */
.richtext-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.tool-btn {
    width: 32px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-sans);
    transition: all 0.12s;
}

.tool-btn:hover {
    background: #e8e9fc;
    color: var(--accent);
}

.tool-btn:active {
    background: #d5d6f7;
}

.tool-btn.active {
    background: #e8e9fc;
    color: var(--accent);
}

.tool-sep {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
}

/* ---------- 富文本内容区 ---------- */
.richtext-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    outline: none;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-editor);
    min-height: 200px;
}

.richtext-content:empty::before {
    content: '开始输入内容…';
    color: var(--text-muted);
    pointer-events: none;
}

/* 富文本内容排版 */
.richtext-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 20px 0 10px;
    line-height: 1.4;
}

.richtext-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 18px 0 8px;
    line-height: 1.4;
}

.richtext-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 16px 0 6px;
    line-height: 1.5;
}

.richtext-content p {
    margin-bottom: 10px;
}

.richtext-content ul,
.richtext-content ol {
    margin-left: 24px;
    margin-bottom: 10px;
}

.richtext-content li {
    margin-bottom: 4px;
}

.richtext-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 14px;
    margin: 10px 0;
    color: var(--text-secondary);
    background: #f8f7ff;
    padding: 10px 14px;
    border-radius: 0 4px 4px 0;
}

.richtext-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 14px 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
}

.richtext-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #e04060;
}

.richtext-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 13px;
}

.richtext-content a {
    color: var(--accent);
    text-decoration: underline;
}

.richtext-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 8px 0;
}

.richtext-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

.richtext-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.richtext-content th,
.richtext-content td {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    text-align: left;
}

.richtext-content th {
    background: #f9fafb;
    font-weight: 600;
}

/* 任务列表样式 */
.richtext-content .checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    list-style: none;
}

.richtext-content .checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Markdown 编辑器 */
.markdown-editor {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 兼容旧的 editor-split 类名 */
.editor-split {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ---- Image Upload Dialog ---- */
.upload-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.upload-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.upload-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.upload-tab:hover:not(.active) {
    color: var(--text-primary);
    background: #f9fafb;
}

.upload-panel {
    display: none;
}

.upload-panel.active {
    display: block;
}

.upload-url-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.upload-url-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 13px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--accent);
    background: #f5f3ff;
    color: var(--accent);
}

.upload-dropzone .drop-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

.upload-dropzone input[type="file"] {
    display: none;
}

.upload-preview {
    margin-top: 12px;
    text-align: center;
}

.upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.upload-filename {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

.richtext-content.dragover {
    outline: 2px dashed var(--accent);
    outline-offset: -4px;
    background: #f5f3ff;
}

/* ---------- Vditor 编辑器 ---------- */
.vditor-container {
    flex: 1;
    min-height: 0;
}
.vditor-container .vditor {
    border: none;
    border-radius: 0;
}
.vditor-container .vditor--fullscreen {
    z-index: 1001;
}

/* ============================================================
   登录页重设计 - 双栏布局
   ============================================================ */

#auth-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 顶部栏 */
.auth-header {
    flex-shrink: 0;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 32px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);
}
.auth-header-inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.auth-header-logo {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.btn-chrome {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-chrome:hover {
    background: rgba(255,255,255,0.25);
}

/* 主体双栏 */
.auth-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 64px;
    padding: 40px 32px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

/* 左侧介绍区 */
.auth-intro {
    flex: 1;
    max-width: 420px;
    color: #fff;
}
.auth-intro-content h2 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}
.auth-intro-desc {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 36px;
    line-height: 1.5;
}
.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.auth-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 15px;
    opacity: 0.9;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.auth-features li:last-child {
    border-bottom: none;
}
.auth-features .fi {
    width: 24px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* 右侧卡片 - 覆盖原样式 */
.auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 36px 34px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    flex-shrink: 0;
}

/* 应用内头部 */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-chrome-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-chrome-small:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    .auth-body {
        flex-direction: column;
        gap: 32px;
        padding: 24px 16px;
    }
    .auth-intro {
        max-width: 100%;
    }
    .auth-intro-content h2 {
        font-size: 24px;
    }
    .auth-features li {
        font-size: 14px;
    }
}
