:root {
    --primary-color: #5B9BD5;
    --primary-dark: #4A8BC7;
    --sidebar-bg: #2C3E50;
    --sidebar-active: #34495E;
    --text-light: #ffffff;
    --text-dark: #333333;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #F5F7FA;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* 桌面端导航栏 */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
}

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

.menu a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 14px;
    white-space: nowrap;
}

.menu a:hover {
    background-color: rgba(255,255,255,0.15);
}

.user-info {
    font-size: 13px;
    white-space: nowrap;
}

/* 移动端布局 - 基础样式 */
.mobile-layout {
    display: none;
}

/* 移动端顶部栏 */
.mobile-header {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 15px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.mobile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo {
    font-size: 16px;
    font-weight: bold;
    flex: 1;
    text-align: center;
}

/* 移动端侧边栏 */
.mobile-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

.mobile-sidebar-header {
    padding: 20px;
    background-color: var(--sidebar-active);
    border-bottom: 1px solid #3d566e;
}

.mobile-sidebar-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

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

.mobile-sidebar-menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    font-size: 15px;
}

.mobile-sidebar-menu a:hover,
.mobile-sidebar-menu a.active {
    background-color: var(--sidebar-active);
    border-left-color: var(--primary-color);
}

.mobile-sidebar-footer {
    padding: 15px 20px;
    background-color: var(--sidebar-active);
    border-top: 1px solid #3d566e;
}

.mobile-sidebar-footer .user-info {
    color: white;
    font-size: 13px;
}

/* 移动端遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* 内容区域 */
.content {
    padding-top: 60px;
    min-height: 100vh;
}

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

.login-form {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 24px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #FAFAFA;
}

.form-group select[multiple] {
    height: auto;
    min-height: 120px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
    background-color: white;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    width: 100%;
    text-align: center;
    font-weight: 500;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background-color: #545b62;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
}

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

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* 首页仪表盘 */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dashboard-item {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.dashboard-item h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 18px;
}

.dashboard-item p {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

table th,
table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    white-space: nowrap;
    color: #555;
}

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

table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

table a:hover {
    text-decoration: underline;
}

/* 移动端卡片样式 */
.mobile-cards {
    display: none;
}

.card {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.card-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.card-body {
    font-size: 14px;
}

.card-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.card-row:last-child {
    border-bottom: none;
}

.card-label {
    color: #666;
    font-weight: 500;
}

.card-value {
    color: #333;
    text-align: right;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    flex: 1;
}

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

.btn-edit:hover {
    background-color: #e0a800;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.text-success {
    color: var(--success-color);
    font-weight: bold;
}

.text-danger {
    color: var(--danger-color);
    font-weight: bold;
}

.text-warning {
    color: var(--warning-color);
    font-weight: bold;
}

.approval-form {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.approval-form h4 {
    margin-bottom: 12px;
    color: #333;
    font-size: 16px;
}

/* 表单样式 */
.form-container {
    background-color: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-top: 20px;
}

.form-container h1 {
    margin-bottom: 24px;
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 600;
}

.form-container h2 {
    margin-bottom: 16px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.form-container h3 {
    margin-bottom: 12px;
    color: #555;
    font-size: 16px;
    font-weight: 500;
}

.form-container p {
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* 搜索栏 */
.search-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    background-color: #FAFAFA;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
    background-color: white;
}

.search-bar button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s;
}

.search-bar button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3);
}

/* 分页 */
.pagination {
    margin-top: 24px;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination a {
    display: inline-block;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 14px;
    min-width: 44px;
    transition: all 0.3s;
    background-color: white;
}

.pagination a:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 页脚 */
.footer {
    background-color: #f8f9fa;
    color: #999;
    padding: 16px 0;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.footer .container {
    text-align: center;
    font-size: 12px;
}

.footer p {
    margin: 0;
    color: #999;
}

/* 页面标题 */
h1 {
    font-size: 24px;
    margin-bottom: 24px;
    color: #333;
    font-weight: 600;
}

h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #333;
    font-weight: 600;
}

/* 添加按钮 */
.add-user {
    margin-bottom: 20px;
}

.add-user .btn {
    width: auto;
    padding: 12px 24px;
}

/* 响应式设计 - 平板和手机 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    /* 隐藏桌面端导航 */
    .navbar {
        display: none;
    }
    
    /* 显示移动端布局 */
    .mobile-layout {
        display: block;
    }
    
    .mobile-header {
        display: block;
    }
    
    .mobile-sidebar {
        display: flex;
    }
    
    .mobile-content {
        display: block;
        padding: 70px 12px 24px;
    }
    
    .dashboard-item {
        padding: 20px;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-bar input {
        width: 100%;
    }
    
    .search-bar button {
        width: 100%;
    }
    
    h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    h2 {
        font-size: 18px;
        margin-bottom: 14px;
    }
}

@media (max-width: 480px) {
    .mobile-content {
        padding: 65px 10px 20px;
    }
    
    .mobile-sidebar {
        width: 260px;
    }
    
    .mobile-logo {
        font-size: 14px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 18px;
    }
    
    h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .dashboard-item {
        padding: 16px;
    }
    
    .dashboard-item h2 {
        font-size: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 11px;
        font-size: 16px;
    }
    
    .form-group select[multiple] {
        height: auto;
        min-height: 120px;
    }
    
    .btn {
        padding: 11px;
        font-size: 16px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* 表格转卡片 */
    .table-container {
        display: none;
    }
    
    .mobile-cards {
        display: block;
    }
    
    .card {
        margin-bottom: 12px;
        padding: 14px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .card-row {
        font-size: 13px;
        padding: 7px 0;
    }
    
    .pagination a {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 38px;
    }
    
    .login-form {
        padding: 20px;
    }
    
    .login-form h1 {
        font-size: 20px;
    }
    
    .form-container {
        padding: 20px;
    }
}

@media (max-width: 320px) {
    .mobile-sidebar {
        width: 240px;
    }
    
    .mobile-sidebar-menu a {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .mobile-logo {
        font-size: 13px;
    }
    
    h1 {
        font-size: 18px;
    }
    
    h2 {
        font-size: 15px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .card-row {
        font-size: 12px;
    }
    
    .form-container {
        padding: 16px;
    }
}
