/* HTML/JS互转工具专用样式 */

/* ==================== 控制面板 ==================== */
.control-panel {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s;
}

.control-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 转换类型选择器 */
#conversionType {
    padding: 12px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #495057;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
}

#conversionType:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

#conversionType:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

/* 按钮基础样式 */
.control-panel button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.control-panel button i {
    font-size: 14px;
}

/* 主要按钮 - 渐变蓝色 */
.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

/* 次要按钮 */
.secondary-btn {
    background: white;
    color: #495057;
    border: 2px solid #e1e8ed;
}

.secondary-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.secondary-btn:active {
    transform: translateY(0);
}

/* ==================== 转换器容器 - 双栏布局 ==================== */
.converter-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

/* 输入输出区域 */
.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 编辑器标题 */
.editor-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    letter-spacing: 0.3px;
}

.editor-header i {
    font-size: 16px;
}

/* CodeMirror 编辑器容器 */
#inputEditor,
#outputEditor {
    border: 2px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

#inputEditor:hover,
#outputEditor:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* CodeMirror 编辑器样式覆盖 */
.CodeMirror {
    height: 500px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* 只读编辑器样式 */
.CodeMirror-readonly {
    background: #f8f9fa;
}

/* ==================== 响应式设计 - 平板 ==================== */
@media (max-width: 1024px) {
    .converter-container {
        gap: 20px;
    }

    .CodeMirror {
        height: 400px;
        font-size: 13px;
    }

    .control-panel {
        padding: 16px;
        gap: 10px;
    }

    .control-panel button,
    #conversionType {
        padding: 10px 18px;
        font-size: 13px;
    }

    .editor-header {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ==================== 响应式设计 - 手机 ==================== */
@media (max-width: 768px) {
    /* 控制面板移动端优化 */
    .control-panel {
        padding: 15px;
        gap: 10px;
        margin-bottom: 20px;
    }

    /* 转换器改为上下布局 */
    .converter-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .CodeMirror {
        height: 300px;
        font-size: 12px;
    }

    .control-panel button,
    #conversionType {
        padding: 10px 16px;
        font-size: 13px;
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .editor-header {
        padding: 12px 15px;
        font-size: 14px;
    }

    .input-section,
    .output-section {
        gap: 0;
    }
}

/* ==================== 小屏手机优化 ==================== */
@media (max-width: 480px) {
    .control-panel {
        flex-direction: column;
        padding: 12px;
    }

    .control-panel button,
    #conversionType {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .CodeMirror {
        height: 280px;
        font-size: 12px;
    }

    .editor-header {
        padding: 10px 12px;
        font-size: 13px;
    }

    .editor-header i {
        font-size: 14px;
    }
}
