/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}



/* 应用容器样式 */
.app-container {
    display: flex;
    min-height: calc(100vh - 180px);
}

/* 左侧边栏样式 */
.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* 工具导航样式 */
.tool-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: #2c3e50;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f5f7fa;
    border-left-color: #667eea;
    transform: translateX(5px);
}

.nav-item.active {
    background: #667eea;
    color: white;
    border-left-color: #764ba2;
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.nav-text {
    font-weight: 500;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #f5f7fa;
}

.feature-header {
    text-align: center;
    margin-bottom: 2rem;
}

.feature-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.feature-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 欢迎界面样式 */
.welcome {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.welcome h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.welcome p {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* 工具界面样式 */
.tool {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tool-actions {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tool-actions select, .tool-actions input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.tool-content {
    padding: 1rem;
}

/* 文本区域样式 */
textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
    background: #fafafa;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

/* 结果容器样式 */
.result-container {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1rem;
    max-height: 500px;
    overflow: auto;
}

.result-container pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-container code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

/* 按钮样式 */
.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

/* 特殊布局样式 */
.split-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.split-left, .split-right {
    display: flex;
    flex-direction: column;
}

.split-left h4, .split-right h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.split-content textarea {
    margin-bottom: 0;
    flex: 1;
}

.split-content .result-container {
    flex: 1;
    margin-bottom: 0;
}

.diff-content .diff-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.diff-content textarea {
    margin-bottom: 0;
}

/* JSON查看器样式 */
#json-viewer {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

.json-key {
    color: #952a2a;
    font-weight: bold;
}

.json-string {
    color: #2a6d95;
}

.json-number {
    color: #2a956d;
}

.json-boolean {
    color: #956d2a;
    font-weight: bold;
}

.json-null {
    color: #666;
    font-style: italic;
}

.json-indent {
    margin-left: 20px;
}

.json-toggle {
    cursor: pointer;
    color: #667eea;
    margin-right: 5px;
    font-weight: bold;
}

/* Excel预览样式 */
#excel-preview table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

#excel-preview th, #excel-preview td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

#excel-preview th {
    background: #f0f0f0;
    font-weight: bold;
}

/* 页脚样式 */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    
    .feature-header h2 {
        font-size: 1.5rem;
    }
    
    /* 响应式布局 - 小屏幕时垂直排列 */
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .nav-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-icon {
        font-size: 1rem;
        margin-right: 0.5rem;
    }
    
    .split-content {
        grid-template-columns: 1fr;
    }
    
    .diff-content .diff-inputs {
        grid-template-columns: 1fr;
    }
    
    .tool-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tool-actions select, .tool-actions input, .tool-actions button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .tool-actions button:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .navbar {
        padding: 1.5rem 0;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .features, .main-content {
        padding: 1rem 0;
    }
    
    textarea {
        min-height: 150px;
        font-size: 0.8rem;
    }
    
    .result-container {
        max-height: 300px;
    }
}