/* =========================================
   全局变量与基础样式
========================================= */
:root {
    --neon-blue: #00f3ff;
    --neon-red: #ff2a7a;
    --neon-yellow: #f5c518;
    --neon-green: #00ff88;
    --neon-purple: #b538ff;
    --neon-cyan: #00f3ff;
    --dark-bg: #030409;
    --panel-bg: rgba(6, 10, 20, 0.85);
    --font-mono: 'Courier New', Courier, monospace;
}

body {
    margin: 0;
    padding: 15px;
    box-sizing: border-box;
    height: 100vh;
    background-color: var(--dark-bg);
    background-image:
        repeating-linear-gradient(0deg, rgba(0,0,0,0.2) 0px, rgba(0,0,0,0.2) 1px, transparent 1px, transparent 3px),
        linear-gradient(rgba(0, 243, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    display: grid;
    grid-template-columns: 350px 1fr 380px;
    grid-template-rows: 80px 1fr;
    gap: 20px;
    grid-template-areas:
        "header header header"
        "left center right";
    /* GPU加速优化 */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 屏幕边缘暗角效果 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 100px rgba(0,0,0,1);
    pointer-events: none;
    z-index: 100;
}

/* =========================================
   顶部 Header
========================================= */
.header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px dashed var(--neon-blue);
    position: relative;
}

.header::after {
    content: '||||||||||| | ||||| | || |';
    position: absolute;
    bottom: -15px;
    left: 30px;
    font-size: 12px;
    color: var(--neon-blue);
    opacity: 0.5;
    font-family: var(--font-mono);
}

.logo-area h1 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 6px;
    color: #fff;
    text-shadow: 2px 2px 0 var(--neon-red), -2px -2px 0 var(--neon-blue);
    font-style: italic;
}

.logo-area span {
    font-size: 12px;
    color: var(--neon-blue);
    letter-spacing: 6px;
    font-family: var(--font-mono);
}

.sys-status {
    display: flex;
    gap: 40px;
    font-family: var(--font-mono);
}

.stat-badge {
    text-align: right;
    border-right: 3px solid var(--neon-blue);
    padding-right: 15px;
}

.stat-badge .val {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.8);
}

.stat-badge .lbl {
    font-size: 11px;
    color: var(--neon-yellow);
    letter-spacing: 3px;
    font-weight: bold;
}

/* =========================================
   布局列
========================================= */
.left-col {
    grid-area: left;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.center-col {
    grid-area: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-col {
    grid-area: right;
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* =========================================
   响应式布局 - 移动端适配
========================================= */

/* 平板横屏 (1024px - 1280px) */
@media (max-width: 1280px) {
    body {
        grid-template-columns: 300px 1fr 320px;
        gap: 15px;
        padding: 10px;
    }
    
    .header {
        padding: 0 20px;
    }
    
    .logo-area h1 {
        font-size: 24px;
    }
    
    .stat-badge .val {
        font-size: 22px;
    }
}

/* 平板竖屏 (768px - 1024px) */
@media (max-width: 1024px) {
    body {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "header header"
            "left center"
            "right right";
        gap: 15px;
        padding: 10px;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .sys-status {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .left-col, .center-col, .right-col {
        min-height: auto;
    }
    
    .map-panel {
        min-height: 400px;
    }
    
    .right-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .right-col > .hud-panel:last-child {
        grid-column: 1 / -1;
    }
}

/* 手机横屏 (568px - 768px) */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "left"
            "center"
            "right";
        padding: 8px;
        gap: 12px;
    }
    
    .header {
        padding: 10px;
    }
    
    .logo-area h1 {
        font-size: 20px;
        letter-spacing: 3px;
    }
    
    .logo-area span {
        font-size: 10px;
    }
    
    .sys-status {
        gap: 15px;
    }
    
    .stat-badge {
        padding-right: 10px;
    }
    
    .stat-badge .val {
        font-size: 20px;
    }
    
    .stat-badge .lbl {
        font-size: 9px;
    }
    
    .right-col {
        grid-template-columns: 1fr;
    }
    
    .panel-title {
        font-size: 12px;
        padding: 8px 15px;
    }
    
    .hash-code {
        font-size: 9px;
    }
    
    .hw-content {
        padding: 15px;
        gap: 20px;
    }
    
    .cpu-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .reactor-core {
        width: 100px;
        height: 100px;
    }
    
    .cpu-val {
        font-size: 24px;
    }
    
    .proc-table {
        font-size: 11px;
    }
    
    .proc-table th, .proc-table td {
        padding: 6px 4px;
    }
    
    .proc-table td:last-child {
        max-width: 150px;
    }
    
    .map-panel {
        min-height: 300px;
    }
    
    #attackMap {
        min-height: 300px;
    }
    
    .network-panel {
        height: 180px;
    }
    
    .project-list {
        gap: 10px;
        padding: 12px;
    }
    
    .project-item {
        padding: 10px 12px;
    }
    
    .proj-name {
        font-size: 12px;
    }
    
    .proj-port {
        font-size: 10px;
    }
    
    .terminal {
        font-size: 10px;
        padding: 12px;
    }
    
    .log-row {
        font-size: 11px;
    }
}

/* 手机竖屏 (< 568px) */
@media (max-width: 568px) {
    body {
        padding: 5px;
        gap: 10px;
    }
    
    .header {
        padding: 8px;
    }
    
    .header::after {
        display: none;
    }
    
    .logo-area h1 {
        font-size: 18px;
        letter-spacing: 2px;
    }
    
    .logo-area span {
        font-size: 9px;
        letter-spacing: 3px;
    }
    
    .sys-status {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .stat-badge {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: 2px solid var(--neon-blue);
        padding: 8px 0;
    }
    
    .stat-badge .val {
        font-size: 18px;
    }
    
    .stat-badge .lbl {
        font-size: 10px;
    }
    
    .panel-title {
        font-size: 11px;
        padding: 6px 12px;
        letter-spacing: 1px;
    }
    
    .hash-code {
        font-size: 8px;
    }
    
    .hw-content {
        padding: 12px;
        gap: 15px;
    }
    
    .reactor-core {
        width: 80px;
        height: 80px;
    }
    
    .cpu-val {
        font-size: 20px;
    }
    
    .res-info {
        font-size: 11px;
    }
    
    .segmented-bar {
        height: 10px;
    }
    
    .proc-table {
        font-size: 10px;
    }
    
    .proc-table th, .proc-table td {
        padding: 5px 3px;
    }
    
    /* 隐藏进程表的命令列以节省空间 */
    .proc-table th:last-child,
    .proc-table td:last-child {
        display: none;
    }
    
    .map-panel {
        min-height: 250px;
    }
    
    #attackMap {
        min-height: 250px;
    }
    
    .network-panel {
        height: 150px;
    }
    
    .project-list {
        gap: 8px;
        padding: 10px;
    }
    
    .project-item {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .proj-name {
        font-size: 11px;
    }
    
    .proj-port {
        font-size: 9px;
    }
    
    .status-dot {
        font-size: 10px;
    }
    
    .terminal {
        font-size: 9px;
        padding: 10px;
    }
    
    .log-row {
        font-size: 10px;
        gap: 5px;
    }
    
    .log-header {
        font-size: 10px;
    }
    
    /* 登出按钮在小屏幕上调整 */
    .sys-status button {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 10px;
    }
}

/* 超小屏幕 (< 375px) */
@media (max-width: 375px) {
    .logo-area h1 {
        font-size: 16px;
    }
    
    .panel-title {
        font-size: 10px;
        padding: 5px 10px;
    }
    
    .hw-content {
        padding: 10px;
    }
    
    .reactor-core {
        width: 70px;
        height: 70px;
    }
    
    .cpu-val {
        font-size: 18px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    
    .map-panel {
        min-height: 250px;
    }
    
    #attackMap {
        min-height: 250px;
    }
}
