/* 数据分析页面样式 */

/* 时间范围选择 */
.date-range {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.quick-ranges {
    display: flex;
    gap: 12px;
}

.quick-ranges .btn {
    min-width: 80px;
}

.custom-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-range span {
    color: #666;
}

.custom-range .input {
    width: 140px;
}

/* 数据概览卡片 */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.card-header i {
    font-size: 24px;
    color: #1890ff;
}

.card-body .main-value {
    font-size: 28px;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
}

.compare {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare .label {
    font-size: 14px;
    color: #666;
}

.compare .value {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.compare .value.up {
    color: #52c41a;
}

.compare .value.down {
    color: #f5222d;
}

/* 图表区域 */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.chart-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-group {
    display: flex;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
}

.btn-group .btn {
    border: none;
    border-radius: 0;
    padding: 4px 12px;
    font-size: 14px;
}

.btn-group .btn:not(:last-child) {
    border-right: 1px solid #d9d9d9;
}

.btn-group .btn.active {
    background: #1890ff;
    color: #fff;
}

.chart {
    width: 100%;
    height: 300px;
}

/* 数据表格区域 */
.data-table-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.table-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.table-actions {
    display: flex;
    gap: 12px;
}

.data-table {
    margin-bottom: 24px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #fafafa;
    color: #333;
    font-weight: 500;
}

td {
    color: #666;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pagination-size {
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.pagination-text {
    font-size: 14px;
    color: #666;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    color: #1890ff;
    border-color: #1890ff;
}

.pagination-btn.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.pagination-btn:disabled {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #d9d9d9;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #666;
    padding: 0 4px;
}

.pagination-jumper {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.pagination-jumper-input {
    width: 50px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-align: center;
}

.pagination-jumper-button {
    min-width: 60px;
    height: 32px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-jumper-button:hover {
    color: #1890ff;
    border-color: #1890ff;
}

@media screen and (max-width: 1200px) {
    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .overview-cards {
        grid-template-columns: 1fr;
    }

    .date-range {
        flex-direction: column;
        gap: 16px;
    }

    .quick-ranges {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .custom-range {
        width: 100%;
        flex-wrap: wrap;
    }

    .custom-range .input {
        flex: 1;
        min-width: 120px;
    }

    .pagination {
        flex-direction: column;
        align-items: center;
    }
    
    .pagination-info, 
    .pagination-buttons, 
    .pagination-jumper {
        width: 100%;
        justify-content: center;
    }
}

/* 数据分析页面样式 */

/* 数据概览卡片样式 */
.data-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.overview-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.trend {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.trend.up {
    background: #f6ffed;
    color: #52c41a;
}

.trend.down {
    background: #fff1f0;
    color: #f5222d;
}

.card-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.card-footer {
    font-size: 12px;
    color: #999;
}

/* 图表区域样式 */
.chart-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chart-actions select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.chart {
    height: 300px;
    margin-top: 15px;
}

/* 预测区域样式 */
.prediction-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.prediction-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.prediction-content {
    margin-top: 15px;
}

.prediction-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.prediction-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.item-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.confidence {
    font-size: 12px;
    color: #666;
}

.prediction-value {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.prediction-value .value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.prediction-detail {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.prediction-list {
    margin-top: 10px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item .product {
    color: #333;
}

.list-item .forecast {
    color: #666;
    font-size: 12px;
}

/* 建议列表样式 */
.advice-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.advice-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 6px;
    background: #f8f9fa;
}

.advice-item.warning {
    background: #fff7e6;
}

.advice-item.info {
    background: #e6f7ff;
}

.advice-item.success {
    background: #f6ffed;
}

.advice-icon {
    font-size: 20px;
}

.advice-content h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
}

.advice-content p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* 促销建议样式 */
.promotion-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.promotion-item {
    padding: 15px;
    border-radius: 6px;
    background: #f8f9fa;
}

.promotion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.promotion-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.roi {
    font-size: 12px;
    color: #52c41a;
    padding: 2px 6px;
    background: #f6ffed;
    border-radius: 4px;
}

.promotion-products {
    margin: 10px 0;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.product-item:last-child {
    border-bottom: none;
}

.product-item .name {
    color: #333;
}

.product-item .suggestion {
    color: #1890ff;
    font-size: 12px;
}

.promotion-detail {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin-top: 10px;
}

/* 按钮样式 */
.btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover {
    background: #f5f5f5;
}

.btn.primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.btn.primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
} 