/**
 * 全局主题样式
 * 定义CSS变量和基础样式
 */

:root {
    /* 5层颜色变量 - 完全由theme-config.js动态设置 */
    
    /* 壁纸层 - 默认值，会被theme-config.js覆盖 */
    --wallpaper-default: #f5f7fa;
    --wallpaper-fallback: #ffffff;
    
    /* 装饰层 - 默认值，会被theme-config.js覆盖 */
    --decoration-primary: rgba(100, 150, 255, 0.1);
    --decoration-secondary: rgba(100, 150, 255, 0.05);
    
    /* 背景框层 - 默认值，会被theme-config.js覆盖 */
    --bg-primary: rgba(255, 255, 255, 0.8);
    --bg-secondary: rgba(245, 247, 250, 0.9);
    --bg-border: rgba(230, 235, 240, 0.8);
    
    /* 内容层 - 默认值，会被theme-config.js覆盖 */
    --text-color: #2c3e50;
    --text-secondary: #606c80;
    --text-heading: #1a1a1a;
    --link-color: #409eff;
    --link-hover: #66b1ff;
    --active-text-color: #ffffff;
    --success-color: #67c23a;
    --error-color: #f56c6c;
    --warning-color: #e6a23c;
    --info-color: #409eff;
    --success-bg: rgba(103, 194, 58, 0.1);
    --error-bg: rgba(245, 108, 108, 0.1);
    --warning-bg: rgba(230, 162, 60, 0.1);
    --info-bg: rgba(64, 158, 255, 0.1);
    --content-bg: rgba(245, 247, 250, 0.9);
    --content-border: rgba(230, 235, 240, 0.8);
    
    /* 交互层 - 默认值，会被theme-config.js覆盖 */
    --hover-bg: rgba(64, 158, 255, 0.1);
    --active-bg: rgba(64, 158, 255, 0.2);
    --focus-color: #409eff;
    
    /* 其他通用变量 */
    --border-radius: 8px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

body {
    color: var(--text-color);
    background-color: var(--wallpaper-default);
    transition: background-color var(--transition-normal);
}

/* 主容器 */
#app {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 层级定义 */
.layer-wallpaper {
    z-index: 1;
}

.layer-decoration {
    z-index: 2;
    pointer-events: none;
}

.layer-background {
    z-index: 3;
}

.layer-content {
    z-index: 4;
}

.layer-interaction {
    z-index: 5;
}

/* 通用样式 */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--link-hover);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: all var(--transition-fast);
}

input,
textarea,
select {
    font-family: inherit;
    outline: none;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-border);
    border-radius: 4px;
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

/* 壁纸、装饰层、交互层样式 */
.wallpaper-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.decoration-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.interaction-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* 工具类 */
.fade-in {
    animation: fadeIn var(--transition-normal);
}

.fade-out {
    animation: fadeOut var(--transition-normal);
}

.hidden {
    display: none !important;
}

.blur-bg {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
