/* === 全局变量 === */
:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #c0392b;
    /* 血色红 */
    --secondary-color: #2c3e50;
    --font-mono: 'Courier New', Courier, monospace;
    --font-serif: 'Georgia', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: crosshair;
    /* 准星光标 */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    overflow-x: hidden;
    line-height: 1.6;
}


/* 手电筒光标 (更大范围版本) */
#spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
    /* 初始状态透明，用户可以看到完整网站 */
    z-index: 9999;
    transition: background 1.5s ease-out;
    /* 增加过渡时间，让聚焦效果更明显 */
}

/* 手电筒聚焦效果的类 */
#spotlight.focused {
    background: radial-gradient(circle at 50% 35%, transparent 250px, rgba(0, 0, 0, 0.95) 600px);
}

/* === 优化 2：交互反馈 - 伪加载模态框 === */
#loading-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    font-family: var(--font-mono);
    color: #00ff41;
    /* 绿色终端文字 */
    text-align: left;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.5s;
}

.terminal-content {
    background: #000;
    border: 1px solid #00ff41;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
}

.terminal-content p {
    white-space: pre-wrap;
    margin-bottom: 0.5rem;
    height: 5em;
    /* 预留动画空间 */
    overflow: hidden;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: #00ff41;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        background-color: transparent;
    }
}

/* === 基础布局和组件样式 === */
nav {
    display: flex;
    justify-content: space-between;
    padding: 2rem 5%;
    border-bottom: 1px solid #333;
    position: relative;
    z-index: 10;
}

/* === Logo 样式 (放大镜版) === */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--accent-color);
    text-decoration: none;
}

.magnifier-icon {
    width: 30px;
    height: 30px;
    position: relative;
    flex-shrink: 0;
}

.glass {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s;
}

.logo:hover .glass {
    border-color: var(--accent-color);
}

.glass::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 2px;
    background: var(--accent-color);
    top: 50%;
    left: -50%;
    transform: rotate(-45deg);
    animation: scan-glass 3s infinite linear;
    box-shadow: 0 0 5px var(--accent-color);
    opacity: 0.7;
}

.handle {
    width: 3px;
    height: 12px;
    background: var(--text-color);
    position: absolute;
    bottom: 2px;
    right: 6px;
    transform: rotate(-45deg);
    border-radius: 2px;
    transition: background-color 0.3s;
}

.logo:hover .handle {
    background-color: var(--accent-color);
}

.handle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: var(--accent-color);
}

@keyframes scan-glass {
    0% {
        transform: translateY(-20px) rotate(-45deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(20px) rotate(-45deg);
        opacity: 0;
    }
}

.nav-links a {
    color: #666;
    text-decoration: none;
    margin-left: 2rem;
    font-family: var(--font-mono);
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
}

header {
    height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    letter-spacing: 5px;
    animation: glitch 3s infinite;
}

.subtitle {
    font-family: var(--font-mono);
    color: var(--accent-color);
    background: rgba(192, 57, 43, 0.1);
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-color);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin: 4rem 0 2rem;
    font-family: var(--font-mono);
    color: #555;
    border-top: 1px solid #333;
    padding-top: 2rem;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    padding: 0 5%;
}

.filter-btn {
    background: transparent;
    border: 1px solid #444;
    color: #666;
    padding: 0.5rem 1.5rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--accent-color);
    color: var(--text-color);
    box-shadow: 0 0 10px rgba(192, 57, 43, 0.2);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 0 10%;
    margin-bottom: 4rem;
    min-height: 500px;
}

.case-file {
    background: #111;
    border: 1px solid #333;
    padding: 2rem;
    position: relative;
    transition: 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease forwards;
    max-width: 420px;
    /* 限制最大宽度，更精致 */
    margin: 0 auto;
    /* 单个卡片时居中显示 */
    min-height: 520px;
    /* 最小卡片高度，随内容自适应 */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.case-file:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    background: #151515;
}

.case-file::before {
    content: "TOP SECRET";
    position: absolute;
    top: 10px;
    right: -10px;
    background: var(--accent-color);
    color: black;
    font-size: 0.7rem;
    padding: 2px 20px;
    transform: rotate(45deg);
    font-family: var(--font-mono);
    opacity: 0.7;
    z-index: 2;
}

/* === 案发现场封面样式 === */
.case-cover {
    position: relative;
    margin: -2rem -2rem 1.5rem -2rem;
    /* 让图片填满卡片顶部 */
    height: 240px;
    /* 增加高度 (原180px) */
    overflow: hidden;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    /* 防止被压缩 */
}

.case-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%) contrast(1.2) brightness(0.8);
    /* 暗黑监控风格 */
    transition: 0.5s;
}

.case-file:hover .case-cover img {
    filter: grayscale(0%) contrast(1) brightness(1);
    /* 悬停时恢复彩色 */
    transform: scale(1.05);
}

.evidence-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff41;
    /* 终端绿 */
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 2px 6px;
    border: 1px solid #00ff41;
    letter-spacing: 1px;
}

.case-header {
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.case-number {
    font-family: var(--font-mono);
    color: #444;
    font-size: 0.8rem;
}

.case-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 2;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 2px;
    font-weight: bold;
    font-family: var(--font-mono);
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

.tag-hardcore {
    background: #c0392b;
    color: #fff;
}

.tag-tech {
    background: #2980b9;
    color: #fff;
}

.tag-horror {
    background: #27ae60;
    color: #fff;
}

.tag-realistic {
    background: #7f8c8d;
    color: #fff;
}

.tag-psych {
    background: #8e44ad;
    color: #fff;
}

.tag-interactive {
    background: #d35400;
    color: #fff;
}

.case-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.case-desc {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* 文本溢出处理 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* 最多显示3行 */
    -webkit-box-orient: vertical;
    line-height: 1.6;
    max-height: calc(0.9rem * 1.6 * 3);
    overflow: hidden;
    text-overflow: ellipsis;
}

.censor-bar {
    background: black;
    color: black;
    transition: 0.3s;
    padding: 0 5px;
    cursor: help;
}

.case-file:hover .censor-bar {
    background: transparent;
    color: var(--accent-color);
    text-decoration: underline;
}

.meta-info {
    font-size: 0.75rem;
    color: #666;
    font-family: var(--font-mono);
    margin-bottom: 1.5rem;
}

.btn-investigate {
    display: block;
    padding: 0.8rem;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.8rem;
    text-align: center;
    transition: 0.3s;
    margin-top: auto;
    /* 强制推到底部 */
}

.btn-investigate:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: black;
}

.btn-investigate.disabled {
    border-color: #444;
    color: #666;
    cursor: not-allowed;
    background: transparent;
}

.btn-investigate.disabled:hover {
    background: transparent;
    border-color: #444;
    color: #666;
}

.about-section {
    background: #0f0f0f;
    padding: 4rem 10%;
    border-top: 1px solid #333;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.about-text {
    flex: 1;
    min-width: 300px;
    padding-right: 2rem;
}

.about-visual {
    flex: 1;
    min-width: 300px;
    height: 300px;
    background: repeating-linear-gradient(45deg, #111, #111 10px, #1a1a1a 10px, #1a1a1a 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #333;
}

.stamp {
    border: 3px solid var(--accent-color);
    color: var(--accent-color);
    padding: 1rem;
    font-size: 2rem;
    font-weight: bold;
    transform: rotate(-15deg);
    opacity: 0.8;
    font-family: var(--font-mono);
}

footer {
    text-align: center;
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #444;
    border-top: 1px solid #222;
}

@keyframes glitch {
    0% {
        text-shadow: 2px 2px 0px var(--accent-color), -2px -2px 0px blue;
    }

    90% {
        text-shadow: 2px 2px 0px var(--accent-color), -2px -2px 0px blue;
    }

    95% {
        text-shadow: -2px 2px 0px var(--accent-color), 2px -2px 0px blue;
        transform: translate(2px, 1px);
    }

    100% {
        text-shadow: 2px -2px 0px var(--accent-color), -2px 2px 0px blue;
        transform: translate(0, 0);
    }
}

/* === 优化 4：移动端适配方案 === */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .game-grid {
        padding: 0 5%;
    }

    .about-section {
        padding: 2rem 5%;
    }

    /* 1. 禁用手电筒，改为夜视仪模式 */
    #spotlight {
        display: none;
    }

    body {
        cursor: default;
        /* 恢复默认光标 */
        background: #111;
        /* 手机上稍微亮一点 */
    }

    /* 2. 涂抹文字在手机上默认可见，无需 hover */
    .censor-bar {
        background: transparent;
        color: var(--accent-color);
        text-decoration: underline;
    }
}
