/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "微软雅黑", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #F5F7FA;
}

/* 登录页面样式 */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #165DFF 0%, #3B82F6 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-size: 20px;
    font-weight: bold;
    color: #165DFF;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

.role-selection {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
}

.role-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.role-option input[type="radio"] {
    margin-right: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #165DFF;
}

.login-button {
    width: 100%;
    padding: 12px;
    background-color: #165DFF;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-button:hover {
    background-color: #0D47A1;
}

/* 主页面布局 */
.main-container {
    display: flex;
    height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 220px;
    background-color: #fff;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: bold;
    color: #165DFF;
}

.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    text-decoration: none;
}

.menu-item:hover {
    background-color: #F5F7FA;
    color: #165DFF;
}

.menu-item.active {
    background-color: #EBF0FF;
    color: #165DFF;
    border-left: 3px solid #165DFF;
}

.menu-item i {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar.collapsed .menu-item span {
    display: none;
}

.sidebar.collapsed .menu-item i {
    margin-right: 0;
}

/* 主内容区样式 */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部导航栏样式 */
.top-nav {
    height: 60px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 选项卡样式 */
.tabs {
    display: flex;
    background-color: #fff;
    margin-bottom: 20px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab-btn {
    padding: 15px 30px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background-color: #f5f7fa;
}

.tab-btn.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
    background-color: #fff;
}

/* 选项卡内容 */
.tab-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    display: none;
}

.tab-content.active {
    display: block;
}

/* 状态标签样式 */
.status-pending {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background-color: #fff7e6;
    color: #fa8c16;
    font-size: 12px;
}

.status-approved {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background-color: #f0f9ff;
    color: #52c41a;
    font-size: 12px;
}

.status-rejected {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background-color: #fff1f0;
    color: #f5222d;
    font-size: 12px;
}

/* 申请详情样式 */
.detail-info {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
}

.detail-label {
    width: 120px;
    font-weight: 500;
    color: #666;
}

.detail-value {
    flex: 1;
    color: #333;
}

/* 筛选区域样式 */
.filter-container {
    background-color: #fafafa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 提示消息样式 */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-info {
    background-color: #1890ff;
}

.toast-success {
    background-color: #52c41a;
}

.toast-error {
    background-color: #f5222d;
}

.toast-warning {
    background-color: #fa8c16;
}

.nav-left {
    display: flex;
    align-items: center;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    margin-right: 20px;
}

.page-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.nav-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.user-name {
    margin-right: 10px;
}

.logout-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: #F5F7FA;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 15px 20px;
    background-color: #F5F7FA;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.breadcrumb a {
    color: #165DFF;
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 5px;
    color: #999;
}

/* 页面内容区域 */
.page-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 查询区域样式 */
.search-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.search-item {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.search-item label {
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

.search-item input,
.search-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* 操作区域样式 */
.action-section {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: #165DFF;
    color: white;
}

.btn-primary:hover {
    background-color: #0D47A1;
}

.btn-secondary {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
}

.btn-danger {
    background-color: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background-color: #cf1322;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.data-table-wrapper {
    overflow-x: auto;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #F5F7FA;
    font-weight: 500;
    color: #666;
    font-size: 12px;
}

.data-table tr:hover {
    background-color: #fafafa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: #f5f5f5;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 卡片样式 - 用于首页数据概览 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.card-value {
    font-size: 24px;
    font-weight: bold;
    color: #165DFF;
    margin-bottom: 10px;
}

.card-trend {
    font-size: 12px;
}

.card-trend.positive {
    color: #52c41a;
}

.card-trend.negative {
    color: #ff4d4f;
}

/* 必填项标记 */
.required {
    color: #ff4d4f;
    margin-left: 2px;
}

/* 排课矩阵样式 */
.schedule-matrix {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.schedule-matrix th,
.schedule-matrix td {
    padding: 8px;
    text-align: center;
    border: 1px solid #eee;
    min-width: 100px;
}

.schedule-matrix th {
    background-color: #F5F7FA;
    font-weight: 500;
    color: #666;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.schedule-matrix th:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    min-width: 150px;
}

.schedule-cell {
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
}

.schedule-cell.conflict {
    background-color: #fff1f0;
    color: #cf1322;
    font-weight: bold;
}

/* 排课单元格内部样式 */
.time-slot {
    margin-bottom: 4px;
    padding: 3px 5px;
    border-radius: 3px;
    background-color: #e6f4ff;
    color: #165dff;
}

.time-slot.free {
    background-color: #f0f0f0;
    color: #999;
}

.time-label {
    font-weight: bold;
    margin-right: 5px;
}

.group-info {
    font-size: 11px;
}

/* 分割线样式 */
.lunch-break,
.evening-break {
    height: 1px;
    background-color: #d9d9d9;
    margin: 6px 0;
    position: relative;
}

.lunch-break::after {
    content: "午休";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 0 10px;
    font-size: 11px;
    color: #666;
}

.evening-break::after {
    content: "晚间";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 0 10px;
    font-size: 11px;
    color: #666;
}

/* 表格空数据提示 */
.empty-message {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* 模态框样式增强 */
.modal-content {
    max-width: 500px;
    width: 100%;
}

/* 响应式设计 */
@media (max-width: 1366px) {
    .sidebar {
        width: 200px;
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 1280px) {
    .search-item {
        min-width: 180px;
    }
    
    .schedule-matrix th,
    .schedule-matrix td {
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -220px;
        z-index: 30;
        height: 100vh;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .content {
        margin-left: 0;
    }
    
    .modal-content {
        margin: 20px;
    }
    
    .search-row {
        flex-direction: column;
    }
    
    .search-item {
        min-width: 100%;
    }
    
    .action-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-section .btn {
        width: 100%;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-10 {
    padding: 10px;
}

.p-20 {
    padding: 20px;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #165DFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    background-color: #52c41a;
    color: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    z-index: 1500;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast i {
    margin-right: 10px;
    font-size: 18px;
}

.toast.toast-error {
    background-color: #ff4d4f;
}

/* 确认对话框 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.confirm-content {
    background-color: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.confirm-content h4 {
    margin-bottom: 15px;
    color: #333;
}

.confirm-content p {
    margin-bottom: 20px;
    color: #666;
}

.confirm-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #165DFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-message {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 5px;
}

/* 成功提示 */
.success-message {
    color: #52c41a;
    font-size: 12px;
    margin-top: 5px;
}

/* 多选框组样式 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 5px;
}

/* 周历组件样式 */
.week-calendar {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.week-calendar > .week-day {
    flex: 1;
    box-sizing: border-box;
}

.day-slot {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.day-slot:hover {
    background-color: #EBF0FF;
}

.day-slot.selected {
    background-color: #165DFF;
    color: white;
    border-color: #165DFF;
}

/* 评分输入框样式 */
.score-input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* 备注输入框样式 */
.comment-input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 60px;
}