/* 在线测试页面样式 */
.online-test-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.online-test-container h4 {
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.form-section h6 {
    color: #555;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

/* 提交方式选择样式 */
.submit-type-selection {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
    transition: color 0.3s ease;
}

.radio-label:hover {
    color: #007bff;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #007bff;
    background-color: #007bff;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* JSON数据模式样式 */
.json-input-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.json-textarea {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: #2d3748;
    color: #e2e8f0;
    border: 2px solid #4a5568;
    border-radius: 8px;
    padding: 16px;
    resize: vertical;
    min-height: 300px;
    transition: all 0.3s ease;
}

.json-textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.json-textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}



/* 模式切换动画 */
#formDataSection,
#jsonDataSection {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#formDataSection.hidden,
#jsonDataSection.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* JSON语法高亮效果 */
.json-textarea:valid {
    border-color: #28a745;
}

.json-textarea:invalid {
    border-color: #dc3545;
}

/* 参数行样式 */
.parameter-row .row {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin: 0 0 15px 0;
    border-left: 4px solid #007bff;
}

.parameter-name {
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 文件上传样式 */
.file-upload-section {
    display: flex;
    align-items: center;
}

.file-info {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* API地址样式 */
.api-endpoint-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.api-url {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background-color: #fff;
    border: 1px solid #ced4da;
}

#testApiBtn {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

#testApiBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#testApiBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 测试结果样式 */
.test-result-section {
    margin-top: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

/* 结果容器样式 */
.result-container {
    position: relative;
}

/* 复制按钮悬浮样式 */
.copy-btn-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    opacity: 0.8;
    transition: all 0.3s ease;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 4px;
    min-width: auto;
    cursor: pointer;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn-overlay:hover {
    opacity: 1;
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-1px);
}

.copy-btn-overlay.copied {
    border-color: #28a745;
    color: #28a745;
    opacity: 1;
    background-color: transparent;
}

/* 确保pre内容不被按钮遮挡 */
.response-content,
.request-content {
    padding-top: 45px;
}

/* 复制成功提示样式 */
.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 9999;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.copy-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.result-tabs .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.result-tabs .nav-link {
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.result-tabs .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: transparent;
}

.response-content,
.request-content {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 20px;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    border: none;
}



/* 响应式样式 */
@media (max-width: 768px) {
    .online-test-container {
        padding: 20px 15px;
    }
    
    .parameter-row .row {
        flex-direction: column;
    }
    
    .parameter-row .col-md-4 {
        margin-bottom: 10px;
    }
    
    .parameter-row .col-md-4:last-child {
        margin-bottom: 0;
    }
    
    .submit-type-selection {
        flex-direction: column;
        gap: 15px;
    }
    
    .api-endpoint-section .row {
        flex-direction: column;
    }
    
    .api-endpoint-section .col-md-8,
    .api-endpoint-section .col-md-4 {
        margin-bottom: 15px;
    }
    
    .api-endpoint-section .col-md-4:last-child {
        margin-bottom: 0;
    }

    

    
    .json-textarea {
        font-size: 12px;
        min-height: 250px;
    }
    
    .json-input-container {
        padding: 15px;
    }
    
    .file-upload-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-info {
        margin-top: 8px;
        margin-left: 0 !important;
    }
    
    .response-content,
    .request-content {
        font-size: 11px;
        padding: 15px;
    }
    
    .code-block {
        font-size: 11px;
        padding: 15px;
    }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .online-test-container h4 {
        font-size: 18px;
        text-align: center;
    }
    
    .form-section h6 {
        font-size: 14px;
    }
    
    .parameter-name {
        font-size: 12px;
        word-break: break-all;
    }
    
    .badge-danger {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .api-url {
        font-size: 12px;
    }
    
    #testApiBtn {
        font-size: 14px;
        padding: 12px;
    }
}

/* 可访问性和用户体验改进 */
.form-control:focus,
.btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.parameter-row:hover {
    background-color: #f1f3f5;
    transition: background-color 0.2s ease;
}

.radio-label:hover .radio-custom {
    border-color: #007bff;
}





/* 通知样式改进 */
.custom-notification {
    border-left: 4px solid;
    border-radius: 8px;
    animation: slideInRight 0.3s ease-out;
}

.custom-notification.alert-success {
    border-left-color: #28a745;
}

.custom-notification.alert-danger {
    border-left-color: #dc3545;
}

.custom-notification.alert-warning {
    border-left-color: #ffc107;
}

.custom-notification.alert-info {
    border-left-color: #17a2b8;
}

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

/* 加载状态优化 */
.btn:disabled {
    pointer-events: none;
    opacity: 0.9;
}

.btn.loading {
    position: relative;
}

.btn.loading .loading-spinner {
    display: inline-block;
    margin-right: 8px;
}

/* 结果区域动画 */
.test-result-section {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
    .online-test-container {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .parameter-row .row {
        background: #2d2d2d;
        border-left-color: #0d6efd;
    }
    
    .form-control {
        background: #2d2d2d;
        border-color: #495057;
        color: #e0e0e0;
    }
    
    .form-control:focus {
        background: #2d2d2d;
        border-color: #0d6efd;
        color: #e0e0e0;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    animation: spinner-rotate 0.8s linear infinite;
    vertical-align: middle;
}

/* 按钮内的加载动画 */
.btn .loading-spinner {
    margin-right: 6px;
}

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

/* 成功和错误状态 */
.success-response {
    border-left: 4px solid #28a745;
}

.error-response {
    border-left: 4px solid #dc3545;
}

/* Token按钮样式 */
#getToken {
    background: linear-gradient(45deg, #ffc107, #ffca2c);
    border: none;
    color: #212529;
    font-weight: 600;
    transition: all 0.3s ease;
}

#getToken:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* 表单控件优化 */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-1px);
}

/* 参数表格样式 */
#dynamicParameters .table {
    margin-bottom: 0;
    background: #fff;
    table-layout: fixed; /* 固定表格布局 */
    width: 100%;
}

#dynamicParameters .table th {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 12px 15px;
    font-size: 14px;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6; /* 统一下边框 */
}

#dynamicParameters .table thead th {
    border-bottom: 1px solid #dee2e6 !important; /* 移除Bootstrap默认的粗边框 */
    background-color: #f8f9fa !important;
}

.table .thead-light th {
    background-color: #f8f9fa !important;
}

#dynamicParameters .table td {
    border-color: #dee2e6;
    padding: 15px;
    vertical-align: middle;
    word-wrap: break-word; /* 允许长内容换行 */
}

/* 设置各列的固定宽度 */
#dynamicParameters .table th:nth-child(1),
#dynamicParameters .table td:nth-child(1) {
    width: 18%; /* 参数名列 */
}

#dynamicParameters .table th:nth-child(2),
#dynamicParameters .table td:nth-child(2) {
    width: 12%; /* 类型列 */
}

#dynamicParameters .table th:nth-child(3),
#dynamicParameters .table td:nth-child(3) {
    width: 10%; /* 必填列 */
}

#dynamicParameters .table th:nth-child(4),
#dynamicParameters .table td:nth-child(4) {
    width: 60%; /* 说明列 */
}

#dynamicParameters .table code {
    background-color: #f8f9fa;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    border: 1px solid #e9ecef;
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.file-upload-wrapper .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.file-info {
    font-size: 12px;
    color: #6c757d;
    flex: 1;
    min-width: 0;
}

/* 表格内的表单控件样式 */
#dynamicParameters .form-control {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.3s ease;
    height: 31px; /* 统一高度 */
    font-size: 13px;
    padding: 0.25rem 0.5rem;
}

#dynamicParameters .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

#dynamicParameters .form-control[readonly] {
    background-color: #f8f9fa;
    color: #495057;
}

#dynamicParameters .input-group-sm .form-control,
#dynamicParameters .form-control-sm {
    font-size: 13px;
    height: 36px !important; /* 统一高度为36px */
}

#dynamicParameters .btn-sm {
    font-size: 12px;
    padding: 0.375rem 0.75rem;
    height: 36px !important; /* 统一按钮高度为36px */
}

#dynamicParameters .input-group {
    height: 31px; /* 统一input-group高度 */
    min-width: 0; /* 防止内容溢出 */
}

#dynamicParameters .input-group .form-control {
    height: 31px; /* 确保组合输入框内的input高度一致 */
    min-width: 0; /* 防止内容溢出 */
}

/* 防止表格抖动的额外样式 */
#dynamicParameters .table-responsive {
    overflow-x: auto;
}

#dynamicParameters .file-upload-wrapper {
    min-height: 31px;
    align-items: center;
}

/* 状态指示器样式 */
.status-indicator {
    display: flex;
    align-items: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.required-dot {
    background-color: #dc3545; /* 红色 - 必填 */
}

.optional-dot {
    background-color: #6c757d; /* 灰色 - 非必填 */
}

.status-text {
    font-size: 13px;
    font-weight: 500;
}

.status-indicator.required .status-text {
    color: #dc3545; /* 必填文字红色 */
}

.status-indicator.optional .status-text {
    color: rgb(84 197 28); /* 非必填文字灰色 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    #dynamicParameters .table th,
    #dynamicParameters .table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    #dynamicParameters .table th:nth-child(2),
    #dynamicParameters .table td:nth-child(2) {
        display: none;
    }
    
    .file-upload-wrapper {
        width: 100%;
    }
    
    .file-upload-wrapper .btn {
        width: 100%;
    }
}