diff --git a/src/App.tsx b/src/App.tsx index 1189eda..4f129cc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -202,17 +202,17 @@ function App() { return ( -
+
{/* Linear 风格的顶部导航 */} -
+
-

+

CC Switch

@@ -52,23 +52,23 @@ export const ConfirmDialog: React.FC = ({ {/* Content */}
-

+

{message}

{/* Actions */} -
+
diff --git a/src/components/ProviderForm.tsx b/src/components/ProviderForm.tsx index 44eca8f..2aa5e59 100644 --- a/src/components/ProviderForm.tsx +++ b/src/components/ProviderForm.tsx @@ -453,14 +453,14 @@ const ProviderForm: React.FC = ({ {/* Modal */}
{/* Header */} -
-

+
+

{title}

{error && ( -
+
-

{error}

+

{error}

)} @@ -172,8 +172,8 @@ const KimiModelSelector: React.FC = ({
{!apiKey.trim() && ( -
-

+

+

📝 请先填写 API Key(格式:sk-xxx-api-key-here)以获取可用模型列表

diff --git a/src/components/ProviderForm/PresetSelector.tsx b/src/components/ProviderForm/PresetSelector.tsx index 92d8d31..bcd8470 100644 --- a/src/components/ProviderForm/PresetSelector.tsx +++ b/src/components/ProviderForm/PresetSelector.tsx @@ -30,11 +30,11 @@ const PresetSelector: React.FC = ({ if (isSelected) { return isOfficial - ? `${baseClass} bg-[var(--color-warning)] text-white` - : `${baseClass} bg-[var(--color-primary)] text-white`; + ? `${baseClass} bg-amber-500 text-white` + : `${baseClass} bg-blue-500 text-white`; } - return `${baseClass} bg-[var(--color-bg-tertiary)] text-[var(--color-text-secondary)] hover:bg-[var(--color-border)]`; + return `${baseClass} bg-gray-100 text-gray-500 hover:bg-gray-200`; }; const getDescription = () => { @@ -55,13 +55,13 @@ const PresetSelector: React.FC = ({ return (
-
{getDescription() && ( -

+

{getDescription()}

)} diff --git a/src/components/ProviderList.tsx b/src/components/ProviderList.tsx index 3ec1d4b..951afe3 100644 --- a/src/components/ProviderList.tsx +++ b/src/components/ProviderList.tsx @@ -69,13 +69,13 @@ const ProviderList: React.FC = ({
{sortedProviders.length === 0 ? (
-
- +
+
-

+

还没有添加任何供应商

-

+

点击右上角的"添加供应商"按钮开始配置您的第一个API供应商

@@ -90,18 +90,18 @@ const ProviderList: React.FC = ({ key={provider.id} className={`bg-white rounded-lg border p-4 transition-all duration-200 ${ isCurrent - ? "border-[var(--color-primary)] ring-1 ring-[var(--color-primary)]/20 bg-[var(--color-primary)]/5" - : "border-[var(--color-border)] hover:border-[var(--color-border-hover)] hover:shadow-sm" + ? "border-blue-500 ring-1 ring-blue-500/20 bg-blue-500/5" + : "border-gray-200 hover:border-gray-300 hover:shadow-sm" }`} >
-

+

{provider.name}

{isCurrent && ( -
+
当前使用
@@ -115,14 +115,14 @@ const ProviderList: React.FC = ({ e.preventDefault(); handleUrlClick(provider.websiteUrl!); }} - className="inline-flex items-center gap-1 text-[var(--color-primary)] hover:opacity-90 transition-colors" + className="inline-flex items-center gap-1 text-blue-500 hover:opacity-90 transition-colors" title={`访问 ${provider.websiteUrl}`} > {provider.websiteUrl} ) : ( {apiUrl} @@ -137,8 +137,8 @@ const ProviderList: React.FC = ({ disabled={isCurrent} className={`inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${ isCurrent - ? "bg-[var(--color-bg-tertiary)] text-[var(--color-text-tertiary)] cursor-not-allowed" - : "bg-[var(--color-primary)] text-white hover:bg-[var(--color-primary-hover)]" + ? "bg-gray-100 text-gray-400 cursor-not-allowed" + : "bg-blue-500 text-white hover:bg-blue-600" }`} > @@ -147,7 +147,7 @@ const ProviderList: React.FC = ({
@@ -102,11 +102,11 @@ export default function SettingsModal({ onClose }: SettingsModalProps) {
{/* 显示设置 - 功能还未实现 */} {/*
-

+

显示设置

*/} {/* 配置文件位置 */}
-

+

配置文件位置

-
- +
+ {configPath || "加载中..."}
@@ -146,21 +146,21 @@ export default function SettingsModal({ onClose }: SettingsModalProps) { {/* 关于 */}
-

+

关于

-
+
-

+

CC Switch

-

+

版本 {version}

@@ -170,8 +170,8 @@ export default function SettingsModal({ onClose }: SettingsModalProps) { disabled={isCheckingUpdate} className={`px-3 py-1.5 text-xs font-medium rounded-lg transition-all ${ isCheckingUpdate - ? "bg-[var(--color-bg-secondary)] text-[var(--color-text-tertiary)]" - : "bg-white hover:bg-[var(--color-bg-primary)] text-[var(--color-primary)]" + ? "bg-white text-gray-400" + : "bg-white hover:bg-gray-50 text-blue-500" }`} > {isCheckingUpdate ? ( @@ -189,16 +189,16 @@ export default function SettingsModal({ onClose }: SettingsModalProps) {
{/* 底部按钮 */} -
+
diff --git a/src/index.css b/src/index.css index effcde6..62b54ff 100644 --- a/src/index.css +++ b/src/index.css @@ -1,89 +1,37 @@ @import "tailwindcss"; -/* Linear 风格的全局配色和基础样式 */ -:root { - /* Linear 配色方案 */ - --color-bg-primary: #fafafa; - --color-bg-secondary: #ffffff; - --color-bg-tertiary: #f4f4f5; - --color-border: #e4e4e7; - --color-border-hover: #d4d4d8; - - /* 蓝色主色调 */ - --color-primary: #3498db; - --color-primary-hover: #2980b9; - --color-primary-light: #5dade2; - - /* 文本颜色 */ - --color-text-primary: #18181b; - --color-text-secondary: #71717a; - --color-text-tertiary: #a1a1aa; - - /* 状态颜色 */ - --color-success: #10b981; - --color-success-light: #d1fae5; - --color-error: #ef4444; - --color-error-light: #fee2e2; - --color-warning: #f59e0b; - --color-warning-light: #fef3c7; - - /* 阴影 */ - --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05); - --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); - --shadow-lg: - 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); - - /* 圆角 */ - --radius-sm: 0.375rem; - --radius-md: 0.5rem; - --radius-lg: 0.75rem; - - /* 字体 */ - --font-family: - -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", - Arial, sans-serif; -} - +/* 全局基础样式 */ * { box-sizing: border-box; } html { - font-family: var(--font-family); + @apply font-sans antialiased; line-height: 1.5; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; } body { - margin: 0; - padding: 0; - background-color: var(--color-bg-primary); - color: var(--color-text-primary); - font-size: 14px; + @apply m-0 p-0 bg-gray-50 text-gray-900 text-sm; } /* 滚动条样式 */ ::-webkit-scrollbar { - width: 6px; - height: 6px; + @apply w-1.5 h-1.5; } ::-webkit-scrollbar-track { - background: var(--color-bg-tertiary); + @apply bg-gray-100; } ::-webkit-scrollbar-thumb { - background: var(--color-border-hover); - border-radius: 3px; + @apply bg-gray-300 rounded; } ::-webkit-scrollbar-thumb:hover { - background: var(--color-text-tertiary); + @apply bg-gray-400; } /* 焦点样式 */ *:focus-visible { - outline: 2px solid var(--color-primary); - outline-offset: 2px; + @apply outline-2 outline-blue-500 outline-offset-2; } diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..ed8ea9d --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,58 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: [ + "./index.html", + "./src/**/*.{js,ts,jsx,tsx}", + ], + theme: { + extend: { + colors: { + // 扩展蓝色系列以匹配 Linear 风格 + blue: { + 500: '#3498db', + 600: '#2980b9', + 400: '#5dade2', + }, + // 自定义灰色系列 + gray: { + 50: '#fafafa', // bg-primary + 100: '#f4f4f5', // bg-tertiary + 200: '#e4e4e7', // border + 300: '#d4d4d8', // border-hover + 400: '#a1a1aa', // text-tertiary + 500: '#71717a', // text-secondary + 900: '#18181b', // text-primary + }, + // 状态颜色 + green: { + 500: '#10b981', + 100: '#d1fae5', + }, + red: { + 500: '#ef4444', + 100: '#fee2e2', + }, + amber: { + 500: '#f59e0b', + 100: '#fef3c7', + }, + }, + boxShadow: { + 'sm': '0 1px 2px 0 rgb(0 0 0 / 0.05)', + 'md': '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)', + 'lg': '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)', + }, + borderRadius: { + 'sm': '0.375rem', + 'md': '0.5rem', + 'lg': '0.75rem', + 'xl': '0.875rem', + }, + fontFamily: { + sans: ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif'], + mono: ['ui-monospace', 'SFMono-Regular', '"SF Mono"', 'Consolas', '"Liberation Mono"', 'Menlo', 'monospace'], + }, + }, + }, + plugins: [], +} \ No newline at end of file