/* ================= 变量定义 ================= */
:root {
    --primary-color: #60a5fa;      /* 明亮主蓝色 */
    --secondary-color: #38bdf8;    /* 辅助蓝青色 */
    --text-color: #e5f0ff;         /* 稍微更亮的文字色 */
    --bg-color-1: #02081f;         /* 再稍微提亮一点的深蓝背景 */
    --border-radius: 20px;
    --transition-time: 0.3s;
    --frosted-blur: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ================= 登录遮罩层 ================= */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 20, 55, 0.82);
    backdrop-filter: blur(12px);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    background: rgba(15, 23, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius);
    padding: 2.5rem 3rem;
    min-width: 360px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
}

.login-title {
    color: #fff;
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.login-subtitle {
    color: rgba(205, 214, 244, 0.7);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 2rem;
}

.login-form .login-field {
    margin-bottom: 1.2rem;
}

.login-form label {
    display: block;
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.login-form input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(49, 50, 68, 0.5);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition-time) ease;
}

.login-form input:focus {
    border-color: var(--primary-color);
}

.login-form input::placeholder {
    color: rgba(205, 214, 244, 0.4);
}

.login-error {
    color: #f38ba8;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
}

.login-btn {
    width: 100%;
    padding: 0.9rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-time) ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.5);
}

body {
    background-color: var(--bg-color-1);
    color: var(--text-color);
    overflow: hidden; /* 防止特效溢出产生滚动条 */
    min-height: 100vh;
}

/* ================= 背景无限滚动图片网格 (严谨数学对齐版) ================= */
.scrolling-bg {
    position: fixed;
    /* 强行居中这个巨大的容器，不依赖 transform 居中，避免和旋转动画冲突 */
    top: 50%;
    left: 50%;
    width: 4608px; /* 18列 * (240px宽 + 16px边距) = 4608px */
    height: 3136px; /* 16行 * (180px高 + 16px边距) = 3136px */
    margin-left: -2304px; 
    margin-top: -1568px;

    /* 放弃 grid 的 gap，改用 flex 和 margin 计算，彻底杜绝首尾间距误差 */
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    
    opacity: 0.85; /* 再提高透明度，让背景更通透更明亮 */
    z-index: -2;
    animation: scrollBackground 60s linear infinite;
}

/* 单个背景卡片 */
.bg-tile {
    width: 240px;
    height: 180px;
    margin: 8px; /* 左右各8px组成完美的16px间距 */
    border-radius: 18px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* 无缝动画核心：X 和 Y 的偏移量必须是单元格尺寸的完美倍数 */
@keyframes scrollBackground {
    0% {
        /* 使用统一的放大比例，让背景整体“靠近”一点 */
        transform: rotate(-18deg) scale(1.4) translate3d(0, 0, 0);
    }
    100% {
        /* X 移动 6 个图片周期：6 * 256 = -1536px */
        /* Y 移动 2 个图片周期：2 * 196 = -392px */
        /* 保持与 0% 一致的缩放和旋转，只改变位移，依然无缝 */
        transform: rotate(-18deg) scale(1.2) translate3d(-1536px, -392px, 0);
    }
}

/* 背景渐变遮罩，让中间清晰边缘暗淡 */
.bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-color-1) 70%);
    z-index: -1;
}

/* ================= 鼠标散图特效容器 ================= */
#trail-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none; /* 绝对不能阻挡鼠标点击 */
    z-index: 5;
    overflow: hidden;
}

/* 将原来的 img 样式改成了科技感发光四边形 */
.trail-shape {
    position: absolute;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    /* 使用 CSS 变量接收不同模块的颜色，实现发光效果 */
    box-shadow: 0 0 15px var(--shape-color), inset 0 0 10px var(--shape-color);
    background-color: var(--shape-bg);
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.9;
    /* 散开并消失的动画 */
    animation: scatterFade 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes scatterFade {
    0% { transform: translate(-50%, -50%) scale(0.5) rotate(0deg); opacity: 0.9; }
    100% { 
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.5) rotate(var(--rot)); 
        opacity: 0; 
        filter: blur(2px); /* 四边形散开时带有轻微模糊，更有速度感 */
    }
}

/* ================= 角落按钮 (右上角) ================= */
.corner-buttons {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
}

.corner-button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-time) ease;
    text-decoration: none;
    font-size: 0.95rem;
}

.corner-button:hover {
    background: rgba(137, 180, 250, 0.2);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* 右上角“仅展示”的标签框：不需要点击交互 */
.corner-label {
    cursor: default;
    pointer-events: none;
    font-weight: 700;
}

/* 数据报告专属高亮样式 */
.btn-report {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.45);
    color: #fff;
    font-weight: 600;
}
.btn-report:hover {
    background: rgba(56, 189, 248, 0.3);
    border-color: var(--secondary-color);
}

.corner-button svg { width: 18px; height: 18px; fill: currentColor; }

/* ================= 主体导航布局 (1行4列 修长网格) ================= */
.main-content {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.header-titles {
    text-align: center;
    margin-bottom: 4rem; /* 增加了标题和卡片之间的距离 */
    pointer-events: none;
}

.main-title {
    font-size: 3.2rem;
    color: #fff;
    margin-bottom: 0.8rem;
    letter-spacing: 2px;
    text-shadow: 0 0 24px rgba(96, 165, 250, 0.6);
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.1rem;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* 核心修改：改为 4列 并排布局 */
.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 1行4列 */
    gap: 1.5rem; /* 稍微缩小间距，让整体更紧凑 */
    max-width: 1400px; /* 拓宽最大宽度以容纳4个卡片 */
    width: 100%;
    padding: 0 3rem;
}

/* ================= 竖向修长磨砂卡片 ================= */
.nav-card {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--border-radius);
    padding: 3rem 2rem; /* 增加上下内边距，拉长卡片 */
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--frosted-blur));
    -webkit-backdrop-filter: blur(var(--frosted-blur));
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* 让内容垂直居中分布 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 380px; /* 强制设置最小高度，确保修长比例 */
}

.nav-card:hover {
    transform: translateY(-15px); /* 悬浮时向上升起更多，更有立体感 */
    border-color: rgba(96, 165, 250, 0.7);
    box-shadow: 0 20px 40px rgba(15, 23, 55, 0.7);
    background: rgba(15, 23, 55, 0.82);
}

.card-content { 
    position: relative; 
    z-index: 2; 
    pointer-events: none; 
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.card-icon {
    /* 图标作为修长卡片的视觉重心 */
    margin-bottom: 2rem;
    transition: transform 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-icon img {
    width: 5.5rem;
    height: 5.5rem;
    object-fit: contain;
}
.nav-card:hover .card-icon { transform: scale(1.15) translateY(-8px); }

.card-title { 
    color: #fff; 
    font-size: 1.4rem; 
    margin-bottom: 1rem; 
    font-weight: 600; 
}
.card-desc { 
    color: rgba(205, 214, 244, 0.7); 
    font-size: 0.95rem; 
    line-height: 1.6; 
}

/* 探照灯流光效果保持不变 */
.nav-card::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0; transition: opacity 0.3s; z-index: 1; pointer-events: none;
}
.nav-card:hover::before { opacity: 1; }

/* ================= 响应式兼容 ================= */
@media (max-width: 1200px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 900px;
    }
    .nav-card {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
    }
}
