/* 系统设置页面样式 */

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
}

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

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

.modal-body {
    padding: 20px;
}

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

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 权限树样式 */
.permission-tree {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.permission-category {
    margin-bottom: 15px;
    /* 确保每个分类块不会受到浮动等影响，自己占据一行 */
    clear: both;
    width: 100%;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 让标题和图标分开 */
    margin-bottom: 0; /* 折叠时移除下边距 */
    font-weight: 500;
    width: 100%;
    background-color: #f9f9f9;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer; /* 提示可点击 */
    transition: background-color 0.2s;
}

.category-header:hover {
    background-color: #f0f0f0;
}

.category-header .category-title {
    display: flex;
    align-items: center;
}

.category-header::after {
    content: '\f078'; /* Font Awesome down arrow */
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform 0.2s;
    font-size: 12px;
}

.permission-category.expanded > .category-header::after {
    transform: rotate(180deg); /* 展开时箭头向上 */
}

.category-items {
    margin-left: 20px;
    display: none; /* 默认隐藏 */
    padding-top: 10px;
}

.permission-category.expanded > .category-items {
    display: block; /* 展开时显示 */
}

.permission-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.permission-item input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.permission-item label {
    margin-bottom: 0;
    font-weight: normal;
}

/* 状态标签样式 */
.status-tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background-color: #ffebee;
    color: #c62828;
}

.status-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-error {
    background-color: #ffebee;
    color: #c62828;
}

.status-warning {
    background-color: #fff8e1;
    color: #f57f17;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background-color: #4caf50;
}

.notification-error {
    background-color: #f44336;
}

.notification-warning {
    background-color: #ff9800;
}

.notification-info {
    background-color: #2196f3;
}

/* 按钮样式增强 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background-color: #3a7bc8;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #eaeaea;
}

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

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #e68900;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #388e3c;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* 表格样式增强 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

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

th {
    background-color: #f9f9f9;
    font-weight: 500;
    color: #555;
}

tr:hover {
    background-color: #f9f9f9;
}

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

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 搜索筛选区域样式 */
.search-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-filter input[type="text"],
.search-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-filter input[type="text"] {
    flex: 1;
    max-width: 300px;
}

/* 标签页样式增强 */
.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    background-color: #f5f5f5;
}

.tab.active {
    border-bottom-color: #4a90e2;
    color: #4a90e2;
    font-weight: 500;
}

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

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

.card-title {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.card-body {
    padding: 20px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4a90e2;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 表单操作区域样式 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 页面头部样式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    .search-filter input[type="text"] {
        max-width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .table-container {
        overflow-x: scroll;
    }
}
