@charset "UTF-8"; /* YCat Editor - 主编辑器样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } :root { --primary: var(--brand); --secondary: var(--brand-hover); --border: #e0e0e0; --gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%); --bg: #f5f5f5; --card-bg: white; --text: #333; --text-secondary: #666; /* 编辑器设计变量(原缺失,导致 --ed-* 失控) */ --ed-ink: #1f2937; --ed-bg: #f7f8fa; --ed-surface: #ffffff; --ed-line: #e6e8ec; --ed-muted: #5b6472; /* 加深至 ~5.6:1 达 WCAG AA */ --ed-brand: var(--brand); --ed-brand-dim: var(--brand-dim); } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif; background: var(--bg); min-height: 100vh; font-size: 16px; color: var(--text); } /* Header — NOTE: the unified .header (position:fixed) is defined in layout.css v3.0. Do NOT redefine a bare .header here; it would override layout.css (same specificity, later load) and break the fixed top bar. Editor pages use layout.css's .header. Per-page header content below uses .header-content / .logo (non-conflicting). */ .header-content { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; } .logo { font-size: 24px; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-decoration: none; } /* Buttons */ .btn { padding: 10px 24px; border-radius: 24px; border: none; cursor: pointer; font-size: 15px; font-weight: 600; transition: all 0.3s; } .btn-primary { background: var(--gradient); color: white; box-shadow: 0 4px 12px rgba(255,107,53,0.3); } .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255,107,53,0.4); } .btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); } .btn-outline:hover { background: var(--bg); } .btn-sm { padding: 6px 16px; font-size: 13px; } /* Main Layout */ .main { max-width: 1400px; margin: 24px auto; padding: 0 24px; display: grid; grid-template-columns: 1fr 380px; gap: 24px; } /* FIX: layout.css 的 .page-body,.main 全局规则会把编辑器
居中限宽; 此处用 #editor-app 高特异性(!important)复位为左对齐 flex 两栏, 与 editor.html 内联样式保持一致,且可压过任何被浏览器缓存的旧 layout.css */ #editor-app .main { max-width: none !important; display: flex !important; flex-direction: row !important; gap: var(--ed-gap) !important; align-items: flex-start !important; margin: calc(var(--header-height) + 22px) 0 0 calc(var(--rail-w) + 22px) !important; padding: 0 22px 90px !important; transform: none !important; width: auto !important; } #editor-app .main > .editor-col { flex: 1 1 auto; min-width: 0; } #editor-app .main > .side-col { flex: 0 0 360px; } @media (max-width: 1024px) { #editor-app .main { flex-direction: column !important; margin-left: 0 !important; } #editor-app .main > .side-col { flex: 1 1 auto; width: 100%; } .main { grid-template-columns: 1fr; } } /* Editor Section */ .editor-section { display: flex; flex-direction: column; gap: 20px; } .editor-card { background: var(--card-bg); border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); overflow: hidden; } /* Type Switch */ .type-switch { display: flex; background: var(--bg); padding: 6px; gap: 6px; } .type-btn { flex: 1; padding: 10px 16px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-secondary); transition: all 0.3s; } .type-btn.active { background: white; color: var(--primary); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.08); } /* Title Input */ .title-input { width: 100%; padding: 20px 24px; font-size: 24px; font-weight: 600; border: none; outline: none; background: transparent; } .title-input::placeholder { color: #aaa; } /* Toolbar */ .toolbar { display: flex; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; } .toolbar-btn { padding: 6px 12px; border: 1px solid var(--border); background: white; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-secondary); transition: all 0.3s; display: flex; align-items: center; gap: 6px; } .toolbar-btn:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); } /* Editor Container */ .editor-container { padding: 24px; min-height: 500px; } /* Sidebar */ .sidebar { display: flex; flex-direction: column; gap: 20px; } .sidebar-card { background: var(--card-bg); border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); padding: 20px; } .sidebar-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; } /* Content Stats */ .stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; } .stat-item { background: var(--bg); border-radius: 12px; padding: 14px; text-align: center; transition: all 0.2s; } .stat-item:hover { background: #f0f0f0; transform: translateY(-2px); } .stat-value { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.2; margin-bottom: 4px; } .stat-label { font-size: 12px; color: var(--text-secondary); } .stats-hint { margin-top: 12px; font-size: 11px; color: #999; text-align: center; } /* Form Elements */ .form-group { margin-bottom: 16px; } .form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; } .form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: all 0.3s; } .form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,107,53,0.1); } .form-select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: white; cursor: pointer; } /* Tags */ .tags-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; } .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; background: linear-gradient(135deg, rgba(255,107,53,0.1), rgba(78,205,196,0.1)); border-radius: 12px; font-size: 13px; } .tag-remove { cursor: pointer; opacity: 0.6; transition: opacity 0.3s; } .tag-remove:hover { opacity: 1; } /* Cover Upload */ .cover-upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; transition: all 0.3s; background: var(--bg); } .cover-upload-area:hover { border-color: var(--primary); background: rgba(255,107,53,0.05); } .cover-upload-area h4 { font-size: 16px; margin-bottom: 8px; color: var(--text); } .cover-upload-area p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; } .cover-upload-icon { font-size: 48px; margin-bottom: 12px; } .cover-preview { width: 100%; border-radius: 12px; margin-top: 16px; } /* Ratios Grid */ .ratios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; } .cover-ratio-item { aspect-ratio: 1; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden; } .cover-ratio-item.active { border-color: var(--primary); } .cover-ratio-item img { width: 100%; height: 100%; object-fit: cover; } /* Platform Badges */ .platforms-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; } .platform-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.3s; } .platform-item:hover { border-color: var(--primary); background: rgba(255,107,53,0.05); } /* Crop Modal */ .crop-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center; } .crop-modal.show { display: flex; } .crop-container { position: relative; background: white; border-radius: 16px; padding: 24px; max-width: 90vw; max-height: 90vh; } .crop-image { max-width: 100%; max-height: 60vh; display: block; } .crop-frame { position: absolute; border: 2px solid var(--primary); background: rgba(255,107,53,0.1); cursor: move; } .crop-handle { position: absolute; width: 12px; height: 12px; background: white; border: 2px solid var(--primary); border-radius: 2px; } /* Modal */ .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; } .modal.show { display: flex; } .modal-content { background: white; border-radius: 16px; padding: 24px; max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto; } .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .modal-title { font-size: 20px; font-weight: 600; } .modal-close { font-size: 28px; cursor: pointer; color: var(--text-secondary); transition: color 0.3s; } .modal-close:hover { color: var(--text); } /* Toast */ .toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; background: var(--text); color: white; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 2000; opacity: 0; transition: opacity 0.3s; } .toast.show { opacity: 1; } .toast.success { background: #10b981; } .toast.error { background: #ef4444; } .toast.warning { background: #f59e0b; } /* Loading */ .loading { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } /* Responsive */ @media (max-width: 768px) { .header-content { padding: 0 16px; } #editor-app .main { padding: 0 16px; margin: 16px 0; } .title-input { font-size: 20px; padding: 16px; } .toolbar { padding: 12px 16px; } .editor-container { padding: 16px; } .ratios-grid { grid-template-columns: repeat(2, 1fr); } .platforms-grid { grid-template-columns: 1fr; } } /* Markdown 实时预览 */ .editor-card-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; } .preview-toggle-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); background: white; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-secondary); transition: all 0.3s; } .preview-toggle-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(255, 107, 53, 0.05); } .preview-toggle-btn.active { background: var(--gradient); color: white; border-color: transparent; } .preview-toggle-btn.active:hover { opacity: 0.9; color: white; } .preview-toggle-icon { font-size: 15px; } .markdown-preview-container { display: flex; flex-direction: column; min-height: 500px; border-top: 1px solid var(--border); background: #fafafa; } .markdown-preview-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: white; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; color: var(--text); } .markdown-preview-status { font-size: 12px; color: var(--text-secondary); font-weight: 500; } .markdown-preview-status.syncing { color: var(--primary); } .markdown-preview-toolbar { display: flex; gap: 8px; padding: 10px 20px; background: white; border-bottom: 1px solid var(--border); flex-wrap: wrap; } .markdown-preview-content { flex: 1; margin: 0; padding: 20px 24px; overflow: auto; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 14px; line-height: 1.8; color: var(--text); background: #fafafa; white-space: pre-wrap; word-break: break-word; min-height: 420px; } .markdown-preview-content code { font-family: inherit; background: rgba(255, 107, 53, 0.1); padding: 2px 5px; border-radius: 4px; color: #d73a49; } /* Markdown 语法高亮 */ .md-heading { color: #0366d6; font-weight: 700; } .md-bold { color: #24292e; font-weight: 700; } .md-italic { color: #24292e; font-style: italic; } .md-code { color: #d73a49; background: rgba(175, 184, 193, 0.2); padding: 2px 4px; border-radius: 3px; } .md-code-block { display: block; color: #24292e; background: #f6f8fa; padding: 12px; border-radius: 6px; border: 1px solid #e1e4e8; margin: 8px 0; } .md-link { color: #0366d6; text-decoration: underline; } .md-image { color: #22863a; } .md-blockquote { color: #6a737d; } .md-list { color: #24292e; } .md-hr { color: var(--text-secondary); } /* 分屏模式 */ .editor-split-mode .editor-section .editor-card { display: grid; grid-template-columns: 1fr 1fr; } .editor-split-mode #article-editor, .editor-split-mode .markdown-preview-container { grid-column: span 1; } @media (max-width: 1024px) { .editor-split-mode .editor-section .editor-card { grid-template-columns: 1fr; } } @media (max-width: 768px) { .editor-card-header { padding: 10px 12px; } .preview-toggle-btn { padding: 6px 10px; font-size: 12px; } .markdown-preview-header { padding: 10px 16px; } .markdown-preview-toolbar { padding: 8px 16px; } .markdown-preview-content { padding: 16px; font-size: 13px; } } /* 文章大纲样式 */ .outline-container { max-height: 300px; overflow-y: auto; padding: 8px; background: var(--bg); border-radius: 8px; } .outline-empty { text-align: center; color: var(--text-secondary); font-size: 13px; padding: 20px; font-style: italic; } .outline-list { list-style: none; padding: 0; margin: 0; } .outline-item { padding: 8px 12px; margin-bottom: 4px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); transition: all 0.2s; border-left: 3px solid transparent; } .outline-item:hover { background: white; border-left-color: var(--primary); color: var(--primary); } .outline-item.active { background: rgba(255, 107, 53, 0.1); border-left-color: var(--primary); color: var(--primary); font-weight: 600; } .outline-item-h1 { font-size: 15px; font-weight: 700; padding-left: 12px; } .outline-item-h2 { font-size: 14px; font-weight: 600; padding-left: 24px; } .outline-item-h3 { font-size: 13px; font-weight: 500; padding-left: 36px; } .outline-item-h4, .outline-item-h5, .outline-item-h6 { font-size: 12px; font-weight: 400; padding-left: 48px; color: var(--text-secondary); } /* Print Styles */ @media print { .header, .sidebar, .toolbar { display: none; } .main { display: block; } .editor-card { box-shadow: none; } } /* 专注模式样式 */ body.focus-mode .header, body.focus-mode .sidebar, body.focus-mode .editor-card-header .type-switch, body.focus-mode .header-actions .btn-ghost { display: none !important; } body.focus-mode { background: #1a1a1a; } body.focus-mode #editor-app .main { max-width: 100%; padding: 0; margin: 0; } body.focus-mode .editor-section { flex: 1; max-width: 100%; } body.focus-mode .editor-card { height: 100vh; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; } body.focus-mode .editor-card-header { background: #2d2d2d; border-bottom: 1px solid #404040; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; } body.focus-mode .editor-card-header .header-actions-right { display: flex; gap: 10px; } body.focus-mode .focus-mode-btn { background: rgba(255, 107, 53, 0.2); color: #FF6B35; border-color: #FF6B35; } body.focus-mode #article-editor { flex: 1; display: flex; flex-direction: column; background: #2d2d2d; } body.focus-mode #toolbar-container { background: #363636; border-bottom: 1px solid #404040; } body.focus-mode #editor-container { flex: 1; background: #2d2d2d; color: #e0e0e0; } body.focus-mode .title-input { background: #363636; color: #e0e0e0; border-bottom: 1px solid #404040; padding: 20px 24px; font-size: 28px; } body.focus-mode .title-input::placeholder { color: #808080; } /* 专注模式退出提示 */ .focus-mode-exit-hint { position: fixed; top: 20px; right: 20px; background: rgba(0, 0, 0, 0.8); color: white; padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 10000; display: none; align-items: center; gap: 10px; backdrop-filter: blur(10px); } .focus-mode-exit-hint.show { display: flex; animation: slideInRight 0.3s ease; } .focus-mode-exit-hint kbd { background: rgba(255, 255, 255, 0.2); padding: 2px 8px; border-radius: 4px; font-family: monospace; font-size: 12px; } @keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } } /* 专注模式按钮样式 */ .focus-mode-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); background: white; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary); transition: all 0.2s; } .focus-mode-btn:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); } .focus-mode-btn.active { background: var(--primary); color: white; border-color: var(--primary); } .header-actions-right { display: flex; align-items: center; gap: 10px; } /* ============ 全局可访问性增强 ============ */ /* 键盘聚焦描边(无障碍) */ :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; } /* 细滚动条(页面/弹窗/编辑区) */ * { scrollbar-width: thin; scrollbar-color: #c4c9d2 var(--ed-bg); } *::-webkit-scrollbar { width: 9px; height: 9px; } *::-webkit-scrollbar-track { background: var(--ed-bg); } *::-webkit-scrollbar-thumb { background: #c4c9d2; border-radius: 99px; border: 2px solid var(--ed-bg); } *::-webkit-scrollbar-thumb:hover { background: #a7aeb9; }