/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    background-color: #409EFF;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 20px;
    margin: 0;
}

.admin-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s;
}

.admin-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* 选择区域 */
.select-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.select-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.form-group select {
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

/* 今日课程区域 */
.today-section,
.week-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.today-section h2,
.week-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

/* 课程列表 */
.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.course-card {
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.course-info h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.course-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

/* 周课表 */
.week-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
    border: 1px solid #e4e7ed;
    border-radius: 8px;
}

.week-header {
    display: flex;
    background-color: #f0f9eb;
    font-weight: bold;
    border-bottom: 1px solid #e4e7ed;
}

.week-body {
    display: flex;
    flex-direction: column;
}

.time-row {
    display: flex;
    border-bottom: 1px solid #e4e7ed;
}

.time-row:nth-child(even) {
    background-color: #fafafa;
}

.time-cell {
    width: 80px;
    padding: 10px;
    border-right: 1px solid #e4e7ed;
    text-align: center;
    background-color: #fafafa;
    font-weight: bold;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-cell {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border-right: 1px solid #e4e7ed;
    position: relative;
    min-height: 80px;
}

.course-item {
    background-color: #ecf5ff;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 5px;
    font-size: 12px;
    border-left: 3px solid #409EFF;
}

.course-name {
    font-weight: bold;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-teacher {
    font-size: 11px;
    color: #666;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-location {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 14px;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 10px;
    }
    
    .header {
        padding: 0 10px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .select-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group select {
        width: 100%;
    }
    
    .course-list {
        grid-template-columns: 1fr;
    }
    
    .week-table {
        font-size: 12px;
    }
    
    .time-cell {
        width: 60px;
        padding: 5px;
        min-height: 60px;
    }
    
    .day-cell {
        min-width: 100px;
        padding: 5px;
        min-height: 60px;
    }
    
    .course-item {
        padding: 5px;
        font-size: 11px;
    }
}

/* 管理后台样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f5f5f5;
}

.login-form {
    width: 400px;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.form-group input {
    padding: 10px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
}

.form-group button {
    padding: 10px 20px;
    background-color: #409EFF;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.form-group button:hover {
    background-color: #66b1ff;
}

/* 管理后台主页面 */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    background-color: #409EFF;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
    font-size: 20px;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s;
}

.user-info a:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.dashboard-content {
    flex: 1;
    display: flex;
}

.sidebar {
    width: 200px;
    background-color: #f0f2f5;
    padding: 20px 0;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar a:hover {
    background-color: #e6e8eb;
}

.sidebar a.active {
    background-color: #409EFF;
    color: white;
}

.main-panel {
    flex: 1;
    padding: 20px;
    background-color: #f5f5f5;
}

.panel-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.panel-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

table th {
    background-color: #f5f7fa;
    font-weight: bold;
    color: #333;
}

table tr:hover {
    background-color: #f5f7fa;
}

/* 按钮样式 */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #409EFF;
    color: white;
}

.btn-primary:hover {
    background-color: #66b1ff;
}

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

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

.btn-success {
    background-color: #67c23a;
    color: white;
}

.btn-success:hover {
    background-color: #85ce61;
}

/* 表单样式 */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-col {
    flex: 1;
    min-width: 200px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 响应式管理后台 */
@media (max-width: 768px) {
    .dashboard-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px 0;
    }
    
    .sidebar ul {
        display: flex;
        overflow-x: auto;
    }
    
    .sidebar li {
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .sidebar a {
        white-space: nowrap;
        padding: 8px 16px;
    }
    
    .main-panel {
        padding: 10px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-col {
        min-width: 100%;
    }
}