* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

.tab-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

.tab-button.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.container {
    display: flex;
    gap: 20px;
}

.input-section, .output-section {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.text-area {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 300px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-size: 14px;
    background: white;
}

.button-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 10px;
}

button {
    padding: 8px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.corner-button {
    position: static;
    background-color: rgba(76, 175, 80, 0.9);
    font-size: 12px;
}

h3 {
    margin: 0;
    color: #333;
}

.success-tooltip {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: rgba(76, 175, 80, 0.9);
    color: white;
    border-radius: 4px;
    display: none;
    animation: fadeInOut 2s ease-in-out;
}

.stats {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats p {
    margin: 5px 0;
    color: #666;
}

.stats span {
    color: #4CAF50;
    font-weight: bold;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* JSON Viewer Styles */
.json-tools {
    display: flex;
    gap: 8px;
}

.json-viewer {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 300px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    overflow: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.json-item {
    position: relative;
    padding-left: 20px;
}

.json-root {
    padding-left: 0;
}

.json-item:not(.json-root)::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #e0e0e0;
}

.json-item:not(.json-root)::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    width: 12px;
    height: 1px;
    background-color: #e0e0e0;
}

.json-item:last-child::before {
    height: 10px;
}

.json-toggle {
    position: absolute;
    left: 0;
    top: 2px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    color: #666;
    background-color: white;
    z-index: 1;
}

.json-root > .json-toggle {
    position: relative;
    display: inline-block;
    margin-right: 5px;
    vertical-align: top;
}

.json-toggle::before {
    content: '▼';
    font-size: 12px;
}

.json-collapsed > .json-toggle::before {
    content: '▶';
}

.json-collapsed > .json-content {
    display: none;
}

.json-content {
    position: relative;
    margin-left: 20px;
}

.json-root > .json-content {
    margin-left: 0;
}

.json-key {
    color: #881391;
    margin-right: 5px;
}

.json-string {
    color: #268bd2;
}

.json-number {
    color: #b58900;
}

.json-boolean {
    color: #859900;
}

.json-null {
    color: #dc322f;
}

.json-mark {
    color: #999;
}

.json-url {
    color: #268bd2;
    text-decoration: underline;
    cursor: pointer;
}

.json-preview {
    color: #999;
    font-style: italic;
    font-size: 12px;
    margin: 0 4px;
    background-color: white;
    position: relative;
    z-index: 1;
}

.json-collapsed .json-preview {
    display: inline !important;
}

.json-collapsed > div > .json-mark:last-child {
    display: none;
}

.json-key, .json-string, .json-number, .json-boolean, .json-null, .json-mark {
    position: relative;
    z-index: 1;
    background-color: white;
}

/* Message Box Styles */
.message-box {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 300px;
    max-width: 500px;
}

.message-box-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: #dc322f;
}

.message-box-content {
    margin-bottom: 20px;
    line-height: 1.5;
}

.message-box-footer {
    text-align: right;
}

.message-box-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* Split Text Styles */
.split-text-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.output-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.output-column {
    flex: 1;
    min-width: 200px;
    max-width: calc(33.33% - 14px);
}

@media (max-width: 768px) {
    .output-column {
        max-width: 100%;
    }
}

.separator-input {
    width: 150px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.split-options {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.split-separator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.split-tools {
    display: flex;
    gap: 8px;
}

.split-line-count {
    display: flex;
    align-items: center;
    gap: 10px;
}

.line-count-input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 编码解码样式 */
.encode-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.encode-button {
    flex: 1;
    padding: 10px;
    font-size: 16px;
}

.encode-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.encode-result {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
}

.encode-result .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.encode-result .section-header h3 {
    font-size: 14px;
    margin: 0;
    color: #333;
}

.encode-result textarea {
    height: 60px;
    min-height: 60px;
    font-size: 13px;
    line-height: 1.4;
    padding: 5px;
}

/* 响应式布局 */
@media screen and (max-width: 768px) {
    .encode-results {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式优化 */
.encode-results::-webkit-scrollbar {
    width: 8px;
}

.encode-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.encode-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.encode-results::-webkit-scrollbar-thumb:hover {
    background: #555;
} 

/* ICP备案信息样式 */
.icp-container {
    width: 100%;
    text-align: center;
    padding: 20px 0;  /* 减少内边距 */
    background-color: var(--bg-color);
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
    margin-left: 0;
    margin-top: 10px;  /* 添加负边距，使其与上方内容更靠近 */
}

.icp-container a {
    color: #666;
    text-decoration: none;
    font-size: 12px;  /* 稍微减小字体大小 */
    display: inline-block;
    line-height: 1.2;  /* 减小行高 */
}

.icp-container a:hover {
    color: var(--primary-color);
}