* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 顶部标题区域 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e4e8;
}

.logo {
    display: flex;
    align-items: center;
}

.logo i {
    font-size: 28px;
    color: #3498db;
    margin-right: 10px;
}

.logo h1 {
    font-size: 24px;
    color: #2c3e50;
}

/* 悬浮导航栏 */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-right: 5px;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 15px 20px;
    display: block;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

nav a:hover, nav a.active {
    color: #3498db;
    border-bottom: 3px solid #3498db;
    background-color: #f8f9fa;
}

/* 主要内容区域 */
.filter-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 25px;
}

.filter-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.filter-title i {
    margin-right: 8px;
    color: #3498db;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
}

.filter-group input, .filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border 0.3s;
}

.filter-group input:focus, .filter-group select:focus {
    border-color: #3498db;
    outline: none;
}

/* 专业名称和按钮组容器 */
.major-name-with-buttons {
    display: flex;
    width: 100%;
    gap: 15px;
    align-items: flex-end;
}

/* 按钮组样式 - 靠右对齐 */
.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-left: auto;
}

.filter-actions button {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.filter-actions button i {
    margin-right: 5px;
}

.filter-actions .submit-btn {
    background: #3498db;
    color: white;
}

.filter-actions .submit-btn:hover {
    background: #2980b9;
}

.filter-actions .exit-btn {
    background: #e74c3c;
    color: white;
}

.filter-actions .exit-btn:hover {
    background: #c0392b;
}

.data-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 25px;
}

.table-header {
    background: #3498db;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8f9fa;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #e1e4e8;
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #e1e4e8;
}

tr:hover {
    background-color: #f8f9fa;
}

.action-btn {
    color: #3498db;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}

.action-btn:hover {
    background: #e1f0fa;
}

/* 翻页按钮区域 - 修正版 */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 15px 20px;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 14px;
    height: 36px;
}

.pagination-btn i {
    font-size: 12px;
    margin: 0 4px;
}

.pagination-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
    margin: 0 8px;
}

.page-number {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.page-number:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.page-number.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 添加按钮区域 */
.add-section {
    text-align: center;
    margin: 30px 0;
}

.add-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
}

.add-btn i {
    margin-right: 8px;
}

.add-btn:hover {
    background: #219653;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

/* 添加表单 - 初始隐藏 */
.add-form {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    display: none; /* 初始隐藏 */
    margin-top: 20px;
}

.form-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.form-title i {
    margin-right: 8px;
    color: #27ae60;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #3498db;
    outline: none;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.form-actions .submit-btn {
    background: #27ae60;
    color: white;
}

.form-actions .submit-btn:hover {
    background: #219653;
}

.form-actions .reset-btn {
    background: #e0e0e0;
    color: #555;
}

.form-actions .reset-btn:hover {
    background: #d0d0d0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e4e8;
}

.modal-header h3 {
    color: #2c3e50;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
}

.close-btn:hover {
    color: #34495e;
}

.modal-body {
    margin-bottom: 25px;
}

.password-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-top: 10px;
}

.password-input:focus {
    border-color: #3498db;
    outline: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.modal-cancel {
    background: #e0e0e0;
    color: #555;
}

.modal-confirm {
    background: #3498db;
    color: white;
}

.modal-confirm:hover {
    background: #2980b9;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

/* 专业详情样式 */
.major-details {
    margin-top: 20px;
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-label {
    font-weight: 600;
    width: 120px;
    color: #555;
}

.detail-value {
    flex: 1;
    color: #333;
}

.detail-description {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    line-height: 1.6;
}

/* 表格列宽优化 */
th:nth-child(1), td:nth-child(1) { /* 年份 */
    width: 80px;
}

th:nth-child(2), td:nth-child(2) { /* 院校名称 */
    width: 200px;
}

th:nth-child(3), td:nth-child(3) { /* 专业名称 */
    width: 180px;
}

th:nth-child(4), td:nth-child(4) { /* 科类名称 */
    width: 120px;
}

th:nth-child(5), td:nth-child(5) { /* 学习形式 */
    width: 120px;
}

th:nth-child(6), td:nth-child(6) { /* 学制 */
    width: 80px;
}

th:nth-child(7), td:nth-child(7) { /* 计划数 */
    width: 80px;
    text-align: center;
}

th:nth-child(8), td:nth-child(8) { /* 学费 */
    width: 100px;
    text-align: right;
}

th:nth-child(9), td:nth-child(9) { /* 备注 */
    width: 100px;
    text-align: center;
}

/* 数字列对齐优化 */
td:nth-child(7) { /* 计划数 */
    text-align: center;
    font-weight: 500;
}

td:nth-child(8) { /* 学费 */
    text-align: right;
    font-weight: 500;
    color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav ul {
        flex-wrap: wrap;
    }
    
    nav li {
        margin: 0;
        flex: 1;
        text-align: center;
    }
    
    nav a {
        padding: 12px 10px;
        font-size: 14px;
    }
    
    .major-name-with-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-actions {
        margin-left: 0;
        justify-content: flex-end;
        width: 100%;
    }
    
    .filter-actions button {
        flex: 1;
    }
    
    /* 翻页按钮响应式 */
    .pagination-section {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
    
    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* 移动端表格优化 */
    .table-container {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    th:nth-child(1), td:nth-child(1),
    th:nth-child(6), td:nth-child(6),
    th:nth-child(7), td:nth-child(7) {
        width: 60px;
    }
    
    th:nth-child(8), td:nth-child(8) {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .filter-card, .data-table, .add-form {
        padding: 15px;
    }
    
    .filter-row, .form-row {
        gap: 10px;
    }
    
    .filter-group, .form-group {
        min-width: 100%;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* 翻页按钮小屏幕优化 */
    .pagination-section {
        padding: 12px 15px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 13px;
        height: 32px;
    }
    
    .page-number {
        padding: 6px 8px;
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .pagination-controls {
        gap: 4px;
    }
    
    .page-numbers {
        gap: 2px;
        margin: 0 4px;
    }
}