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

/* 主要内容区域 */
.main-content {
    padding: 24px;
    background-color: #f5f7fa;
    min-height: calc(100vh - 64px);
}

/* 内容区域 */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 区域标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #262626;
    margin: 0;
}

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

/* 设置卡片 */
.settings-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    background-color: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* 表单网格 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-control {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-control[readonly] {
    background-color: #f5f5f5;
    color: #595959;
}

/* Logo上传 */
.logo-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #d9d9d9;
}

/* 开关样式 */
.switch-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.switch-item:last-child {
    border-bottom: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.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: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: #1890ff;
}

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

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 表单操作 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e8e8e8;
}

/* 筛选区域 */
.filter-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group .form-control {
    min-width: 150px;
}

/* 表格容器 */
.table-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background-color: #fafafa;
    font-weight: 600;
    color: #262626;
    font-size: 14px;
}

.data-table td {
    font-size: 14px;
    color: #595959;
}

.data-table tbody tr:hover {
    background-color: #fafafa;
}

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

.status-badge.active {
    background-color: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-badge.inactive {
    background-color: #fff2e8;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

.status-badge.pending {
    background-color: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

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

.btn-edit {
    background-color: #e6f7ff;
    color: #1890ff;
}

.btn-delete {
    background-color: #fff1f0;
    color: #ff4d4f;
}

.btn-view {
    background-color: #f6ffed;
    color: #52c41a;
}

/* 角色网格 */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.role-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.role-name {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
}

.role-count {
    font-size: 12px;
    color: #8c8c8c;
}

.role-description {
    font-size: 14px;
    color: #595959;
    margin-bottom: 16px;
    line-height: 1.5;
}

.role-actions {
    display: flex;
    gap: 8px;
}

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

.permission-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.permission-item:last-child {
    border-bottom: none;
}

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

.permission-item label {
    margin: 0;
    cursor: pointer;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination button:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination button.active {
    background-color: #1890ff;
    color: #ffffff;
    border-color: #1890ff;
}

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

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

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

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

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #262626;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8c8c8c;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: #f5f5f5;
    color: #262626;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: #1890ff;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

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

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

.btn-danger {
    background-color: #ff4d4f;
    color: #ffffff;
}

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

.btn-success {
    background-color: #52c41a;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #73d13d;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 4px;
    color: #ffffff;
    font-weight: 500;
    z-index: 1001;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background-color: #52c41a;
}

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

.notification.info {
    background-color: #1890ff;
}

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

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .role-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 12px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .main-content {
        background-color: #141414;
    }
    
    .section-header h2 {
        color: #ffffff;
    }
    
    .settings-card {
        background-color: #1f1f1f;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .card-header {
        background-color: #262626;
        border-bottom-color: #434343;
    }
    
    .card-header h3 {
        color: #ffffff;
    }
    
    .form-group label {
        color: #d9d9d9;
    }
    
    .form-control {
        background-color: #141414;
        border-color: #434343;
        color: #ffffff;
    }
    
    .form-control:focus {
        border-color: #1890ff;
        box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    }
    
    .form-control[readonly] {
        background-color: #262626;
        color: #d9d9d9;
    }
    
    .switch-item {
        border-bottom-color: #434343;
    }
    
    .switch-item label {
        color: #d9d9d9;
    }
    
    .section-header {
        border-bottom-color: #434343;
    }
    
    .filter-section {
        background-color: #1f1f1f;
    }
    
    .table-container {
        background-color: #1f1f1f;
    }
    
    .data-table th {
        background-color: #262626;
        color: #ffffff;
        border-bottom-color: #434343;
    }
    
    .data-table td {
        color: #d9d9d9;
        border-bottom-color: #434343;
    }
    
    .data-table tbody tr:hover {
        background-color: #262626;
    }
    
    .role-card {
        background-color: #1f1f1f;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .role-name {
        color: #ffffff;
    }
    
    .role-description {
        color: #d9d9d9;
    }
    
    .permission-tree {
        background-color: #141414;
        border-color: #434343;
    }
    
    .permission-item {
        border-bottom-color: #434343;
    }
    
    .modal-content {
        background-color: #1f1f1f;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }
    
    .modal-header {
        border-bottom-color: #434343;
    }
    
    .modal-header h3 {
        color: #ffffff;
    }
    
    .modal-footer {
        border-top-color: #434343;
    }
    
    .btn-secondary {
        background-color: #262626;
        color: #d9d9d9;
        border-color: #434343;
    }
    
    .btn-secondary:hover {
        background-color: #434343;
    }
    
    .close-btn {
        color: #d9d9d9;
    }
    
    .close-btn:hover {
        background-color: #434343;
        color: #ffffff;
    }
    
    .pagination button {
        background-color: #1f1f1f;
        color: #d9d9d9;
        border-color: #434343;
    }
    
    .pagination button:hover {
        border-color: #1890ff;
        color: #1890ff;
    }
    
    .pagination button.active {
        background-color: #1890ff;
        color: #ffffff;
        border-color: #1890ff;
    }
}