/* 自定义全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 修改select选择框内部文字颜色为黑色 */
select {
    color: #000000 !important;
}

/* 确保option文字也是黑色 */
option {
    color: #000000 !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1F2937;
    background-color: #F9FAFB;
    margin-left: 0; /* 重置margin */
    padding-left: 48px; /* 侧边栏收缩后的最小宽度 + 额外空间 */
    transition: padding-left 0.3s ease;
}

/* 侧边栏样式 */
#sidebar {
    overflow-x: hidden;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 100; /* 确保侧边栏在适当的层级 */
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 180px;
    transition: width 0.3s ease;
}

#sidebar a {
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

#sidebar a:hover {
    color: #165DFF;
    background-color: rgba(22, 93, 255, 0.08);
}

#toggle-sidebar {
    transition: transform 0.3s ease;
}

#toggle-sidebar:hover {
    transform: scale(1.1);
}

/* 侧边栏菜单项图标动画 */
#sidebar a i {
    transition: all 0.3s ease;
}

#sidebar a:hover i {
    transform: translateX(2px);
}

#main-header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    padding-left: 48px; /* 侧边栏收缩后的宽度 + 额外空间 */
    z-index: 50;
    transition: padding-left 0.3s ease;
}

#main-content {
    padding-left: 0;
    padding-right: 0;
    margin-top: 10px; /* 减小顶部空白 */
    padding-right: 16px;
}

/* 响应式调整 */
@media (max-width: 767px) {
    body {
        padding-left: 0; /* 移动端重置 */
    }
    
    #main-header {
        left: 0;
        padding-left: 16px; /* 移动端左侧内边距 */
    }
    
    #main-content {
        margin-left: 0;
        width: 100%;
        padding-left: 16px; /* 移动端内容左侧内边距 */
        padding-right: 16px; /* 移动端内容右侧内边距 */
    }
    
    #sidebar {
        position: fixed;
        left: -180px; /* 默认隐藏 */
        transition: left 0.3s ease;
    }
    
    #sidebar.active {
        left: 0; /* 激活时显示 */
    }
    
    /* 移动端音频播放器优化 */
    .mt-2.flex.gap-2 > div:first-child,
    .mt-2.flex.gap-2 > div:nth-child(2) {
        width: 35%; /* 减小文本框宽度 */
        min-width: 0;
    }
    
    #audio-player-container {
        width: 30%; /* 为音频播放器留出足够空间 */
        min-width: 0;
    }
    
    /* 确保音频播放器控件显示完整 */
    #strategy-audio {
        width: 100%;
        min-width: 100px; /* 设置最小宽度确保控件显示 */
    }
}

/* 自定义脉冲动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 呼吸效果动画 - 缓慢的忽隐忽现 */
@keyframes breathe {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
}

.breathe-slow {
    animation: breathe 20s ease-in-out infinite;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 卡片悬停效果增强 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* 移动设备样式增强 */
@media (max-width: 640px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .chart-container {
        height: 300px !important;
    }
    
    /* 确保所有元素都适应移动端宽度 */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
}