/* ===== 全局重置 & 基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    background: #0a0e17;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* ===== Canvas 粒子背景 ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== 网格叠加 ===== */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* ===== 扫描线 ===== */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent 0px,
            transparent 3px,
            rgba(0, 212, 255, 0.015) 3px,
            rgba(0, 212, 255, 0.015) 4px);
}

/* ===== 主容器 ===== */
.main-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 880px;
    padding: 40px 50px 50px;
    background: rgba(10, 14, 23, 0.65);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 32px;
    border: 1px solid rgba(0, 212, 255, 0.20);
    box-shadow:
        0 0 60px rgba(0, 212, 255, 0.06),
        inset 0 0 60px rgba(0, 212, 255, 0.03);
    transition: box-shadow 0.6s ease;
    animation: containerIn 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.97);
}

.main-container:hover {
    box-shadow:
        0 0 80px rgba(0, 212, 255, 0.10),
        inset 0 0 80px rgba(0, 212, 255, 0.04);
}

@keyframes containerIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== 顶部装饰线 ===== */
.top-accent {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.12);
}

.top-accent .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.30), transparent);
}

.top-accent .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ===== 标题 ===== */
.brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand h1 {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.15));
    position: relative;
    display: inline-block;
}

.brand h1::after {
    content: '▌';
    -webkit-text-fill-color: initial;
    color: #00d4ff;
    animation: blinkCursor 1.2s step-end infinite;
    font-weight: 400;
    margin-left: 4px;
    opacity: 0.7;
}

@keyframes blinkCursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.brand .sub {
    display: block;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 10px;
    color: rgba(0, 212, 255, 0.40);
    margin-top: 6px;
    text-transform: uppercase;
}

/* ===== 按钮组 ===== */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 36px;
}

.btn {
    position: relative;
    flex: 1 1 140px;
    min-width: 120px;
    padding: 16px 20px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    font-family: 'Orbitron', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.btn .icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.4s ease;
}

.btn .label {
    position: relative;
    z-index: 2;
}

/* 按钮光晕 */
.btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.05) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.btn:hover::before {
    opacity: 1;
}

/* 各自颜色 */
.btn-home {
    --btn-color: #00d4ff;
    --btn-glow: rgba(0, 212, 255, 0.25);
}

.btn-game {
    --btn-color: #7c3aed;
    --btn-glow: rgba(124, 58, 237, 0.25);
}

.btn-chat {
    --btn-color: #10b981;
    --btn-glow: rgba(16, 185, 129, 0.25);
}

.btn-home.active,
.btn-home:hover {
    background: rgba(0, 212, 255, 0.10);
    border-color: rgba(0, 212, 255, 0.35);
    color: #00d4ff;
    box-shadow: 0 0 40px var(--btn-glow), inset 0 0 30px rgba(0, 212, 255, 0.04);
    transform: translateY(-2px) scale(1.02);
}

.btn-game.active,
.btn-game:hover {
    background: rgba(124, 58, 237, 0.10);
    border-color: rgba(124, 58, 237, 0.35);
    color: #a78bfa;
    box-shadow: 0 0 40px var(--btn-glow), inset 0 0 30px rgba(124, 58, 237, 0.04);
    transform: translateY(-2px) scale(1.02);
}

.btn-chat.active,
.btn-chat:hover {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
    box-shadow: 0 0 40px var(--btn-glow), inset 0 0 30px rgba(16, 185, 129, 0.04);
    transform: translateY(-2px) scale(1.02);
}

.btn:active {
    transform: scale(0.95) !important;
    transition-duration: 0.1s;
}

.btn .ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--btn-color);
    transform: translate(-50%, -50%) scale(0);
    animation: rippleAnim 0.6s linear forwards;
    pointer-events: none;
    opacity: 0.25;
}

@keyframes rippleAnim {
    to {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ===== 内容区域 ===== */
.content-area {
    position: relative;
    min-height: 220px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 28px 30px;
    overflow: hidden;
    transition: border-color 0.5s ease;
}

.content-area .panel {
    display: none;
    animation: panelFade 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.content-area .panel.active {
    display: block;
}

@keyframes panelFade {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- 主页面板 ---- */
.panel-home .status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.panel-home .status-item {
    background: rgba(0, 212, 255, 0.04);
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(0, 212, 255, 0.06);
    text-align: center;
    transition: all 0.4s ease;
}

.panel-home .status-item:hover {
    background: rgba(0, 212, 255, 0.07);
    border-color: rgba(0, 212, 255, 0.12);
    transform: translateY(-2px);
}

.panel-home .status-item .label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.5);
    margin-bottom: 6px;
}

.panel-home .status-item .value {
    font-size: 24px;
    font-weight: 900;
    color: #00d4ff;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
}

.panel-home .status-item .value.green {
    color: #10b981;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

.panel-home .status-item .value.purple {
    color: #7c3aed;
    text-shadow: 0 0 30px rgba(124, 58, 237, 0.15);
}

/* 数值单位小字 */
.panel-home .status-item .value .unit {
    font-size: 14px;
    opacity: 0.4;
}

/* 负载颜色状态 */
.panel-home .status-item .value.load-normal {
    color: #00d4ff;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
}

.panel-home .status-item .value.load-warning {
    color: #f59e0b;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.15);
}

.panel-home .status-item .value.load-danger {
    color: #ef4444;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
}

.panel-home .welcome-text {
    font-size: 14px;
    color: rgba(148, 163, 184, 0.6);
    letter-spacing: 1px;
    margin-bottom: 14px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 14px;
}

.panel-home .welcome-text strong {
    color: #e2e8f0;
    font-weight: 700;
}

/* ---- 游戏面板 ---- */
.panel-game .game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.panel-game .game-card {
    background: rgba(124, 58, 237, 0.04);
    border-radius: 14px;
    padding: 18px 16px;
    border: 1px solid rgba(124, 58, 237, 0.06);
    text-align: center;
    transition: all 0.4s ease;
    cursor: default;
}

.panel-game .game-card:hover {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.05);
}

.panel-game .game-card .emoji {
    font-size: 32px;
    display: block;
    margin-bottom: 6px;
}

.panel-game .game-card .name {
    font-size: 13px;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 1px;
}

.panel-game .game-card .desc {
    font-size: 10px;
    color: rgba(148, 163, 184, 0.4);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.panel-game .game-status {
    text-align: center;
    font-size: 12px;
    color: rgba(148, 163, 184, 0.3);
    letter-spacing: 2px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* ---- 聊天面板 ---- */
.panel-chat .chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 6px;
}

.panel-chat .chat-messages::-webkit-scrollbar {
    width: 3px;
}

.panel-chat .chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.panel-chat .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.25);
    border-radius: 10px;
}

.panel-chat .msg {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.04);
    border-radius: 12px;
    border-left: 2px solid rgba(16, 185, 129, 0.15);
    animation: msgIn 0.4s ease forwards;
    opacity: 0;
    transform: translateX(-10px);
}

.panel-chat .msg:nth-child(1) {
    animation-delay: 0.05s;
}

.panel-chat .msg:nth-child(2) {
    animation-delay: 0.15s;
}

.panel-chat .msg:nth-child(3) {
    animation-delay: 0.25s;
}

.panel-chat .msg:nth-child(4) {
    animation-delay: 0.35s;
}

@keyframes msgIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.panel-chat .msg .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(16, 185, 129, 0.10);
    flex-shrink: 0;
}

.panel-chat .msg .body {
    flex: 1;
}

.panel-chat .msg .body .user {
    font-size: 11px;
    font-weight: 700;
    color: #34d399;
    letter-spacing: 1px;
}

.panel-chat .msg .body .text {
    font-size: 13px;
    color: rgba(226, 232, 240, 0.7);
    margin-top: 2px;
    font-weight: 400;
    font-family: 'Segoe UI', sans-serif;
}

.panel-chat .msg .body .time {
    font-size: 9px;
    color: rgba(148, 163, 184, 0.25);
    float: right;
    margin-top: 2px;
}

.panel-chat .chat-input-sim {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.panel-chat .chat-input-sim .fake-input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(148, 163, 184, 0.3);
    font-size: 12px;
    letter-spacing: 1px;
    font-family: 'Orbitron', sans-serif;
}

.panel-chat .chat-input-sim .fake-btn {
    padding: 10px 22px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.15);
    background: rgba(16, 185, 129, 0.06);
    color: rgba(16, 185, 129, 0.4);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: default;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
}

.panel-chat .chat-input-sim .fake-btn:hover {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.25);
    color: #34d399;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .main-container {
        padding: 24px 18px 30px;
        border-radius: 24px;
        width: 94%;
    }

    .btn-group {
        gap: 10px;
    }

    .btn {
        flex: 1 1 80px;
        min-width: 70px;
        padding: 14px 12px;
        font-size: 12px;
        letter-spacing: 1px;
        border-radius: 12px;
    }

    .btn .icon {
        font-size: 16px;
    }

    .content-area {
        padding: 18px 16px;
        min-height: 180px;
    }

    .panel-home .status-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .panel-home .status-item .value {
        font-size: 18px;
    }

    .panel-game .game-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .brand h1 {
        font-size: 26px;
        letter-spacing: 3px;
    }

    .brand .sub {
        font-size: 10px;
        letter-spacing: 6px;
    }

    .top-accent {
        margin-bottom: 14px;
        padding-bottom: 12px;
    }
}

@media (max-width: 440px) {
    .btn {
        font-size: 10px;
        padding: 12px 8px;
        min-width: 60px;
        gap: 4px;
    }

    .btn .icon {
        font-size: 14px;
    }

    .panel-home .status-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .panel-home .status-item {
        padding: 12px 10px;
    }

    .panel-game .game-grid {
        grid-template-columns: 1fr 1fr;
    }

    .panel-chat .msg .body .text {
        font-size: 12px;
    }
}

/* ===== 工具类 ===== */
.glow-text {
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.08);
}

/* 小装饰 - 角落标记 */
.corner-deco {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: rgba(0, 212, 255, 0.08);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
}

.corner-deco.tl {
    top: 12px;
    left: 12px;
    border-top-width: 1px;
    border-left-width: 1px;
}

.corner-deco.tr {
    top: 12px;
    right: 12px;
    border-top-width: 1px;
    border-right-width: 1px;
}

.corner-deco.bl {
    bottom: 12px;
    left: 12px;
    border-bottom-width: 1px;
    border-left-width: 1px;
}

.corner-deco.br {
    bottom: 12px;
    right: 12px;
    border-bottom-width: 1px;
    border-right-width: 1px;
}

.main-container {
    position: relative;
}

.main-container .corner-deco {
    display: block;
}

@media (max-width: 640px) {
    .corner-deco {
        display: none !important;
    }
}

/* ===== 内容区域发光（JS 切换用 class） ===== */
.content-area.glow-home {
    box-shadow: inset 0 0 60px rgba(0, 212, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.content-area.glow-game {
    box-shadow: inset 0 0 60px rgba(124, 58, 237, 0.04);
    border-color: rgba(255, 255, 255, 0.04);
}

.content-area.glow-chat {
    box-shadow: inset 0 0 60px rgba(16, 185, 129, 0.04);
    border-color: rgba(255, 255, 255, 0.04);
}
