/* 餐饮食品行业堆叠柱状图样式 */
:root {
    --food-primary: #FF6B6B;
    --food-secondary: #4ECDC4;
    --food-tertiary: #FFD166;
    --food-quaternary: #6A8EAE;
    --food-chart-bg: linear-gradient(145deg, #ffffff, #f8f8f8);
    --traditional-primary: #FF6B6B;
    --traditional-secondary: #4ECDC4;
    --douyin-primary: #FE2C55;
}

/* 堆叠柱状图容器 */
.food-stacked-container {
    background: var(--food-chart-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    margin: 20px auto;
    transition: all 0.3s ease;
    max-width: 480px;
    width: 100%;
    height: auto;
    min-height: 320px;
    position: relative;
    z-index: 10;
    overflow: visible;
}

.food-stacked-container:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.food-stacked-container h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.food-stacked-container h4::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, var(--food-primary), var(--food-secondary));
    border-radius: 3px;
}

/* 堆叠柱状图区域 */
.stacked-columns-wrapper {
    margin: 20px auto;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 30px;
    position: relative;
}

/* 堆叠柱状图 */
.stacked-columns {
    display: flex;
    align-items: flex-end;
    gap: 60px;
    height: 100%;
    position: relative;
    z-index: 2;
}

.stacked-column {
    width: 70px;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
}

.stacked-column:hover {
    transform: translateY(-5px) !important;
}

.column-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
    color: #333;
}

.segment {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 2px;
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
    background-color: rgba(0,0,0,0.05);
}

.segment-fill {
    width: 100%;
    height: 100%;
    transition: height 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.segment-label {
    position: absolute;
    left: 105%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    white-space: nowrap;
    color: #666;
}

.segment-value {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 特定样式 */
.traditional .segment:nth-child(1) .segment-fill {
    background: linear-gradient(to bottom, var(--food-primary), rgba(255, 107, 107, 0.7));
}

.traditional .segment:nth-child(2) .segment-fill {
    background: linear-gradient(to bottom, var(--food-secondary), rgba(78, 205, 196, 0.7));
}

.traditional .segment:nth-child(3) .segment-fill {
    background: linear-gradient(to bottom, var(--food-tertiary), rgba(255, 209, 102, 0.7));
}

.douyin .segment:nth-child(1) .segment-fill {
    background: linear-gradient(to bottom, #FE2C55, rgba(254, 44, 85, 0.7));
}

.douyin .segment:nth-child(2) .segment-fill {
    background: linear-gradient(to bottom, #25F4EE, rgba(37, 244, 238, 0.7));
}

.douyin .segment:nth-child(3) .segment-fill {
    background: linear-gradient(to bottom, #8134AF, rgba(129, 52, 175, 0.7));
}

/* 动画效果 */
@keyframes segmentRise {
    from {
        height: 0;
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-segment {
    animation: segmentRise 1s forwards;
    animation-delay: calc(var(--segment-index, 0) * 0.1s);
}

/* 图表备注 */
.stacked-chart-note {
    position: relative;
    margin-top: 15px;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    padding-top: 5px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #444;
}

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

.legend-item:nth-child(1) .legend-color {
    background: var(--food-primary);
}

.legend-item:nth-child(2) .legend-color {
    background: var(--food-secondary);
}

.legend-item:nth-child(3) .legend-color {
    background: #FE2C55;
}

/* 悬停效果 */
.segment:hover {
    transform: scaleX(1.05);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.segment:hover .segment-value {
    font-weight: bold;
    font-size: 0.85rem;
}

/* 高亮效果 */
.stacked-column.highlight {
    z-index: 5;
}

.stacked-column.highlight .segment {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* 响应式样式 */
@media (max-width: 767px) {
    .stacked-columns {
        gap: 30px;
    }
    
    .stacked-column {
        width: 50px;
    }
    
    .segment-label {
        display: none;
    }
    
    .food-stacked-container {
        padding: 15px 10px;
    }
} 