/* CURL 转换工具样式 - 复用ASCII转换样式 */

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

/* 左侧输入区域 */
.curl-converter-input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 100%;
    overflow: hidden;
    width: 0;
}

/* 右侧输出区域 */
.curl-converter-output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 100%;
    overflow: hidden;
    margin-bottom: 20px;
    width: 0;
    max-height: calc(88vh + 85px) !important;
}

/* 编辑器容器 */
.curl-converter-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 结果查看器 */
.curl-converter-result {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    overflow-wrap: break-word;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.result-viewer {
    overflow: auto;
    padding: 0;
    margin: 0;
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

#resultOutput {
    background-color: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-family: var(--font-family-mono);
    font-size: 14px;
    line-height: 1.4;
    overflow-x: auto;
    overflow-y: auto;
    min-height: 200px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    width: 100%;
    box-sizing: border-box;
    /* max-height: calc(88vh - 32px) !important; */
}

/* Prism 语法高亮优化 - 暗色主题 */
#resultOutput code[class*="language-"],
#resultOutput pre[class*="language-"] {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 注释 - 灰色 */
#resultOutput .token.comment,
#resultOutput .token.prolog,
#resultOutput .token.doctype,
#resultOutput .token.cdata {
    color: #6A9955;
    font-style: italic;
}

/* 标点符号 */
#resultOutput .token.punctuation {
    color: #ABB2BF;
}

/* 数字、布尔值、常量 - 橙色 */
#resultOutput .token.property,
#resultOutput .token.tag,
#resultOutput .token.boolean,
#resultOutput .token.number,
#resultOutput .token.constant,
#resultOutput .token.symbol,
#resultOutput .token.deleted {
    color: #D19A66;
}

/* 字符串 - 绿色 */
#resultOutput .token.selector,
#resultOutput .token.attr-name,
#resultOutput .token.string,
#resultOutput .token.char,
#resultOutput .token.builtin,
#resultOutput .token.inserted {
    color: #98C379;
}

/* 操作符、实体、URL - 青色 */
#resultOutput .token.operator,
#resultOutput .token.entity,
#resultOutput .token.url {
    color: #56B6C2;
}

/* 关键字、属性值 - 紫色/粉色 */
#resultOutput .token.atrule,
#resultOutput .token.attr-value,
#resultOutput .token.keyword {
    color: #C678DD;
}

/* 函数名、类名 - 黄色 */
#resultOutput .token.function,
#resultOutput .token.class-name {
    color: #E5C07B;
}

/* 正则表达式、重要标记、变量 - 红色 */
#resultOutput .token.regex,
#resultOutput .token.important,
#resultOutput .token.variable {
    color: #E06C75;
}

/* 特殊标记 */
#resultOutput .token.important,
#resultOutput .token.bold {
    font-weight: bold;
}

#resultOutput .token.italic {
    font-style: italic;
}

/* 命名空间 */
#resultOutput .token.namespace {
    opacity: 0.7;
}

.resize-handle {
    width: 12px;
    background-color: var(--bg-primary);
    cursor: col-resize;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    min-width: 8px;
    flex-shrink: 0;
}

.resize-line {
    width: 2px;
    height: 60px;
    background-color: var(--border-color);
    border-radius: 1px;
    transition: background-color 0.2s ease;
}

.resize-handle:hover .resize-line {
    background-color: var(--text-primary);
}

.resize-handle:active .resize-line {
    background-color: var(--text-primary);
}

/* 错误信息样式 */
.curl-converter-error {
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
}

/* 错误样式 - 红色 */
.curl-converter-error.error {
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.curl-converter-error.error h4 {
    color: var(--error-color);
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #3c1b1a;
}

/* 警告样式 - 橙色 */
.curl-converter-error.warning {
    background-color: rgba(251, 146, 60, 0.05);
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-left: 3px solid rgba(251, 146, 60, 0.8);
}

.curl-converter-error.warning strong {
    color: #fb923c;
}

.curl-converter-error .error-message {
    display: block;
    margin-top: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 0;
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.6;
}

.curl-converter-error ul {
    margin: 12px 0;
    padding-left: 24px;
}

.curl-converter-error li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* 生成结果样式 */
.generated-result {
    color: var(--accent-light);
    background: rgba(16, 185, 129, 0.05);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--success-color);
    margin-bottom: 8px;
}

/* 结果区域整体样式 */
.result-section {
    padding: 12px;
}

/* 结果标题 */
.result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 带复制按钮的标题容器 */
.result-title-with-copy {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-title-with-copy .result-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* 复制按钮样式 */
.btn-copy {
    padding: 4px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

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

.btn-copy:active {
    background-color: var(--accent-light);
    border-color: var(--accent-light);
    color: white;
}

/* 统计区域整体样式 */
.stats-section {
    margin-top: 16px;
    padding: 12px;
}

/* 统计标题 */
.stats-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 结果统计信息 */
.result-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

#resultStatus {
    width: 100%;
    box-sizing: border-box;
    margin-top:12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.stat-label {
    font-weight: 500;
    font-size: 11px;
    white-space: nowrap;
}

.stat-value {
    font-weight: 600;
    font-family: var(--font-family-mono);
    font-size: 11px;
    white-space: nowrap;
}

/* 生成结果样式 */
.generated-result {
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    padding: 12px;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 动画效果 */
.result-fade-in {
    animation: fadeInResult 0.3s ease-in-out;
}

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

/* 处理状态指示器 */
.processing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
}

.processing-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    border-top-color: var(--accent-light);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 文档区域样式 - 完全复用ascii-converter样式 */
.curl-params {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.param-item {
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.param-item code:first-child {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.param-item p {
    margin: 0 0 12px 0;
    font-size: 13px;
}

.param-item .example {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 8px;
}

.param-item .example code {
    display: block;
    background: transparent;
    border: none;
    padding: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.use-cases {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.use-case {
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.use-case h4 {
    margin: 0 0 12px 0;
}

.use-case .example {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.use-case .example code {
    display: block;
    background: transparent;
    border: none;
    padding: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.browser-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.browser-item {
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.browser-item h4 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.browser-item ol {
    margin: 0;
    padding-left: 24px;
    font-size: 13px;
}

.browser-item li {
    margin: 8px 0;
}

.warning-box {
    padding: 16px 20px;
    background: var(--bg-error);
    border: 1px solid var(--error-deep);
    border-radius: 8px;
    margin: 20px 0;
}

.warning-box h4 {
    margin: 0 0 8px 0;
    color: var(--error-color);
}

.warning-box p {
    margin: 0;
    font-size: 13px;
}

#languageSelect{
    width: 160px;
    font-size: 12px;
}

#exampleSelect{
    width: 110px;
}


/* 响应式设计 */
@media (max-width: 1300px) {
    #languageSelect{
        width: 80px;
    }
    #exampleSelect{
        width: 50px;
    }
    #resultOutput{
        font-size: 12px;
    }
    .result-title {
        font-size: 12px;
    }
    .result-title-with-copy {
        font-size: 12px;
    }
    .result-stats {
        font-size: 12px;
    }
}


/* 复制 CURL 命令提示模块 */
.copy-curl-image {
    text-align: center;
    margin-bottom: 24px;
    max-width: 800px;
}

.copy-curl-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.copy-curl-content h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    /* border-bottom: 1px solid rgba(99, 102, 241, 0.2); */
}

.browser-guide-simple {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.browser-item-simple {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.browser-item-simple h4 {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.browser-item-simple h4::before {
    content: "🌐";
    margin-right: 8px;
    font-size: 16px;
}

.browser-item-simple ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.browser-item-simple ol li {
    margin-bottom: 8px;
}

.browser-item-simple code {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: var(--font-family-mono);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.warning-box-simple {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.warning-box-simple strong {
    color: #f59e0b;
    font-weight: 600;
}

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

