/* 全局样式 - 异想纪元·熵寂录（最终整合版） */
:root {
    --bg-dark: #0a0c0f;
    --bg-card: #151a1f;
    --text-light: #e0e4e8;
    --text-dim: #a0a8b0;
    --accent-cyan: #3ecfcf;
    --accent-purple: #9b4dff;
    --accent-red: #ff4d6d;
    --border-glow: 0 0 10px rgba(62, 207, 207, 0.3);
    --font-main: 'Segoe UI', 'Roboto', system-ui, sans-serif;
    --transition-standard: all 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-main);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    /* 响应式全局背景 */
    background:
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
        url('images/home-bg-mobile.jpg') center/cover no-repeat fixed;
}

@media (min-width: 768px) {
    body {
        background:
            linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
            url('images/home-bg-tablet.jpg') center/cover no-repeat fixed;
    }
}

@media (min-width: 1200px) {
    body {
        background:
            linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
            url('images/home-bg-desktop.jpg') center/cover no-repeat fixed;
    }
}

/* 加载层（替换原 #loadingVideo） */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black; /* 后备颜色 */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#loading.hide {
    opacity: 0;
    pointer-events: none;
}

/* 加载图片 */
.loading-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;      /* 确保图片铺满不变形 */
    z-index: 10001;
}

/* 进度条容器需要置于图片之上 */
.progress-left, .progress-right {
    z-index: 10002;         /* 比图片高 */
}

.skip-btn {
    z-index: 10003;         /* 比进度条高 */
}

/* 如果原 #loadingVideo 样式存在，请删除或注释掉 */
/* 左右垂直进度条（方形） */
.progress-left, .progress-right {
    position: absolute;
    top: 0;
    width: 20px;               /* 进度条宽度，可调整 */
    height: 100%;
    background: repeating-linear-gradient(45deg, #666, #666 4px, #444 4px, #444 8px);
    z-index: 10001;
    overflow: visible;          /* 允许数字溢出 */
    border: none;               /* 确保无圆角 */
}

.progress-left {
    left: 0;
}

.progress-right {
    right: 0;
}

/* 垂直填充条（从底部上升） */
.progress-fill-vertical {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;                 /* 初始高度0，由JS控制 */
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
    transition: none;           /* 由JS逐帧更新，无CSS过渡 */
    overflow: visible;          /* 允许数字溢出 */
}

/* 百分比数字 */
.progress-percent {
    position: absolute;
    bottom: 100%;               /* 位于填充条顶部上方 */
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 5px black;
    white-space: nowrap;
    z-index: 10003;
    line-height: 1;
    pointer-events: none;       /* 防止干扰点击 */
}

/* 左侧数字：放在进度条右侧（屏幕内侧） */
.progress-left .progress-percent {
    left: 100%;
    margin-left: 10px;          /* 与进度条间距 */
}

/* 右侧数字：放在进度条左侧（屏幕内侧） */
.progress-right .progress-percent {
    right: 100%;
    margin-right: 10px;         /* 与进度条间距 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    .progress-left, .progress-right {
        width: 12px;
    }
    .progress-percent {
        font-size: 1rem;
    }
    .progress-left .progress-percent {
        margin-left: 6px;
    }
    .progress-right .progress-percent {
        margin-right: 6px;
    }
}

.skip-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    color: white;
    background: rgba(0,0,0,0.6);
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid var(--accent-cyan);
    cursor: pointer;
    z-index: 10002;
    font-size: 1rem;
    transition: 0.2s;
}
.skip-btn:hover {
    background: var(--accent-cyan);
    color: black;
}

/* ===== 粒子画布 ===== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* ===== 导航栏 ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    border-bottom: 1px solid rgba(62, 207, 207, 0.2);
    background: rgba(10, 12, 15, 0.95);
    backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.logo span {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* 汉堡菜单按钮（移动端显示） */
.menu-btn {
    width: 28px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
}
.menu-btn span {
    width: 100%;
    height: 2px;
    background: var(--accent-cyan);
    border-radius: 2px;
    transition: 0.3s;
}

/* 大屏幕隐藏菜单按钮，侧边栏常显 */
@media (min-width: 768px) {
    .menu-btn {
        display: none;
    }
    .sidebar {
        left: 0 !important;
        box-shadow: none;
        border-right: 1px solid rgba(62, 207, 207, 0.2);
        z-index: 50;
    }
    .scroll-content {
        margin-left: 400px; /* 与侧边栏宽度相同 */
    }
    .overlay {
        display: none;
    }
}

/* ===== 侧边栏 ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 200px;
    height: 100vh;
    background: rgba(10, 12, 15, 0.98);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(62, 207, 207, 0.3);
    box-shadow: 4px 0 20px rgba(0,0,0,0.8);
    z-index: 2000;
    transition: left 0.3s ease;
    padding: 2rem 1.5rem;
}
.sidebar.open {
    left: 0;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(62, 207, 207, 0.3);
}
.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.close-btn {
    font-size: 2rem;
    line-height: 1;
    color: var(--text-dim);
    cursor: pointer;
}
.close-btn:hover {
    color: var(--accent-cyan);
}
.sidebar-nav {
    list-style: none;
}
.sidebar-nav li {
    margin-bottom: 1.2rem;
}
.sidebar-nav a {
    color: var(--text-light);
    font-size: 1.1rem;
    display: block;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(62, 207, 207, 0.1);
    color: var(--accent-cyan);
    border-left: 3px solid var(--accent-cyan);
    padding-left: 1.2rem;
}

/* 遮罩层（移动端） */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ===== 滚动内容 ===== */
.scroll-content {
    position: relative;
    z-index: 1;
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 6rem 5% 4rem;
    scroll-margin-top: 80px;
}

/* 各模块独立背景 */
.lore-section {
    background:
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('images/lore-bg.jpg') center/cover no-repeat fixed;
    background-attachment: local;
}
.gameplay-section {
    background:
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('images/gameplay-bg.jpg') center/cover no-repeat fixed;
    background-attachment: local;
}
.characters-section {
    background:
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('images/characters-bg.jpg') center/cover no-repeat fixed;
    background-attachment: local;
}
.progress-section {
    background:
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('images/progress-bg.jpg') center/cover no-repeat fixed;
    background-attachment: local;
}
.community-section {
    background:
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('images/community-bg.jpg') center/cover no-repeat fixed;
    background-attachment: local;
}
.notice-section {
    background:
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('images/notice-bg.jpg') center/cover no-repeat fixed;
    background-attachment: local;
}

/* ===== 通用卡片样式（方形边框+括号装饰） ===== */
.card {
    background: var(--bg-card);
    border-radius: 0;
    border: 1px solid rgba(62, 207, 207, 0.2);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    transition: var(--transition-standard);
    position: relative;
    padding: 1.8rem;
}
.card::before {
    content: '「';
    position: absolute;
    top: -6px;
    left: -4px;
    font-size: 1.8rem;
    color: var(--accent-cyan);
    opacity: 0.8;
    font-weight: bold;
    text-shadow: 0 0 8px var(--accent-cyan);
    pointer-events: none;
    z-index: 2;
}
.card::after {
    content: '」';
    position: absolute;
    bottom: -6px;
    right: -4px;
    font-size: 1.8rem;
    color: var(--accent-purple);
    opacity: 0.8;
    font-weight: bold;
    text-shadow: 0 0 8px var(--accent-purple);
    pointer-events: none;
    z-index: 2;
}
.card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-cyan);
    transform: translateY(-4px);
}
.card:hover::before {
    color: var(--accent-purple);
}
.card:hover::after {
    color: var(--accent-cyan);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 0.8rem 2rem;
    border-radius: 0;
    font-weight: 600;
    transition: var(--transition-standard);
    text-decoration: none;
}
.btn:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--accent-cyan);
    transform: scale(1.02);
}

/* ===== 英雄区 ===== */
.hero-section {
    justify-content: center;
    align-items: center;
}
.hero-title {
    font-size: clamp(3rem, 15vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    animation: glitch 3s infinite;
}
@keyframes glitch {
    0%, 100% { transform: skew(0deg, 0deg); opacity: 1; }
    95% { transform: skew(0deg, 0deg); opacity: 1; }
    96% { transform: skew(5deg, 2deg); opacity: 0.8; text-shadow: 2px 2px var(--accent-purple); }
    97% { transform: skew(-3deg, -1deg); opacity: 0.9; text-shadow: -2px -2px var(--accent-cyan); }
    98% { transform: skew(0deg, 0deg); opacity: 1; }
}
.hero-sub {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin: 1rem auto 2rem;
    font-size: 1.2rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.hero-sub .left {
    color: var(--accent-cyan);
}
.hero-sub .right {
    color: var(--accent-purple);
}
.hero-btn {
    margin: 2rem 0 3rem;
}
.hero-footer {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.8;
    border-top: 1px solid rgba(62, 207, 207, 0.2);
    padding-top: 2rem;
    width: 100%;
    max-width: 400px;
}
.hero-footer p {
    margin: 0.2rem 0;
}

/* ===== 模块标题统一样式（移除绝对定位） ===== */
.section-header {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 1200px;
    padding: 0 5%;
    box-sizing: border-box;
}
.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin: 0;
    line-height: 1.2;
}
.sub-title {
    font-size: 1rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin: 0;
}
.sub-title .arrow {
    font-size: 1.2rem;
    margin-left: 5px;
    color: var(--accent-purple);
}

/* 移除之前为绝对定位预留的额外间距 */
.lore-content-wrapper,
.character-carousel,
.progress-list,
.community-cards,
.notice-detail {
    margin-top: 0; /* 或者根据实际需要调整 */
}
/* ===== 世界观轮播 ===== */
.lore-section {
    position: relative;
}
.lore-content-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 80px; /* 给标题留空间 */
}
.lore-text {
    max-width: 800px;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.42,0,0.58,1), opacity 0.6s cubic-bezier(0.42,0,0.58,1);
}
.lore-text h3 {
    font-size: 2.5rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}
.lore-text p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-light);
}
.lore-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}
.lore-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    color: black;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lore-arrow:hover {
    background: var(--accent-cyan);
    color: white;
}
.current-title {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

/* ===== 玩法介绍扩充 ===== */
.gameplay-desc {
    margin: 2rem auto;
    max-width: 900px;
    width: 100%;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* ===== 角色轮播 ===== */
.character-carousel {
    width: 100%;
    max-width: 800px;
    margin: 80px auto 0;
}
.character-display {
    display: flex;
    gap: 2rem;
    align-items: center;
    transition: transform 0.6s cubic-bezier(0.42,0,0.58,1), opacity 0.6s cubic-bezier(0.42,0,0.58,1);
}
.character-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--accent-purple);
    box-shadow: 0 0 20px var(--accent-purple);
}
.character-info {
    flex: 1;
}
.character-info h3 {
    font-size: 2rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}
.character-info p {
    font-size: 1.1rem;
    line-height: 1.6;
}
.character-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}
.char-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    color: black;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.char-arrow:hover {
    background: var(--accent-cyan);
    color: white;
}
.current-name {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

/* ===== 开发进度（恢复圆角） ===== */
.progress-list {
    background: transparent;
    padding: 1rem 5%;
    max-width: none;        /* 取消宽度限制 */
    width: 100%;
    margin: 36px auto 0;
}
.progress-item {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}
.progress-item span:first-child {
    width: 60%;
    font-weight: 500;
}
.progress-item span:last-child {
    width: 15%;
    text-align: right;
    color: var(--accent-cyan);
}
.progress-bar {
    width: 100%;
    margin-top: 0.3rem;
    background: #2a2f35;
    height: 24px; /* 加高 */
    border-radius: 12px; /* 弧形边 */
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 12px;
}

/* ===== 社区卡片交错排列 ===== */
.community-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 80px auto 0;
}
.community-card {
    width: 70%;
    margin-left: 0;
    margin-right: auto;
}
.community-card:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
}
@media (max-width: 768px) {
    .community-card {
        width: 100%;
    }
    .community-card:nth-child(even) {
        margin-left: 0;
        margin-right: 0;
    }
}

/* ===== 公告模块 ===== */
.notice-section {
    position: relative;
}
.notice-detail {
    display: none;
    background: rgba(0,0,0,0.7);
    border: 1px solid var(--accent-cyan);
    padding: 2rem;
    margin: 80px auto 2rem;
    max-width: 800px;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.42,0,0.58,1), opacity 0.6s cubic-bezier(0.42,0,0.58,1);
}
.notice-detail h3 {
    font-size: 2rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}
.notice-detail p {
    font-size: 1.1rem;
    line-height: 1.6;
}
.notice-list {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-cyan) #333;
}
.notice-list::-webkit-scrollbar {
    height: 6px;
}
.notice-list::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 3px;
}
.notice-card {
    flex: 0 0 auto;
    background: var(--bg-card);
    border: 1px solid rgba(62, 207, 207, 0.3);
    padding: 1rem 2rem;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.notice-card:hover {
    border-color: var(--accent-cyan);
    background: rgba(62, 207, 207, 0.1);
}

/* ===== 背景音乐播放器 ===== */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    border: 1px solid var(--accent-cyan);
    padding: 10px 15px;
    border-radius: 30px;
    z-index: 1000;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 10px;
}
.music-btn {
    background: transparent;
    border: none;
    color: var(--accent-cyan);
    font-size: 1.2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.music-btn:hover {
    color: white;
}
#trackName {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-left: 5px;
}

/* ===== 动画类 ===== */
.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.42,0,0.58,1) forwards;
}
.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.42,0,0.58,1) forwards;
}
@keyframes slideInRight {
    0% { transform: translateX(50px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes slideInLeft {
    0% { transform: translateX(-50px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(62, 207, 207, 0.2);
    color: var(--text-dim);
    margin-left: 0;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }
    .navbar {
        padding: 0.8rem 5%;
    }
    .section {
        padding: 5rem 1rem 3rem;
        min-height: auto;
    }
    .section-header {
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }
    .main-title {
        font-size: 2rem;
    }
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
    .hero-sub {
        font-size: 1rem;
        max-width: 300px;
    }
    .sidebar {
        width: 250px;
    }
    .character-display {
        flex-direction: column;
        text-align: center;
    }
    .character-avatar {
        width: 150px;
        height: 150px;
    }
    .lore-text h3 {
        font-size: 2rem;
    }
    .lore-text p {
        font-size: 1rem;
    }
    .lore-controls {
        gap: 1rem;
    }
    .current-title {
        font-size: 1.2rem;
    }
    .music-player {
        bottom: 10px;
        right: 10px;
        padding: 5px 10px;
    }
}
