/**
 * AI市场洞察日报 - 响应式样式
 * 适配PC端和移动端
 */

/* ==================== 基础样式 ==================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: var(--text-color);
    background-color: #f5f7fa;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ==================== 头部样式 ==================== */
.header-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.8rem;
}

.generate-time {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==================== 主标题区域 ==================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 50px 20px 60px;
    text-align: center;
}

.report-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 25px;
}

.report-summary {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 25px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* ==================== 市场导航 ==================== */
.market-nav {
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.market-nav .nav-pills {
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 10px;
}

.market-nav .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-nav .nav-link:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.market-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.market-nav .nav-link i {
    font-size: 1.1rem;
}

/* ==================== 主要内容区 ==================== */
.main-content {
    padding: 40px 0;
}

/* ==================== 市场模块 ==================== */
.market-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease;
}

.market-section:hover {
    box-shadow: var(--card-shadow-hover);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    font-size: 1.5rem;
}

.market-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-cn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
}

.badge-hk {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.badge-us {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: white;
}

.badge-crypto {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

/* ==================== 数据卡片 ==================== */
.data-cards {
    margin-bottom: 30px;
}

.index-card,
.crypto-card {
    background: linear-gradient(145deg, #ffffff, #f5f7fa);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
}

.index-card:hover,
.crypto-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.index-card.positive,
.crypto-card.positive {
    border-left: 4px solid var(--success-color);
}

.index-card.negative,
.crypto-card.negative {
    border-left: 4px solid var(--danger-color);
}

.index-name,
.crypto-symbol {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.crypto-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.index-value,
.crypto-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.index-change,
.crypto-change {
    font-size: 0.9rem;
    font-weight: 500;
}

.positive .index-change,
.positive .crypto-change {
    color: var(--success-color);
}

.negative .index-change,
.negative .crypto-change {
    color: var(--danger-color);
}

.change-icon {
    margin-right: 3px;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    background: var(--light-color);
    border-radius: 10px;
}

/* ==================== 分析内容 ==================== */
.analysis-content {
    background: linear-gradient(145deg, #fafbfc, #ffffff);
    border-radius: 12px;
    padding: 25px 30px;
    border: 1px solid var(--border-color);
    line-height: 1.8;
}

.analysis-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.analysis-content h3:first-child {
    margin-top: 0;
}

.analysis-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 20px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-content h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 15px 0 10px;
}

.analysis-content p {
    margin-bottom: 15px;
    color: var(--text-color);
}

.analysis-content ul {
    margin: 15px 0;
    padding-left: 0;
    list-style: none;
}

.analysis-content li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.analysis-content li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--primary-color);
    font-weight: bold;
}

.analysis-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.analysis-content em {
    color: var(--text-muted);
    font-style: italic;
}

/* ==================== 底部区域 ==================== */
.footer-section {
    background: var(--dark-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 0 30px;
    margin-top: 20px;
}

.disclaimer {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 4px solid var(--warning-color);
}

.disclaimer h5 {
    color: var(--warning-color);
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.disclaimer p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.7;
    opacity: 0.85;
}

.copyright {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

.copyright p {
    margin: 0;
}

/* ==================== 响应式设计 ==================== */

/* 平板设备 */
@media (max-width: 992px) {
    .hero-section {
        padding: 40px 15px 50px;
    }
    
    .report-title {
        font-size: 2rem;
    }
    
    .report-subtitle {
        font-size: 1.3rem;
    }
    
    .market-section {
        padding: 25px 20px;
    }
    
    .section-header h3 {
        font-size: 1.2rem;
    }
    
    .analysis-content {
        padding: 20px;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    .header-section .d-flex {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .logo {
        justify-content: center;
    }
    
    .hero-section {
        padding: 30px 15px 40px;
    }
    
    .report-title {
        font-size: 1.6rem;
    }
    
    .report-subtitle {
        font-size: 1.1rem;
    }
    
    .report-summary {
        font-size: 0.95rem;
        padding: 15px;
    }
    
    .market-nav .nav-pills {
        justify-content: flex-start;
        padding-bottom: 5px;
    }
    
    .market-nav .nav-link {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .market-nav .nav-link i {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .market-section {
        padding: 20px 15px;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-header h3 {
        font-size: 1.15rem;
    }
    
    .market-badge {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    
    .index-card,
    .crypto-card {
        padding: 15px;
    }
    
    .index-name,
    .crypto-symbol {
        font-size: 0.85rem;
    }
    
    .index-value,
    .crypto-price {
        font-size: 1.2rem;
    }
    
    .index-change,
    .crypto-change {
        font-size: 0.8rem;
    }
    
    .analysis-content {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .analysis-content h4 {
        font-size: 1rem;
    }
    
    .analysis-content h5 {
        font-size: 0.95rem;
    }
    
    .footer-section {
        padding: 30px 15px 25px;
    }
    
    .disclaimer {
        padding: 20px 15px;
    }
    
    .disclaimer h5 {
        font-size: 0.95rem;
    }
    
    .disclaimer p {
        font-size: 0.85rem;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .report-title {
        font-size: 1.4rem;
    }
    
    .report-subtitle {
        font-size: 1rem;
    }
    
    .market-nav .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .section-header h3 {
        font-size: 1.05rem;
    }
    
    .index-value,
    .crypto-price {
        font-size: 1.1rem;
    }
    
    .analysis-content {
        font-size: 0.9rem;
        line-height: 1.7;
    }
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ==================== 打印样式 ==================== */
@media print {
    .market-nav,
    .history-selector {
        display: none;
    }
    
    .market-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hero-section {
        background: #667eea;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

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

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

.market-section:nth-child(2) {
    animation-delay: 0.1s;
}

.market-section:nth-child(3) {
    animation-delay: 0.2s;
}

.market-section:nth-child(4) {
    animation-delay: 0.3s;
}

/* ==================== 加载状态 ==================== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
