/* 系统设置页面样式 */
.settings-page {
    padding: 0;
}

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    margin-bottom: 0;
}

.page-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.page-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

/* 标签页 */
.settings-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0 30px;
}

.tab-btn {
    padding: 15px 25px;
    border: none;
    background: none;
    color: #6c757d;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* 内容区域 */
.settings-content {
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 配置区块 */
.config-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.section-header {
    padding: 25px 30px;
    border-bottom: 1px solid #f8f9fa;
    background: #f8f9fa;
}

.section-header h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.section-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* 等级规则表格 */
.rules-table,
.rates-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 120px;
    background: #f8f9fa;
    padding: 20px 30px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.rates-table .table-header {
    grid-template-columns: 1fr 1fr 1fr 1fr 120px;
}

.table-body {
    padding: 0 30px;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 120px;
    padding: 20px 0;
    border-bottom: 1px solid #f8f9fa;
    align-items: center;
}

.rates-table .table-row {
    grid-template-columns: 1fr 1fr 1fr 1fr 120px;
}

.table-row:last-child {
    border-bottom: none;
}

.level-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.level-name {
    font-weight: 600;
    color: #333;
}

.level-num {
    font-size: 12px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
}

.rate-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
}

/* 系统配置表单 */
.config-form {
    padding: 30px;
}

.config-group {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f8f9fa;
}

.config-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-group h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* 开关组件 */
.switch-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.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;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.modal-header .close {
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.modal-header .close:hover {
    color: #333;
}

.modal-form {
    padding: 30px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f8f9fa;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-cancel {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.btn-cancel:hover {
    background: #e9ecef;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: #6c757d;
    font-size: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
    .settings-content {
        padding: 20px;
    }
    
    .settings-tabs {
        padding: 0 20px;
        overflow-x: auto;
    }
    
    .tab-btn {
        white-space: nowrap;
        min-width: 100px;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: repeat(6, minmax(120px, 1fr));
        overflow-x: auto;
    }
    
    .rates-table .table-header,
    .rates-table .table-row {
        grid-template-columns: repeat(5, minmax(120px, 1fr));
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}