/**
 * YAML JSON 转换器样式 - 简化版
 * 粘贴即转换，两栏布局
 */

/* ============================================
   转换器容器布局 - 简化为两栏
   ============================================ */
.tool-page .converter-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

/* ============================================
   输入输出区域
   ============================================ */
.tool-page .input-section,
.tool-page .output-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 区域头部 */
.tool-page .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.tool-page .section-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.tool-page .section-actions {
    display: flex;
    gap: 8px;
}

.tool-page .btn-action {
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
    font-size: 14px;
}

.tool-page .btn-action:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* 输入文本框 */
.tool-page .code-textarea {
    width: 100%;
    min-height: 350px;
    padding: 16px;
    border: none;
    outline: none;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #fafafa;
    color: #333;
}

.tool-page .code-textarea::placeholder {
    color: #adb5bd;
}

.tool-page .code-textarea:focus {
    background: #ffffff;
}

/* 格式识别提示条 */
.tool-page .format-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    border-radius: 6px;
    margin: 0 10px;
    font-size: 13px;
    color: #155724;
    font-weight: 500;
}

.tool-page .format-indicator i {
    color: #28a745;
    font-size: 16px;
}

/* 输出显示区域 */
.tool-page .output-display {
    min-height: 350px;
    padding: 0;
    background: #fafafa;
    overflow: auto;
}

.tool-page .output-display pre {
    margin: 0;
    padding: 16px;
    background: transparent;
}

.tool-page .code-output {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 区域底部 */
.tool-page .section-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    min-height: 40px;
}

.tool-page .char-count {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

/* ============================================
   快速操作栏（交换按钮）
   ============================================ */
.tool-page .quick-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.tool-page .quick-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.tool-page .quick-actions .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.tool-page .quick-actions .btn-secondary i {
    font-size: 16px;
}

/* ============================================
   Toast 消息
   ============================================ */
.toast-message {
    position: fixed;
    top: 20px;
    right: -300px;
    background: #ffffff;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: right 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    min-width: 200px;
    max-width: 350px;
}

.toast-message.show {
    right: 20px;
}

.toast-message i {
    font-size: 18px;
}

.toast-message.toast-success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.toast-message.toast-success i {
    color: #28a745;
}

.toast-message.toast-error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.toast-message.toast-error i {
    color: #dc3545;
}

.toast-message.toast-warning {
    border-left: 4px solid #ffc107;
    color: #856404;
}

.toast-message.toast-warning i {
    color: #ffc107;
}

.toast-message.toast-info {
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.toast-message.toast-info i {
    color: #17a2b8;
}

/* ============================================
   Prism 语法高亮定制
   ============================================ */
.tool-page .output-display pre[class*="language-"] {
    margin: 0;
    background: transparent;
}

.tool-page .output-display code[class*="language-"] {
    background: transparent;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   响应式设计
   ============================================ */

/* 平板端 */
@media (max-width: 1024px) {
    .tool-page .converter-container {
        gap: 15px;
    }

    .tool-page .code-textarea,
    .tool-page .output-display {
        min-height: 300px;
    }
}

/* 手机端 */
@media (max-width: 768px) {
    .tool-page .converter-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tool-page .code-textarea,
    .tool-page .output-display {
        min-height: 250px;
    }

    .tool-page .section-header {
        padding: 10px 12px;
    }

    .tool-page .section-header h3 {
        font-size: 13px;
    }

    .tool-page .btn-action {
        padding: 5px 8px;
        font-size: 13px;
    }

    .tool-page .format-indicator {
        font-size: 12px;
        padding: 8px 12px;
    }

    .tool-page .quick-actions .btn-secondary {
        padding: 8px 20px;
        font-size: 13px;
    }

    .toast-message {
        right: -280px;
        min-width: 250px;
    }

    .toast-message.show {
        right: 10px;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .tool-page .section-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tool-page .format-indicator {
        font-size: 11px;
        padding: 6px 10px;
        margin: 0 8px;
    }

    .tool-page .quick-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
