/* 基础样式 */
body {
    margin: 0;
    padding: 20px;
    background: #fff;
    font-family: Arial, sans-serif;
    color: #007bff;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 2px solid #007bff;
    margin-bottom: 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

/* 标题动画效果 */
.title {
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
    display: inline-block;
}

.title span {
    display: inline-block;
    animation: titleText 2s ease-out infinite;
    animation-fill-mode: both;
}

.title span:nth-child(1) { animation-delay: 0.1s; }
.title span:nth-child(2) { animation-delay: 0.2s; }
.title span:nth-child(3) { animation-delay: 0.3s; }
.title span:nth-child(4) { animation-delay: 0.4s; }
.title span:nth-child(5) { animation-delay: 0.5s; }
.title span:nth-child(6) { animation-delay: 0.6s; }

@keyframes titleText {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    20% {
        opacity: 1;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0.8;
        transform: translateY(0);
    }
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    color: #fff;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #007bff;
}

.data-table th {
    background: #2a2a2a;
}

/* 图表区域样式 */
.charts-area {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* 图表容器样式 */
.chart-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
}

/* 产量图表样式 */
.production-chart {
    flex: 1;
    margin-right: 20px;
}

.chart-content {
    position: relative;
    height: 400px;
    padding: 20px 40px;
    background: #fff;
    border-radius: 10px;
}

/* Y轴样式 */
.y-axis {
    position: absolute;
    left: 0;
    top: 20px;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 10px;
    border-right: 1px solid #007bff;
    color: #007bff;
}

/* 柱状图样式 */
.chart-bars {
    position: relative;
    height: 100%;
    margin-left: 40px;
}

.bar-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: calc(100% - 40px);
    padding-top: 20px;
    color: #007bff;
}

.bar {
    width: 40px;
    background: linear-gradient(to top, #ff0000, #cc0000);
    margin: 0 20px;
    position: relative;
    border-radius: 3px 3px 0 0;
    transition: height 0.1s linear;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.bar:hover {
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

/* 移除之前的动画相关样式 */
.bar[data-value="10"],
.bar[data-value="0"] {
    height: auto;
}

.bar::after,
.bar::before {
    display: none;
}

/* 目标线样式 */
.target-line {
    position: absolute;
    top: 60%;
    left: 0;
    right: 0;
    border-top: 2px dashed #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.target-text {
    position: absolute;
    right: 0;
    top: -30px;
    color: #007bff;
    text-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
    animation: glowPulse 2s infinite;
}

/* X轴样式 */
.x-axis {
    position: absolute;
    left: 40px;
    right: 0;
    bottom: 0;
    border-top: 1px solid #007bff;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 15px;
    color: #007bff;
}

.time-label {
    transform: rotate(-45deg);
    transform-origin: top left;
    font-size: 12px;
    color: #007bff;
    white-space: nowrap;
    margin-top: 15px;
    margin-left: 20px;
}

/* 饼图样式 */
.pie-container {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pie-chart {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #072951;
    margin-right: 20px;
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #fff;
    font-weight: bold;
}

.pie-slice {
    position: absolute;
    width: 100%;
    height: 100%;
    clip: rect(0, 150px, 150px, 75px);
    border-radius: 50%;
    background: #00ff00;
    transform: rotate(0deg);
}

.pie-slice-fix {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #00ff00;
    clip: rect(0, 75px, 150px, 0);
    transform: rotate(180deg);
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #00ff00;
}

.legend-color.red {
    background: red;
}

.legend-text {
    color: #fff;
    font-size: 16px;
}

.percentage {
    font-weight: bold;
}

/* 动画关键帧 */
@keyframes barRise {
    0% {
        height: 0;
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        height: var(--height);
        opacity: 1;
    }
}

@keyframes barGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
    }
}

@keyframes targetLinePulse {
    0%, 100% {
        opacity: 1;
        border-width: 2px;
    }
    50% {
        opacity: 0.5;
        border-width: 3px;
    }
}

@keyframes targetLineMove {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes textPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    }
}

@keyframes clockRotate {
    0% {
        transform: rotate(-180deg);
        background: #00ff00;
    }
    100% {
        transform: rotate(180deg);
        background: #00ff00;
    }
}

@keyframes pieGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 0, 0.6);
        filter: brightness(1.2);
    }
}

@keyframes legendFade {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 为柱状图设置具体高度 */
.bar[data-value="10"] {
    --height: 28.57%;  /* (10/35) * 100 */
}

.bar[data-value="0"] {
    --height: 0%;
}

/* 时间标签 */
.bar::after {
    content: attr(data-time);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    white-space: nowrap;
    font-size: 12px;
    color: #007bff;
}

/* 数值标签 */
.bar::before {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    animation: numberPulse 2s infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes numberPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        transform: translateX(-50%) scale(1.2);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }
}

/* 添加新的动画效果 */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
    }
}

/* 应用发光动画到主要元素 */
.bar, .target-line {
    animation: glowPulse 2s infinite;
}

.defect-chart {
    flex: 1;
    padding: 20px;
    background: #072951;
    border-radius: 10px;
    position: relative;
}

.pie-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

.pie-chart {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #333;
}

.pie-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 50%;
    background: #00ff00;
    transform-origin: bottom center;
    animation: rotateIndicator 12s linear infinite;
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00ff00;
    transform: translate(-50%, -50%);
}

.pie-mark {
    position: absolute;
    top: 0;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00ff00;
    transform: translate(-50%, -10px);
}

.pie-mark-end {
    position: absolute;
    top: 0;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00ff00;
    transform: translate(-50%, -10px) rotate(30deg);
    transform-origin: center 150px;
}

.pie-value {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: -40px;
    color: #00ff00;
    font-size: 36px;
    font-weight: bold;
}

.pie-trail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: polygon(50% 50%, 50% 0, 60% 0, 60% 60%, 50% 50%);
    background: #00ff00;
    transform-origin: center;
    animation: rotateTrail 12s linear infinite;
}

@keyframes rotateIndicator {
    from {
        transform: rotate(-90deg);
    }
    to {
        transform: rotate(270deg);
    }
}

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

.pie-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.8));
    pointer-events: none;
}

.chart-title {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
}

/* 饼图容器 */
.pie-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: auto;
}

/* 饼图样式 */
.pie-chart {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #444;
}

.pie-slice {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#00ff00 0deg, #444 0deg);
    transform: rotate(-90deg);
    transform-origin: center;
}

/* 百分比显示 */
.percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #00ff00;
}

.percentage::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #00ff00;
    border-radius: 4px;
}

/* 圆形图样式 */
.circle-chart {
    flex: 1;
    margin-left: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
}

.circle-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

.circle-base {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f8f9fa;
    overflow: hidden;
}

.circle-sector {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00ff00;
    transform-origin: center;
    animation: expandSector 12s linear infinite;
    border-radius: 50%;
}

.circle-text {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: -40px;
    color: #00ff00;
    font-size: 24px;
    font-weight: bold;
}

@keyframes expandSector {
    0% {
        clip-path: polygon(50% 50%, 50% 0, 50% 0);
    }
    25% {
        clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 50%);
    }
    50% {
        clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 50% 100%);
    }
    75% {
        clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 50%);
    }
    100% {
        clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 0, 50% 0);
    }
}

.container {
    display: flex;
    min-height: 80vh;
    align-items: flex-end;
}

.chart-section, .login-section {
    height: 80%;
    padding: 20px;
}

.chart-section {
    flex: 2;
}

.login-section {
    flex: 1;
}

.chart-container, .login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
} 