/* ========== 游戏页样式 ========== */

/* 游戏页容器 - 【优化】背景色调整为白色 */
#gamePage {
    width: 100%;
    min-height: 100vh;
    background-color: #fff;
}

/* 导航栏容器 */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
}

/* 左侧区域：标题和班级名称 */
#navLeft {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#navTitle {
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-color);
    white-space: nowrap;
}

#currentClassName {
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-color);
}

/* 居中区域：导航框（胶囊形） */
#navBox {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 2px solid var(--theme-color);
    border-radius: 30px;
    padding: 4px 8px;
    box-shadow: var(--theme-shadow);
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* 导航按钮样式 */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.nav-btn:hover {
    background-color: color-mix(in srgb, var(--theme-color) 15%, transparent);
    color: var(--theme-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn:hover .nav-icon,
.nav-btn:hover .nav-text {
    transform: scale(1.05);
}

/* 导航按钮图标和文字过渡效果 */
.nav-btn .nav-icon,
.nav-btn .nav-text {
    transition: transform 0.2s ease;
}

.nav-btn.active {
    background-color: var(--theme-color);
    color: #fff;
}

/* 导航按钮图标样式 */
.nav-icon {
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 导航按钮文字样式 */
.nav-text {
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
}

/* 右侧区域：搜索框、帮助和退出按钮 */
#navRight {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 学生搜索框样式 */
.student-search-box {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 4px 12px;
    transition: all 0.2s ease;
    position: relative;
}

.student-search-box:focus-within {
    border-color: var(--theme-color);
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.student-search-box .search-icon {
    font-size: 14px;
    margin-right: 6px;
    opacity: 0.6;
}

.student-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 120px;
    color: #333;
    font-family: inherit;
}

.student-search-input::placeholder {
    color: #999;
}

.btn-clear-search {
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.btn-clear-search:hover {
    color: #e53935;
}

/* 图标按钮样式 */
.nav-btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background-color: #f5f5f5;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.nav-btn-icon:hover {
    background-color: color-mix(in srgb, var(--theme-color) 15%, transparent);
    transform: scale(1.1);
}

/* 主内容区域 */
#mainContent {
    margin-top: 60px;
    padding: 5px 20px 20px 20px;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 批量操作按钮容器 - 固定在右下角 */
#batchOpBtnContainer {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

/* 主页面批量操作按钮样式 - 固定尺寸90px×35px，带呼吸动画 */
.btn-batch-main {
    width: 90px;
    height: 35px;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--theme-color) 0%, color-mix(in srgb, var(--theme-color) 80%, #000) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    color: #fff !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    animation: batchBtnBreathe 3s ease-in-out infinite;
    transform-origin: center center;
}

.btn-batch-main:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
    animation-play-state: paused;
}

/* 批量操作按钮图标样式 - 白色线条勾勒效果（使用滤镜将emoji变白） */
.btn-batch-main .batch-icon {
    font-size: 13.3px; /* 与文字同比例缩小5% */
    display: inline-block;
    line-height: 1;
    /* 使用滤镜将彩色emoji变成白色 */
    filter: grayscale(100%) brightness(10);
    opacity: 0.95;
}

/* 批量操作按钮整体呼吸动画 - 整个按钮（图标+文字）一起呼吸 */
@keyframes batchBtnBreathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.06);
        opacity: 0.92;
    }
}

/* 学生卡片容器网格布局 - 【优化】全屏时一行显示6个卡片，减少左右边距 */
#cardContainer {
    display: grid;
    grid-template-columns: repeat(6, 230px);
    gap: 24px;
    padding: 0;
    justify-content: center;
    justify-items: center;
}

/* ========== 云同步状态指示器（小光点） ========== */

/* 同步指示器基础样式 - 小光点，内联显示在标题后面 */
#syncStatus.sync-indicator {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    position: relative;
}

.sync-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

/* 光点扩散效果 */
.sync-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    opacity: 0.3;
    transition: all 0.3s ease;
}

/* 本地模式 - 灰色 */
.sync-indicator.sync-local {
    background-color: #9e9e9e;
    box-shadow: 0 0 4px rgba(158, 158, 158, 0.6);
}

.sync-indicator.sync-local::before {
    background-color: #9e9e9e;
}

/* 同步中 - 蓝色闪烁 */
.sync-indicator.sync-syncing {
    background-color: #2196f3;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.8);
    animation: syncPulse 1.5s ease-in-out infinite;
}

.sync-indicator.sync-syncing::before {
    background-color: #2196f3;
    animation: syncGlow 1.5s ease-in-out infinite;
}

/* 已同步 - 绿色 */
.sync-indicator.sync-synced {
    background-color: #4caf50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.8);
}

.sync-indicator.sync-synced::before {
    background-color: #4caf50;
}

/* 检测中 - 橙色闪烁 */
.sync-indicator.sync-checking {
    background-color: #ff9800;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.8);
    animation: syncPulse 1s ease-in-out infinite;
}

.sync-indicator.sync-checking::before {
    background-color: #ff9800;
    animation: syncGlow 1s ease-in-out infinite;
}

/* 云端模式 - 青色 */
.sync-indicator.sync-online {
    background-color: #00bcd4;
    box-shadow: 0 0 6px rgba(0, 188, 212, 0.8);
}

.sync-indicator.sync-online::before {
    background-color: #00bcd4;
}

/* 光点闪烁动画 */
@keyframes syncPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

/* 光晕扩散动画 */
@keyframes syncGlow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* 悬停时显示提示效果 */
.sync-indicator:hover {
    transform: scale(1.2);
}

.sync-indicator:hover::before {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.8);
}


/* ========== 班级选择弹窗样式 ========== */
.class-select-list {
    max-height: 300px;
    overflow-y: auto;
}

.class-select-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.class-select-item:hover {
    border-color: var(--theme-color);
    background-color: rgba(211, 91, 126, 0.05);
}

.class-select-item:last-child {
    margin-bottom: 0;
}

.class-select-item .class-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.class-select-item .class-count {
    font-size: 14px;
    color: #999;
}


/* ========== 帮助弹窗样式 ========== */
.help-content {
    line-height: 1.8;
}

.help-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.help-content h4:first-child {
    margin-top: 0;
}

.help-content p {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.help-content ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.help-content li {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
}


/* ========== 游戏页响应式 ========== */
@media (max-width: 1600px) {
    #cardContainer {
        grid-template-columns: repeat(5, 230px);
    }
}

@media (max-width: 1400px) {
    #cardContainer {
        grid-template-columns: repeat(4, 230px);
    }
}

@media (max-width: 1200px) {
    #navBox {
        position: static;
        transform: none;
    }
    
    #navbar {
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .nav-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    #cardContainer {
        grid-template-columns: repeat(3, 230px);
    }
}

@media (max-width: 950px) {
    #cardContainer {
        grid-template-columns: repeat(2, 230px);
    }
}

@media (max-width: 992px) {
    #navBox {
        display: none;
    }
    
    #navbar {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    #navbar {
        height: 50px;
        padding: 0 15px;
    }
    
    #navTitle {
        font-size: 16px;
    }
    
    #mainContent {
        margin-top: 50px;
        padding: 12px 15px 15px 15px;
        min-height: calc(100vh - 50px);
    }
    
    #cardContainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        justify-content: center;
        width: 100%;
    }
    
    .nav-btn-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    /* 批量操作按钮在小屏幕上调整位置 */
    #batchOpBtnContainer {
        right: 15px;
        bottom: 15px;
    }
    
    .btn-batch-main {
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    #cardContainer {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    #navTitle {
        font-size: 14px;
    }
    
    /* 批量操作按钮在超小屏幕上进一步调整 */
    #batchOpBtnContainer {
        right: 10px;
        bottom: 10px;
    }
    
    .btn-batch-main {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 20px;
    }
    
    .btn-batch-main .batch-icon {
        font-size: 14px;
    }
}
