/**
 * 环球智汇财经平台 - 自定义样式
 * 基于Bootstrap 5，响应式设计
 */

/* ===== 全局样式 ===== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ===== 导航栏 ===== */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.4rem;
}

.nav-link {
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* ===== Hero区域 ===== */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    min-height: 400px;
}

.hero-chart {
    text-align: center;
    opacity: 0.3;
}

/* ===== 行情卡片 ===== */
.market-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.market-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.market-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.price {
    font-family: "Roboto Mono", monospace;
}

.change.up {
    color: var(--danger-color);
}

.change.down {
    color: var(--success-color);
}

.change.up::before {
    content: "▲ ";
}

.change.down::before {
    content: "▼ ";
}

/* ===== 新闻卡片 ===== */
.news-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.news-card .card-header {
    background: transparent;
    border-bottom: 1px solid #eee;
    padding: 1rem;
}

.news-card .badge {
    font-weight: 500;
}

.news-card .card-title {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.news-card .card-text {
    color: #666;
    font-size: 0.9rem;
}

.ai-analysis {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.ai-analysis h6 {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.ai-analysis .impact {
    font-weight: 600;
}

.ai-analysis .impact.positive {
    color: var(--danger-color);
}

.ai-analysis .impact.negative {
    color: var(--success-color);
}

.ai-analysis .impact.neutral {
    color: var(--secondary-color);
}

/* ===== 知识卡片 ===== */
.knowledge-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.knowledge-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.knowledge-card .card-body {
    padding: 1.5rem;
}

.knowledge-card .category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* ===== 特色功能 ===== */
.feature-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ===== 风险提示 ===== */
.risk-warning {
    border-top: 3px solid var(--warning-color);
}

/* ===== 页脚 ===== */
footer a:hover {
    color: #fff !important;
}

/* ===== 详情页面 ===== */
.page-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    padding: 3rem 0;
    color: #fff;
}

.page-header h1 {
    font-weight: 700;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #fff;
}

/* ===== 行情详情页 ===== */
.market-detail-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.market-detail-card .price-main {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: "Roboto Mono", monospace;
}

.market-detail-card .price-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.market-detail-card .price-info-item {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.market-detail-card .price-info-item label {
    font-size: 0.8rem;
    color: #666;
    display: block;
}

.market-detail-card .price-info-item span {
    font-weight: 600;
    font-family: "Roboto Mono", monospace;
}

/* ===== 新闻详情页 ===== */
.news-detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.news-detail-content p {
    margin-bottom: 1.5rem;
}

.news-meta {
    color: #666;
    font-size: 0.9rem;
}

/* ===== 知识详情页 ===== */
.knowledge-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.knowledge-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.knowledge-content ul,
.knowledge-content ol {
    margin-bottom: 1.5rem;
}

.knowledge-content li {
    margin-bottom: 0.5rem;
}

/* ===== 表单样式 ===== */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
}

/* ===== 分页样式 ===== */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
    border: none;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
}

/* ===== 加载动画 ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ===== 响应式调整 ===== */
@media (max-width: 991.98px) {
    .hero-section {
        min-height: 300px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .navbar-collapse {
        background: var(--primary-color);
        padding: 1rem;
        border-radius: 8px;
        margin-top: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .market-card h5 {
        font-size: 0.9rem;
    }
    
    .market-card .price {
        font-size: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem !important;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 1.5rem !important;
    }
    
    footer .row > div {
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ===== 工具类 ===== */
.text-gradient {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.shadow-soft {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.rounded-lg {
    border-radius: 12px;
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== 导航栏修复 ===== */
.navbar-nav {
    flex-wrap: nowrap;
}
.navbar-nav .nav-item {
    white-space: nowrap;
}
.navbar-nav .nav-link {
    white-space: nowrap;
    font-size: 0.9rem;
}


/* ===== 导航栏样式优化 ===== */
.navbar-custom {
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.navbar-brand {
    font-size: 1.3rem;
    font-weight: bold;
}
.navbar-nav {
    flex-wrap: nowrap;
}
.navbar-nav .nav-item {
    white-space: nowrap;
}
.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
}
.dropdown-menu {
    background: #1a2a4a;
    border: 1px solid rgba(212,175,55,0.2);
}
.dropdown-item {
    color: #f8f9fa;
}
.dropdown-item:hover {
    background: rgba(255,215,0,0.1);
    color: #ffd700;
}
.lang-switch a {
    font-size: 0.8rem;
}
.lang-switch a.active {
}

/* ===== 导航栏样式优化 ===== */
.navbar-custom {
    background: linear-gradient(90deg, #0a1628, #1a2a4a);
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.navbar-brand {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700;
}
.navbar-nav {
    flex-wrap: nowrap;
}
.navbar-nav .nav-item {
    white-space: nowrap;
}
.navbar-nav .nav-link {
    color: #f8f9fa;
    font-weight: 500;
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #ffd700;
}
.dropdown-menu {
    background: #1a2a4a;
    border: 1px solid rgba(212,175,55,0.2);
}
.dropdown-item {
    color: #f8f9fa;
}
.dropdown-item:hover {
    background: rgba(255,215,0,0.1);
    color: #ffd700;
}
.lang-switch a {
    font-size: 0.8rem;
}
.lang-switch a.active {
    color: #ffd700;
}

/* 登录按钮样式修复 */
.navbar .btn-outline-warning {
    white-space: nowrap;
    padding: 0.375rem 0.75rem;
}

