/* CURL转译工具样式 - 完全基于JWT编码工具样式 */

/* 主容器 */
.curl-container {
    display: flex;
    gap: 20px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

/* 左侧配置区域 */
.curl-config-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 400px;
    overflow: hidden;
}

/* 右侧结果区域 */
.curl-result-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    overflow: hidden;
}

/* 配置表单 */
.curl-config-form {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: 90vh;
}

/* 配置区块 */
.config-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* 区块标题 - 完全基于JWT样式 */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title .title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

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

/* 颜色指示器 */
.color-indicator {
    width: 4px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
}

.method-color { background: var(--accent-light); }
.headers-color { background: var(--error-deep); }
.auth-color { background: #00B9F1; }
.body-color { background: #FF8C00; }

/* 表单组样式 - 基于JWT样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* 基本请求配置 */
.request-basic {
    margin-bottom: 16px;
}

.method-url-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.method-select {
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s ease;
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s ease;
}

.method-select:focus,
.url-input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 参数配置 */
.params-section, .headers-section {
    margin-top: 16px;
}

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

.params-header label, .headers-header label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.common-headers {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
}

.common-headers small {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 12px;
}

/* 参数/头部列表 */
.params-list, .headers-list, .form-data-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-row, .header-row, .form-field-row {
    display: flex;
    gap: 2px;
    align-items: center;
    padding: 2px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.param-row input, .header-row input, .form-field-row input {
    padding: 6px 6px;
    background: transparent;
    border: none;
    color: var(--text-primary);
}

.param-row input:focus, .header-row input:focus, .form-field-row input:focus {
    outline: none;
}

.param-row input::placeholder, .header-row input::placeholder, .form-field-row input::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}

/* 行内启用/禁用 checkbox */
.row-toggle {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 4px;
    cursor: pointer;
}

.row-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: var(--accent-color);
}

.param-row.row-disabled,
.header-row.row-disabled,
.form-field-row.row-disabled {
    opacity: 0.4;
    background: var(--bg-secondary);
}

.param-row.row-disabled input[type="text"],
.header-row.row-disabled input[type="text"],
.form-field-row.row-disabled input[type="text"] {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.param-separator, .header-separator {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    padding: 0 4px;
    user-select: none;
}

.param-separator {
    color: var(--accent-light);
}

.header-separator {
    color: var(--accent-light);
}

/* 域名解析配置 */
.resolve-section {
    margin-top: 16px;
}

.resolve-header {
    margin-bottom: 12px;
}

.resolve-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.resolve-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.resolve-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.resolve-config {
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 8px;
}

.resolve-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.resolve-url-display {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
    min-height: 20px;
    display: flex;
    align-items: center;
}

.resolve-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.resolve-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.resolve-input::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}

.resolve-port {
    flex: 0 0 80px;
}

.resolve-separator {
    color: var(--accent-light);
    font-weight: 500;
    font-size: 14px;
    user-select: none;
}

.resolve-hint {
    margin: 0;
}

.resolve-hint small {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.4;
}

/* 安装指南样式 */
.install-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.install-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
    transition: all 0.2s ease;
}

.install-item:hover {
    border-color: var(--accent-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.install-item h3 {
    margin: 0 0 12px 0;
    color: var(--accent-light);
    font-size: 14px;
    font-weight: 600;
}

.install-item .code-block {
    margin: 0;
}

.install-item .code-block code {
    font-size: 12px;
}

/* 调试输出样式 */
.debug-example {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
    margin: 16px 0;
}

.debug-example h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.debug-example .code-block {
    margin: 10px 0;
}

.debug-output {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    font-family: var(--font-family-mono);
    font-size: 12px;
    margin-top: 12px;
}

.debug-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    padding: 4px 0;
}

.debug-line:last-child {
    margin-bottom: 0;
}

.debug-line code {
    flex: 0 0 auto;
    min-width: 200px;
    color: var(--accent-light);
    font-family: inherit;
    background: none;
    padding: 0;
    border: none;
}

.debug-desc {
    flex: 1;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.4;
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.symbol-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.symbol-item code {
    flex: 0 0 auto;
    width: 40px;
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    background: none;
    padding: 0;
    border: none;
}

.symbol-item span {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
}

/* 编辑弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.edit-area {
    flex: 1;
    min-height: 300px;
}

.editable-command {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.editable-command:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.editable-command::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    min-width: 120px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .editable-command {
        min-height: 250px;
        font-size: 12px;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn-primary,
    .modal-actions .btn-secondary {
        width: 100%;
        min-width: auto;
    }
}

.remove-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    transition: background-color 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* 认证配置 */
.auth-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-type-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-type-selector label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 80px;
}

.auth-type-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s ease;
}

.auth-type-select:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.auth-config {
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-row {
    display: flex;
    gap: 8px;
}

.input-row input, .input-row select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s ease;
}

.input-row input:focus, .input-row select:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.input-row input::placeholder {
    color: var(--text-muted);
}

/* 请求体配置 */
.body-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.body-type-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.body-tab {
    flex: 1;
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.body-tab.active {
    background: #FF8C00;
    color: white;
}

/* Content-Type 字段样式 */
.content-type-section {
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.content-type-section .form-group {
    margin: 0;
}

.content-type-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.content-type-section .form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-family-mono);
}

.content-type-section .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.body-tab:hover:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 编辑器 */
.body-editor {
    min-height: 120px;
}

.json-editor, .raw-editor {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s ease;
}

.json-editor:focus, .raw-editor:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.json-editor::placeholder, .raw-editor::placeholder {
    color: var(--text-muted);
}

/* 文件上传 */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.upload-text p {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.upload-text small {
    color: var(--text-muted);
    font-size: 12px;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-path-hint {
    color: var(--warning-color);
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

/* None Body 样式 */
.no-body-message {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: left;
}

.no-body-icon {
    font-size: 48px;
    opacity: 0.6;
}

.no-body-text h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.no-body-text p {
    margin: 0 0 4px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.no-body-text small {
    color: var(--text-muted);
    font-size: 12px;
}

/* CURL结果显示 */
.curl-result {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: 90vh;
}

.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* CURL命令显示 */
.curl-display {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.curl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.curl-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.curl-title .icon {
    font-size: 14px;
}

.curl-title .title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.curl-options-row {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
}

.option-checkbox input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

.curl-command-container {
    position: relative;
}

.curl-command {
    margin: 0;
    padding: 16px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

/* 代码导出 */
.code-export {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

/* 代码块样式 */
.code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
}

.code-block code {
    display: block;
    font-size: 13px;
    line-height: 1.8;
    color: var(--accent-light);
    font-family: var(--font-family-mono);
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
}

.export-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.export-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-header .icon {
    font-size: 14px;
}

.export-header .title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.language-tabs {
    display: flex;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}

.lang-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.lang-tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent-light);
}

.lang-tab:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.code-display {
    max-height: 300px;
    overflow-y: auto;
}

.code-content {
    margin: 0;
    padding: 16px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* 历史记录 */
.history-section {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: height 0.3s ease;
}

/* 历史记录区域 - 全屏模式（没有其他内容时） */
.history-section.full-height {
    height: calc(100vh - 200px); /* 减去header和padding的高度 */
    min-height: 400px;
}

/* 历史记录区域 - 紧凑模式（有其他内容时） */
.history-section.compact-height {
    height: auto;
    max-height: 200px;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.history-header .icon {
    font-size: 14px;
}

.history-header .title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.history-list {
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

/* 全屏模式下的历史记录列表 */
.history-section.full-height .history-list {
    max-height: calc(100vh - 280px); /* 减去header、padding等的高度 */
    min-height: 320px;
}

/* 紧凑模式下的历史记录列表 */
.history-section.compact-height .history-list {
    max-height: 160px; /* 200px - header高度 */
}

.history-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.history-item:hover {
    background: var(--bg-secondary);
}

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

.history-main {
    flex: 1;
    min-width: 0; /* 允许内容收缩 */
}

.history-request {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.history-method {
    display: inline-block;
    padding: 2px 6px;
    background: var(--success-color);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    flex-shrink: 0; /* 防止方法标签收缩 */
}

.history-method.POST { background: var(--warning-color); }
.history-method.PUT { background: var(--info-color); }
.history-method.DELETE { background: var(--error-color); }
.history-method.PATCH { background: var(--info-color); }
.history-method.HEAD { background: var(--text-secondary); }
.history-method.OPTIONS { background: var(--text-secondary); }

.history-url {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.history-body {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
}

.body-type {
    display: inline-block;
    padding: 1px 4px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    flex-shrink: 0;
}

.body-content {
    color: var(--text-tertiary);
    font-family: var(--font-family-mono);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.history-time {
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    line-height: 1.2;
}

.history-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.history-actions {
    display: flex;
    gap: 4px;
}

.history-btn {
    padding: 2px 6px;
    font-size: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: var(--font-family-base);
}

.history-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* HTTP请求查看弹窗样式 */
.http-request-display {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    max-height: 500px;
    overflow: auto;
}

.http-request-content {
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* CURL知识库 */
.knowledge-base-section {
    margin-top: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.kb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.kb-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.kb-tabs {
    display: flex;
    gap: 4px;
}

.kb-tab {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kb-tab.active {
    background: var(--accent-light);
    color: white;

}

.kb-tab:hover:not(.active) {
    background: var(--bg-input);
    color: var(--text-primary);
}

.kb-content {
    padding: 20px;
}

.kb-section h2 {
    margin: 16px 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 参数网格 */
.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.param-item {
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.param-item:hover {
    border-color: var(--border-hover);
}

.param-item code {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 6px;
    font-family: var(--font-family-mono);
}

.param-item span {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 技巧列表 */
.tips-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tip-item {
    padding: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tip-item:hover {
    border-color: var(--accent-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tip-item h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.tip-item code {
    display: block;
    padding: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--warning-color);
    border-radius: 4px;
    font-family: var(--font-family-mono);
    font-size: 13px;
    color: var(--accent-light);
    line-height: 1.8;
    margin: 8px 0;
    overflow-x: auto;
    white-space: pre;
}

.tip-item p {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 示例列表 */
.examples-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.example-item {
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.example-item:hover {
    border-color: var(--accent-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.example-item h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.example-item h3::before {
    content: '▶';
    color: var(--accent-light);
    font-size: 12px;
}

.example-item code {
    display: block;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--success-color);
    border-radius: 4px;
    font-family: var(--font-family-mono);
    font-size: 13px;
    color: var(--accent-light);
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

.example-item p {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.example-item p strong {
    color: var(--warning-color);
    font-weight: 600;
}

/* 错误显示 */
.curl-error {
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 6px;
    margin-top: 16px;
    /* 确保错误提示可见 */
    position: relative;
    z-index: 10;
    min-height: 60px;
}

.curl-error p {
    margin: 0 0 8px 0;
    color: var(--error-color);
    font-size: 14px;
    font-weight: 600;
}

.error-message {
    font-size: 13px;
    color: var(--error-color);
    line-height: 1.4;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1300px) {
    
    .param-grid {
        grid-template-columns: 1fr;
    }

    
    
    
    .method-select {
        min-width: auto;
        width: 100%;
    }
    
    .kb-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .kb-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .curl-options {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .common-headers {
        flex-wrap: wrap;
    }
}

/* ==================== HTTP请求导入相关样式 ==================== */

/* 导入说明 */
.import-instructions {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.import-instructions p {
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
}

.import-instructions details {
    margin-top: 12px;
}

.import-instructions summary {
    color: var(--accent-light);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    transition: color 0.2s;
}

.import-instructions summary:hover {
    color: var(--accent-color);
}

.import-instructions .code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
    font-family: var(--font-family-mono);
    font-size: 12px;
    overflow-x: auto;
}

.import-instructions .code-block code {
    color: var(--text-primary);
    white-space: pre;
    display: block;
    line-height: 1.5;
}

/* 验证消息 */
.validation-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    animation: slideIn 0.3s ease-out;
}

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

/* 导入弹窗特殊样式 */
#importModal .modal-container {
    max-width: 900px;
}

#importModal .editable-command {
    min-height: 350px;
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.6;
}

/* 响应式：导入弹窗 */
@media (max-width: 768px) {
    #importModal .modal-container {
        max-width: 95%;
        max-height: 90vh;
    }
    
    #importModal .editable-command {
        min-height: 250px;
        font-size: 12px;
    }
    
    .import-instructions {
        font-size: 13px;
        padding: 12px;
    }
}
