/**
 * 自定义样式文件
 * 版本号: V.0002
 */

/* 全局样式 */
.container {
    max-width: 90% !important;
    width: 90% !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 导航栏 */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* 卡片样式 */
.card {
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card.shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* 搜索框 */
#searchInput {
    border-radius: 0.375rem 0 0 0.375rem;
}

#searchBtn {
    border-radius: 0 0.375rem 0.375rem 0;
}

/* 搜索结果列表 */
#searchResults {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

#searchResults .list-group-item {
    cursor: pointer;
    border-left: none;
    border-right: none;
}

#searchResults .list-group-item:first-child {
    border-top: none;
}

#searchResults .list-group-item:last-child {
    border-bottom: none;
}

#searchResults .list-group-item:hover {
    background-color: #f8f9fa;
}

/* 快捷搜索链接 */
.quick-search {
    margin: 0 8px;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.quick-search:hover {
    background-color: #e9ecef;
}

/* 历史记录 */
.history-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-item:hover {
    background-color: #f8f9fa;
}

/* 功能特性图标 */
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

/* 分析页面样式 */
.info-card {
    border-left: 4px solid #0d6efd;
}

.badge-suggestion {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* K线图表容器 */
#klineChart {
    width: 100%;
    height: 500px;
}

/* 趋势分析卡片 */
#trendCard .badge {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
}

/* AI分析卡片 */
#aiAnalysisCard h5 {
    font-weight: 600;
}

#aiAnalysisCard .badge-suggestion {
    font-size: 1.1rem;
    font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    #klineChart {
        height: 400px;
    }
    
    .feature-icon {
        width: 60px !important;
        height: 60px !important;
        line-height: 60px !important;
    }
    
    .feature-icon i {
        font-size: 1.5rem !important;
    }
}

/* 表格样式 */
.table-sm td {
    padding: 0.5rem;
}

/* 风险提示框 */
.alert-warning {
    border-left: 4px solid #ffc107;
}

/* 滚动条样式（Webkit） */
#searchResults::-webkit-scrollbar {
    width: 6px;
}

#searchResults::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#searchResults::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#searchResults::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-in-out;
}

/* 按钮悬停效果 */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 页脚样式 */
footer {
    margin-top: auto;
}

/* 价格颜色 */
.text-price-up {
    color: #dc3545;
}

.text-price-down {
    color: #28a745;
}

/* Toast提示样式 */
.toast {
    min-width: 250px;
}

/* 模态框样式 */
.modal-content {
    border-radius: 0.5rem;
}

/* 加载动画居中 */
.modal-body .spinner-border {
    display: block;
    margin: 0 auto;
}

/* ==================== 自动补全下拉建议 ==================== */
#searchResults {
    position: absolute;
    z-index: 1050;
    width: 100%;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#searchResults .suggest-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
}

#searchResults .suggest-item:last-child {
    border-bottom: none;
}

#searchResults .suggest-item:hover,
#searchResults .suggest-item.active {
    background: #f0f4ff;
}

#searchResults .suggest-name {
    font-weight: 500;
    font-size: 0.95rem;
}

#searchResults .suggest-code {
    color: #888;
    font-size: 0.95rem;
    font-family: 'Consolas', 'Monaco', monospace;
    margin-left: 12px;
    flex-shrink: 0;
}

#searchResults .suggest-highlight {
    color: #0d6efd;
    font-weight: 700;
}

#searchResults .suggest-empty {
    padding: 16px;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}
