/* 自定义样式补充 */

/* ==================== 石坤要求：强制启用暗色模式 ==================== */
/* 让电脑也显示和手机一样的深色背景 */

/* 强制暗色模式 - 覆盖所有设备 */
body {
    background-color: #0a0a0a !important; /* 深黑色背景 */
    color: #ffffff !important; /* 白色文字 - 提高对比度 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6 !important;
}

/* 提高所有标题对比度 */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important; /* 白色标题 */
    font-weight: 600 !important;
}

/* 段落文字 - 全部白色 */
p {
    color: #ffffff !important; /* 白色段落 */
    opacity: 0.95 !important;
}

/* 小文字 - 提高为白色 */
small, .small {
    color: #ffffff !important; /* 白色小字 */
    opacity: 0.9 !important; /* 轻微透明保持层次 */
}

/* 卡片暗色样式 - 提高对比度到纯白 */
.card {
    background-color: #1a1a1a !important; /* 深灰色卡片背景 */
    color: #ffffff !important; /* 纯白色卡片文字 */
    border: 1px solid #333333 !important; /* 深灰色边框 */
}

.card-header {
    background-color: #252525 !important; /* 稍深的卡片标题背景 */
    color: #ffffff !important; /* 纯白色标题文字 */
    border-bottom: 1px solid #444444 !important;
    font-weight: 700 !important; /* 加粗标题 */
}

/* 卡片正文全部纯白 */
.card-body {
    color: #ffffff !important; /* 纯白色正文文字 */
}

.card-title {
    color: #ffffff !important; /* 纯白色标题 */
    font-weight: 700 !important;
}

.card-text {
    color: #ffffff !important; /* 纯白色正文 - 不再用灰色 */
}

.card-subtitle {
    color: #ffffff !important; /* 纯白色副标题 */
}

/* 表格暗色样式 - 全部白色 */
.table {
    color: #ffffff !important; /* 白色表格文字 */
    background-color: transparent !important;
}

.table thead th {
    color: #ffffff !important; /* 白色表头 */
    font-weight: 700 !important;
    border-bottom-color: #444444 !important;
}

.table tbody td {
    color: #ffffff !important; /* 白色表格数据 */
    border-top-color: #333333 !important;
    opacity: 0.95 !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1) !important; /* 稍亮的悬停背景 */
}

/* 按钮暗色样式 */
.btn {
    border-color: #444444 !important;
}

.btn-outline-primary {
    color: #4dabf7 !important;
    border-color: #4dabf7 !important;
}

.btn-outline-primary:hover {
    background-color: #4dabf7 !important;
    color: #ffffff !important;
}

/* 表单暗色样式 */
.form-control {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-color: #444444 !important;
}

.form-control:focus {
    background-color: #333333 !important;
    border-color: #4dabf7 !important;
    box-shadow: 0 0 0 0.25rem rgba(77, 171, 247, 0.25) !important;
}

.form-label {
    color: #cccccc !important;
}

/* 进度条暗色样式 */
.progress {
    background-color: #333333 !important;
}

.progress-bar {
    background-color: #4dabf7 !important;
}

/* 警告框暗色样式 - 提高对比度 */
.alert {
    background-color: rgba(255, 255, 255, 0.08) !important; /* 提高背景亮度 */
    border-color: rgba(255, 255, 255, 0.15) !important; /* 提高边框亮度 */
    color: #ffffff !important; /* 白色文字 */
    font-weight: 500 !important;
}

.alert-primary {
    background-color: rgba(77, 171, 247, 0.15) !important; /* 提高蓝色背景 */
    border-color: rgba(77, 171, 247, 0.3) !important; /* 提高蓝色边框 */
    color: #4dabf7 !important; /* 亮蓝色文字 */
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.15) !important; /* 提高绿色背景 */
    border-color: rgba(40, 167, 69, 0.3) !important; /* 提高绿色边框 */
    color: #28a745 !important; /* 亮绿色文字 */
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.15) !important; /* 提高红色背景 */
    border-color: rgba(220, 53, 69, 0.3) !important; /* 提高红色边框 */
    color: #dc3545 !important; /* 亮红色文字 */
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.15) !important; /* 提高黄色背景 */
    border-color: rgba(255, 193, 7, 0.3) !important; /* 提高黄色边框 */
    color: #ffc107 !important; /* 亮黄色文字 */
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.15) !important; /* 提高青色背景 */
    border-color: rgba(23, 162, 184, 0.3) !important; /* 提高青色边框 */
    color: #17a2b8 !important; /* 亮青色文字 */
}

/* 警告框内的加粗文字 */
.alert strong {
    color: #ffffff !important; /* 白色加粗文字 */
    font-weight: 700 !important;
}

/* 列表组暗色样式 - 全部白色 */
.list-group-item {
    background-color: #1a1a1a !important;
    color: #ffffff !important; /* 白色列表文字 */
    border-color: #333333 !important;
}

.list-group-item:hover {
    background-color: #222222 !important;
}

.list-group-item h6 {
    color: #ffffff !important; /* 白色列表标题 */
    font-weight: 700 !important;
}

.list-group-item p {
    color: #ffffff !important; /* 白色列表描述 */
    opacity: 0.95 !important;
}

.list-group-item small {
    color: #ffffff !important; /* 白色小字 */
    opacity: 0.9 !important;
}

/* 徽章暗色样式 */
.badge {
    color: #ffffff !important;
}

.badge.bg-light {
    background-color: #444444 !important;
    color: #ffffff !important;
}

.badge.bg-dark {
    background-color: #222222 !important;
}

/* 链接暗色样式 */
a {
    color: #4dabf7 !important;
}

a:hover {
    color: #6cb2f8 !important;
}

/* 文本颜色调整 - 全部提高为白色 */
.text-muted {
    color: #ffffff !important; /* 白色弱化文字 */
    opacity: 0.85 !important; /* 轻微透明 */
}

.text-secondary {
    color: #ffffff !important; /* 白色次要文字 */
    opacity: 0.9 !important; /* 轻微透明 */
}

/* 特别提高重要文本对比度 */
.fw-bold {
    color: #ffffff !important; /* 白色加粗文字 */
    font-weight: 700 !important;
}

.lead {
    color: #ffffff !important; /* 白色引导文字 */
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    color: #ffffff !important; /* 白色大标题 */
}

/* 特别修复：仓位管理和风险管理卡片 - 全部白色文字 */
.card.bg-light {
    background-color: #222222 !important; /* 改为深灰色 */
    color: #ffffff !important; /* 纯白色文字 */
    border: 1px solid #444444 !important; /* 更明显的边框 */
}

.card.bg-light .card-body {
    color: #ffffff !important; /* 纯白色正文 */
}

.card.bg-light h6 {
    color: #ffffff !important; /* 纯白色标题 */
    font-weight: 700 !important; /* 更粗的标题 */
    border-bottom: 1px solid #444444 !important; /* 添加下划线分隔 */
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
}

.card.bg-light .fw-bold {
    color: #ffffff !important; /* 纯白色加粗文字 */
    font-weight: 700 !important;
}

.card.bg-light small {
    color: #ffffff !important; /* 纯白色小文字 */
    opacity: 0.9 !important;
}

.card.bg-light .text-muted {
    color: #ffffff !important; /* 纯白色弱化文字 */
    opacity: 0.85 !important;
}

/* 特别提高交易计算器对比度 - 全部白色 */
.bg-light {
    background-color: #222222 !important;
    color: #ffffff !important; /* 纯白色文字 */
    border: 1px solid #444444 !important;
}

.bg-light h6 {
    color: #ffffff !important; /* 纯白色标题 */
    font-weight: 700 !important;
}

.bg-light .form-label {
    color: #ffffff !important; /* 纯白色标签 */
    font-weight: 700 !important;
}

.bg-light .form-control {
    background-color: #333333 !important;
    color: #ffffff !important; /* 纯白色输入文字 */
    border-color: #555555 !important;
}

.bg-light .form-control::placeholder {
    color: #bbbbbb !important; /* 亮灰色占位符 */
}

/* 交易计算器暗色样式 */
.bg-light {
    background-color: #222222 !important;
    color: #e0e0e0 !important;
}

.bg-light h6 {
    color: #ffffff !important;
}

.bg-light .form-label {
    color: #cccccc !important;
}

.bg-light .form-control {
    background-color: #333333 !important;
    color: #e0e0e0 !important;
}

/* ==================== 石坤要求的字体颜色修复 ==================== */
/* 只修复仓位管理和风险管理部分的字体颜色，不修改其他部分 */

/* 修复：仓位管理和风险管理卡片中的文字颜色 */
.card.bg-light {
    color: #333333 !important; /* 深灰色，确保在浅色背景上清晰可见 */
}

.card.bg-light .card-body {
    color: #333333 !important;
}

.card.bg-light h6 {
    color: #222222 !important; /* 标题更深 */
}

.card.bg-light .fw-bold {
    color: #000000 !important; /* 加粗文字用黑色 */
}

.card.bg-light .text-danger {
    color: #dc3545 !important; /* 保持危险色 */
}

.card.bg-light .text-success {
    color: #198754 !important; /* 保持成功色 */
}

.card.bg-light small {
    color: #555555 !important; /* 小文字用中灰色 */
}

.card.bg-light .text-muted {
    color: #666666 !important; /* 弱化文字用深灰色 */
}

/* 修复：交易计算器部分 */
.bg-light {
    color: #333333 !important;
}

.bg-light h6 {
    color: #222222 !important;
}

.bg-light .form-label {
    color: #333333 !important;
}

.bg-light .form-control {
    color: #333333 !important;
}

/* 修复：交易纪律提醒 */
.alert-info {
    color: #055160 !important; /* 确保信息提示文字清晰 */
}

.alert-info strong {
    color: #033642 !important; /* 加粗部分更深 */
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .metric-value {
        font-size: 1.8rem !important;
    }
    
    .card-header {
        font-size: 1rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
    }
}

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

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

/* 信号强度指示器 */
.signal-strength {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.strength-high { background-color: #27ae60; }
.strength-medium { background-color: #f39c12; }
.strength-low { background-color: #e74c3c; }
.strength-none { background-color: #95a5a6; }

/* 新闻情感指示器 */
.sentiment-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

/* 进度条自定义 */
.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

/* 表格悬停效果 */
.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
    cursor: pointer;
}

/* 卡片标题图标 */
.card-header i {
    margin-right: 8px;
}

/* 按钮悬停效果 */
.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
    transition: all 0.3s ease;
}

.btn-outline-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
    transition: all 0.3s ease;
}

/* 加载动画 */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* 工具提示样式 */
.tooltip-inner {
    background-color: var(--primary-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

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

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

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

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

/* 打印样式 */
@media print {
    .navbar, .btn, footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .card-header {
        background-color: #fff !important;
        color: #000 !important;
        border-bottom: 2px solid #000 !important;
    }
}

/* 暗色模式已强制启用，移除此媒体查询 */

/* 辅助类 */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-line-ellipsis {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 信号卡片特殊效果 */
.signal-card {
    position: relative;
    overflow: hidden;
}

.signal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--signal-color), transparent);
}

.signal-strong-buy::before { --signal-color: var(--success-color); }
.signal-buy::before { --signal-color: #2ecc71; }
.signal-weak-buy::before { --signal-color: #7fdbff; }
.signal-neutral::before { --signal-color: #95a5a6; }
.signal-weak-sell::before { --signal-color: #ff851b; }
.signal-sell::before { --signal-color: #ff4136; }
.signal-strong-sell::before { --signal-color: var(--danger-color); }