/* ================================
   图表相关样式
   ================================ */

/* 图表容器 */
.chart-container {
    background: var(--bg-color, #ffffff);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e1e5e9);
}

/* 图表头部 */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color, #e1e5e9);
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #333);
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chart-controls select,
.chart-controls button {
    padding: 8px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--bg-color, white);
    color: var(--text-primary, #333);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-controls select:hover,
.chart-controls button:hover {
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* 图表主体 */
#chart {
    width: 100%;
    min-height: 400px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* 图表占位符样式 */
.chart-placeholder {
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed var(--border-color, #dee2e6);
    border-radius: 8px;
    color: var(--text-secondary, #6c757d);
    font-size: 16px;
    text-align: center;
}

.chart-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.6;
}

.chart-placeholder .subtitle {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.8;
}

/* 图表加载状态 */
.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.chart-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color, #007bff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 图表工具栏 */
.chart-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e1e5e9);
}

.chart-toolbar-left,
.chart-toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-button {
    padding: 6px 12px;
    background: var(--bg-color, white);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary, #333);
    transition: all 0.2s ease;
}

.toolbar-button:hover {
    background: var(--primary-color, #007bff);
    color: white;
    border-color: var(--primary-color, #007bff);
}

.toolbar-button.active {
    background: var(--primary-color, #007bff);
    color: white;
    border-color: var(--primary-color, #007bff);
}

/* 图表信息面板 */
.chart-info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.chart-info-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e1e5e9);
}

.chart-info-label {
    font-size: 12px;
    color: var(--text-secondary, #666);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #333);
}

.chart-info-value.positive {
    color: var(--success-color, #28a745);
}

.chart-info-value.negative {
    color: var(--danger-color, #dc3545);
}

/* 图表全屏模式 */
.chart-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--bg-color, white);
    padding: 20px;
}

.chart-fullscreen .chart-container {
    height: 100%;
    margin: 0;
}

.chart-fullscreen #chart {
    height: calc(100% - 100px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .chart-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .chart-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .chart-toolbar-left,
    .chart-toolbar-right {
        width: 100%;
        justify-content: center;
    }
    
    .chart-info-panel {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .chart-placeholder {
        height: 300px;
        font-size: 14px;
    }
    
    .chart-placeholder i {
        font-size: 36px;
    }
}

/* 暗黑主题支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #404040;
        --primary-color: #0d6efd;
        --success-color: #198754;
        --danger-color: #dc3545;
    }
    
    .chart-placeholder {
        background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
    }
    
    .chart-loading {
        background: rgba(26, 26, 26, 0.9);
    }
}

/* ======================================
   交易对选择器样式
   ====================================== */

/* 交易对和时间周期选择器 */
.trading-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 交易对选择器 */
.symbol-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.symbol-input {
    padding: 8px 35px 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 120px;
    cursor: pointer;
}

.symbol-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.symbol-selector-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #6c757d;
    border-radius: 4px;
}

.symbol-selector-btn:hover {
    background: #e9ecef;
    color: #333;
}

/* 时间周期选择器 */
.timeframe-selector {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
    min-width: 100px;
}

.timeframe-selector:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 快速选择按钮 */
.quick-symbols {
    display: flex;
    gap: 5px;
}

.quick-symbol-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-symbol-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.quick-symbol-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* 交易对模态框 */
.symbol-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.symbol-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.symbol-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.symbol-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #e9ecef;
    color: #333;
}

.symbol-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 搜索区域 */
.symbol-search-section {
    margin-bottom: 20px;
}

.symbol-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.symbol-search-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 分类按钮 */
.symbol-categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.category-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* 交易对列表 */
.symbol-section {
    margin-bottom: 25px;
}

.symbol-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.symbol-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.symbol-item:hover {
    border-color: #0d6efd;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.15);
}

.favorite-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 14px;
    color: #ffc107;
    cursor: pointer;
    padding: 2px;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.symbol-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    flex: 1;
}

.symbol-price {
    text-align: right;
    font-size: 12px;
}

.price-up {
    color: #198754;
}

.price-down {
    color: #dc3545;
}

.loading-symbols {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
}

.loading-symbols .fas {
    margin-right: 10px;
    font-size: 18px;
}

/* 交易对选择器响应式设计 */
@media (max-width: 768px) {
    .trading-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .control-group {
        width: 100%;
    }
    
    .quick-symbols {
        justify-content: center;
    }
    
    .symbol-modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .symbol-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   AI分析进度样式
   ================================ */

/* 分析结果显示 */
.analysis-content {
    padding: 15px;
}

.analysis-text {
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
    color: var(--text-primary);
}

.analysis-confidence {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
}

.confidence-value {
    font-weight: bold;
    color: var(--accent-color);
}

/* 分析进度显示 */
.analysis-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.progress-message {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
    font-weight: 500;
}

.progress-dots {
    display: flex;
    gap: 8px;
}

.progress-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0d6efd;
    opacity: 0.3;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.progress-dots span:nth-child(1) { animation-delay: 0s; }
.progress-dots span:nth-child(2) { animation-delay: 0.3s; }
.progress-dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 分析模块动画状态 */
.analysis-module.analyzing {
    border-color: #0d6efd;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
}

.analysis-module.analyzing .module-header {
    background: linear-gradient(135deg, #0d6efd, #5a9bd5);
    color: white;
}

/* 旋转图标 */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-right: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
} 