/* ============================================
 * Base CSS - 基础样式
 * 包含：CSS 变量、字体导入、全局重置、排版
 * ============================================ */

/* 字体导入 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS 变量定义 */
:root {
    /* 色彩系统 */
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --bg-primary: rgba(255, 255, 255, 0.05);
    --bg-secondary: rgba(255, 255, 255, 0.08);
    --bg-hover: rgba(255, 255, 255, 0.12);

    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-hint: rgba(255, 255, 255, 0.4);

    /* 强调色 */
    --accent-blue: #00d9ff;
    --accent-red: #ff6b6b;
    --accent-green: #4ade80;
    --accent-purple: #a78bfa;
    --accent-yellow: #fbbf24;
    --accent-orange: #fb923c;

    /* 边框 */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.15);
    --border-strong: rgba(255, 255, 255, 0.2);

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 217, 255, 0.3);

    /* 玻璃效果 */
    --glass-blur: 20px;
    --glass-blur-heavy: 40px;

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* 字体 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* 字体大小 */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 30px;
    --text-4xl: 36px;

    /* 行高 */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* 动画 */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* 容器 */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
}

/* 全局样式重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--text-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 基础排版 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--leading-tight);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-primary);
}

strong, b {
    font-weight: 600;
}

code, pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

code {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

pre {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

/* 图片 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 表单元素重置 */
button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    background: transparent;
}

/* 列表重置 */
ul, ol {
    list-style: none;
}

/* 隐藏元素 */
.hidden { display: none !important; }
.invisible { visibility: hidden !important; }

/* 文字截断 */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 禁用选择 */
.no-select {
    user-select: none;
    -webkit-user-select: none;
}