/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    width: 95%;           /* 改为固定宽度比例 */
    max-width: none;      /* 移除最大宽度限制 */
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    font-weight: bold;
}

.user-info button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.user-info button:hover {
    background-color: #c0392b;
}

/* 导航样式 */
nav {
    background-color: #34495e;
    padding: 0.5rem 2rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

nav li a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav li a:hover,
nav li a.active {
    background-color: #2c3e50;
}

/* 主内容区域 */
main {
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 仪表板样式 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    background-color: #ecf0f1;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background-color: #34495e;
    color: white;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e8f4f8;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 表格操作按钮 */
.detail-btn, .edit-btn, .delete-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    margin: 0 0.2rem;
}

.back-button {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #7f8c8d;
}

/* 表格操作区域 */
.table-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

/* 表格数据区域 */
.table-data {
    margin-top: 1rem;
}

.table-data h3 {
    margin-bottom: 1rem;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* 详情表样式 */
.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.field-label {
    font-weight: bold;
    background-color: #f8f9fa;
    width: 30%;
}

.field-value {
    width: 70%;
}

/* 模态框操作按钮 */
.modal-actions {
    margin-top: 1rem;
    text-align: right;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 1001;
    display: none;
}

.message.success {
    background-color: #2ecc71;
}

.message.error {
    background-color: #e74c3c;
}

.message.warning {
    background-color: #f39c12;
}

.message.info {
    background-color: #3498db;
}

/* 分页控件 */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.pagination-left,
.pagination-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-info {
    color: #666;
    font-size: 0.9rem;
}

/* 搜索区域 */
.table-search {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.search-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-field {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.search-field label {
    margin-bottom: 0.25rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.search-field input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        min-height: 100vh;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    main {
        padding: 1rem;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-left,
    .pagination-right {
        justify-content: center;
    }
    
    .search-fields {
        flex-direction: column;
    }
}