/* 美妆行业内容互动分布环形图样式 */
:root {
    --pink-color: #FE2C55;
    --blue-color: #25F4EE;
    --purple-color: #8134AF;
    --orange-color: #FF9A5A;
}

/* 环形图容器样式 */
.dy-industry-chart-container {
    background: linear-gradient(145deg, #ffffff, #f8f8f8);
    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: 280px;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

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

.dy-industry-chart-container h5 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.dy-industry-chart-container h5::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, var(--pink-color), var(--blue-color));
    border-radius: 3px;
}

/* 图表包装器 */
.dy-chart-wrapper {
    height: 230px;
    position: relative;
    margin: 0 auto;
}

/* 环形图样式 */
.dy-donut-chart {
    width: 200px;
    height: 200px;
    position: relative;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out forwards;
}

/* 环形图片段 */
.dy-donut-segment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: rotate(calc(var(--segment-start) * 3.6deg));
    transition: all 0.3s ease;
}

.dy-donut-segment:hover {
    transform: rotate(calc(var(--segment-start) * 3.6deg)) scale(1.05);
    z-index: 5;
}

.dy-donut-segment::before {
    content: "";
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: var(--segment-color);
    clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 0, 50% 0);
    transform: rotate(calc(var(--segment-percent) * 3.6deg));
    animation: growSegment 1.5s ease-out forwards;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 环形中心 */
.dy-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35%;
    height: 35%;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: 10;
    animation: pulseCenter 2s infinite alternate ease-in-out;
}

.dy-donut-center span {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

.dy-donut-center strong {
    font-size: 0.85rem;
    color: #333;
    font-weight: 600;
    margin-top: 2px;
    text-align: center;
}

/* 标签样式 */
.dy-segment-label {
    position: absolute;
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 4px 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    z-index: 20;
    opacity: 0;
    animation: fadeInLabel 0.5s forwards;
    animation-delay: calc(var(--segment-start) * 0.005s + 0.8s);
}

/* 为每个标签设置位置 */
.dy-donut-segment:nth-child(1) .dy-segment-label {
    top: 15%;
    right: -10px;
}

.dy-donut-segment:nth-child(2) .dy-segment-label {
    top: 15%;
    left: -10px;
}

.dy-donut-segment:nth-child(3) .dy-segment-label {
    bottom: 25%;
    left: -10px;
}

.dy-donut-segment:nth-child(4) .dy-segment-label {
    bottom: 25%;
    right: -10px;
}

/* 图表标题 */
.dy-chart-caption {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    padding-top: 5px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes growSegment {
    from {
        transform: rotate(0deg);
        opacity: 0;
    }
    to {
        transform: rotate(calc(var(--segment-percent) * 3.6deg));
        opacity: 1;
    }
}

@keyframes fadeInLabel {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseCenter {
    from {
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    }
    to {
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .dy-industry-chart-container {
        max-width: 100%;
        height: 260px;
    }
    
    .dy-chart-wrapper {
        height: 210px;
    }
    
    .dy-donut-chart {
        width: 180px;
        height: 180px;
    }
    
    .dy-segment-label {
        font-size: 0.7rem;
        padding: 3px 7px;
    }
}

/* 交互样式 */
.dy-donut-segment.hover {
    z-index: 30;
}

.dy-donut-segment.active::before {
    filter: drop-shadow(0 0 15px var(--segment-color));
    transform: rotate(calc(var(--segment-percent) * 3.6deg)) scale(1.05);
}

.dy-donut-segment.animate-in::before {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: center;
}

.dy-donut-center.updating {
    animation: centerUpdate 0.3s ease-in-out;
}

.dy-donut-center.pulse {
    animation: pulseStronger 1.5s infinite alternate ease-in-out;
}

@keyframes popIn {
    0% {
        transform: rotate(0deg) scale(0);
        opacity: 0;
    }
    60% {
        transform: rotate(calc(var(--segment-percent) * 3.6deg)) scale(1.1);
    }
    100% {
        transform: rotate(calc(var(--segment-percent) * 3.6deg)) scale(1);
        opacity: 1;
    }
}

@keyframes centerUpdate {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes pulseStronger {
    0% {
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* 鼠标悬停时显示段值 */
.dy-donut-segment:hover::after {
    content: attr(data-value);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    z-index: 100;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
} 