﻿/* ================= 基础设置 ================= */
@charset "UTF-8";
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #050505;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: background-color 0.8s ease;
}

.hidden {
    display: none !important;
}

/* ================= 界面 1：黑客暗黑登录 ================= */
#login-container {
    width: 90%;
    max-width: 800px;
    z-index: 3;
    position: relative;
    font-family: 'Courier New', Courier, monospace;
}

    #login-container::before {
        content: " ";
        display: block;
        position: absolute;
        top: -50px;
        left: -50px;
        right: -50px;
        bottom: -50px;
        background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
        z-index: -1;
        background-size: 100% 2px, 3px 100%;
        pointer-events: none;
    }

.terminal {
    border: 1px solid #003300;
    background-color: rgba(0, 20, 0, 0.8);
    padding: 30px 20px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.logo-container {
    width: 130px;
    height: 130px;
    margin-bottom: 20px;
    animation: float-logo 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(0, 255, 65, 0.6));
}

    .logo-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

@keyframes float-logo {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.typewriter {
    color: #00ff41;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    min-height: 60px;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.btn {
    background-color: transparent;
    color: #00ff41;
    border: 1px solid #00ff41;
    padding: 12px 30px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    display: block;
    margin: 20px auto 0;
}

    .btn:hover {
        background-color: #00ff41;
        color: #000;
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
    }

.input-box {
    background-color: transparent;
    border: none;
    border-bottom: 2px solid #00ff41;
    color: #00ff41;
    font-size: 1.2rem;
    padding: 5px 10px;
    outline: none;
    text-align: center;
    display: block;
    margin: 20px auto 0;
    width: 85%;
    letter-spacing: 2px;
}

    .input-box::placeholder {
        color: #005500;
        font-size: 1rem;
    }

.warn-text {
    color: #ff0000;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 15px;
    text-shadow: 0 0 8px #ff0000;
    animation: text-flash 1s infinite;
    text-align: center;
}

@keyframes text-flash {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

.error-shake {
    animation: shake 0.3s;
    color: #ff0000 !important;
    border-color: #ff0000 !important;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.visitor-link {
    position: absolute;
    bottom: 20px;
    font-size: 0.85rem;
    color: #008800;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

    .visitor-link:hover {
        color: #00ff41;
        text-decoration: underline;
    }

/* ================= 专属过渡动画 ================= */
#light-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, #ffffff 0%, #e0f2fe 100%);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.door-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ================= 界面 2：3D 环形主控台 ================= */
#dashboard-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f4f6f9;
    color: #333;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease;
    overflow: hidden;
    position: relative;
    overscroll-behavior-y: contain;
}

.dashboard-active {
    opacity: 1 !important;
}

.dash-header {
    padding: 30px 40px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    background-color: #fff;
    display: none;
}

.user-text {
    pointer-events: auto;
}

    .user-text h2 {
        font-size: 1.8rem;
        color: #1a1a1a;
        font-weight: 600;
        letter-spacing: 1px;
    }

    .user-text p {
        font-size: 0.9rem;
        color: #888;
        margin-top: 5px;
    }

.settings-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: transform 0.3s, box-shadow 0.3s;
    color: #666;
}

    .settings-btn:hover {
        transform: rotate(90deg) scale(1.1);
        color: #00ff41;
        box-shadow: 0 6px 20px rgba(0,255,65,0.2);
    }

.logout-btn-floating {
    position: absolute;
    bottom: 30px;
    right: 40px;
    background: transparent;
    color: #888;
    border: 1px solid #ccc;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1000;
}

    .logout-btn-floating:hover {
        background: #ff4d4d;
        color: #fff;
        border-color: #ff4d4d;
    }

.diary-entry {
    position: absolute;
    bottom: 30px;
    left: 40px;
    width: 65px;
    height: 65px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s;
}

    .diary-entry:hover {
        transform: scale(1.15) rotate(-5deg);
    }

    .diary-entry img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
    }

    /* 删掉原来的 .diary-entry::after { ... } */

    /* 👇 新增的样式，让文字悬浮在上方 */
    .diary-entry .diary-text {
        position: absolute;
        top: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: #888;
        white-space: nowrap;
        opacity: 0;
        transition: opacity 0.3s;
        font-weight: bold;
        pointer-events: none;
    }

    .diary-entry:hover .diary-text {
        opacity: 1;
    }

    .diary-entry:hover::after {
        opacity: 1;
    }

/* 3D 轮播组件 */
.scene {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    touch-action: pan-y;
    position: relative;
}

.carousel-track {
    position: relative;
    width: 260px;
    height: 440px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    user-select: none;
    transform-style: preserve-3d;
}

.card-inner {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05), 0 15px 35px rgba(0,0,0,0.1), 0 30px 60px rgba(0,0,0,0.05);
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    transform: translateZ(40px);
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1));
}

.card-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 10px;
    transform: translateZ(25px);
}

.card-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    flex: 1;
    transform: translateZ(15px);
}

.locked-card .card-inner {
    background: #f0f0f0;
    transform-style: flat !important;
}

.locked-card .card-icon, .locked-card .card-title, .locked-card .card-desc {
    transform: translateZ(0px) !important;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #999;
    transform: translateZ(0px);
    z-index: 10;
}

    .lock-overlay i {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: #666;
    z-index: 100;
    transition: all 0.3s;
}

    .nav-arrow:hover {
        background: #00ff41;
        color: #fff;
    }

.arrow-left {
    left: 10%;
}

.arrow-right {
    right: 10%;
}

/* ================= 训练营 ================= */
.training-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 10, 20, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    perspective: 1000px;
}

    .training-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

.training-container {
    width: 90%;
    max-width: 600px;
    background: rgba(10, 20, 35, 0.9);
    border: 1px solid #00ff41;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.2), inset 0 0 30px rgba(0, 255, 65, 0.05);
    display: flex;
    flex-direction: column;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transform: rotateX(10deg) scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.training-modal.active .training-container {
    transform: rotateX(0deg) scale(1);
}

.training-header {
    text-align: center;
    color: #00ff41;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.rule-btn {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: rgba(0, 255, 65, 0.2);
    border: 1px solid #00ff41;
    color: #00ff41;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

    .rule-btn:hover {
        background: #00ff41;
        color: #000;
    }

.training-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
}

    .training-close-btn:hover {
        background: #00ff41;
        color: #000;
        transform: rotate(90deg);
    }

.game-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-item {
    background: rgba(0, 20, 10, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

    .game-item:hover {
        background: rgba(0, 30, 15, 0.9);
        border-color: #00ff41;
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
    }

    .game-item.locked {
        opacity: 0.5;
        cursor: not-allowed;
    }

.game-icon {
    font-size: 2.5rem;
}

.game-info h3 {
    color: #fff;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.game-info p {
    color: #999;
    font-size: 0.85rem;
}

.whack-game-area {
    display: none;
    flex-direction: column;
    align-items: center;
}

.game-hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 8px;
}

.hud-score {
    color: #00ff41;
    font-weight: bold;
}

.hud-time {
    color: #ff9900;
    font-weight: bold;
}

.grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 350px;
    margin-bottom: 20px;
}

.hole {
    background: #111;
    border: 1px solid #333;
    border-radius: 50%;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    cursor: pointer;
    user-select: none;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.8);
    transition: background 0.1s;
}

    .hole:active {
        background: #222;
    }

    .hole.mole {
        background: #001100;
        border-color: #00ff41;
        box-shadow: 0 0 20px rgba(0,255,65,0.5);
    }

    .hole.special {
        background: #1a001a;
        border-color: #ff4d4d;
        box-shadow: 0 0 20px rgba(255,77,77,0.5);
    }

.game-start-btn {
    background: #00ff41;
    color: #000;
    border: none;
    padding: 10px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: 'Courier New', Courier, monospace;
}

    .game-start-btn:hover {
        transform: scale(1.05);
    }

/* ================= 人事部 ================= */
.hr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 10, 20, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    perspective: 1000px;
}

    .hr-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

.hr-container {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: rgba(10, 20, 35, 0.8);
    border: 1px solid #00ff41;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.1), inset 0 0 30px rgba(0, 255, 65, 0.05);
    display: flex;
    flex-direction: column;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transform: rotateX(10deg) scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hr-modal.active .hr-container {
    transform: rotateX(0deg) scale(1);
}

.hr-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 255, 65, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 65, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    pointer-events: none;
}

.hr-header {
    text-align: center;
    color: #00ff41;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 20px;
    z-index: 1;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.hr-scroll-area {
    flex: 1;
    overflow-y: auto;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 20px;
    scrollbar-width: none;
}

    .hr-scroll-area::-webkit-scrollbar {
        display: none;
    }

.staff-card {
    background: rgba(0, 20, 10, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

    .staff-card:hover {
        background: rgba(0, 30, 15, 0.8);
        border-color: #00ff41;
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
    }

.staff-avatar {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    flex-shrink: 0;
    background: #000;
    border: 2px solid #00ff41;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0, 255, 65, 0.3);
}

    .staff-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.staff-info {
    flex: 1;
    color: #ccc;
    font-family: 'Courier New', Courier, monospace;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.staff-name {
    font-size: 1.3rem;
    color: #fff;
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-id-tag {
    font-size: 0.65rem;
    background: #00ff41;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.staff-title {
    font-size: 0.85rem;
    color: #ff9900;
    margin-bottom: 10px;
    font-weight: bold;
}

.info-scroll-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.staff-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #999;
    word-break: break-word;
}

.title-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.title-tag {
    font-size: 0.75rem;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid rgba(0, 255, 65, 0.3);
    color: #00ff41;
    padding: 3px 8px;
    border-radius: 12px;
}

.staff-card.hs-card {
    border-color: #ff4d4d;
}

    .staff-card.hs-card .staff-name {
        color: #ff4d4d;
    }

    .staff-card.hs-card .staff-avatar {
        border-color: #ff4d4d;
        box-shadow: inset 0 0 15px rgba(255, 77, 77, 0.3);
    }

    .staff-card.hs-card .title-tag {
        background: rgba(255, 77, 77, 0.1);
        border-color: rgba(255, 77, 77, 0.3);
        color: #ff9999;
    }

.folder-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.2s, filter 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

    .folder-icon:hover {
        transform: scale(1.2) rotate(5deg);
        filter: drop-shadow(0 0 10px #00ff41);
    }

.hr-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
}

    .hr-close-btn:hover {
        background: #00ff41;
        color: #000;
        transform: rotate(90deg);
    }

/* ================= 自定义提示弹窗 ================= */
.custom-alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 3500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

    .custom-alert-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

.custom-alert-box {
    background: #111;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-alert-modal.active .custom-alert-box {
    transform: scale(1);
}

.alert-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    font-family: 'Courier New', Courier, monospace;
}

.alert-msg {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 25px;
    font-family: 'Courier New', Courier, monospace;
}

.alert-btn {
    background: transparent;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 25px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
}

    .alert-btn:hover {
        background: #fff;
        color: #000;
    }

.alert-hs .custom-alert-box {
    border-color: #ff4d4d;
    box-shadow: 0 0 30px rgba(255, 77, 77, 0.3);
}

.alert-hs .alert-title {
    color: #ff4d4d;
    text-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
    animation: text-flash 1s infinite;
}

.alert-hs .alert-btn {
    border-color: #ff4d4d;
    color: #ff4d4d;
}

    .alert-hs .alert-btn:hover {
        background: #ff4d4d;
        color: #000;
    }

.alert-error .custom-alert-box {
    border-color: #00ff41;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
    background: #050505;
}

.alert-error .alert-title {
    color: #00ff41;
    font-family: 'Courier New', Courier, monospace;
}

.alert-error .alert-msg {
    color: #00ff41;
    text-align: left;
}

.alert-error .alert-btn {
    border-color: #00ff41;
    color: #00ff41;
}

    .alert-error .alert-btn:hover {
        background: #00ff41;
        color: #000;
    }

/* ================= 团团专属相册 ================= */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

    .gallery-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

.gallery-header {
    padding: 20px;
    text-align: center;
    color: #d4af37;
    font-size: 1.2rem;
    font-family: 'Courier New', Courier, monospace;
    border-bottom: 1px dashed #333;
}

.gallery-scroll {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    scrollbar-width: none;
}

    .gallery-scroll::-webkit-scrollbar {
        display: none;
    }

.gallery-item {
    flex: 0 0 90vw;
    max-width: 600px;
    height: 60vh;
    scroll-snap-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

    .gallery-item img, .gallery-item video {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        transition: opacity 0.3s ease;
    }

.gallery-loading {
    position: absolute;
    color: #666;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    letter-spacing: 2px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.gallery-empty {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #050505;
    border: 1px solid #222;
    border-radius: 10px;
    color: #555;
    font-family: 'Courier New', Courier, monospace;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-text {
    font-size: 1rem;
    letter-spacing: 2px;
}

.gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: #fff;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    z-index: 3010;
    transition: transform 0.3s;
}

    .gallery-close:hover {
        transform: rotate(90deg);
        background: rgba(255,255,255,0.4);
    }

/* ================= 系统日志 ================= */
.book-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    perspective: 1500px;
}

    .book-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

.book-wrapper {
    position: relative;
    width: 320px;
    height: 460px;
    transform-style: preserve-3d;
    transform: rotateX(15deg) scale(0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.book-modal.active .book-wrapper {
    transform: rotateX(0deg) scale(1);
}

.book-wrapper.opened {
    cursor: default;
}

.book-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fdfaf6;
    border-radius: 4px 12px 12px 4px;
    box-shadow: inset 25px 0 30px rgba(0,0,0,0.05), inset -5px 0 15px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    border: 1px solid #e0dcd3;
    overflow: hidden;
}

.page-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #555;
    text-align: center;
    padding: 20px 0 10px;
    margin-left: 15px;
}

.pages-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    margin-left: 15px;
}

.pages-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chat-page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 15px 10px 10px;
}

.chat-date {
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    margin: 15px 0;
    font-weight: bold;
    position: relative;
}

    .chat-date::before, .chat-date::after {
        content: '';
        position: absolute;
        top: 50%;
        width: 20%;
        height: 1px;
        background: #e0e0e0;
    }

    .chat-date::before {
        left: 10%;
    }

    .chat-date::after {
        right: 10%;
    }

.chat-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 5px;
    mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
}

    .chat-list::-webkit-scrollbar {
        width: 4px;
    }

    .chat-list::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 4px;
    }

.chat-system-msg {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    margin: 10px 0;
    width: 100%;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

    .chat-message.chat-left {
        flex-direction: row;
    }

    .chat-message.chat-right {
        flex-direction: row-reverse;
    }

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 1.5rem;
}

.chat-message.chat-right .chat-avatar {
    border-color: #00ff41;
    background-color: #001100;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-all;
    display: flex;
    flex-direction: column;
}

.chat-left .chat-bubble {
    background: #f0f2f5;
    color: #333;
    border-top-left-radius: 2px;
}

.chat-right .chat-bubble {
    background: #00ff41;
    color: #000;
    border-top-right-radius: 2px;
    font-weight: 500;
}

.quote-box {
    background: rgba(0, 0, 0, 0.06);
    border-left: 3px solid #bbb;
    padding: 5px 8px;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 8px;
    border-radius: 4px;
    line-height: 1.4;
    word-break: break-all;
}

.chat-right .quote-box {
    background: rgba(0, 0, 0, 0.1);
    border-left-color: #009933;
    color: #444;
}

.chat-bubble.image-bubble {
    background: transparent !important;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

    .chat-bubble.image-bubble img {
        display: block;
        max-width: 100%;
        max-height: 160px;
        object-fit: contain;
        border-radius: 8px;
    }

.page-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px 20px 40px;
    font-size: 0.8rem;
    color: #888;
}

.page-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

    .page-btn:hover {
        color: #00ff41;
    }

    .page-btn:disabled {
        color: #ddd;
        cursor: not-allowed;
    }

.book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border-radius: 4px 12px 12px 4px;
    border: 2px solid #111;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.4);
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backface-visibility: hidden;
}

    .book-cover::before {
        content: '';
        position: absolute;
        left: 8px;
        top: 0;
        width: 2px;
        height: 100%;
        background: rgba(255,255,255,0.1);
    }

.book-title {
    color: #d4af37;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 5px;
    font-family: 'Courier New', Courier, monospace;
}

.book-subtitle {
    color: #666;
    font-size: 0.8rem;
    margin-top: 10px;
    letter-spacing: 2px;
}

.book-wrapper.opened .book-cover {
    transform: rotateY(-160deg);
    box-shadow: -5px 5px 20px rgba(0,0,0,0.2);
}

.close-book-hint {
    position: absolute;
    bottom: -40px;
    width: 100%;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* ================= 唱诗班 ================= */
.choir-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

    .choir-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

.choir-scroll {
    width: 90%;
    max-width: 400px;
    background: url('poetry_pic.webp') no-repeat center center;
    background-size: cover;
    border-radius: 10px;
    padding: 40px 20px 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: none;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 80vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.choir-modal.active .choir-scroll {
    transform: translateY(0);
}

.close-choir-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.2rem;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

    .close-choir-btn:hover {
        background: #fff;
        transform: rotate(90deg);
        color: #ff4d4d;
    }

.choir-pages-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.choir-pages-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.choir-page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
}

    .choir-page::-webkit-scrollbar {
        width: 4px;
    }

    .choir-page::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.1);
        border-radius: 4px;
    }

.choir-title {
    text-align: center;
    color: #d4af37;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.8);
    flex-shrink: 0;
}

.choir-content {
    flex: 1;
    color: #333;
    font-family: 'Courier New', Courier, monospace;
    line-height: 2.2;
    font-size: 1.05rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.choir-line {
    transition: color 0.3s, transform 0.3s, font-weight 0.3s;
}

    .choir-line.active {
        color: #e74c3c;
        font-weight: bold;
        transform: scale(1.05);
    }

.music-player {
    width: 100%;
    border-radius: 20px;
    background: #eee;
    outline: none;
    display: block;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.choir-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10px 0;
    font-size: 0.85rem;
    color: #555;
    flex-shrink: 0;
    border-top: 1px dashed rgba(0,0,0,0.1);
    margin-top: 10px;
}

.choir-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #555;
    cursor: pointer;
    transition: color 0.2s;
}

    .choir-btn:hover {
        color: #d4af37;
    }

    .choir-btn:disabled {
        color: rgba(0,0,0,0.1);
        cursor: not-allowed;
    }

/* ================= 遗失的日记 ================= */
.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #faf8f5;
    z-index: 3000;
    display: none;
    overflow-y: auto;
    scroll-behavior: smooth;
    opacity: 0;
    transition: opacity 0.5s;
}

    .story-modal.active {
        display: block;
        opacity: 1;
    }

.close-story {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 3010;
    font-size: 2rem;
    color: #333;
    background: rgba(255,255,255,0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s;
    backdrop-filter: blur(5px);
}

    .close-story:hover {
        transform: rotate(90deg);
        background: #fff;
    }

.story-scroll-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 50px 20px 80px;
}

.story-header-visual {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 40px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .story-header-visual img {
        width: 100%;
        height: auto;
        object-fit: contain;
        filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
    }

.stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border: 4px double #e74c3c;
    color: #e74c3c;
    font-size: 2.2rem;
    font-weight: 900;
    font-family: 'Courier New', Courier, monospace;
    padding: 8px 20px;
    border-radius: 6px;
    opacity: 0.9;
    pointer-events: none;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.6);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4), inset 0 0 10px rgba(231, 76, 60, 0.2);
}

.story-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    margin-bottom: 20px;
}

    .story-section.visible {
        opacity: 1;
        transform: translateY(0);
    }

.paper-card {
    background: url('diary_pic.webp') no-repeat center center;
    background-size: 100% 100%;
    width: 100%;
    max-width: 440px;
    aspect-ratio: 3 / 4;
    padding: 60px 40px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border-radius: 4px;
}

.chapter-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    color: #333;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.story-text p {
    font-size: 1.05rem;
    line-height: 2;
    color: #2c2c2c;
    margin-bottom: 12px;
    font-weight: 500;
}

.highlight-text {
    font-weight: bold;
    color: #005500;
}

/* ================= 飞书动画 & 全局 Toast ================= */
#book-animation-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 4000;
    pointer-events: none;
    display: none;
}

    #book-animation-layer.active {
        display: block;
    }

#fly-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
    width: 320px;
    height: 420px;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

    #fly-wrapper.flying {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }

#fly-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
    transition: opacity 0.2s ease;
}

#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1rem;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    backdrop-filter: blur(5px);
    max-width: 85vw;
    line-height: 1.5;
    word-break: break-word;
}

    #toast.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

/* ================= 响应式适配 (手机端) ================= */
@media (max-width: 768px) {
    .nav-arrow {
        display: none;
    }

    .dash-header {
        padding: 20px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
    }

    .user-avatar {
        width: 50px;
        height: 50px;
    }

    .user-text h2 {
        font-size: 1.3rem;
    }

    .user-text p {
        font-size: 0.8rem;
    }

    .settings-btn {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .logout-btn-floating {
        bottom: 20px;
        right: 20px;
    }

    .diary-entry {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
    }

        .diary-entry::after {
            display: none;
        }

    .carousel-track {
        width: 220px;
        height: 310px;
    }

    .card-inner {
        padding: 15px 18px;
    }

    .card-title {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .card-icon {
        font-size: 2rem;
        margin-bottom: 12px;
    }

    .card-desc {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .book-wrapper {
        width: 280px;
        height: 420px;
    }

    .book-title {
        font-size: 1.5rem;
    }

    .hr-container {
        padding: 15px 10px;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }

    .hr-header {
        font-size: 1.1rem;
        margin-bottom: 10px;
        flex-shrink: 0;
    }

    .hr-scroll-area {
        flex: 1;
        overflow-y: auto;
        padding: 5px 5px 20px 5px;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .staff-card {
        flex-direction: row;
        align-items: center;
        text-align: left;
        height: 130px;
        padding: 10px 30px 10px 10px;
        gap: 12px;
    }

    .staff-avatar {
        width: 55px;
        height: 55px;
        font-size: 1.8rem;
        margin-top: 0;
        flex-shrink: 0;
    }

    .staff-info {
        flex: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .staff-name {
        justify-content: flex-start;
        font-size: 1.1rem;
        margin-bottom: 2px;
        flex-shrink: 0;
    }

    .staff-title {
        font-size: 0.75rem;
        margin-bottom: 5px;
        flex-shrink: 0;
    }

    .info-scroll-area {
        flex: 1;
        overflow-y: auto;
        padding-right: 3px;
        -webkit-overflow-scrolling: touch;
    }

        .info-scroll-area::-webkit-scrollbar {
            display: none;
        }

    .staff-desc {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 5px;
    }

    .title-tags {
        justify-content: flex-start;
        gap: 5px;
        margin-top: 0;
    }

    .title-tag {
        font-size: 0.65rem;
        padding: 2px 5px;
    }

    .folder-icon {
        top: 10px;
        right: 10px;
        font-size: 1rem;
        background: rgba(0, 255, 65, 0.1);
        border-radius: 50%;
        padding: 4px;
        width: 26px;
        height: 26px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hr-close-btn {
        width: 32px;
        height: 32px;
        line-height: 28px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
    }

    .chat-avatar {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .chat-bubble {
        max-width: 75%;
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .training-container {
        padding: 20px 15px;
    }

    .training-header {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .rule-btn {
        right: 45px;
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }

    .training-close-btn {
        width: 32px;
        height: 32px;
        line-height: 28px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
    }

    .game-item {
        padding: 15px;
        gap: 15px;
    }

    .game-icon {
        font-size: 2rem;
    }

    .game-info h3 {
        font-size: 1rem;
    }

    .game-info p {
        font-size: 0.75rem;
    }

    .grid-3x3 {
        gap: 10px;
        max-width: 280px;
    }

    .hole {
        font-size: 2.5rem;
    }

    .game-hud {
        font-size: 1rem;
        padding: 10px;
    }

    .choir-scroll {
        padding: 35px 15px 25px;
        height: 75vh;
    }

    .choir-content {
        font-size: 0.95rem;
    }

    .close-choir-btn {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        line-height: 28px;
        font-size: 1rem;
    }

    .story-header-visual {
        max-width: 200px;
        margin-bottom: 30px;
    }

    .stamp {
        font-size: 1.6rem;
        padding: 6px 15px;
        border-width: 3px;
    }

    .paper-card {
        max-width: 90vw;
        aspect-ratio: auto;
        min-height: 480px;
        padding: 50px 25px;
    }

    .story-text p {
        font-size: 1rem;
        line-height: 1.8;
    }

    .close-story {
        top: 15px;
        right: 15px;
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
        line-height: 30px;
    }

    #fly-wrapper {
        width: 280px;
        height: 380px;
    }

        #fly-wrapper.flying {
            transform: translate(-50%, -50%) scale(1);
        }
}
/* ================= 记忆重组（翻牌）游戏 ================= */
.memory-game-area {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.memory-grid-4x4 {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 👈 4 列 → 6 列 */
    gap: 8px;
    width: 100%;
    max-width: 460px; /* 👈 放宽一点，给 6 列空间 */
    margin-bottom: 20px;
}

.memory-card {
    aspect-ratio: 1;
    perspective: 800px;
    cursor: pointer;
    user-select: none;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    font-size: 1.4rem;
    overflow: hidden;
}

.memory-card-front {
    background: linear-gradient(135deg, #001100, #003300);
    border: 1px solid #00ff41;
    color: #00ff41;
    box-shadow: inset 0 0 15px rgba(0, 255, 65, 0.2);
}

    .memory-card-front::after {
        content: "?";
        font-family: 'Courier New', Courier, monospace;
        font-weight: bold;
        font-size: 1.1rem;
        text-shadow: 0 0 10px rgba(0, 255, 65, 0.6);
    }

.memory-card-back {
    background: #0a0a0a;
    border: 1px solid #333;
    color: #fff;
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-back {
    background: linear-gradient(135deg, #001a00, #003300);
    border-color: #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.memory-card.matched {
    cursor: default;
    animation: memory-match-pop 0.4s ease;
}

@keyframes memory-match-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .memory-grid-4x4 {
        gap: 5px;
        max-width: 96vw;
    }

    .memory-card-front::after {
        font-size: 0.95rem;
    }

    .memory-card-back {
        font-size: 1.1rem;
    }

        .memory-card-back img {
            width: 94%;
            height: 94%;
            border-radius: 4px;
        }

    .memory-game-area .game-hud {
        font-size: 0.85rem;
        padding: 8px 6px;
        gap: 8px;
    }
}
/* ================= 记忆重组 - 图片卡片 ================= */
.memory-card-back img {
    width: 92%;
    height: 92%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.memory-card.matched .memory-card-back img {
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.6);
}
/* ================= 记忆重组 - 模式选择 ================= */
.memory-mode-select {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 380px;
    margin-bottom: 20px;
}

.mode-card {
    background: rgba(0, 20, 10, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

    .mode-card:hover {
        background: rgba(0, 30, 15, 0.9);
        border-color: #00ff41;
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
        transform: translateX(5px);
    }

.mode-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.mode-info {
    flex: 1;
}

.mode-name {
    color: #00ff41;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 3px;
}

.mode-desc {
    color: #999;
    font-size: 0.8rem;
    line-height: 1.4;
}

.memory-game-play {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game-back-btn {
    background: transparent;
    border: 1px solid #555;
    color: #999;
    padding: 6px 18px;
    font-size: 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
}

    .game-back-btn:hover {
        border-color: #00ff41;
        color: #00ff41;
    }

@media (max-width: 768px) {
    .memory-mode-select {
        max-width: 320px;
        gap: 10px;
    }

    .mode-card {
        padding: 12px 15px;
    }

    .mode-icon {
        font-size: 1.6rem;
    }

    .mode-name {
        font-size: 0.9rem;
    }

    .mode-desc {
        font-size: 0.75rem;
    }
}
/* ================= 记忆重组 - 交换提示 ================= */
.memory-card.swap-hint .memory-card-back {
    border: 2px solid #ff9900 !important;
    background: linear-gradient(135deg, #1a1000, #332200) !important;
    animation: swap-hint-pulse 0.4s ease infinite;
}

@keyframes swap-hint-pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 153, 0, 0.6), inset 0 0 10px rgba(255, 153, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 35px rgba(255, 153, 0, 1), inset 0 0 20px rgba(255, 153, 0, 0.6);
    }
}
/* ================= 安保部 ================= */
.security-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 10, 20, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    perspective: 1000px;
}

    .security-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

.security-container {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: rgba(10, 20, 35, 0.85);
    border: 1px solid #00ff41;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.1), inset 0 0 30px rgba(0, 255, 65, 0.05);
    display: flex;
    flex-direction: column;
    padding: 25px 20px 20px;
    position: relative;
    overflow: hidden;
    transform: rotateX(10deg) scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.security-modal.active .security-container {
    transform: rotateX(0deg) scale(1);
}

.security-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(0, 255, 65, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 65, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    pointer-events: none;
}

.security-header {
    text-align: center;
    color: #00ff41;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 15px;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    z-index: 1;
    flex-shrink: 0;
}

.security-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
}

    .security-close-btn:hover {
        background: #00ff41;
        color: #000;
        transform: rotate(90deg);
    }

/* Tab 切换 */
.security-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 15px;
    z-index: 1;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    padding-bottom: 10px;
}

.security-tab {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.3);
    color: #888;
    padding: 8px 6px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    position: relative;
}

    .security-tab:hover:not(.locked) {
        color: #00ff41;
        border-color: #00ff41;
    }

    .security-tab.active {
        background: rgba(0, 255, 65, 0.15);
        color: #00ff41;
        border-color: #00ff41;
        box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
    }

    .security-tab.locked {
        cursor: not-allowed;
        opacity: 0.5;
    }

        .security-tab.locked::after {
            content: " 🔒";
            font-size: 0.75rem;
        }

/* 内容区 */
.security-scroll-area {
    flex: 1;
    overflow-y: auto;
    z-index: 1;
    padding: 5px 5px 10px;
    scrollbar-width: thin;
    scrollbar-color: #00ff41 transparent;
}

    .security-scroll-area::-webkit-scrollbar {
        width: 5px;
    }

    .security-scroll-area::-webkit-scrollbar-thumb {
        background: rgba(0, 255, 65, 0.4);
        border-radius: 3px;
    }

.security-panel {
    display: none;
    animation: sec-fade-in 0.3s ease;
}

    .security-panel.active {
        display: block;
    }

@keyframes sec-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 员工档案 */
.sec-profile {
    display: flex;
    gap: 20px;
    background: rgba(0, 20, 10, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 10px;
    padding: 20px;
    align-items: flex-start;
}

.sec-photo {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    border: 2px solid #00ff41;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3), inset 0 0 20px rgba(0, 255, 65, 0.1);
    cursor: zoom-in;
}

    .sec-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.sec-info {
    flex: 1;
    min-width: 0;
    color: #ccc;
    font-family: 'Courier New', Courier, monospace;
}

.sec-name {
    font-size: 1.4rem;
    color: #fff;
    font-weight: bold;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sec-badge {
    font-size: 0.65rem;
    background: #00ff41;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 1px;
}

.sec-quote {
    font-size: 0.85rem;
    color: #ff9900;
    font-style: italic;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 2px solid #ff9900;
    line-height: 1.5;
}

.sec-desc {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.6;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.sec-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sec-field {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    line-height: 1.5;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(0, 255, 65, 0.15);
}

    .sec-field:last-child {
        border-bottom: none;
    }

.sec-field-label {
    color: #00ff41;
    min-width: 70px;
    flex-shrink: 0;
    font-weight: bold;
}

.sec-field-value {
    color: #ccc;
    flex: 1;
    word-break: break-word;
}

.sec-field.highlight .sec-field-value {
    color: #00ff41;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

/* 合格证验真 */
.sec-cert-box {
    background: rgba(0, 20, 10, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 10px;
    padding: 25px 20px;
    text-align: center;
}

.sec-cert-title {
    color: #00ff41;
    font-size: 1.05rem;
    font-weight: bold;
    margin-bottom: 8px;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
}

.sec-cert-sub {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.sec-cert-input-row {
    display: flex;
    gap: 8px;
    max-width: 360px;
    margin: 0 auto 20px;
}

.sec-cert-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.5);
    border-radius: 6px;
    color: #00ff41;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    outline: none;
    text-align: center;
    transition: all 0.2s;
}

    .sec-cert-input:focus {
        border-color: #00ff41;
        box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    }

    .sec-cert-input::placeholder {
        color: #005500;
        letter-spacing: 1px;
    }

.sec-cert-btn {
    background: #00ff41;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.2s;
}

    .sec-cert-btn:hover {
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
        transform: scale(1.03);
    }

.sec-cert-result {
    display: none;
    white-space: pre-line;
    text-align: left;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.7;
    font-family: 'Courier New', Courier, monospace;
    animation: sec-fade-in 0.3s ease;
}

    .sec-cert-result.success {
        display: block;
        background: rgba(0, 255, 65, 0.1);
        border: 1px solid #00ff41;
        color: #00ff41;
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
    }

    .sec-cert-result.fail {
        display: block;
        background: rgba(255, 77, 77, 0.08);
        border: 1px solid #ff4d4d;
        color: #ff9999;
        box-shadow: 0 0 20px rgba(255, 77, 77, 0.15);
    }

/* 任务日志时间轴 */
.sec-timeline {
    position: relative;
    padding-left: 30px;
}

    .sec-timeline::before {
        content: '';
        position: absolute;
        left: 12px;
        top: 10px;
        bottom: 10px;
        width: 2px;
        background: linear-gradient(to bottom, #00ff41, rgba(0, 255, 65, 0.1));
    }

.sec-log-item {
    position: relative;
    margin-bottom: 20px;
    background: rgba(0, 20, 10, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.2s;
}

    .sec-log-item:hover {
        border-color: rgba(0, 255, 65, 0.5);
        background: rgba(0, 30, 15, 0.7);
    }

    .sec-log-item::before {
        content: '';
        position: absolute;
        left: -24px;
        top: 16px;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #00ff41;
        border: 2px solid #050505;
        box-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    }

.sec-log-date {
    font-size: 0.75rem;
    color: #00ff41;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.sec-log-text {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
    font-family: 'Courier New', Courier, monospace;
}

.sec-log-icon {
    margin-right: 6px;
}

@media (max-width: 768px) {
    .security-container {
        padding: 15px 12px;
        max-height: 88vh;
    }

    .security-header {
        font-size: 1.05rem;
        letter-spacing: 2px;
        margin-bottom: 12px;
    }

    .security-close-btn {
        width: 32px;
        height: 32px;
        line-height: 28px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
    }

    .security-tab {
        font-size: 0.75rem;
        padding: 7px 4px;
        letter-spacing: 0;
    }

    .sec-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
        gap: 15px;
    }

    .sec-photo {
        width: 140px;
        height: 140px;
    }

    .sec-name {
        justify-content: center;
        font-size: 1.2rem;
    }

    .sec-quote {
        text-align: left;
    }

    .sec-field {
        text-align: left;
    }

    .sec-field-label {
        min-width: 60px;
        font-size: 0.8rem;
    }

    .sec-field-value {
        font-size: 0.8rem;
    }

    .sec-cert-input-row {
        flex-direction: column;
    }

    .sec-cert-btn {
        width: 100%;
    }

    .sec-timeline {
        padding-left: 25px;
    }

    .sec-log-item::before {
        left: -21px;
    }
}
/* ================= 安保部 - 缩略图 & 全屏看图 ================= */
.sec-gallery-label {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #00ff41;
    font-size: 0.8rem;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    padding-left: 4px;
}

.sec-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 4px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 65, 0.4) transparent;
}

    .sec-gallery::-webkit-scrollbar {
        height: 4px;
    }

    .sec-gallery::-webkit-scrollbar-thumb {
        background: rgba(0, 255, 65, 0.4);
        border-radius: 2px;
    }

.sec-thumb {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(0, 255, 65, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: zoom-in;
    transition: all 0.2s;
}

    .sec-thumb:hover {
        border-color: #00ff41;
        box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
        transform: translateY(-2px);
    }

    .sec-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* 全屏看图 */
.sec-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

    .sec-lightbox.active {
        opacity: 1;
        pointer-events: auto;
    }

.sec-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

    .sec-lightbox-content img {
        max-width: 90vw;
        max-height: 78vh;
        object-fit: contain;
        border-radius: 8px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
        display: block;
        transition: opacity 0.2s;
    }

.sec-lightbox-footer {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sec-lightbox-btn {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.2s;
}

    .sec-lightbox-btn:hover {
        background: #00ff41;
        color: #000;
    }

.sec-lightbox-counter {
    color: #00ff41;
    font-size: 0.85rem;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    min-width: 60px;
    text-align: center;
}

.sec-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    line-height: 40px;
    text-align: center;
    font-size: 1.8rem;
    color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

    .sec-lightbox-close:hover {
        background: #00ff41;
        color: #000;
        transform: rotate(90deg);
    }

/* 手机上全屏看图适配 */
@media (max-width: 768px) {
    .sec-lightbox-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        line-height: 32px;
        font-size: 1.4rem;
    }

    .sec-lightbox-content img {
        max-height: 72vh;
    }

    .sec-lightbox-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .sec-lightbox-counter {
        font-size: 0.75rem;
        min-width: 50px;
    }

    .sec-lightbox-footer {
        gap: 12px;
    }

    .sec-thumb {
        flex: 0 0 75px;
        width: 75px;
        height: 75px;
    }
}
/* ================= 后勤部 · 物资台账 ================= */
.logistics-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    perspective: 1800px;
}

    .logistics-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

/* 账本容器 */
.ledger-wrapper {
    position: relative;
    width: 90vw;
    max-width: 440px;
    height: 82vh;
    max-height: 620px;
    transform-style: preserve-3d;
    transform: rotateX(8deg) translateY(20px) scale(0.9);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logistics-modal.active .ledger-wrapper {
    transform: rotateX(0deg) translateY(0) scale(1);
}

/* 内页（纸张） */
.ledger-page {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient( to bottom, transparent 0, transparent 39px, rgba(120, 100, 70, 0.15) 39px, rgba(120, 100, 70, 0.15) 40px ), linear-gradient(135deg, #f5ecd8 0%, #ede1c6 100%);
    border-radius: 4px 14px 14px 4px;
    box-shadow: inset 20px 0 30px rgba(80, 60, 30, 0.08), inset -5px 0 15px rgba(80, 60, 30, 0.04), 5px 5px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    border: 1px solid #c9b896;
    overflow: hidden;
    perspective: 1200px; /* 👈 新增：3D 翻页透视 */
    z-index: 1;
}

    /* 装订线 */
    .ledger-page::before {
        content: '';
        position: absolute;
        left: 28px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: linear-gradient( to bottom, transparent 0%, rgba(180, 60, 60, 0.4) 15%, rgba(180, 60, 60, 0.4) 85%, transparent 100% );
        z-index: 2;
        pointer-events: none;
    }

    /* 装订孔 */
    .ledger-page::after {
        content: '';
        position: absolute;
        left: 15px;
        top: 0;
        bottom: 0;
        width: 10px;
        background-image: radial-gradient(circle, rgba(80, 60, 30, 0.5) 2px, transparent 2.5px), radial-gradient(circle, rgba(80, 60, 30, 0.5) 2px, transparent 2.5px), radial-gradient(circle, rgba(80, 60, 30, 0.5) 2px, transparent 2.5px);
        background-size: 10px 10px, 10px 10px, 10px 10px;
        background-position: 0 15%, 0 50%, 0 85%;
        background-repeat: no-repeat;
        z-index: 2;
        pointer-events: none;
    }

.ledger-page-header {
    padding: 22px 30px 10px 45px;
    flex-shrink: 0;
    position: relative;
}

.ledger-page-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: #3a2d1a;
    letter-spacing: 3px;
    font-family: 'Courier New', Courier, monospace;
    border-bottom: 2px solid #8b6f3f;
    padding-bottom: 8px;
    display: inline-block;
}

.ledger-page-sub {
    font-size: 0.7rem;
    color: #8b6f3f;
    margin-top: 6px;
    letter-spacing: 1px;
    font-family: 'Courier New', Courier, monospace;
}

/* 台账内容区 */
.ledger-page-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 30px 20px 45px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 111, 63, 0.4) transparent;
    position: relative;
    z-index: 1;
    backface-visibility: hidden; /* 👈 新增 */
    -webkit-backface-visibility: hidden; /* 👈 新增 */
}

    .ledger-page-body::-webkit-scrollbar {
        width: 4px;
    }

    .ledger-page-body::-webkit-scrollbar-thumb {
        background: rgba(139, 111, 63, 0.4);
        border-radius: 2px;
    }

/* 单条台账记录 */
.ledger-entry {
    padding: 14px 0;
    border-bottom: 1px dashed rgba(139, 111, 63, 0.35);
    font-family: 'Courier New', Courier, monospace;
    color: #3a2d1a;
    animation: ledger-entry-fade 0.5s ease backwards;
}

@keyframes ledger-entry-fade {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ledger-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    gap: 10px;
}

.ledger-entry-id {
    font-size: 0.8rem;
    color: #8b6f3f;
    font-weight: bold;
    letter-spacing: 1px;
}

.ledger-entry-date {
    font-size: 0.75rem;
    color: #6b5435;
    letter-spacing: 1px;
}

.ledger-entry-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: #2c2010;
    margin-bottom: 6px;
    line-height: 1.4;
}

.ledger-entry-row {
    display: flex;
    gap: 8px;
    font-size: 0.78rem;
    line-height: 1.6;
    margin-bottom: 3px;
}

.ledger-entry-label {
    color: #8b6f3f;
    min-width: 60px;
    flex-shrink: 0;
}

.ledger-entry-value {
    color: #4a3a20;
    flex: 1;
    word-break: break-word;
}

.ledger-entry-note {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(180, 140, 80, 0.08);
    border-left: 2px solid rgba(180, 140, 80, 0.5);
    font-size: 0.75rem;
    color: #5a4a30;
    line-height: 1.6;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

/* 空白页 / 彩蛋接口 */
.ledger-blank {
    padding: 20px 0;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    color: #a89878;
    font-size: 0.78rem;
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(139, 111, 63, 0.2);
}

.ledger-egg {
    padding: 20px 0 10px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.3s;
}

    .ledger-egg:hover {
        transform: scale(1.02);
    }

.ledger-egg-bookmark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #d4a24a, #b8852f);
    color: #fff;
    font-size: 0.85rem;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(139, 111, 63, 0.3);
    animation: ledger-egg-breathe 2.5s ease-in-out infinite;
    position: relative;
    margin-top: -8px;
}

@keyframes ledger-egg-breathe {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(139, 111, 63, 0.3);
    }

    50% {
        box-shadow: 0 4px 20px rgba(212, 162, 74, 0.6);
    }
}

.ledger-egg-content {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: rgba(212, 162, 74, 0.1);
    border: 1px dashed rgba(184, 133, 47, 0.5);
    border-radius: 8px;
    text-align: left;
    font-family: 'Courier New', Courier, monospace;
    animation: ledger-egg-unfold 0.4s ease;
}

@keyframes ledger-egg-unfold {
    from {
        opacity: 0;
        transform: scaleY(0.5);
        transform-origin: top;
    }

    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

.ledger-egg.expanded .ledger-egg-content {
    display: block;
}

.ledger-egg-title {
    color: #8b5a1a;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.ledger-egg-text {
    color: #5a4a30;
    font-size: 0.8rem;
    line-height: 1.7;
    margin-bottom: 8px;
}

.ledger-egg-eta {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(184, 133, 47, 0.2);
    border-radius: 10px;
    color: #8b5a1a;
    font-size: 0.72rem;
    letter-spacing: 1px;
}

/* 底部印章 */
.ledger-page-footer {
    padding: 8px 30px 18px 45px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    gap: 12px;
}

.ledger-stamp {
    display: inline-block;
    padding: 6px 14px;
    border: 2px solid rgba(180, 60, 60, 0.65);
    color: rgba(180, 60, 60, 0.75);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 4px;
    border-radius: 4px;
    transform: rotate(-8deg);
    text-shadow: 0 0 2px rgba(180, 60, 60, 0.3);
    opacity: 0.85;
}

/* 封面 */
.ledger-cover {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #2a1810 0%, #3d2418 50%, #2a1810 100%);
    border-radius: 4px 14px 14px 4px;
    border: 2px solid #1a0f08;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6), 5px 5px 25px rgba(0, 0, 0, 0.6);
    transform-origin: left center;
    transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backface-visibility: hidden;
    cursor: pointer;
    overflow: hidden;
}

    /* 封面烫金纹路 */
    .ledger-cover::before {
        content: '';
        position: absolute;
        inset: 15px;
        border: 1px solid rgba(212, 162, 74, 0.3);
        border-radius: 3px 10px 10px 3px;
        pointer-events: none;
    }

    .ledger-cover::after {
        content: '';
        position: absolute;
        inset: 20px;
        border: 1px solid rgba(212, 162, 74, 0.15);
        border-radius: 2px 8px 8px 2px;
        pointer-events: none;
    }

.ledger-cover-line {
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, transparent 0%, rgba(212, 162, 74, 0.3) 20%, rgba(212, 162, 74, 0.3) 80%, transparent 100%);
}

.ledger-cover-title {
    color: #d4a24a;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 12px;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 15px rgba(212, 162, 74, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-left: 12px;
    z-index: 1;
}

.ledger-cover-sub {
    color: rgba(212, 162, 74, 0.7);
    font-size: 0.85rem;
    letter-spacing: 8px;
    margin-top: 15px;
    margin-left: 8px;
    font-family: 'Courier New', Courier, monospace;
    z-index: 1;
}

.ledger-cover-seal {
    position: absolute;
    bottom: 45px;
    color: rgba(212, 162, 74, 0.5);
    font-size: 0.7rem;
    letter-spacing: 4px;
    font-family: 'Courier New', Courier, monospace;
    z-index: 1;
}

/* 翻开状态 */
.ledger-wrapper.opened .ledger-cover {
    transform: rotateY(-165deg);
    box-shadow: -8px 5px 20px rgba(0, 0, 0, 0.3);
}

.ledger-wrapper.opened .ledger-cover-title,
.ledger-wrapper.opened .ledger-cover-sub,
.ledger-wrapper.opened .ledger-cover-seal,
.ledger-wrapper.opened .ledger-cover-line {
    opacity: 0;
    transition: opacity 0.2s;
}

/* 提示 */
.ledger-hint {
    position: absolute;
    bottom: -35px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 20;
}

.ledger-wrapper.opened .ledger-hint {
    opacity: 0;
}

/* 关闭按钮 */
.ledger-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    line-height: 38px;
    text-align: center;
    font-size: 1.6rem;
    color: #d4a24a;
    background: rgba(42, 24, 16, 0.85);
    border: 1px solid rgba(212, 162, 74, 0.4);
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
}

    .ledger-close-btn:hover {
        background: #d4a24a;
        color: #2a1810;
        transform: rotate(90deg);
    }

@media (max-width: 768px) {
    .ledger-wrapper {
        width: 92vw;
        max-width: none;
        height: 80vh;
        max-height: 600px;
    }

    .ledger-page-header {
        padding: 18px 20px 8px 42px;
    }

    .ledger-page-title {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .ledger-page-sub {
        font-size: 0.65rem;
    }

    .ledger-page-body {
        padding: 8px 20px 15px 42px;
    }

    .ledger-entry {
        padding: 12px 0;
    }

    .ledger-entry-name {
        font-size: 0.88rem;
    }

    .ledger-entry-row {
        font-size: 0.72rem;
    }

    .ledger-entry-label {
        min-width: 52px;
    }

    .ledger-entry-note {
        font-size: 0.7rem;
        padding: 6px 8px;
    }

    .ledger-page-footer {
        padding: 5px 20px 15px 42px;
    }

    .ledger-stamp {
        font-size: 0.75rem;
        padding: 4px 10px;
        letter-spacing: 3px;
    }

    .ledger-cover-title {
        font-size: 1.6rem;
        letter-spacing: 8px;
    }

    .ledger-cover-sub {
        font-size: 0.75rem;
        letter-spacing: 6px;
    }

    .ledger-cover-seal {
        bottom: 35px;
        font-size: 0.6rem;
    }

    .ledger-close-btn {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        line-height: 32px;
        font-size: 1.3rem;
    }

    .ledger-hint {
        bottom: -30px;
        font-size: 0.72rem;
    }
}
/* ================= 后勤部 · 台账内照片 ================= */
.ledger-entry-photos {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 4px;
    margin-top: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 111, 63, 0.3) transparent;
}

    .ledger-entry-photos::-webkit-scrollbar {
        height: 3px;
    }

    .ledger-entry-photos::-webkit-scrollbar-thumb {
        background: rgba(139, 111, 63, 0.3);
        border-radius: 2px;
    }

.ledger-photo-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(180, 140, 80, 0.15);
    border: 1px solid rgba(139, 111, 63, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    cursor: zoom-in;
    transition: all 0.2s;
    position: relative;
}

    .ledger-photo-thumb::after {
        content: '';
        position: absolute;
        inset: 0;
        box-shadow: inset 0 0 15px rgba(80, 60, 30, 0.15);
        pointer-events: none;
    }

    .ledger-photo-thumb:hover {
        border-color: #b8852f;
        box-shadow: 0 2px 10px rgba(139, 111, 63, 0.4);
        transform: translateY(-2px);
    }

    .ledger-photo-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        pointer-events: none;
    }

@media (max-width: 768px) {
    .ledger-photo-thumb {
        flex: 0 0 56px;
        width: 56px;
        height: 56px;
    }
}
/* ================= 后勤部 · 分页导航 ================= */
.ledger-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.ledger-nav-btn {
    background: transparent;
    border: 1px solid rgba(139, 111, 63, 0.55);
    color: #8b6f3f;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    font-family: 'Courier New', Courier, monospace;
    flex-shrink: 0;
    padding: 0;
}

    .ledger-nav-btn:hover:not(:disabled) {
        background: rgba(139, 111, 63, 0.15);
        border-color: #8b6f3f;
        color: #3a2d1a;
    }

    .ledger-nav-btn:disabled {
        opacity: 0.25;
        cursor: not-allowed;
    }

.ledger-page-indicator {
    font-size: 0.8rem;
    color: #6b5435;
    letter-spacing: 2px;
    font-family: 'Courier New', Courier, monospace;
    min-width: 55px;
    text-align: center;
    flex-shrink: 0;
}

/* 页切换过渡 */


@media (max-width: 768px) {
    .ledger-page-footer {
        padding: 6px 20px 15px 42px;
        gap: 8px;
    }

    .ledger-nav {
        gap: 10px;
    }

    .ledger-nav-btn {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .ledger-page-indicator {
        font-size: 0.72rem;
        min-width: 48px;
    }
}
/* ================= 后勤部 · SCP 项目备注 ================= */
.ledger-scp {
    margin-top: 12px;
    background: rgba(180, 140, 80, 0.06);
    border: 1px dashed rgba(139, 111, 63, 0.4);
    border-radius: 6px;
    padding: 10px 12px;
}

.ledger-scp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.68rem;
    color: #8b5a1a;
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(139, 111, 63, 0.3);
    padding-bottom: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.ledger-scp-code {
    color: #6b5435;
}

.ledger-scp-level {
    color: #b8852f;
    font-weight: bold;
}

.ledger-scp-body {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    line-height: 1.75;
    color: #5a4a30;
    white-space: pre-line;
    word-break: break-word;
}

@media (max-width: 768px) {
    .ledger-scp {
        padding: 8px 10px;
        margin-top: 10px;
    }

    .ledger-scp-header {
        font-size: 0.62rem;
    }

    .ledger-scp-body {
        font-size: 0.68rem;
        line-height: 1.7;
    }
}
/* ================= 魔卡部 ================= */
.magic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 10, 20, 0.92);
    backdrop-filter: blur(10px);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

    .magic-modal.active {
        opacity: 1;
        pointer-events: auto;
    }

.magic-container {
    width: 90%;
    max-width: 900px;
    max-height: 88vh;
    background: rgba(10, 20, 35, 0.85);
    border: 1px solid #00ff41;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.1), inset 0 0 30px rgba(0, 255, 65, 0.05);
    display: flex;
    flex-direction: column;
    padding: 25px 20px 20px;
    position: relative;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-modal.active .magic-container {
    transform: scale(1);
}

.magic-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(0, 255, 65, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 65, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    pointer-events: none;
}

.magic-header {
    text-align: center;
    color: #00ff41;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 6px;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    z-index: 1;
    flex-shrink: 0;
}

.magic-sub {
    text-align: center;
    color: #888;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
    z-index: 1;
    flex-shrink: 0;
}

.magic-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
}

    .magic-close-btn:hover {
        background: #00ff41;
        color: #000;
        transform: rotate(90deg);
    }

.magic-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    z-index: 1;
}

    .magic-view.active {
        display: flex;
    }

.magic-boxes {
    display: flex;
    gap: 20px;
    flex: 1;
    align-items: stretch;
    padding: 10px 5px;
    min-height: 0;
}

.magic-box {
    flex: 1;
    position: relative;
    border-radius: 16px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    min-height: 260px;
}

    .magic-box.normal {
        background: radial-gradient(circle at 30% 20%, rgba(0, 255, 65, 0.08) 0%, transparent 60%), linear-gradient(135deg, rgba(0, 20, 10, 0.95), rgba(0, 40, 20, 0.75));
        border: 1px solid rgba(0, 255, 65, 0.4);
        box-shadow: inset 0 0 40px rgba(0, 255, 65, 0.05), 0 4px 20px rgba(0, 0, 0, 0.3);
        cursor: pointer;
    }

        .magic-box.normal:hover {
            border-color: #00ff41;
            box-shadow: inset 0 0 40px rgba(0, 255, 65, 0.12), 0 0 35px rgba(0, 255, 65, 0.35);
            transform: translateY(-6px);
        }

        .magic-box.normal::before {
            content: '';
            position: absolute;
            inset: 12px;
            border: 1px dashed rgba(0, 255, 65, 0.2);
            border-radius: 10px;
            pointer-events: none;
        }

    .magic-box.magic {
        background: radial-gradient(circle at 20% 30%, rgba(255, 180, 250, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 70%, rgba(180, 150, 255, 0.15) 0%, transparent 50%), linear-gradient(135deg, #2a1030, #1a0820, #2a1030);
        border: 1px solid rgba(255, 150, 220, 0.4);
        box-shadow: inset 0 0 40px rgba(255, 150, 220, 0.08), 0 4px 20px rgba(0, 0, 0, 0.4);
        cursor: not-allowed;
        overflow: hidden;
    }

        .magic-box.magic::before {
            content: '✨';
            position: absolute;
            top: 15px;
            right: 20px;
            font-size: 1.4rem;
            animation: magic-star-twinkle 2.2s ease-in-out infinite;
        }

        .magic-box.magic::after {
            content: '';
            position: absolute;
            inset: 0;
            background-image: radial-gradient(circle at 15% 20%, rgba(255, 220, 250, 0.6) 1px, transparent 2px), radial-gradient(circle at 85% 30%, rgba(220, 200, 255, 0.5) 1px, transparent 2px), radial-gradient(circle at 70% 80%, rgba(255, 220, 250, 0.5) 1px, transparent 2px), radial-gradient(circle at 25% 75%, rgba(220, 200, 255, 0.4) 1px, transparent 2px), radial-gradient(circle at 50% 50%, rgba(255, 200, 250, 0.3) 1px, transparent 2px);
            background-size: 100% 100%;
            pointer-events: none;
            animation: magic-twinkle-bg 3s ease-in-out infinite;
        }

@keyframes magic-star-twinkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.25) rotate(20deg);
    }
}

@keyframes magic-twinkle-bg {
    0%, 100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.magic-box-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    z-index: 1;
}

.magic-box-name {
    font-size: 1.15rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-family: 'Courier New', Courier, monospace;
    z-index: 1;
}

.magic-box.normal .magic-box-name {
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.magic-box.magic .magic-box-name {
    color: #ffb4ea;
    text-shadow: 0 0 10px rgba(255, 180, 234, 0.6);
}

.magic-box-desc {
    font-size: 0.78rem;
    line-height: 1.6;
    font-family: 'Courier New', Courier, monospace;
    z-index: 1;
    margin-bottom: 12px;
}

.magic-box.normal .magic-box-desc {
    color: #8a9a8a;
}

.magic-box.magic .magic-box-desc {
    color: #9a8aa0;
}

.magic-box-count {
    font-size: 0.75rem;
    color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid rgba(0, 255, 65, 0.3);
    padding: 3px 12px;
    border-radius: 12px;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    z-index: 1;
}

.magic-box-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.magic-box-sealed {
    margin-top: 15px;
    padding: 6px 16px;
    background: rgba(255, 150, 220, 0.1);
    border: 1px solid rgba(255, 150, 220, 0.4);
    border-radius: 12px;
    color: #ffb4ea;
    font-size: 0.78rem;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    z-index: 1;
    animation: sealed-pulse 2s ease-in-out infinite;
}

@keyframes sealed-pulse {
    0%, 100% {
        box-shadow: 0 0 0 rgba(255, 150, 220, 0);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 150, 220, 0.4);
    }
}

.magic-back-btn {
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.4);
    color: #00ff41;
    padding: 6px 16px;
    font-size: 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.2s;
    margin-bottom: 15px;
    align-self: flex-start;
    flex-shrink: 0;
}

    .magic-back-btn:hover {
        background: rgba(0, 255, 65, 0.1);
        border-color: #00ff41;
    }

.magic-card-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 65, 0.4) transparent;
}

    .magic-card-scroll::-webkit-scrollbar {
        width: 5px;
    }

    .magic-card-scroll::-webkit-scrollbar-thumb {
        background: rgba(0, 255, 65, 0.4);
        border-radius: 3px;
    }

/* ===== 卡片列表（列表页的卡面） ===== */
.memorial-grid {
    column-count: 3;
    column-gap: 18px;
    padding: 5px;
}

@media (max-width: 768px) {
    .memorial-grid {
        column-count: 2;
        column-gap: 14px;
    }
}

.mem-card {
    position: relative;
    aspect-ratio: var(--mem-ratio, 0.625);
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s;
}

    .mem-card:hover {
        transform: translateY(-4px);
    }

.mem-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mem-card-inner {
    transition: transform 0.15s ease-out;
}

.mem-card-face {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a1a0d;
    border: 1px solid rgba(0, 255, 65, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0, 255, 65, 0.05);
}

    .mem-card-face img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        pointer-events: none;
    }

.mem-card-back {
    transform: rotateY(180deg);
    border-color: rgba(212, 162, 74, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(212, 162, 74, 0.08);
}

.mem-card-wrap {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px;
    padding-bottom: 24px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.mem-card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    color: #888;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.mem-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-family: 'Courier New', Courier, monospace;
}

.mem-empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ===== 3D 展示页 ===== */
.mem-viewer {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 20, 10, 0.95), rgba(0, 0, 0, 0.98));
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    perspective: 1500px;
}

    .mem-viewer.active {
        opacity: 1;
        pointer-events: auto;
    }

.mem-viewer-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    max-width: 90vw;
    perspective: 1200px; /* 👈 新增，与主控台一致 */
}

.mem-viewer-card {
    width: min(340px, 78vw);
    aspect-ratio: var(--mem-ratio, 0.625);
    cursor: pointer;
    transform-style: preserve-3d; /* 👈 替换原来的 perspective: 1600px */
    animation: mem-viewer-enter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes mem-viewer-enter {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(15deg);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.mem-viewer-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.mem-viewer-card.flipped .mem-viewer-inner {
    transform: rotateY(180deg);
}

.mem-viewer-face {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a1a0d;
    border: 2px solid rgba(0, 255, 65, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 255, 65, 0.15), inset 0 0 30px rgba(0, 255, 65, 0.05);
    transition: box-shadow 0.3s;
}

    .mem-viewer-face img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        pointer-events: none;
    }

.mem-viewer-back {
    transform: rotateY(180deg);
    border-color: rgba(212, 162, 74, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(212, 162, 74, 0.2), inset 0 0 30px rgba(212, 162, 74, 0.08);
}

.mem-viewer-card:hover .mem-viewer-face {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 50px rgba(0, 255, 65, 0.25), inset 0 0 30px rgba(0, 255, 65, 0.08);
}

.mem-viewer-info {
    text-align: center;
    color: #00ff41;
    font-family: 'Courier New', Courier, monospace;
    max-width: 500px;
    padding: 0 10px;
}

.mem-viewer-info-name {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.mem-viewer-info-meta {
    font-size: 0.78rem;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.mem-viewer-info-desc {
    font-size: 0.82rem;
    color: #bbb;
    line-height: 1.7;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 255, 65, 0.2);
}

.mem-viewer-hint {
    color: rgba(0, 255, 65, 0.5);
    font-size: 0.8rem;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    animation: mem-hint-pulse 2s ease-in-out infinite;
}

@keyframes mem-hint-pulse {
    0%, 100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.mem-viewer-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    line-height: 40px;
    text-align: center;
    font-size: 1.6rem;
    color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
    z-index: 10;
}

    .mem-viewer-close:hover {
        background: #00ff41;
        color: #000;
        transform: rotate(90deg);
    }

.mem-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 255, 65, 0.08);
    border: 1px solid rgba(0, 255, 65, 0.4);
    color: #00ff41;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    font-family: 'Courier New', Courier, monospace;
    z-index: 10;
}

    .mem-viewer-nav:hover:not(:disabled) {
        background: #00ff41;
        color: #000;
    }

    .mem-viewer-nav:disabled {
        opacity: 0.2;
        cursor: not-allowed;
    }

.mem-nav-prev {
    left: 30px;
}

.mem-nav-next {
    right: 30px;
}

@media (max-width: 768px) {
    .magic-container {
        padding: 18px 12px;
        max-height: 90vh;
    }

    .magic-header {
        font-size: 1.05rem;
        letter-spacing: 2px;
    }

    .magic-sub {
        font-size: 0.68rem;
        margin-bottom: 15px;
    }

    .magic-close-btn {
        width: 32px;
        height: 32px;
        line-height: 28px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
    }

    .magic-boxes {
        flex-direction: column;
        gap: 15px;
    }

    .magic-box {
        min-height: 140px;
        padding: 20px 15px;
    }

    .magic-box-icon {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }

    .magic-box-name {
        font-size: 1rem;
    }

    .magic-box-desc {
        font-size: 0.72rem;
        margin-bottom: 8px;
    }

    .magic-box-sealed {
        font-size: 0.72rem;
        padding: 4px 12px;
    }

    .memorial-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .mem-card-label {
        font-size: 0.65rem;
        bottom: -20px;
    }

    .mem-card-wrap {
        padding-bottom: 24px;
    }

    .mem-viewer-card {
        width: min(300px, 72vw);
    }

    .mem-viewer-info-name {
        font-size: 0.95rem;
    }

    .mem-viewer-info-desc {
        font-size: 0.75rem;
    }

    .mem-viewer-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        line-height: 32px;
        font-size: 1.3rem;
    }

    .mem-viewer-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .mem-nav-prev {
        left: 10px;
    }

    .mem-nav-next {
        right: 10px;
    }
}
/* ================= 镭射卡效果 ================= */
.mem-card.holo .mem-card-face {
    position: relative;
}

.mem-card.holo .mem-card-front::after,
.mem-card.holo .mem-card-back::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient( 115deg, transparent 20%, rgba(255, 0, 128, 0.35) 30%, rgba(255, 200, 0, 0.35) 40%, rgba(0, 255, 128, 0.35) 50%, rgba(0, 200, 255, 0.35) 60%, rgba(180, 0, 255, 0.35) 70%, transparent 80% );
    background-size: 250% 250%;
    background-position: calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 5;
    transition: background-position 0.08s linear;
}

.mem-card.holo:hover .mem-card-front::after,
.mem-card.holo:hover .mem-card-back::after {
    animation: none;
    background-position: calc(var(--mx, 0) * 1%) calc(var(--my, 0) * 1%);
}

@keyframes holo-idle {
    0% {
        background-position: 0% 30%;
    }

    50% {
        background-position: 200% 70%;
    }

    100% {
        background-position: 0% 30%;
    }
}

/* 镭射卡边框微光 */
.mem-card.holo .mem-card-face {
    border-color: rgba(255, 180, 250, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 150, 220, 0.15), inset 0 0 30px rgba(255, 180, 250, 0.05);
}

/* 主彩虹层：自动流动，永不停止 */
/* 3D 页镭射层 —— 与列表页完全一致：只跟随鼠标，不自动流动 */
.mem-viewer-card.holo .mem-viewer-face::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient( 115deg, transparent 20%, rgba(255, 0, 128, 0.45) 30%, rgba(255, 200, 0, 0.45) 40%, rgba(0, 255, 128, 0.45) 50%, rgba(0, 200, 255, 0.45) 60%, rgba(180, 0, 255, 0.45) 70%, transparent 80% );
    background-size: 250% 250%;
    background-position: calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 5;
    border-radius: 14px;
    transition: background-position 0.08s linear;
}

.mem-viewer-card.holo .mem-viewer-face {
    border-color: rgba(255, 180, 250, 0.7);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 60px rgba(255, 150, 220, 0.25), inset 0 0 30px rgba(255, 180, 250, 0.08);
}

/* 3D 页卡片的倾斜过渡 */
.mem-viewer-card {
    transition: transform 0.15s ease-out;
}

/* ================= 卡盒开盒动画 ================= */
.magic-box {
    perspective: 1200px;
}

.magic-box-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease 0.2s;
}

/* 盒盖 */
.magic-box-lid {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 40, 20, 0.98), rgba(0, 60, 30, 0.92));
    border: 1px solid rgba(0, 255, 65, 0.5);
    box-shadow: inset 0 0 40px rgba(0, 255, 65, 0.1), 0 4px 20px rgba(0, 0, 0, 0.4);
    transform-origin: top center;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.5s ease 0.3s;
    z-index: 10;
    pointer-events: none;
}

    .magic-box-lid::before {
        content: '';
        position: absolute;
        inset: 12px;
        border: 1px dashed rgba(0, 255, 65, 0.25);
        border-radius: 10px;
    }

    .magic-box-lid::after {
        content: '翻开';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-family: 'Courier New', Courier, monospace;
        font-size: 0.9rem;
        color: rgba(0, 255, 65, 0.6);
        letter-spacing: 6px;
        font-weight: bold;
    }

/* 开盒状态 */
.magic-box.opening .magic-box-lid {
    transform: rotateX(-115deg);
    opacity: 0;
}

.magic-box.opening .magic-box-inner {
    opacity: 0;
    transform: scale(0.95);
}

/* 列表切换时的入场动画 */
.magic-card-list.active .magic-card-scroll {
    animation: magic-list-enter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes magic-list-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片逐个入场 */
.magic-card-list.active .mem-card-wrap {
    animation: mem-card-enter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

    .magic-card-list.active .mem-card-wrap:nth-child(1) {
        animation-delay: 0.05s;
    }

    .magic-card-list.active .mem-card-wrap:nth-child(2) {
        animation-delay: 0.1s;
    }

    .magic-card-list.active .mem-card-wrap:nth-child(3) {
        animation-delay: 0.15s;
    }

    .magic-card-list.active .mem-card-wrap:nth-child(4) {
        animation-delay: 0.2s;
    }

    .magic-card-list.active .mem-card-wrap:nth-child(5) {
        animation-delay: 0.25s;
    }

    .magic-card-list.active .mem-card-wrap:nth-child(6) {
        animation-delay: 0.3s;
    }

    .magic-card-list.active .mem-card-wrap:nth-child(7) {
        animation-delay: 0.35s;
    }

    .magic-card-list.active .mem-card-wrap:nth-child(8) {
        animation-delay: 0.4s;
    }

@keyframes mem-card-enter {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}