/* 工具分类样式 */
.tool-categories {
    margin-bottom: 30px;
}

.category-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 2px solid rgba(255, 107, 107, 0.3);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.tool-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tool-item {
    padding: 12px 15px;
    margin: 4px 0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.8);
}

.tool-item:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    transform: translateX(5px);
}

.tool-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.tool-icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.tool-name {
    font-size: 14px;
    font-weight: 500;
}

/* 推荐工具网格 */
.featured-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.featured-tool-card {
    background: white;
    padding: 25px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    border: 2px solid transparent;
}

.featured-tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.featured-tool-icon {
    font-size: 32px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

.featured-tool-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.featured-tool-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: var(--transition);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 无工具提示 */
.no-tools-message {
    text-align: center;
    padding: 50px 30px;
    color: #666;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    margin: 20px;
    border: 2px dashed #dee2e6;
}

/* 工具内容通用样式 */
.tool-content {
    padding: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.tool-description {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.6;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

/* 按钮样式 */
.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.primary-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.secondary-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    margin-left: 10px;
}

.secondary-btn:hover {
    background: #3dbeb4;
    transform: translateY(-2px);
}

/* 输入输出区域 */
.tool-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: var(--transition);
    background: white;
}

.tool-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.tool-textarea.output {
    background: #f8f9fa;
    color: #333;
    border-color: #dee2e6;
}

/* 状态消息 */
.status-message {
    padding: 15px;
    margin: 15px 0;
    border-radius: var(--border-radius);
    font-weight: 600;
    border-left: 4px solid;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

/* 网格布局 */
.text-compare-grid,
.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 25px 0;
}

.text-area,
.converter-section {
    display: flex;
    flex-direction: column;
}

.text-input,
.converter-input,
.converter-output {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: var(--transition);
    background: white;
}

.text-input:focus,
.converter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.converter-output {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.text-info {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* JSON工具样式 */
.json-input,
.json-output {
    width: 100%;
    height: 250px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background: white;
}

.json-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.json-output {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.json-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 验证结果 */
.validation-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--border-radius);
    font-weight: 600;
    border-left: 4px solid;
}

.validation-result.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.validation-result.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* 差异对比 */
.diff-line {
    padding: 12px 15px;
    margin: 6px 0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.diff-line.changed {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.diff-line.same {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
}

.line-number {
    font-weight: bold;
    color: #666;
    margin-bottom: 8px;
    font-size: 12px;
}

.old-line {
    color: #dc3545;
    text-decoration: line-through;
}

.new-line {
    color: #28a745;
}

.diff-summary {
    font-weight: bold;
    margin-bottom: 15px;
    color: #666;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .main-content {
        margin: 0;
        border-radius: 0;
    }
    
    .text-compare-grid,
    .converter-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-tools {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
}
