/* ======================================================================== * Vela — index.css * TailwindCSS v4 全面适配版本 * * 层级顺序(由低到高): * @layer theme — Tailwind 设计令牌 * @layer base — 全局重置、CSS变量、滚动条 * @layer components — 自定义组件(panel-header, tree-item 等) * @layer utilities — Tailwind 工具类(px-3, flex, gap-2 等) * 无层样式 — CodeMirror 覆盖等需要最高优先级的样式 * * 关键:所有自定义样式必须归入正确的 @layer, * 否则无层样式会覆盖 Tailwind 工具类,导致 px-3/py-1 等全部失效。 * ======================================================================== */ /* ===== 本地内置字体(无需网络,所有字体文件均放置于 public/fonts/) ===== */ /* Sora — 现代几何无衬线,显示性强,独特但不过分 */ @font-face { font-family: 'Sora'; src: url('/fonts/Sora-VariableFont_wght.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; } /* Sora 斜体 */ @font-face { font-family: 'Sora'; src: url('/fonts/Sora-VariableFont_wght.ttf') format('truetype'); font-weight: 100 900; font-style: italic; font-display: swap; } /* ===== 本地内置中文写作字体(无需网络,放置于 public/fonts/) ===== */ /* 霞鹜文楷 Regular — 楷体,温润典雅,适合小说写作 */ @font-face { font-family: 'LXGW WenKai'; src: url('/fonts/LXGWWenKai-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; } /* 霞鹜文楷 Medium — 较粗字重,阅读舒适感更强 */ @font-face { font-family: 'LXGW WenKai'; src: url('/fonts/LXGWWenKai-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; } /* 思源宋体 — 可变字体,支持 100-900 所有字重,印刷感强 */ @font-face { font-family: 'Noto Serif SC'; src: url('/fonts/NotoSerifSC-VariableFont_wght.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; } /* 思源黑体 — 可变字体,支持 100-900 所有字重,现代简洁 */ @font-face { font-family: 'Noto Sans SC'; src: url('/fonts/NotoSansSC-VariableFont_wght.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; } /* ===== TailwindCSS v4 核心导入 ===== */ @import "tailwindcss"; @plugin "tailwindcss-animate"; @plugin "@tailwindcss/typography"; /* dark 变体:匹配 .dark 或 .galaxy 类的子元素 */ @custom-variant dark (&:is(.dark *, .galaxy *)); /* ===== Tailwind v4 设计令牌(精简版 — 仅保留 Tailwind 需要的扩展) ===== */ @theme { /* 字体栈 - 使用 Sora 替代 Inter,更具个性 */ --font-sans: 'Sora', system-ui, -apple-system, sans-serif; --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace; --font-writing: 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif; /* 文字尺寸 */ --text-2xs: 0.625rem; --text-2xs--line-height: 0.875rem; /* 间距 */ --spacing-sidebar: 260px; --spacing-panel-min: 200px; --spacing-titlebar: 36px; --spacing-statusbar: 24px; --spacing-activity-bar: 48px; /* Tailwind 动画 - 扩展更多交互动画 */ --animate-fade-in: fade-in 0.15s ease-out; --animate-fade-in-up: fade-in-up 0.25s ease-out; --animate-fade-in-down: fade-in-down 0.25s ease-out; --animate-slide-in-right: slide-in-right 0.2s ease-out; --animate-slide-in-left: slide-in-left 0.2s ease-out; --animate-slide-in-up: slide-in-up 0.2s ease-out; --animate-scale-in: scale-in 0.2s ease-out; --animate-bounce-in: bounce-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); --animate-shimmer: shimmer 2s linear infinite; @keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } @keyframes fade-in-up { 0% { opacity: 0; transform: translateY(12px); } 100% { opacity: 1; transform: translateY(0); } } @keyframes fade-in-down { 0% { opacity: 0; transform: translateY(-12px); } 100% { opacity: 1; transform: translateY(0); } } @keyframes slide-in-right { 0% { transform: translateX(10px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } } @keyframes slide-in-left { 0% { transform: translateX(-10px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } } @keyframes slide-in-up { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } } @keyframes scale-in { 0% { opacity: 0; transform: scale(0.92); } 100% { opacity: 1; transform: scale(1); } } @keyframes bounce-in { 0% { opacity: 0; transform: scale(0.3); } 50% { transform: scale(1.05); } 70% { transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } } @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } } } /* ===================================================================== * @layer base — 全局重置、CSS变量、基础元素样式 * 优先级低于 utilities,保证 Tailwind 工具类能正常覆盖 * ===================================================================== */ @layer base { /* ===== CSS 变量 — 从 Logo 提取品牌色系 ===== */ /* Logo 核心色:深邃蓝 #0A1628 · 冰蓝 #7EC8E3 · 星空蓝 #5B9ED6 薰衣草紫 #9B8EC8 · 星辰金 #C9A76C */ :root { /* ☀️ 浅色主题 — 清冷蓝调(从 Logo 蓝紫色系延伸) */ /* 背景层次(冷白蓝调,与Logo深蓝形成呼应) */ --color-bg: #F7F9FC; --color-sidebar: #EFF2F7; --color-panel: #EFF2F7; --color-titlebar: #F7F9FC; --color-activity-bar: #E5E9F0; --color-hover: #EBF0F7; --color-active: #DDE3ED; /* 文字层次 */ --color-text: #1A2233; --color-text-secondary: #4A5568; --color-text-muted: #8A9AAB; /* 边框 */ --color-border: #DEE3ED; /* 强调色(Logo 星空蓝) */ --color-accent: #5B9ED6; --color-accent-hover: #4A8DC5; --color-accent-rgb: 91, 158, 214; /* 品牌金色(Logo 星辰点睛) */ --color-gold: #C9A76C; /* 语义色(莫兰迪低饱和度高通透感) */ --color-success: #10b981; --color-warning: #f59e0b; --color-error: #f43f5e; --color-info: #5B9ED6; /* Tab 系统 */ --color-tab-bg: transparent; --color-tab-active: #FFFFFF; --color-tab-border: transparent; --color-tab-indicator: #5B9ED6; /* 状态栏 */ --color-statusbar: #EFF2F7; --color-statusbar-text: #8994A7; /* 标题栏文字 */ --color-titlebar-text: #2D3748; /* 活动栏图标颜色 */ --color-activity-icon: #8994A7; --color-activity-icon-active: #1A2233; --color-activity-indicator: #5B9ED6; /* 编辑器 */ --color-editor-bg: #F7F9FC; --color-editor-line-highlight: rgba(91, 158, 214, 0.04); --color-editor-selection: rgba(91, 158, 214, 0.14); /* 分割条 Sash */ --color-sash: transparent; --color-sash-hover: rgba(91, 158, 214, 0.15); /* ===== 语义令牌 ===== */ /* 焦点环 */ --color-focus-ring: rgba(91, 158, 214, 0.45); /* 遮罩层 */ --color-backdrop: rgba(10, 22, 40, 0.20); /* Tooltip */ --color-tooltip-bg: #0F1A2E; --color-tooltip-text: #E8ECF2; /* 骨架屏 */ --color-skeleton: rgba(91, 158, 214, 0.08); /* Badge */ --color-badge-bg: rgba(91, 158, 214, 0.10); --color-badge-text: #5B9ED6; /* ===== 尺寸规范 ===== */ --height-titlebar: 40px; --height-statusbar: 28px; --height-tab: 36px; --height-panel-header: 36px; --width-left-bar: 44px; --width-right-bar: 44px; --width-bottom-bar: 32px; /* 圆角(加大圆角,更现代) */ --radius-sm: 4px; --radius-md: 6px; --radius-lg: 10px; --radius-xl: 14px; --radius-2xl: 20px; /* 阴影(蓝调弥散阴影) */ --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.05); --shadow-md: 0 4px 12px rgba(10, 22, 40, 0.07); --shadow-lg: 0 12px 32px rgba(10, 22, 40, 0.09); --shadow-popover: 0 16px 40px -8px rgba(10, 22, 40, 0.14), 0 4px 16px -4px rgba(10, 22, 40, 0.07); --shadow-tooltip: 0 4px 12px rgba(10, 22, 40, 0.18); /* 过渡(加入顺滑阻尼) */ --transition-fast: 0.12s cubic-bezier(0.16, 1, 0.3, 1); --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1); --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 字体 */ --font-sans: 'Sora', system-ui, -apple-system, sans-serif; --font-mono: 'JetBrains Mono', 'Fira Code', monospace; --font-writing: 'LXGW WenKai', 'Noto Serif SC', serif; } /* 🌑 星空主题 — Logo 深邃星空(直接取自 Logo 背景色 #0A1628) */ .galaxy { /* 背景层次 — Logo 深蓝背景色为基底,逐层提亮 */ --color-bg: #0A1628; --color-sidebar: #0E1B30; --color-panel: #0E1B30; --color-titlebar: #0A1628; --color-activity-bar: #071220; --color-hover: #142640; --color-active: #1C3050; /* 文字层次 — 冰蓝色阶梯,与Logo蓝色调和谐 */ --color-text: #E0ECF4; --color-text-secondary: #8BA4BE; --color-text-muted: #5A7A96; /* 边框 — 深蓝色边框,微弱可见 */ --color-border: #172B42; /* 强调色 — Logo 冰蓝 #7EC8E3 */ --color-accent: #7EC8E3; --color-accent-hover: #6AB8D8; --color-accent-rgb: 126, 200, 227; /* 品牌金色 — Logo 星辰金 #C9A76C */ --color-gold: #C9A76C; --color-success: #4ade80; --color-warning: #fbbf24; --color-error: #fb7185; --color-info: #7EC8E3; --color-tab-bg: transparent; --color-tab-active: #0E1E35; --color-tab-border: transparent; --color-tab-indicator: #7EC8E3; --color-statusbar: #071220; --color-statusbar-text: #4A6580; --color-titlebar-text: #8BA4BE; --color-activity-icon: #4A6580; --color-activity-icon-active: #E0ECF4; --color-activity-indicator: #7EC8E3; --color-editor-bg: #091525; --color-editor-line-highlight: rgba(126, 200, 227, 0.04); --color-editor-selection: rgba(126, 200, 227, 0.18); --color-sash: transparent; --color-sash-hover: rgba(126, 200, 227, 0.15); /* 语义令牌 */ --color-focus-ring: rgba(126, 200, 227, 0.50); --color-backdrop: rgba(5, 10, 20, 0.65); --color-tooltip-bg: #E0ECF4; --color-tooltip-text: #0E1B30; --color-skeleton: rgba(126, 200, 227, 0.06); --color-badge-bg: rgba(126, 200, 227, 0.12); --color-badge-text: #7EC8E3; /* 阴影 — 深蓝光晕 */ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5); --shadow-md: 0 4px 12px rgba(5, 10, 20, 0.6); --shadow-lg: 0 12px 32px rgba(5, 10, 20, 0.7); --shadow-popover: 0 0 0 1px rgba(126, 200, 227, 0.06), 0 16px 40px -8px rgba(5, 10, 20, 0.85), 0 4px 16px -4px rgba(5, 10, 20, 0.7); --shadow-tooltip: 0 4px 12px rgba(5, 10, 20, 0.5); } /* 📜 纸质感主题 — 写作沉浸(温暖牛皮纸色调 + Logo 紫色强调) */ .paper { --color-bg: #F5F0E8; --color-sidebar: #EDE8E0; --color-panel: #EDE8E0; --color-titlebar: #F5F0E8; --color-activity-bar: #E4DDD4; --color-hover: #E8E3DB; --color-active: #DCD5CB; --color-text: #2C2520; --color-text-secondary: #6B6058; --color-text-muted: #A89888; --color-border: #DDD8D0; /* 强调色 — Logo 薰衣草紫 #9B8EC8 */ --color-accent: #9B8EC8; --color-accent-hover: #8B7EB8; --color-accent-rgb: 155, 142, 200; --color-gold: #C9A76C; --color-success: #4d9e72; --color-warning: #c8923a; --color-error: #c45b5b; --color-info: #7B92C0; --color-tab-bg: transparent; --color-tab-active: #FAF5ED; --color-tab-border: transparent; --color-tab-indicator: #9B8EC8; --color-statusbar: #EDE8E0; --color-statusbar-text: #A09488; --color-titlebar-text: #4A4038; --color-activity-icon: #A09488; --color-activity-icon-active: #2C2520; --color-activity-indicator: #9B8EC8; --color-editor-bg: #F8F3EB; --color-editor-line-highlight: rgba(155, 142, 200, 0.04); --color-editor-selection: rgba(155, 142, 200, 0.12); --color-sash: transparent; --color-sash-hover: rgba(155, 142, 200, 0.12); /* 语义令牌 */ --color-focus-ring: rgba(155, 142, 200, 0.45); --color-backdrop: rgba(44, 37, 32, 0.25); --color-tooltip-bg: #2C2520; --color-tooltip-text: #F5F0E8; --color-skeleton: rgba(0, 0, 0, 0.05); --color-badge-bg: rgba(155, 142, 200, 0.10); --color-badge-text: #9B8EC8; /* 阴影 */ --shadow-sm: 0 1px 2px rgba(44, 37, 32, 0.06); --shadow-md: 0 4px 12px rgba(44, 37, 32, 0.08); --shadow-lg: 0 12px 32px rgba(44, 37, 32, 0.10); --shadow-popover: 0 16px 40px -8px rgba(44, 37, 32, 0.14), 0 4px 16px -4px rgba(44, 37, 32, 0.08); --shadow-tooltip: 0 4px 12px rgba(44, 37, 32, 0.18); } /* 🌃 黑夜主题 — VS Code / IDEA 深灰极客风(真正的暗黑模式) */ .dark { --color-bg: #1E1E1E; --color-sidebar: #252526; --color-panel: #252526; --color-titlebar: #181818; --color-activity-bar: #333333; --color-hover: #2A2D2E; --color-active: #37373D; --color-text: #D4D4D4; --color-text-secondary: #A0A0A0; --color-text-muted: #888888; --color-border: #3C3C3C; --color-accent: #0E639C; --color-accent-hover: #1177BB; --color-accent-rgb: 14, 99, 156; --color-gold: #C9A76C; --color-success: #89D185; --color-warning: #CCA700; --color-error: #F14C4C; --color-info: #3794FF; --color-tab-bg: transparent; --color-tab-active: #1E1E1E; --color-tab-border: transparent; --color-tab-indicator: #0E639C; --color-statusbar: #181818; --color-statusbar-text: #909090; --color-titlebar-text: #CCCCCC; --color-activity-icon: #858585; --color-activity-icon-active: #FFFFFF; --color-activity-indicator: #FFFFFF; --color-editor-bg: #1E1E1E; --color-editor-line-highlight: rgba(255, 255, 255, 0.04); --color-editor-selection: rgba(38, 79, 120, 0.6); --color-sash: transparent; --color-sash-hover: rgba(0, 122, 204, 0.5); --color-focus-ring: rgba(0, 122, 204, 0.4); --color-backdrop: rgba(0, 0, 0, 0.4); --color-tooltip-bg: #252526; --color-tooltip-text: #CCCCCC; --color-skeleton: rgba(255, 255, 255, 0.05); --color-badge-bg: #4D4D4D; --color-badge-text: #FFFFFF; --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5); --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6); --shadow-popover: 0 16px 40px -8px rgba(0, 0, 0, 0.7), 0 4px 16px -4px rgba(0, 0, 0, 0.5); --shadow-tooltip: 0 4px 12px rgba(0, 0, 0, 0.5); } /* ===== 全局基础样式 ===== */ *, *::before, *::after { box-sizing: border-box; } html { font-size: 14px; scroll-behavior: smooth; } html, body, #root { width: 100%; height: 100%; overflow: hidden; font-family: var(--font-sans); font-size: inherit; line-height: 1.5; color: var(--color-text); background-color: var(--color-bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; /* 增强的过渡曲线 */ transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); } /* 禁止文本选择(IDE 区域) */ .no-select { user-select: none; -webkit-user-select: none; } /* 允许文本选择(编辑区域) */ .allow-select { user-select: text; -webkit-user-select: text; } /* ===== 滚动条样式(细腻 6px) ===== */ ::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.25); border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 128, 0.45); } .galaxy ::-webkit-scrollbar-thumb { background: rgba(126, 200, 227, 0.12); } .galaxy ::-webkit-scrollbar-thumb:hover { background: rgba(126, 200, 227, 0.25); } .dark ::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.20); } .dark ::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 128, 0.40); } .paper ::-webkit-scrollbar-thumb { background: rgba(120, 100, 80, 0.20); } .paper ::-webkit-scrollbar-thumb:hover { background: rgba(120, 100, 80, 0.35); } } /* ===================================================================== * @layer components — 自定义 IDE 组件样式 * 优先级高于 base,低于 utilities(Tailwind 工具类可覆盖) * ===================================================================== */ @layer components { /* ===== 分隔条(拖拽调整大小)— 白色微光风格 ===== */ .sash { position: absolute; z-index: 10; background: var(--color-sash); transition: background var(--transition-fast); } .sash:hover, .sash.active { background: var(--color-sash-hover); } .sash-vertical { width: 4px; cursor: col-resize; top: 0; bottom: 0; } .sash-horizontal { height: 4px; cursor: row-resize; left: 0; right: 0; } /* ===== 面板标题栏 — JetBrains 风格:紧凑、全大写、弱化 ===== */ .panel-header { @apply flex items-center px-3 gap-2; height: var(--height-panel-header); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); background: transparent; user-select: none; flex-shrink: 0; } /* ===== 树节点 — 舒适的 26px 行高,带增强悬停效果 ===== */ .tree-item { @apply flex items-center gap-1.5 px-2 cursor-pointer; height: 26px; font-size: 13px; color: var(--color-text); transition: background var(--transition-fast), box-shadow var(--transition-fast), transform 0.12s ease; position: relative; border-radius: var(--radius-sm); margin: 0 4px; } .tree-item:hover { background: var(--color-hover); transform: translateX(2px); } /* 激活节点:背景 + 左侧 2px 品牌色竖线 */ .tree-item.active { background: var(--color-active); box-shadow: inset 2px 0 0 var(--color-accent); } /* ===== 旧按钮类已废弃 — 请使用