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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* 登录页面样式 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h2 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-box h3 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    font-weight: normal;
}

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

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

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

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

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.login-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #999;
    font-size: 12px;
}

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

/* 侧边栏样式 */
.sidebar {
    width: 220px;
    background: #1a365d;
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    background: #0f2442;
    border-bottom: 1px solid #2a4365;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 500;
}

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

.menu-item {
    margin-bottom: 5px;
}

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

.menu-item > a:hover,
.menu-item.active > a {
    background: #2a4365;
    color: white;
}

.menu-item.active > a {
    border-left: 3px solid #3182ce;
}

.menu-icon {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.menu-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.menu-item.open > .menu-arrow {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    background: #0f2442;
    padding: 5px 0;
}

.menu-item.open > .submenu {
    display: block;
}

.submenu-item {
    padding: 10px 20px 10px 50px;
    color: #95a5a6;
    text-decoration: none;
    display: block;
    transition: all 0.3s;
    font-size: 14px;
}

.submenu-item:hover,
.submenu-item.active {
    color: white;
    background: #1a365d;
}

.sidebar-footer {
    padding: 15px 20px;
    background: #0f2442;
    border-top: 1px solid #2a4365;
    font-size: 12px;
    color: #95a5a6;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* 主页面样式 */
.header {
    background: #1a365d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    color: white;
}

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

.user-info {
    color: white;
}

.user-info a {
    color: #e2e8f0;
    text-decoration: none;
}

.user-info a:hover {
    text-decoration: underline;
    color: white;
}

.container {
    max-width: 98%;
    margin: 20px auto;
    padding: 0 10px;
}

/* 操作栏样式 */
.action-bar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.action-bar h2 {
    font-size: 18px;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: #1a365d;
    color: white;
}

.btn-primary:hover {
    background: #2a4365;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 筛选表单样式 */
.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-form select,
.filter-form input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

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

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

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table td {
    font-size: 14px;
    color: #666;
}

.data-table .actions {
    display: flex;
    gap: 5px;
}

.data-table .actions .btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    padding: 20px;
    gap: 5px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #667eea;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

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

.modal-body {
    padding: 20px;
}

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

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

.form-row label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #667eea;
}

/* 消息提示样式 */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* 空数据提示 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .filter-form {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-form select,
    .filter-form input,
    .filter-form button {
        width: 100%;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.grid-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* 响应式网格 */
.grid-sm {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-md {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid-lg {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

/* 固定列数网格 */
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.card-body {
    padding: 0;
}

/* 响应式网格调整 */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 200px;
    }
    
    .container {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 180px;
    }
    
    .sidebar-header h2 {
        font-size: 16px;
    }
    
    .menu-item > a {
        padding: 10px 15px;
    }
    
    .submenu-item {
        padding: 8px 15px 8px 40px;
    }
}
