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

body {
    font-family: 'Noto Sans SC', 'Nunito', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
    padding-top: 80px;
}

/* 顶部导航栏样式 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.logo-section:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 移动端汉堡菜单 */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 20px;
    align-items: center;
    justify-content: center;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 16px;
    z-index: 999;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu.active {
    display: flex;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 1024px) {
    .nav-menu {
        display: none;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .logo-text {
        font-size: 16px;
    }
    .top-header {
        padding: 0 16px;
    }
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn:hover {
    background: #f1f5f9;
    color: #334155;
    transform: translateY(-1px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 工具箱下拉菜单 */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 160px;
    padding: 8px;
    display: none;
    border: 1px solid #e2e8f0;
    z-index: 1001;
}

.nav-dropdown-menu.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

.nav-dropdown-item {
    width: 100%;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-align: left;
}

.nav-dropdown-item:hover {
    background: #f1f5f9;
    color: #667eea;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 8px;
}

.class-selector {
    position: relative;
}

.class-dropdown-btn {
    padding: 8px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.class-dropdown-btn:hover {
    border-color: #667eea;
    background: #fff;
}

.class-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 200px;
    padding: 8px;
    display: none;
    border: 1px solid #e2e8f0;
}

.class-dropdown-menu.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

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

.class-item {
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.class-item:hover {
    background: #f1f5f9;
}

.class-item.active {
    background: #eff6ff;
    color: #667eea;
    font-weight: 700;
}

.class-delete-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.class-item:hover .class-delete-btn {
    opacity: 1;
}

/* 主内容区域 */
.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 32px;
}

@media (max-width: 768px) {
    .main-container {
        padding: 16px;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* 工具栏样式 - PC端 */
.toolbar {
    background: white;
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    visibility: visible;
    opacity: 1;
}

.search-box {
    position: relative;
    width: 280px;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

/* ============================================
   排序选择器样式 - 已修复：增强浏览器兼容性
   ============================================ */
.sort-select,
.form-select,
.workbench-class-select {
    /* 标准属性 */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    -ms-appearance: none;
    
    /* 基础样式 */
    padding: 10px 40px 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    /* 修改1：主页排序文字不加粗，颜色变淡 */
    font-weight: 400;
    cursor: pointer;
    outline: none;
    
    /* 渐变背景 + 下拉箭头 */
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    
    /* 过渡效果 */
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    
    /* 修改1：文字颜色变淡，从#1e293b改为#64748b */
    color: #64748b;
    min-width: 140px;
    
    /* 阴影 */
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* 禁用默认下拉箭头 - IE/Edge */
.sort-select::-ms-expand,
.form-select::-ms-expand,
.workbench-class-select::-ms-expand {
    display: none;
}

/* Hover状态 */
.sort-select:hover,
.form-select:hover,
.workbench-class-select:hover {
    border-color: #667eea;
    -webkit-box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    -moz-box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    -webkit-transform: translateY(-1px);
    -moz-transform: translateY(-1px);
    -ms-transform: translateY(-1px);
    transform: translateY(-1px);
}

/* Focus状态 */
.sort-select:focus,
.form-select:focus,
.workbench-class-select:focus {
    border-color: #667eea;
    -webkit-box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    -moz-box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* PC端工具栏中的排序选择器 */
.toolbar .sort-select {
    min-width: 160px;
    padding: 12px 42px 12px 18px;
    font-size: 15px;
    border-radius: 24px;
}

/* 工作台中的排序选择器 */
.student-sort-controls .sort-select {
    min-width: 150px;
    border-radius: 24px;
}

/* 下拉选项样式 - 跨浏览器兼容，确保完整显示 */
.sort-select option,
.form-select option,
.workbench-class-select option {
    padding: 12px 16px;
    font-size: 14px;
    /* 修改1：选项文字也不加粗，颜色变淡 */
    font-weight: 400;
    background: #ffffff;
    /* 修改1：选项文字颜色变淡 */
    color: #64748b;
    min-height: 40px;
    line-height: 1.5;
}

/* 选项Hover/Selected状态 */
.sort-select option:hover,
.sort-select option:checked,
.form-select option:hover,
.form-select option:checked,
.workbench-class-select option:hover,
.workbench-class-select option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-color: #667eea;
    color: white;
}

/* Firefox专用选项样式 */
@-moz-document url-prefix() {
    .sort-select,
    .form-select,
    .workbench-class-select {
        background-color: #ffffff;
        /* 修改1：Firefox文字颜色变淡 */
        color: #64748b;
        font-weight: 400;
    }
    
    .sort-select option,
    .form-select option,
    .workbench-class-select option {
        background-color: #ffffff;
        /* 修改1：Firefox选项文字颜色变淡 */
        color: #64748b;
        font-weight: 400;
        padding: 8px;
    }
}

/* Safari/Chrome专用 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .sort-select,
    .form-select,
    .workbench-class-select {
        -webkit-appearance: none;
        appearance: none;
    }
}

/* 移动端适配 - 触摸友好 */
@media (max-width: 768px) {
    .sort-select,
    .form-select,
    .workbench-class-select {
        min-width: 100px;
        padding: 12px 36px 12px 14px;
        font-size: 14px;
        border-radius: 20px;
        background-position: right 12px center;
        background-size: 14px;
        height: 44px; /* 触摸友好的高度 */
    }
    
    .toolbar .sort-select {
        min-width: auto;
        width: 100%;
        padding: 12px 36px 12px 14px;
        font-size: 14px;
        border-radius: 20px;
        height: 44px;
    }
    
    .student-sort-controls .sort-select {
        min-width: 100%;
        width: 100%;
        border-radius: 20px;
        height: 44px;
    }
    
    /* 移动端选项样式 - 更大的触摸区域 */
    .sort-select option,
    .form-select option,
    .workbench-class-select option {
        padding: 16px;
        font-size: 16px; /* 防止iOS缩放 */
        min-height: 48px;
    }
}

/* iOS专用修复 */
@supports (-webkit-touch-callout: none) {
    .sort-select,
    .form-select,
    .workbench-class-select {
        font-size: 16px; /* 防止iOS缩放 */
        -webkit-border-radius: 20px;
        border-radius: 20px;
    }
    
    .sort-select option,
    .form-select option,
    .workbench-class-select option {
        font-size: 16px;
    }
}

/* 禁用状态 */
.sort-select:disabled,
.form-select:disabled,
.workbench-class-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    -webkit-transform: none;
    -moz-transform: none;
    -ms-transform: none;
    transform: none;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
}

/* 确保在所有容器中保持一致椭圆外观 */
.student-list-header .sort-select,
.workbench-header .sort-select,
.toolbar .sort-select,
.group-management-header .sort-select,
.edit-form-item .sort-select,
.score-selector .sort-select {
    border-radius: 24px;
    height: auto;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .student-list-header .sort-select,
    .workbench-header .sort-select,
    .toolbar .sort-select,
    .group-management-header .sort-select,
    .edit-form-item .sort-select,
    .score-selector .sort-select {
        border-radius: 20px;
        height: 44px;
    }
}

/* ============================================
   排序选择器样式结束
   ============================================ */

.view-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 24px;
    padding: 4px;
    gap: 4px;
    flex-shrink: 0;
}

.view-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s;
    white-space: nowrap;
}

.view-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.batch-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-left: auto; /* 将批量按钮推到右侧 */
}

.batch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

/* 移动端工具栏 - 两行两列网格布局 */
@media (max-width: 768px) {
    .toolbar {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 16px;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .search-box {
        width: auto; /* 取消固定宽度 */
        grid-column: 1 / 2;
    }

    .search-box input {
        border-radius: 20px;
    }

    .sort-select {
        grid-column: 2 / 3;
        width: 100%; /* 占满网格列 */
        border-radius: 20px;
        min-width: auto;
    }

    .view-toggle {
        grid-column: 1 / 2;
        width: 100%;
        border-radius: 20px;
    }

    .view-btn {
        border-radius: 16px;
    }

    .batch-btn {
        grid-column: 2 / 3;
        width: 100%;
        margin-left: 0; /* 取消PC端的自动外边距 */
        justify-content: center;
        border-radius: 20px;
    }

    /* 调整间距和字体 */
    .search-box input,
    .sort-select,
    .view-btn,
    .batch-btn {
        font-size: 14px;
    }

    .view-btn {
        padding: 8px 0; /* 减少左右内边距，适应小屏 */
        flex: 1;
        text-align: center;
    }
}

/* 神兽页面激活时的样式 - 隐藏主内容和工具栏 */
body.shenshou-page-active .main-container,
body.shenshou-page-active .toolbar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* PC端神兽页面样式 */
body.shenshou-page-active .shenshou-page {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 移动端神兽页面适配 */
@media (max-width: 768px) {
    .shenshou-page {
        padding: 16px;
    }
    
    /* 神兽页面激活时强制隐藏主内容 - 覆盖移动端媒体查询 */
    body.shenshou-page-active .main-container,
    body.shenshou-page-active .toolbar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* 神兽页面内部元素的移动端适配 */
    .shenshou-main-card {
        padding: 24px;
        border-radius: 24px;
    }
    
    .shenshou-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .shenshou-image-wrapper {
        width: 180px;
        height: 180px;
    }
    
    .shenshou-image {
        width: 140px;
        height: 140px;
    }
    
    .shenshou-name {
        font-size: 22px;
    }
    
    .shenshou-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .shenshou-btn {
        width: 100%;
        justify-content: center;
    }
    
    .shenshou-contribution-item {
        padding: 12px;
        gap: 10px;
    }
    
    .shenshou-contributor-avatar {
        width: 40px;
        height: 40px;
    }
    
    .shenshou-contributor-meta {
        font-size: 11px;
    }
}