/* 全局样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --text-color: #333;
    --border-radius: 4px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

header p {
    font-size: 14px;
}

/* 控制按钮区域 */
.controls {
    margin-bottom: 10px;
}

.input-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    background-color: #f0f0f0;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    background-color: #e0e0e0;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--secondary-color);
}

.btn i {
    font-size: 14px;
}

/* 文件上传相关样式 */
.file-upload-wrapper {
    position: relative;
    display: inline-block;
}

.file-input-hidden {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

/* 主内容区域 - 左右分栏 */
main {
    flex: 1;
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    height: calc(100vh - 220px); /* 调整高度以适应屏幕 */
    min-height: 400px;
    overflow: hidden;
}

.editor-container, .result-container {
    flex: 1;
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-header {
    background-color: #f5f5f5;
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    color: var(--dark-color);
    font-size: 14px;
}

.editor-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    height: calc(100% - 40px);
    overflow: hidden;
}

#json-input, #json-output {
    width: 100%;
    height: 100%;
    padding: 15px;
    border: none;
    resize: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow: auto;
}

#json-input:focus, #json-output:focus {
    outline: none;
}

#json-output {
    background-color: #fafafa;
}

/* 状态栏样式 */
.status-bar {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.message {
    padding: 8px;
    border-radius: var(--border-radius);
    display: none;
    font-size: 14px;
}

.message.error {
    display: block;
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.message.success {
    display: block;
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
    gap: 5px;
}

.stats > div {
    flex: 1;
    min-width: 100px;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 10px 0;
    border-top: 1px solid #eee;
    color: #777;
    font-size: 13px;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        flex-direction: column;
        height: calc(100vh - 280px);
    }
    
    .editor-container, .result-container {
        height: 50%;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.message {
    animation: fadeIn 0.3s ease-in-out;
}

/* 拖放样式 */
#json-input.dragover {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.05);
} 