:root {
    --primary-color: #4361ee;
    --bg-color: #f0f2f5;
    --card-bg: #fff;
    --text-primary: #333;
    --text-secondary: #6c757d;
    --border-color: #eee;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}



* {
    margin: 0;
    padding: 0;
    text-decoration: none;
    list-style-type: none;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    transition: background-color 0.3s ease;
    line-height: 1.6;
}

header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 15px 0;
    transition: all 0.3s ease;
}

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

.nav-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: inline-block;
    font-size: 16px;
    padding: 10px 20px;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* 内容区域样式 */
.content {
    padding: 30px 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 表单样式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

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

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

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.full-width {
    grid-column: 1 / -1;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 5px;
}

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

.btn-primary:hover {
    background-color: #3a56d4;
    transform: scale(1.05);
}

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

.btn-success:hover {
    background-color: #218838;
    transform: scale(1.05);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover {
    color: #3a56d4;
}

/* 复选框和单选按钮样式 */
input[type="checkbox"], input[type="radio"] {
    margin-right: 5px;
}

/* 验证码样式 */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.captcha-image {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
}

/* 统计网格样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-trend {
    font-size: 13px;
    display: flex;
    align-items: center;
}

.trend-up {
    color: #28a745;
}

.trend-down {
    color: #dc3545;
}

/* 图表区域样式 */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 60px;
    box-shadow: var(--shadow);
    height: 350px;
    transition: background-color 0.3s ease;
}

.chart-title {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-weight: 600;
}

canvas {
    width: 100%;
    height: calc(100% - 30px);
}

/* 搜索容器样式 */
.search-container {
    position: relative;
    width: 300px;
    display: flex;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 50px 0 0 50px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.search-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.search-btn:hover {
    background-color: #3a56d4;
    transform: scale(1.05);
}

.search-btn:active {
    transform: scale(0.98);
}

.search-icon {
    margin-right: 5px;
}

/* 表格样式 */
.person-table {
    width: 100%;
    border-collapse: collapse;
}

.person-table th,
.person-table td {
    padding: 40px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.person-table th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.person-table tr {
    transition: background-color 0.2s ease;
}

.person-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 操作按钮样式 */
.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    margin-right: 5px;
    transition: all 0.2s ease;
}

.view-btn {
    background-color: rgba(22, 93, 255, 0.1);
    color: #165dff;
}

.edit-btn {
    background-color: rgba(255, 125, 0, 0.1);
    color: #ff7d00;
}

.delete-btn {
    background-color: rgba(245, 63, 63, 0.1);
    color: #f53f3f;
}



.action-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

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

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.page-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

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

/* 列表头部样式 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 模态框样式 - 更可靠的实现 */
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.3s;
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: none;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
    pointer-events: auto;
}

/* 模态框内容容器 - 使用绝对定位实现可靠居中 */
.modal-content {
    background-color: var(--card-bg);
    padding: 25px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    position: relative;
    overflow: hidden;
    margin: 5vh auto;
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal.active .modal-content {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.modal-body {
    margin-bottom: 25px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
    padding-right: 5px;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #7209b7);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.modal-title {
    margin: 0;
    font-size: 22px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.close {
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    outline: none;
}

.close:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    margin-bottom: 25px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
    margin: -25px;
    margin-top: 25px;
    padding: 20px 25px;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 90%;
        margin: 15% auto;
    }
    
    /* 表格容器添加横向滚动 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
    }
    
    .person-table {
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    .nav-link {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .search-container {
        width: 100%;
        margin-top: 10px;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content {
        padding: 20px 0;
    }
    
    .card {
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    /* 表格容器添加横向滚动 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
    }
    
    .person-table {
        min-width: 600px;
    }
    
    /* 表格单元格内边距调整 */
    .person-table th,
    .person-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    /* 操作按钮调整 */
    .action-btn {
        padding: 4px 8px;
        font-size: 12px;
        margin-right: 3px;
        margin-bottom: 3px;
    }
    
    /* 导航栏调整 */
    .container {
        width: 95%;
    }
    
    .nav-list {
        gap: 5px;
    }
    
    /* 头部容器调整 */
    header .container {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 标题和按钮区域调整 */
    .card > div:first-of-type {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* 按钮组调整 */
    .card > div:first-of-type > div {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* 按钮调整 */
    .btn {
        padding: 8px 16px;
        font-size: 13px;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    /* 表单元素调整 */
    .form-control {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* 角色徽章调整 */
    .role-badge {
        padding: 3px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    /* 导航链接进一步调整 */
    .nav-link {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    /* 表格单元格内边距进一步调整 */
    .person-table th,
    .person-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* 操作按钮进一步调整 */
    .action-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    /* 标题字体大小调整 */
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    /* 卡片内边距调整 */
    .card {
        padding: 12px;
    }
    
    /* 内容区域内边距调整 */
    .content {
        padding: 15px 0;
    }
}