/* 数据大屏样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #050b14;
    --bg-card: rgba(16, 30, 56, 0.6);
    --border-color: rgba(59, 130, 246, 0.25);
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.screen-container {
    width: 100%;
    height: 100vh;
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 背景装饰 */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* 顶部标题 */
.screen-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 20px;
    margin-bottom: 8px;
}

.header-title {
    text-align: center;
    position: relative;
    z-index: 1;
}

.header-title h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(180deg, #ffffff 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    margin-bottom: 4px;
}

.header-title p {
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--accent-cyan);
    opacity: 0.8;
}

.header-decoration {
    position: absolute;
    top: 28px;
    width: 35%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
}

.header-decoration.left {
    left: 0;
}

.header-decoration.right {
    right: 0;
}

.header-decoration::after {
    content: '';
    position: absolute;
    top: -3px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--accent-cyan);
    transform: rotate(45deg);
}

.header-decoration.left::after {
    right: 20%;
}

.header-decoration.right::after {
    left: 20%;
}

.header-time {
    position: absolute;
    right: 0;
    top: 12px;
    font-size: 14px;
    color: var(--accent-cyan);
    font-family: 'Consolas', monospace;
    letter-spacing: 1px;
}

/* KPI 卡片 */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 12px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
}

.kpi-card.warning::before {
    background: linear-gradient(90deg, var(--accent-orange), #fbbf24);
}

.kpi-card.danger::before {
    background: linear-gradient(90deg, var(--accent-red), #f87171);
}

.kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
}

.kpi-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.kpi-value .num {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Consolas', 'Arial Black', sans-serif;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.kpi-card.warning .num {
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.kpi-card.danger .num {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.kpi-value .unit {
    font-size: 11px;
    color: var(--text-muted);
}

/* 通用面板 */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.panel-icon {
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 2px;
}

.panel-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* 主体网格 */
.main-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
    margin-bottom: 16px;
}

/* 订单生产进度 */
.order-panel {
    min-height: 0;
}

.order-list {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.scroll-track {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: scrollUp 30s linear infinite;
}

.order-list:hover .scroll-track,
.inventory-body-scroll:hover .scroll-track {
    animation-play-state: paused;
}

@keyframes scrollUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.order-card {
    background: rgba(8, 20, 40, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 14px 16px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.order-info h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.order-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.order-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.order-progress {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.progress-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.progress-ring {
    position: relative;
    width: 56px;
    height: 56px;
}

.progress-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 5;
}

.progress-ring-bar {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.progress-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

/* 右侧图表 */
.right-charts {
    display: grid;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 16px;
    min-height: 0;
}

.chart-panel {
    min-height: 0;
}

.chart-box {
    flex: 1;
    min-height: 0;
    width: 100%;
}

.alert-panel {
    min-height: 0;
}

.alert-list {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    font-size: 12px;
}

.alert-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-red);
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--accent-red);
}

.alert-dot.warning {
    background: var(--accent-orange);
    box-shadow: 0 0 8px var(--accent-orange);
}

.alert-content {
    flex: 1;
    color: var(--text-secondary);
}

.alert-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.alert-time {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
}

/* 底部网格 */
.bottom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 16px;
    height: 220px;
    flex-shrink: 0;
}

.bottom-grid .panel {
    min-height: 0;
}

/* 表格 */
.table-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.inventory-head-table,
.inventory-body-table {
    table-layout: fixed;
}

.inventory-head-table th:nth-child(1),
.inventory-body-table td:nth-child(1) { width: 10%; }
.inventory-head-table th:nth-child(2),
.inventory-body-table td:nth-child(2) { width: 22%; }
.inventory-head-table th:nth-child(3),
.inventory-body-table td:nth-child(3) { width: 22%; }
.inventory-head-table th:nth-child(4),
.inventory-body-table td:nth-child(4) { width: 13%; }
.inventory-head-table th:nth-child(5),
.inventory-body-table td:nth-child(5) { width: 15%; }
.inventory-head-table th:nth-child(6),
.inventory-body-table td:nth-child(6) { width: 18%; }

.inventory-body-scroll {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.inventory-body-scroll .scroll-track {
    animation: scrollUp 24s linear infinite;
    gap: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    text-align: left;
    padding: 8px 6px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}

.data-table td {
    padding: 7px 6px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(59, 130, 246, 0.08);
    white-space: nowrap;
}

.data-table tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

.data-table td:first-child {
    color: var(--accent-cyan);
    font-weight: 700;
}

.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-tag.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.status-tag.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* 动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.kpi-value .num {
    transition: all 0.5s ease;
}

/* 响应式：保持比例缩放 */
@media (max-width: 1600px) {
    .kpi-value .num {
        font-size: 22px;
    }
    .header-title h1 {
        font-size: 28px;
    }
}

@media (max-width: 1366px) {
    .screen-container {
        padding: 12px 16px 16px;
    }
    .kpi-row {
        grid-template-columns: repeat(4, 1fr);
    }
    .main-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1.2fr 1fr;
    }
    .right-charts {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 1fr;
    }
    .bottom-grid {
        grid-template-columns: 1fr 1fr;
        height: auto;
        min-height: 200px;
    }
}

@media (max-width: 1024px) {
    .right-charts {
        grid-template-columns: 1fr;
    }
    .bottom-grid {
        grid-template-columns: 1fr;
    }
    .order-progress {
        flex-wrap: wrap;
    }
}
