/**
 * basic.css - 之马助研全局基础样式
 * 作者：之马工场
 * 创建日期：2026-01-01
 */

/* ========== 明亮模式（默认） ========== */
:root {
    /* 主色调 - 科技蓝绿 */
    --primary-color: #00a884;
    --primary-dark: #008f6f;
    --primary-light: #00d4aa;
    
    /* 辅助色 */
    --accent-color: #5b4cdb;
    --accent-light: #8b7cf6;
    --warning-color: #f5a623;
    --danger-color: #e74c3c;
    --success-color: #00a884;
    
    /* 明亮主题背景 */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #e2e8f0;
    
    /* 文字颜色 */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* 边框颜色 */
    --border-color: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.12);
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(0, 168, 132, 0.12);
    
    /* 导航栏背景 */
    --nav-bg: #ffffff;
    --nav-border: rgba(0, 0, 0, 0.06);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* 字体 */
    --font-sans: 'Outfit', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* 侧边栏宽度 */
    --sidebar-width: 280px;
    --sidebar-collapsed: 72px;
}

/* ========== 深色模式 ========== */
[data-theme="dark"] {
    /* 主色调 - 科技蓝绿渐变 */
    --primary-color: #00d4aa;
    --primary-dark: #00b894;
    --primary-light: #55efc4;
    
    /* 辅助色 */
    --accent-color: #6c5ce7;
    --accent-light: #a29bfe;
    --warning-color: #fdcb6e;
    --danger-color: #ff7675;
    --success-color: #00b894;
    
    /* 深色主题背景 */
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: #1a2332;
    --bg-hover: #243044;
    
    /* 文字颜色 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* 边框颜色 */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.15);
    
    /* 导航栏背景 */
    --nav-bg: linear-gradient(180deg, #0d1320 0%, #0a0f1a 100%);
    --nav-border: rgba(255, 255, 255, 0.06);
}

/* ========== 字体引入 ========== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ========== 重置样式 ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ========== 链接样式 ========== */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

/* ========== 图片样式 ========== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== 列表样式 ========== */
ul, ol {
    list-style: none;
}

/* ========== 按钮基础样式 ========== */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: transparent;
}

/* ========== 输入框基础样式 ========== */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
}

/* ========== 标题样式 ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* ========== 段落样式 ========== */
p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== 选中文字样式 ========== */
::selection {
    background: var(--primary-color);
    color: white;
}

/* ========== 主题切换按钮 ========== */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-normal);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
}

/* 明亮模式：显示月亮图标（点击切换到暗色） */
.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* 深色模式：显示太阳图标（点击切换到明亮） */
[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ========== 动画定义 ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--primary-color); }
    50% { box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); }
}

.animate-fadeIn { animation: fadeIn 0.5s ease; }
.animate-slideUp { animation: slideInUp 0.5s ease; }
.animate-slideLeft { animation: slideInLeft 0.5s ease; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
