/* ========== 全局 & 布局 ========== */
body {
    background: #000;
    color: #fff;
    margin: 0;
    overflow-x: hidden;
}
.main-wrapper { position: relative; z-index: 1; }
.mount-fixed { z-index: 0; }

/* ========== 标题 & Logo ========== */
.title {
    text-align: center;
    animation: titleFadeIn 1s ease forwards;
}
@keyframes titleFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}
#logo {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}
#logo:hover {
    filter: drop-shadow(0 6px 16px rgba(216, 0, 0, 0.5));
    transform: scale(1.05);
}

/* ========== 磁贴容器 & 磁贴 ========== */
.bbox {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px;
    padding: 20px;
}
.box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: tileSlideIn 0.6s ease forwards;
}
.box:nth-child(1) { animation-delay: 0.1s; }
.box:nth-child(2) { animation-delay: 0.2s; }
.box:nth-child(3) { animation-delay: 0.3s; }
.box:nth-child(4) { animation-delay: 0.4s; }
@keyframes tileSlideIn {
    from { opacity: 0; transform: translateY(40px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 磁贴 Aero 高光 */
.box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}
/* 磁贴点击波纹 */
.box::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}
.box.ripple::after {
    width: 300%; height: 300%;
    opacity: 1;
}

/* 磁贴交互 */
.box:hover {
    transform: translateY(-4px) scale(1.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.box:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s ease;
}
.box p {
    margin-top: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.box img {
    width: 10vw;
    padding: 20px;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.box:hover img {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 10px rgba(0, 180, 216, 0.6));
}

/* ========== 模态窗口 ========== */
.modal {
    position: fixed;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 25, 8, 0.676);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
}
.modal.show { visibility: visible; opacity: 1; pointer-events: auto; }

/* 弹窗面板 */
.modal-content {
    margin: 5% auto;
    width: 90%; height: 85%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 1px rgba(255, 255, 255, 0.2) inset;
    display: flex;
    flex-direction: column;
    /* 翻出动画：顶部固定，窗口从 20% 高度向下拉伸至完整尺寸 */
    transform: scaleY(0.2);
    transform-origin: top center;
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.4s ease;
    position: relative;
    z-index: 10000;
}
.modal.show .modal-content {
    transform: scaleY(1);
    opacity: 1;
}
/* 弹窗顶部高光线 */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* 弹窗标题栏 */
.modal-header {
    background: rgba(255, 255, 255, 0.08);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-title {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.modal-buttons { display: flex; gap: 10px; }

/* 弹窗按钮 */
.modal-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}
.modal-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}
.modal-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(0, 180, 216, 0.5);
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.2);
}
.modal-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.2);
}

/* 弹窗内容区 (iframe) */
.modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}
/* 白色底衬，防止 iframe 透明背景透出下方模糊 */
.modal-body::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #fff;
}
.modal-body iframe {
    width: 100%; height: 100%;
    border: none;
    position: relative;
    z-index: 1;
}

/* ========== 侧边栏 ========== */
.sidebar {
    position: fixed;
    top: 0; right: 0;
    width: 400px; height: 100vh;
    background: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}
/* 侧边栏顶部高光线 */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    pointer-events: none;
    z-index: 1;
}
.sidebar.show { transform: translateX(0); }

/* 侧边栏头部 */
.sidebar-header {
    background: rgba(255, 255, 255, 0.06);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}
.sidebar-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}
.sidebar-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    padding: 0;
}
.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(0, 180, 216, 0.4);
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.15);
}
.sidebar-close:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.2);
}

/* 侧边栏内容 */
.sidebar-content {
    padding: 24px 20px;
    color: #fff;
    flex: 1;
    overflow-y: auto;
}
.sidebar-section { margin-bottom: 28px; }
.sidebar-section h3 {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-section p {
    line-height: 1.7;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}
.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

/* 侧边栏功能菜单项 */
.sidebar-item {
    padding: 12px 14px;
    border-left: 2px solid transparent;
    cursor: pointer;
    /* 竖线瞬间出现，背景缓慢变亮 */
    transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-left-color 0s;
    margin-bottom: 2px;
    /* 逐项滑入入场动画 */
    opacity: 0;
    transform: translateX(20px);
    animation: sidebarItemIn 0.4s ease forwards;
}
.sidebar-item:nth-child(1)  { animation-delay: 0.05s; }
.sidebar-item:nth-child(2)  { animation-delay: 0.10s; }
.sidebar-item:nth-child(3)  { animation-delay: 0.15s; }
.sidebar-item:nth-child(4)  { animation-delay: 0.20s; }
.sidebar-item:nth-child(5)  { animation-delay: 0.25s; }
.sidebar-item:nth-child(6)  { animation-delay: 0.30s; }
.sidebar-item:nth-child(7)  { animation-delay: 0.35s; }
.sidebar-item:nth-child(8)  { animation-delay: 0.40s; }
@keyframes sidebarItemIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* 菜单项交互：左竖线瞬现 + 文字缓右移 */
.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: rgba(255, 255, 255, 0.4);
}
.sidebar-item:active {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
    border-left-color: rgba(255, 255, 255, 0.5);
}
.sidebar-item p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-item:hover p { transform: translateX(6px); }

/* ========== 响应式 ========== */
/* 横屏：侧边栏内嵌挤压主内容 */
@media (orientation: landscape) {
    body {
        display: flex;
        overflow: hidden;
    }
    body > .mount-fixed,
    body > .main-wrapper {
        flex: 1;
        min-width: 0;
    }
    body > .sidebar {
        position: relative;
        right: 0;
        transform: none;
        flex-shrink: 0;
        width: 0;
        overflow: hidden;
        box-shadow: none;
        height: 100vh;
        z-index: auto;
        transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body > .sidebar.show { width: 400px; }
}
@media (orientation: portrait) {
    body.landscape-sidebar-open { display: block; }
}
