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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 3px;
}

/* 主容器 */
.main-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* 左侧边栏 */
.sidebar {
    width: 220px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #555;
}

.category:hover {
    background-color: #f0f2f5;
}

.category.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-icon {
    font-size: 1.2rem;
}

.category-name {
    font-weight: 500;
}

/* 右侧内容区 */
.content {
    flex: 1;
    min-width: 0;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 8px;
}

.section-header p {
    color: #718096;
    font-size: 1rem;
}

/* 工具网格 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tool-card {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.tool-card h3 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 8px;
}

.tool-card p {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 工具详情面板 */
.tool-panel {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tool-detail {
    padding: 30px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.detail-header h2 {
    font-size: 1.5rem;
    color: #2d3748;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: #f5f7fa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.close-btn:hover {
    background-color: #e2e8f0;
    color: #333;
}

.description {
    color: #718096;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* 图片上传区域 */
.image-upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.image-upload-area:hover,
.image-upload-area.dragover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.upload-content p {
    margin: 8px 0;
    color: #555;
}

.upload-hint {
    font-size: 0.85rem !important;
    color: #999 !important;
}

/* 选项区域 */
.compress-options,
.watermark-options,
.enlarge-options,
.merge-options,
.qrcode-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.compress-options label,
.watermark-options label,
.enlarge-options label,
.merge-options label,
.qrcode-options label {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.compress-options span,
.watermark-options span,
.enlarge-options span,
.merge-options span,
.qrcode-options span {
    min-width: 80px;
    color: #555;
}

input[type="range"] {
    flex: 1;
    min-width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #eee;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
}

select {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    font-size: 1rem;
    cursor: pointer;
    color: #333;
}

/* 结果区域 */
.compress-result,
.convert-result,
.removebg-result,
.watermark-result,
.enlarge-result,
.merge-result {
    margin-top: 20px;
}

.result-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.image-box {
    text-align: center;
}

.image-box img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.image-size {
    font-size: 0.85rem;
    color: #666;
}

.result-info {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.result-info p {
    color: #333;
    font-weight: 500;
}

/* 按钮样式 */
.download-btn,
.action-btn,
.copy-btn,
.merge-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn,
.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.download-btn:hover,
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.copy-btn {
    background-color: #f0f2f5;
    color: #555;
    margin-top: 10px;
}

.copy-btn:hover {
    background-color: #e2e8f0;
}

.merge-btn {
    background-color: #28a745;
    color: white;
}

.merge-btn:hover {
    background-color: #218838;
}

/* 文本工具样式 */
textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

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

textarea[readonly] {
    background-color: #f8f9fa;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

.convert-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* 字数统计结果 */
.wordcount-result {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

/* 繁简转换容器 */
.chtcns-container,
.compare-container,
.encode-container,
.timestamp-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.chtcns-buttons,
.encode-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 文本对比结果 */
.compare-result {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.diff-added {
    background-color: #d4edda;
    padding: 2px 4px;
    border-radius: 2px;
}

.diff-removed {
    background-color: #f8d7da;
    padding: 2px 4px;
    border-radius: 2px;
}

/* 二维码结果 */
.qrcode-result {
    text-align: center;
    margin-top: 20px;
}

/* MD5结果 */
.md5-result {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.result-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-box label {
    font-size: 0.9rem;
    color: #666;
}

.result-box input {
    margin-bottom: 0;
}

/* 进制转换 */
.base-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.base-input,
.base-output {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.base-output {
    flex-direction: column;
}

.base-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    max-width: 200px;
}

/* 单位换算 */
.unit-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.unit-input,
.unit-output {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* 随机数生成 */
.random-container,
.password-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.random-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 密码强度 */
.password-strength {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.strength-weak {
    background-color: #f8d7da;
    color: #721c24;
}

.strength-medium {
    background-color: #fff3cd;
    color: #856404;
}

.strength-strong {
    background-color: #d4edda;
    color: #155724;
}

/* 便民工具结果 */
.phone-result,
.ip-result,
.weather-result,
.zodiac-result {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #666;
}

.result-value {
    color: #333;
}

/* 天气卡片 */
.weather-card {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.weather-icon {
    font-size: 4rem;
}

.weather-temp {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
}

.weather-city {
    font-size: 1.2rem;
    color: #333;
}

.weather-desc {
    color: #666;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

/* 页脚 */
.footer {
    background-color: #2d3748;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content p {
    margin: 5px 0;
    color: #a0aec0;
}

/* Toast提示 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

.toast.info {
    background-color: #17a2b8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        order: 3;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 10px;
        padding: 10px;
        margin-top: 10px;
    }
    
    .nav-links.show {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-link {
        padding: 10px 15px;
        border-radius: 8px;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .main-container {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    
    .sidebar {
        width: 100%;
        padding: 15px;
    }
    
    .category-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .category {
        padding: 10px 15px;
        border-radius: 20px;
    }
    
    .section-header h1 {
        font-size: 1.5rem;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tool-detail {
        padding: 20px;
    }
    
    .image-upload-area {
        padding: 30px 15px;
    }
    
    .result-images {
        grid-template-columns: 1fr;
    }
    
    .convert-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .encode-buttons,
    .chtcns-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .base-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .footer {
        padding: 20px 0;
    }
    
    .toast {
        right: 15px;
        left: 15px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .tool-card {
        padding: 20px 15px;
    }
    
    .tool-icon {
        font-size: 2rem;
    }
    
    .tool-card h3 {
        font-size: 1.1rem;
    }
    
    .detail-header h2 {
        font-size: 1.3rem;
    }
    
    textarea {
        min-height: 120px;
        padding: 12px;
    }
}
