/* ============================================
   common.css - 老师专用通用样式
   ============================================ */

/* ---------- 全局重置 ---------- */
body:not(.loaded) {
    visibility: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F2F3F5;
    margin: 0;
    padding-top: 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 页头样式 ---------- */
.header {
    background-color: white;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    transition: all 0.3s ease;
}

.header h1 {
    color: #1F2937;
    display: flex;
    align-items: center;
}

.header h1 i {
    margin-right: 0.5rem;
    color: #165DFF;
}

/* ---------- 用户信息 ---------- */
.user-info {
    display: flex;
    align-items: center;
}

.player-prefix {
    color: #1F2937;
    font-weight: 500;
    margin-right: 0.25rem;
}

.username-blue {
    color: #165DFF;
    font-weight: bold;
}

/* ---------- 导航按钮 ---------- */
.nav-button {
    background-color: #E5E7EB;
    font-size: 16px;
    color: #666666;
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 0.5rem;
}

.nav-button:hover {
    background-color: #D1D5DB;
    color: #1DA1F2;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.logout-button {
    background-color: #E5E7EB;
    font-size: 18px;
    color: #666666;
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 0.5rem;
}

.logout-button:disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.logout-button:hover {
    background-color: #D1D5DB;
    color: #1DA1F2;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ---------- 首页按钮图标悬停 ---------- */
#homeBtn:hover i {
    transform: scale(1.8);
    transition: transform 0.3s ease;
}

#homeBtn i {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* ---------- VIP标识 ---------- */
.vip-badge {
    display: none;
    background-color: #1E90FF;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.vip-badge.active {
    display: inline-block;
}

/* ---------- 下拉菜单 ---------- */
.dropdown {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
}

.dropdown-button {
    background-color: #6B7280;
    color: white;
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 0.5rem;
    overflow: hidden;
}

.dropdown-content a {
    color: #1F2937;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    text-align: left;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #F3F4F6;
}

.dropdown-content a i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* ---------- Logo 响应式 ---------- */
.logo-desktop {
    display: block;
}
.logo-mobile {
    display: none;
}

/* ---------- 主内容区（flex:1 自动撑开，把页脚推到底部） ---------- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* ---------- 页脚容器（自动在底部） ---------- */
#footer-placeholder {
    margin-top: auto;
    width: 100%;
}

/* ---------- 页脚样式 ---------- */
.footer {
    background-color: #1F2937;
    color: white;
    padding: 1rem;
    text-align: center;
    width: 100%;
}

.footer a {
    color: #9CA3AF;
    text-decoration: none;
}

.footer a:hover {
    color: white;
}

/* ---------- SweetAlert2 按钮修复 ---------- */
.swal2-styled.swal2-confirm {
    background-color: #3085d6 !important;
}

.swal2-styled.swal2-confirm:hover {
    background-color: #1a73d6 !important;
}

.swal2-styled.swal2-cancel {
    background-color: #d33 !important;
}

.swal2-styled.swal2-cancel:hover {
    background-color: #c11 !important;
}

.swal2-styled {
    color: white !important;
}

.swal2-popup {
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .header {
        padding: 0.5rem;
    }

    /* 小屏幕：隐藏独立按钮，显示下拉菜单 */
    .nav-button:not(#homeBtn), .logout-button {
        display: none;
    }

    .dropdown {
        display: inline-block;
    }

    .logo-desktop {
        display: none;
    }
    .logo-mobile {
        display: block;
    }

    .main-content {
        padding: 0.5rem;
    }
}

/* ---------- 大屏幕：隐藏下拉菜单，显示独立按钮 ---------- */
@media (min-width: 769px) {
    .dropdown {
        display: none;
    }

    .nav-button, .logout-button {
        display: flex;
    }

    .logo-desktop {
        display: block;
    }
    .logo-mobile {
        display: none;
    }
}