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

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 自定义滚动条样式，使其在 Windows 上更美观 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* 暗色模式下的滚动条 */
body[data-theme^="dark"] ::-webkit-scrollbar-thumb,
body[data-theme="monokai"] ::-webkit-scrollbar-thumb,
body[data-theme="3024-night"] ::-webkit-scrollbar-thumb,
body[data-theme="ambiance"] ::-webkit-scrollbar-thumb,
body[data-theme="base16-dark"] ::-webkit-scrollbar-thumb,
body[data-theme="cobalt"] ::-webkit-scrollbar-thumb,
body[data-theme="dark"] ::-webkit-scrollbar-thumb,
body[data-theme="dracula"] ::-webkit-scrollbar-thumb,
body[data-theme="dracula-custom"] ::-webkit-scrollbar-thumb,
body[data-theme="jellybeans"] ::-webkit-scrollbar-thumb,
body[data-theme="material"] ::-webkit-scrollbar-thumb,
body[data-theme="mbo"] ::-webkit-scrollbar-thumb,
body[data-theme="mehdi"] ::-webkit-scrollbar-thumb,
body[data-theme="midnight"] ::-webkit-scrollbar-thumb,
body[data-theme="okaidia"] ::-webkit-scrollbar-thumb,
body[data-theme="panda-syntax"] ::-webkit-scrollbar-thumb,
body[data-theme="the-matrix"] ::-webkit-scrollbar-thumb,
body[data-theme="tomorrow"] ::-webkit-scrollbar-thumb,
body[data-theme="twilight"] ::-webkit-scrollbar-thumb,
body[data-theme="zenburn"] ::-webkit-scrollbar-thumb {
    background: #555;
}

#root {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.json-tool-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.json-tool-header {
    background-color: #07a;
    color: white;
    padding: 12px 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.json-tool-header h1 {
    font-size: 16px;
    font-weight: 600;
}

.json-tool-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.theme-selector {
    display: flex;
    align-items: center;
    gap: 5px;
}

.theme-selector label {
    font-size: 13px;
    color: white;
}

.theme-selector select {
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    font-size: 13px;
    background-color: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    outline: none;
}

/* 修复 Windows 上下拉列表文字颜色不可见的问题 */
.theme-selector select option,
.theme-selector select optgroup {
    background-color: #fff;
    color: #333;
}

/* 确保 optgroup 在 Windows 上也有正确的样式 */
.theme-selector select optgroup {
    font-style: normal;
    font-weight: bold;
    background-color: #f0f0f0;
}

.theme-selector select:hover {
    border-color: rgba(255,255,255,0.5);
}

.theme-selector select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

.btn {
    background-color: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: rgba(255,255,255,0.3);
}

.btn:active {
    background-color: rgba(255,255,255,0.4);
    transform: translateY(1px);
}

.json-tool-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.json-editor-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: white;
    margin: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.json-result-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: white;
    margin: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#json-editor,
#json-result {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: none;
    outline: none;
}

.CodeMirror {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.CodeMirror-scroll {
    overflow-x: auto;
    overflow-y: auto;
}

/* 暗色主题适配 */
body[data-theme^="dark"] #json-result,
body[data-theme="monokai"] #json-result,
body[data-theme="3024-night"] #json-result,
body[data-theme="ambiance"] #json-result,
body[data-theme="base16-dark"] #json-result,
body[data-theme="cobalt"] #json-result,
body[data-theme="dark"] #json-result,
body[data-theme="dracula"] #json-result,
body[data-theme="dracula-custom"] #json-result,
body[data-theme="jellybeans"] #json-result,
body[data-theme="material"] #json-result,
body[data-theme="mbo"] #json-result,
body[data-theme="mehdi"] #json-result,
body[data-theme="midnight"] #json-result,
body[data-theme="okaidia"] #json-result,
body[data-theme="panda-syntax"] #json-result,
body[data-theme="the-matrix"] #json-result,
body[data-theme="tomorrow"] #json-result,
body[data-theme="twilight"] #json-result,
body[data-theme="zenburn"] #json-result {
    background-color: #2d2d2d;
    color: #f8f8f2;
    border-color: #444;
}

/* 亮色主题适配 */
body[data-theme^="light"] #json-result,
body[data-theme="eclipse"] #json-result,
body[data-theme="coy"] #json-result,
body[data-theme="idea"] #json-result,
body[data-theme="mdn-like"] #json-result,
body[data-theme="neo"] #json-result,
body[data-theme="yeti"] #json-result {
    background-color: #ffffff;
    color: #333333;
    border-color: #e0e0e0;
}

.json-tool-footer {
    background-color: white;
    padding: 10px 20px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.json-error {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    border-left: 4px solid #d32f2f;
    flex: 1;
    margin-right: 20px;
    display: none;
}

.json-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

@media (max-width: 768px) {
    .json-tool-content {
        flex-direction: column;
    }
    
    .json-editor-container,
    .json-result-container {
        margin: 10px 0;
    }
    
    .json-tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .json-tool-buttons {
        flex-wrap: wrap;
    }
    
    .json-tool-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .json-error {
        margin-right: 0;
        width: 100%;
    }
}