:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --success: #4cc9f0;
    --danger: #f72585;
    --json-bg: #282c34;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fa;
    color: var(--dark);
    line-height: 1.6;
    padding: 0.5rem 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
}

/* 卡片通用样式 */
.tool-card {
    background: white;
    border-radius: 12px;
    padding: 0.5rem 2rem 2rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
}

/* 全宽卡片 */
.full-width {
    grid-column: 1 / -1;
}

/* 小工具并排布局 */
.small-tools-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* 输入输出框样式 */
textarea, .result-box {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    resize: vertical;
    background: #f8f9fa;
}

textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67,97,238,0.2);
}

.color-box {
    width: 100%;
    height: 60px;
    border: 1px solid #ddd;
    margin: 10px 0;
}

input {
    padding: 8px;
    margin: 5px 0;
    width: 100%;
    border-radius: 8px;
}

/* 按钮样式 */
button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin: 0.5rem 0.5rem 0.5rem 0;
    transition: all 0.2s ease;
}

button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* JSON结果区特殊样式 */
.json-result {
    background: var(--json-bg);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* 语法高亮 */
.json-key { color: #7bdcfe; }
.json-string { color: #ce9178; }
.json-number { color: #b5cea8; }
.json-boolean { color: #d19a66; }
.json-null { color: #d19a66; }

/* 响应式设计 */
@media (max-width: 768px) {
    .small-tools-row {
        grid-template-columns: 1fr;
    }
}
