/* ===================================
   案例页面图表样式 - 符合广告法要求
   用抽象图表替代具体数字
   =================================== */

/* 图表容器 */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* 对比柱状图 - 实施前后对比 */
.bar-chart-wrapper {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.bar-chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
}

.bar-chart {
    display: flex;
    justify-content: space-around;
    height: 180px;
    padding: 0 20px;
    position: relative;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.bar {
    width: 50px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    transition: var(--transition);
    display: block;
}

.bar:hover {
    opacity: 0.8;
}

.bar-before {
    background: linear-gradient(180deg, #e0e0e0 0%, #bdbdbd 100%);
}

.bar-after-cost {
    background: linear-gradient(180deg, #4caf50 0%, #2e7d32 100%);
}

.bar-after-efficiency {
    background: linear-gradient(180deg, #2196f3 0%, #1565c0 100%);
}

.bar-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.bar-trend {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #4caf50;
    white-space: nowrap;
}

.bar-trend.down {
    color: #4caf50;
}

.bar-trend.up {
    color: #2196f3;
}

/* 环形图 - 流程覆盖度 */
.donut-chart-wrapper {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.donut-chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.donut-chart {
    position: relative;
    width: 150px;
    height: 150px;
}

.donut-chart svg {
    transform: rotate(-90deg);
}

.donut-chart-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 12;
}

.donut-chart-progress {
    fill: none;
    stroke: url(#donutGradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    animation: donutAnimation 1.5s ease-out forwards;
}

@keyframes donutAnimation {
    from {
        stroke-dashoffset: 283;
    }
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.donut-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 5px;
}

/* 进度条组 */
.progress-bars-wrapper {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.progress-bars-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
}

.progress-item {
    margin-bottom: 20px;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.progress-value {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
}

.progress-bar-bg {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 1.5s ease-out;
}

/* 指标卡片 - 无具体数字 */
.metrics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.metric-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    padding: 20px 15px;
    text-align: center;
    color: white;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.metric-trend {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.metric-desc {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 趋势指示器 */
.trend-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.trend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.trend-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.trend-icon.up {
    background: #e3f2fd;
    color: #1976d2;
}

.trend-icon.down {
    background: #e8f5e9;
    color: #388e3c;
}

.trend-content {
    display: flex;
    flex-direction: column;
}

.trend-label {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.trend-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* 免责声明 */
.disclaimer {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #666;
}

.disclaimer i {
    color: #f57c00;
    margin-right: 8px;
}

/* 图表图例 */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-color.before {
    background: linear-gradient(180deg, #e0e0e0 0%, #bdbdbd 100%);
}

.legend-color.after {
    background: linear-gradient(180deg, #4caf50 0%, #2e7d32 100%);
}

/* 响应式 */
@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }

    .bar-chart {
        padding: 0 10px;
    }

    .bar {
        width: 40px;
    }

    .metrics-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
