/* =========================================
   PROJECT NEXUS - GLOBAL STYLES (v1.2)
   ========================================= */

:root {
    --bg-void: #050505;
    --text-primary: #ffffff;
    --font-main: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", Consolas, monospace;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- 1. THE SHUTTER --- */
.shutter-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999; pointer-events: none; display: flex;
}
.shutter-left, .shutter-right {
    width: 50%; height: 100%; background: #111;
    transition: transform 0.8s var(--ease-out-expo);
    transform: scaleX(0);
}
.shutter-left { transform-origin: left; }
.shutter-right { transform-origin: right; }
.shutter-layer.closed .shutter-left, .shutter-layer.closed .shutter-right { transform: scaleX(1); }
.loading-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 2px;
    color: #444; opacity: 0; transition: opacity 0.3s;
}
.shutter-layer.closed .loading-text { opacity: 1; transition-delay: 0.4s; }

/* --- 2. THE HUB --- */
.hub-container {
    height: 100%; width: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: transform 0.8s var(--ease-out-expo), opacity 0.5s, filter 0.3s;
}
.hub-container.hidden { transform: scale(0.95); opacity: 0; pointer-events: none; }

.hub-header { text-align: center; margin-bottom: 50px; }
.hub-header h1 { 
    font-size: 4rem; font-weight: 900; letter-spacing: 10px; margin-bottom: 5px; 
    text-shadow: 0 0 30px rgba(255,255,255,0.1);
}
.subtitle-cn { font-size: 1.5rem; color: #fff; letter-spacing: 5px; margin-bottom: 5px; font-weight: 300; }
.subtitle-en { font-family: var(--font-mono); color: #666; font-size: 0.7rem; letter-spacing: 3px; }

.portal-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    width: 90%; max-width: 1400px; height: 55vh;
}
.portal-card {
    position: relative; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1); cursor: pointer;
    transition: all 0.4s var(--ease-out-expo); overflow: hidden;
}
.portal-card:hover {
    border-color: var(--theme-color); transform: translateY(-10px);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.5);
}
.portal-card:hover .glow {
    opacity: 0.2; background: radial-gradient(circle at center, var(--theme-color), transparent 70%);
}
.card-inner {
    height: 100%; width: 100%; padding: 30px;
    display: flex; flex-direction: column; justify-content: flex-end;
    position: relative; z-index: 2;
}
.glow {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; transition: opacity 0.4s; z-index: 1;
}
.card-id {
    position: absolute; top: 20px; left: 20px;
    font-family: var(--font-mono); font-size: 2.5rem;
    color: rgba(255,255,255,0.05); font-weight: bold;
}
.portal-card h2 { font-size: 1.6rem; margin-bottom: 10px; color: #fff; text-transform: uppercase; }
.portal-card p { font-size: 0.9rem; color: rgba(255,255,255,0.7); line-height: 1.6; }

/* --- 3. VIEWPORT --- */
.viewport-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: none; opacity: 0;
}
.viewport-container.active { pointer-events: auto; opacity: 1; }
iframe { width: 100%; height: 100%; border: none; }

/* --- 4. HUD CONTROLS (v1.2 全新系统) --- */
.hud-controls {
    position: fixed; bottom: 30px; right: 30px;
    z-index: 100;
    display: flex; gap: 15px; /* 按钮之间的间距 */
    align-items: center;
}

/* 统一的按钮样式 */
.hud-btn {
    background: rgba(0,0,0,0.8);
    border: 1px solid #333;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 0.8rem;
    color: #888;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.hud-btn:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,0.05); }

.hud-btn .icon {
    width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; font-size: 0.7rem;
}

/* 返回按钮的特殊状态：默认隐藏 */
.back-btn {
    display: none; /* 默认不显示 */
    opacity: 0;
    transform: translateX(20px);
}

/* 当添加 .visible 类时显示 */
.back-btn.visible {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    animation: slideIn 0.5s var(--ease-out-expo) forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- 5. MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    z-index: 10000; display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-box {
    width: 400px; max-width: 90%; background: #111; border: 1px solid #333;
    padding: 40px; border-radius: 8px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    transform: translateY(20px); transition: transform 0.3s ease; text-align: center;
}
.modal-overlay.active .modal-box { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; margin-bottom: 30px; border-bottom: 1px solid #333; padding-bottom: 15px; }
.modal-header h3 { font-family: var(--font-mono); color: #888; font-size: 0.8rem; letter-spacing: 2px; }
.close-btn { cursor: pointer; color: #fff; font-size: 1.2rem; }


.modal-content h4 { font-size: 1.5rem; margin-bottom: 5px; color: #fff; }
.role { font-family: var(--font-mono); color: #8b5cf6; font-size: 0.8rem; margin-bottom: 20px; }
.divider { height: 1px; background: #222; margin: 20px 0; }

.contact-list { list-style: none; text-align: left; margin-bottom: 25px; padding: 0; }
.contact-list li { 
    margin-bottom: 10px; font-family: var(--font-mono); font-size: 0.85rem; color: #ccc; 
    display: flex; justify-content: space-between; border-bottom: 1px dashed #333; padding-bottom: 5px;
}
.contact-list span { color: #666; }
.bio { font-size: 0.9rem; color: #888; line-height: 1.6; text-align: left; }

/* Mobile */
@media (max-width: 768px) {
    .portal-grid { grid-template-columns: 1fr; height: auto; padding-bottom: 100px; }
    .portal-card { height: 200px; }
    .hub-header h1 { font-size: 2.5rem; }
    .subtitle-cn { font-size: 1rem; }
}
