/* ========================================= */
/* 1. 全局变量与基础设置 (Design System)    */
/* ========================================= */
:root {
    /* 配色方案：更具游戏感的配色 */
    --primary-color: #2b3e50;      /* 深蓝灰 (Header/Footer) */
    --accent-color: #ff9f1c;       /* 活力橙 (强调色/按钮) */
    --accent-hover: #e68a00;       /* 按钮悬停深色 */
    
    --bg-body: #eef2f5;            /* 浅灰蓝背景，比纯白更有质感 */
    --bg-card: #ffffff;            /* 内容卡片背景 */
    
    --text-main: #2d3436;          /* 主要文字色 (非纯黑) */
    --text-muted: #636e72;         /* 次要文字色 */
    
    /* 字体栈 */
    --font-heading: 'Fredoka', sans-serif; /* 标题字体 (可爱圆润) */
    --font-body: 'Poppins', sans-serif;    /* 正文字体 (现代清晰) */
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7; /* 增加行高，提升阅读舒适度 */
}

/* ========================================= */
/* 2. Header (保留导航靠右布局)             */
/* ========================================= */
header {
    height: 80px;
    width: 100%;    
    background: var(--primary-color);
    color: #fff;
    padding: 0 30px; /* 增加左右内边距 */
    
    display: flex;
    justify-content: space-between; /* Logo左，导航右 */
    align-items: center;
    
    /* position: sticky;
    top: 0; */
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); /* 更有立体感的投影 */
}

/* Logo 区域 */
header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

header .logo a {
    display: flex;
    text-decoration: none;
    border: none;
}

header .logo img {
    height: 55px; /* 稍微加大 Logo */
    width: auto;
    transition: transform 0.2s;
}

header .logo img:hover {
    transform: scale(1.05); /* 鼠标放上去有轻微放大效果 */
}

/* 导航链接优化 */
header nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

header nav ul li a {
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    font-size: 16px;
    font-weight: 600; /* 加粗 */
    font-family: var(--font-body);
    transition: all 0.3s;
    position: relative;
}

header nav ul li a:hover {
    color: var(--accent-color); /* 悬停变橙色 */
}

/* 导航下划线动效 */
header nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

header nav ul li a:hover::after {
    width: 100%;
}

/* ========================================= */
/* 3. 布局容器 & 游戏区域                   */
/* ========================================= */
.container {
    max-width: 960px; /* 稍宽一点 */
    margin: 30px auto;
    padding: 0 20px;
    min-height: 80vh;
}

/* ======== Click-to-Play Cover (封面样式) ======== */

/* 覆盖层容器 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* 必须比 iframe 高 */
    cursor: pointer;
    background-color: #222; /* 图片加载前的背景 */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

/* 封面背景图 */
.cover-bg-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证图片填满且不变形 */
    opacity: 0.6; /*稍微暗一点，为了突出按钮 */
    transition: transform 0.5s;
}

/* 鼠标悬停时背景轻微放大 */
.game-overlay:hover .cover-bg-img {
    transform: scale(1.05);
    opacity: 0.4;
}

/* 黑色渐变遮罩，让按钮更显眼 */
.overlay-mask {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
}

/* 按钮区域 */
.play-content {
    position: relative; /* 确保在遮罩之上 */
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 大号 Play 按钮 */
.play-btn-big {
    width: 80px;
    height: 80px;
    background: var(--accent-color); /* 使用你的主题橙色 */
    border: 4px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(255, 159, 28, 0.7);
    animation: pulse-orange 2s infinite; /* 脉冲动画 */
    transition: transform 0.2s;
}

.play-icon {
    font-size: 30px;
    color: #fff;
    margin-left: 5px; /* 视觉修正三角形位置 */
}

.play-text {
    color: #fff;
    font-family: var(--font-heading); /* 使用 Fredoka 字体 */
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.game-overlay:hover .play-btn-big {
    transform: scale(1.1);
    background-color: #ffb84d; /* 悬停变亮 */
}

/* 定义脉冲动画 */
@keyframes pulse-orange {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 159, 28, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(255, 159, 28, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 159, 28, 0);
    }
}

/* 隐藏封面时的类 (JS控制) */
.hidden-overlay {
    opacity: 0;
    pointer-events: none; /* 让鼠标能穿透去点击 iframe */
}

/* 游戏外框 */
.iframe-box {
    background: #000;
    border-radius: 12px; /* 更大的圆角 */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25); /* 深邃的投影，强调游戏区 */
    margin-bottom: 40px;
    border: 4px solid #fff; /* 给游戏加个白边框，像画廊一样 */
}

.inner-frame-box {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0; 
}

.inner-frame-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ⚡️ 游戏控制栏优化 */
.header-game {
    background: var(--bg-card); /* 使用卡片背景色，更柔和 */
    padding: 10px 20px; /* 减少内边距，使其更紧凑 */
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
}

.game-controls {
    width: 100%;
    display: flex;
    justify-content: flex-end; /* 按钮靠右对齐 */
    align-items: center;
    flex-wrap: wrap;
    gap: 10px; /* 减小间距 */
}

/* 按钮容器，方便统一管理 */
.game-actions {
    display: flex;
    gap: 10px;
}

/* 按钮样式升级：胶囊形状，鲜艳颜色 */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    padding: 6px 15px; /* 减少内边距，更紧凑 */
    background-color: var(--bg-body); /* 默认浅灰背景 */
    border: 2px solid transparent;
    border-radius: 50px; /* 胶囊圆角 */
    
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-action:hover {
    background-color: var(--accent-color); /* 悬停变橙 */
    color: #fff;
    transform: translateY(-2px); /* 微微上浮 */
    box-shadow: 0 4px 10px rgba(255, 159, 28, 0.4); /* 发光阴影 */
}

/* 按钮图标和文字间距 */
.btn-action i {
    margin-right: 5px;
    font-style: normal; /* 确保图标不倾斜 */
}

/* 移动端隐藏按钮文字，只显示图标，进一步紧凑 */
@media (max-width: 500px) {
    .btn-action {
        padding: 6px 12px;
    }
    .btn-text {
        display: none;
    }
    .btn-action i {
        margin-right: 0;
    }
}


/* ========================================= */
/* 4. 文字内容卡片 (Card UI)                */
/* ========================================= */
.info-section, .comments-section {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* 轻柔的阴影 */
}

/* 标题排版优化 */
.info-section h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center; /* 标题居中更大气 */
    letter-spacing: -1px;
}

.info-section h2, .comments-section h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--accent-color); /* 使用强调色 */
    margin-top: 30px;
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
}

/* 给 h2 加个左侧装饰条 */
.info-section h2::before, .comments-section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 24px;
    background-color: var(--primary-color);
    border-radius: 4px;
}

.info-section p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: justify; /* 两端对齐更整齐 */
}

/* 列表样式 */
.tips-list {
    list-style: none; /* 去掉默认圆点 */
    padding-left: 0;
}

.tips-list li {
    background: #f8f9fa;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent-color); /* 左侧橙色边框 */
    border-radius: 0 4px 4px 0;
    font-weight: 500;
    color: var(--text-main);
}

/* ========================================= */
/* 5. 评论区表单优化                        */
/* ========================================= */
.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-main);
    background-color: var(--bg-card);
    transition: border-color 0.3s ease;
    
    /* ⚡️ 核心优化点：控制缩放 */
    resize: vertical;       /* 仅允许垂直方向缩放 */
    min-height: 120px;      /* 设定最小高度 */
    max-height: 300px;      /* 设定最大高度，防止撑开页面 */
}

.comment-form textarea:focus {
border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.2);
}

.comment-form button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(43, 62, 80, 0.3);
}

.comment-form button:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

/* ========================================= */
/* 6. Footer (页脚)                         */
/* ========================================= */
footer {
    background: var(--primary-color);
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    border-top: 4px solid var(--accent-color); /* 顶部橙色线条 */
}

footer ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    list-style: none;
    margin-bottom: 20px;
}

footer ul li a {
    color: #a4b0be;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

footer ul li a:hover {
    color: var(--accent-color);
}

footer p {
    color: #7f8fa6;
    font-size: 14px;
}

/* ========================================= */
/* 7. 剧院模式 & 移动端适配                 */
/* ========================================= */
body.theater-active {
    background-color: #000;
}
/* 这里省略重复的剧院模式代码，与之前保持一致即可，主要是背景变黑 */

/* 移动端汉堡菜单 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s;
}
.menu-toggle span {
    width: 28px;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

/* ⚡️ 新增：汉堡菜单激活时的 X 样式 */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg); /* 第二条 span 的一半距离 + 旋转 */
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0; /* 隐藏中间的 span */
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg); /* 第二条 span 的一半距离 + 旋转 */
}

@media (max-width: 700px) {
    header {
        padding: 0 20px; /* 移动端内边距减小 */
    }
    
    .menu-toggle {
        display: flex;
    }

    header nav {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--primary-color);
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        z-index: 999;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    header nav.open {
        display: block;
        animation: slideDown 0.3s ease;
    }

    /* ⚡️ 确保在菜单打开时，按钮被置于最上层 */
    header {
        position: relative; /* 方便其子元素 z-index 工作 */
    }
    .menu-toggle.active {
        z-index: 1001; /* 比导航栏高一点 */
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .info-section h1 {
        font-size: 2rem;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------- */
/* ⚡️ 全屏退出按钮样式 */
/* ----------------------------------------- */
.exit-fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10000; /* 确保它在所有元素之上 */
    background: rgba(43, 62, 80, 0.7); /* 半透明背景 */
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    line-height: 40px;
    cursor: pointer;
    display: none; /* 默认隐藏 */
    transition: background 0.3s;
    text-align: center;
    padding: 0;
}

.exit-fullscreen-btn:hover {
    background: var(--accent-color); /* 悬停时突出显示 */
}

/* 关键：使用 :fullscreen 伪类，只有当父容器处于全屏模式时，按钮才显示 */
.iframe-box:fullscreen .exit-fullscreen-btn,
.inner-frame-box:fullscreen .exit-fullscreen-btn {
    display: block;
}


/* ========================================= */
/* 8. 新版评论区样式 (New Comments UI)       */
/* ========================================= */

/* 表单布局优化 */
.comment-form-wrapper {
    margin-bottom: 40px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 200px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--accent-color);
}

/* 星级评分组件样式 */
.rating-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 0 15px;
    border-radius: 8px;
    border: 2px solid #eee;
}

.rating-group label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 14px;
}

.star-rating {
    display: flex;
    cursor: pointer;
}

.star-rating span {
    font-size: 24px;
    color: #ddd; /* 未选中颜色 */
    transition: color 0.2s, transform 0.2s;
    padding: 0 2px;
}

.star-rating span.active,
.star-rating span:hover,
.star-rating span:hover ~ span {
    /* 注意：这里利用JS控制 active 类，或者简单的 hover */
}

/* 选中或者是鼠标悬停时的金色 */
.star-rating span.filled {
    color: #ffc107; /* 金星 */
}

.star-rating span:hover {
    transform: scale(1.2);
}

/* 评论列表区域 */
/* ========================================= */
/* 8. 评论区 UI 深度优化 (Optimized UI)      */
/* ========================================= */

/* --- 容器布局 --- */
.comments-display {
    margin-top: 40px;
    border-top: 2px dashed #dde1e6; /* 使用虚线分割，更像票据/清单 */
    padding-top: 30px;
}

.comments-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.comments-header-row h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 评论计数胶囊 */
.comment-count {
    background: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(43, 62, 80, 0.3);
}

/* 评论列表容器 */
.comments-grid {
    display: flex;
    flex-direction: column;
    gap: 20px; /* 卡片之间的间距 */
}

/* --- 评论卡片设计 (核心) --- */
.comment-card {
    background: #fff;
    border-radius: 16px; /* 更大的圆角，呼应游戏风格 */
    padding: 20px;
    display: flex;
    gap: 18px;
    border: 1px solid rgba(0,0,0,0.03); /* 极细微边框 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.04); /* 基础阴影 */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* 平滑过渡 */
    position: relative;
    overflow: hidden;
}

/* 悬停动效：卡片轻微上浮 */
.comment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: rgba(255, 159, 28, 0.3); /* 悬停时出现淡淡的橙色边框 */
}

/* 头像设计 */
.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), #34495e); /* 渐变背景，更有质感 */
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(43, 62, 80, 0.3);
    border: 2px solid #fff; /* 白色内描边 */
}

/* 内容区域布局 */
.comment-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 卡片头部信息 */
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 用户名 */
.user-name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

/* 星级展示 */
.user-rating {
    color: var(--accent-color); /* 你的主题橙色 */
    font-size: 14px;
    letter-spacing: 1px;
    background: #fff8e1; /* 浅黄色背景衬托星星 */
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

/* 日期 */
.comment-date {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 500;
}

/* 评论正文 */
.comment-text {
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word; /* 防止长单词撑破布局 */
}

/* --- 占位符与空状态 --- */
.loading-placeholder, .empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .comment-card {
        padding: 15px;
        gap: 12px;
    }
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .comment-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .user-rating {
        margin-left: 0;
        margin-top: 2px;
        display: inline-block;
    }
}

/* ========================================= */
/* 9. Toast 通知 UI 样式 (代替 Alert)        */
/* ========================================= */

/* 容器定位：固定在页面顶部 */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000; /* 确保它在所有内容之上 */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 单个 Toast 样式 */
.toast {
    background: var(--primary-color); 
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px; /* 圆角 */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    font-family: var(--font-body);
    min-width: 250px;
    max-width: 350px;
    /* 初始状态：完全透明且向右移，准备滑入 */
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

/* Toast 动画效果：滑入与滑出 */
.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* 强调类型：成功/错误 */
.toast.success {
    /* 成功色使用强调色 */
    border-left: 5px solid var(--accent-color); 
}

.toast.error {
    /* 错误色使用红色，略微柔和 */
    border-left: 5px solid #e74c3c;
}