/* 响应式样式表 - 适用于所有页面 */

/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-success {
    background-color: #2ecc71;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-warning {
    background-color: #f39c12;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th, 
.table td {
    padding: 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* 响应式导航栏 */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.navbar-menu {
    display: flex;
    list-style: none;
}

.navbar-menu li {
    margin-left: 20px;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-menu a:hover {
    background-color: #34495e;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    text-decoration: none;
}

.pagination a:hover {
    background-color: #2980b9;
}

.pagination a.active {
    background-color: #2980b9;
}

/* 消息样式 */
.message {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 网格系统 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

/* 管理员侧边栏 */
.admin-sidebar {
    width: 250px;
    background-color: #2c3e50;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    color: white;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.admin-sidebar h2 {
    padding: 20px;
    text-align: center;
    background-color: #34495e;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid #34495e;
    transition: all 0.3s ease;
}

.admin-sidebar li a:hover {
    background-color: #34495e;
}

.admin-sidebar i {
    margin-right: 10px;
}

.admin-content {
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s ease;
}

/* 日历表样式 */
.calendar table {
    width: 100%;
}

.calendar th, 
.calendar td {
    text-align: center;
    padding: 10px;
}

.calendar .attended {
    background-color: #2ecc71;
    color: #fff;
}

.calendar .leave {
    background-color: #e74c3c;
    color: #fff;
}

/* 响应式布局 - 小屏幕设备 */
@media (max-width: 992px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    /* 导航响应式 */
    .navbar-toggle {
        display: block;
    }
    
    .navbar-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: #2c3e50;
        z-index: 100;
    }
    
    .navbar-menu.show {
        display: flex;
    }
    
    .navbar-menu li {
        margin: 0;
        border-top: 1px solid #34495e;
    }
    
    .navbar-menu a {
        display: block;
        padding: 15px;
        border-radius: 0;
    }
    
    /* 管理员侧边栏响应式 */
    .admin-sidebar {
        width: 0;
        z-index: 999;
    }
    
    .admin-sidebar.show {
        width: 250px;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    /* 表单响应式 */
    .form-group {
        flex-direction: column;
    }
    
    /* 表格响应式 */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    /* 网格系统响应式 */
    .row {
        flex-direction: column;
    }
    
    .col {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    /* 按钮响应式 */
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* 工具栏响应式 */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar > * {
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    /* 超小屏幕设备样式 */
    .container {
        padding: 10px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .navbar-brand {
        font-size: 18px;
    }
    
    .card {
        padding: 15px;
    }
    
    .table th, 
    .table td {
        padding: 8px;
        font-size: 13px;
    }
    
    .form-control {
        font-size: 13px;
    }
}

/* 移动端触控体验优化 */
@media (max-width: 768px) {
    /* 增加按钮和链接的触摸区域 */
    .btn, 
    .navbar-menu a,
    .pagination a,
    .admin-sidebar li a {
        padding: 12px 16px;
    }
    
    /* 表单元素优化 */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    select,
    textarea,
    .form-control {
        height: 44px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    /* 增加表格单元格的间距 */
    .table th, 
    .table td {
        padding: 12px 8px;
    }
    
    /* 增加复选框和单选框的大小 */
    input[type="checkbox"],
    input[type="radio"] {
        transform: scale(1.2);
        margin-right: 8px;
    }
}

/* 夜间模式 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #f0f0f0;
    }
    
    .card {
        background-color: #2a2a2a;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .table th {
        background-color: #333;
    }
    
    .table td,
    .table th {
        border-color: #444;
    }
    
    .table tr:nth-child(even) {
        background-color: #2a2a2a;
    }
    
    .table tr:hover {
        background-color: #333;
    }
    
    .form-control {
        background-color: #333;
        border-color: #444;
        color: #f0f0f0;
    }
} 