/**
 * 市场分析页面样式
 */

/* 市场阶段图例 */
.market-phase-legend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.legend-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 0.25rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
}

.legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 统计卡片 */
.stat-card {
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card .card-rank {
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stat-card .rank-icon {
    font-size: 1.25rem;
}

.stat-card .card-content {
    padding: 1.5rem 1rem;
}

.stat-card .card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card .card-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* 图表卡片 */
.chart-card {
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-card .card-header h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* 错误提示 */
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--error-bg);
    color: var(--error-text);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.error-toast i {
    font-size: 1.25rem;
}

/* 四列卡片布局 */
.cards-container.four-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

@media (min-width: 1200px) {
    .cards-container.four-column {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .cards-container.four-column {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stat-card .card-title {
        font-size: 1.25rem;
    }

    .chart-card .card-body {
        padding: 1rem;
    }

    .error-toast {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

@media (max-width: 576px) {
    .stat-card .card-rank {
        font-size: 0.75rem;
    }

    .stat-card .card-title {
        font-size: 1.125rem;
    }
}

/* 同步按钮样式 */
#syncBtn {
    transition: all 0.2s;
}

#syncBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spin-icon {
    animation: spin 1s linear infinite;
}

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