/* 基础样式重置 - 紧凑版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.4;
    font-size: 13px;
}

.container {
    /*max-width: 1400px;*/
    margin: 0 auto;
    padding: 0 8px;
}

/* 广告位样式 - 更紧凑 */
.ad-top, .ad-bottom, .ad-content-bottom {
    width: 100%;
    margin: 6px 0;
    text-align: center;
}

.ad-sidebar {
    margin-bottom: 10px;
}

.ad-placeholder {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 6px;
    border-radius: 4px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.ad-top .ad-placeholder {
    height: 80px;
}

.ad-bottom .ad-placeholder,
.ad-content-bottom .ad-placeholder {
    height: 80px;
}

.ad-sidebar .ad-placeholder {
    height: 500px;
    writing-mode: vertical-rl;
    font-size: 1.2rem;
}

/* 紧凑头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #e1e5e9;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo i {
    font-size: 1.5rem;
    color: #4a6cf7;
}

.logo h1 {
    font-size: 1.3rem;
    color: #2d3748;
    font-weight: 700;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #666;
}

.tool-count {
    background-color: #e8f4ff;
    color: #2b6cb0;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.update-time {
    color: #718096;
}

/* 横向导航菜单 - 更紧凑 */
.horizontal-nav {
    background-color: white;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
}

.nav-container {
    display: flex;
    position: relative;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    color: #4a6cf7;
    background-color: #f7f9fc;
}

.nav-link.active {
    color: #4a6cf7;
    border-bottom-color: #4a6cf7;
    background-color: #f0f5ff;
}

.nav-link i {
    margin-right: 6px;
    font-size: 0.9rem;
}

.nav-link.has-submenu::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 4px;
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.nav-link.active.has-submenu::after {
    transform: rotate(180deg);
}

/* 二级菜单 - 更紧凑 */
.submenu-container {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 180px;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    border: 1px solid #e2e8f0;
    border-top: none;
}

.submenu-container.show {
    display: block;
}

.submenu-item {
    display: block;
    padding: 8px 14px;
    color: #4a5568;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.submenu-item:last-child {
    border-bottom: none;
}

.submenu-item:hover {
    color: #4a6cf7;
    background-color: #f7f9fc;
    padding-left: 18px;
}

.submenu-item.active {
    color: #4a6cf7;
    background-color: #f0f5ff;
    font-weight: 600;
}

.submenu-item i {
    margin-right: 6px;
    font-size: 0.85rem;
    width: 14px;
    text-align: center;
}

/* 主内容区布局 - 更紧凑 */
.main-content {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.sidebar {
    flex: 0 0 110px;
}

.content-wrapper {
    flex: 1;
    min-width: 0;
}

/* 侧边栏工具列表 - 更紧凑 */
.quick-links, .hot-tools {
    background-color: white;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-links h4, .hot-tools h4 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-links h4 i {
    color: #f59e0b;
}

.hot-tools h4 i {
    color: #ef4444;
}

.quick-tools, .hot-tools-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-tool, .hot-tool {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background-color: #f8fafc;
    border-radius: 4px;
    color: #4a5568;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.quick-tool:hover, .hot-tool:hover {
    background-color: #edf2f7;
    color: #4a6cf7;
    transform: translateX(2px);
}

.quick-tool i, .hot-tool i {
    margin-right: 6px;
    font-size: 0.85rem;
}

/* 内容区域样式 - 更紧凑 */
.content {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    min-height: 550px;
    margin-bottom: 10px;
}

/* 工具内容样式 - 更紧凑 */
.tool-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.tool-title {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-title i {
    color: #4a6cf7;
}

.tool-description {
    color: #718096;
    font-size: 0.85rem;
    line-height: 1.4;
}

.tool-content {
    margin-top: 15px;
}

/* 工具操作区域样式 - 更紧凑 */
.tool-container {
    background-color: #f8fafc;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

.input-section, .output-section {
    margin-bottom: 15px;
}

.section-title {
    font-size: 0.95rem;
    color: #2d3748;
    margin-bottom: 8px;
    font-weight: 600;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.85rem;
}

.input-group textarea,
.input-group input,
.input-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    background-color: white;
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
}

.input-group textarea:focus,
.input-group input:focus,
.input-group select:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.1);
}

.checkbox-group, .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-item input, .radio-item input {
    width: auto;
}

.checkbox-item label, .radio-item label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
    font-size: 0.85rem;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-value {
    min-width: 25px;
    text-align: center;
    font-weight: 600;
    color: #4a6cf7;
}

.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background-color: #4a6cf7;
    color: white;
}

.btn-primary:hover {
    background-color: #3a5bd9;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(74, 108, 247, 0.2);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background-color: #cbd5e0;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #0da271;
}

.btn i {
    font-size: 0.85rem;
}

.result-box {
    background-color: white;
    border-radius: 4px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    margin-top: 12px;
}

.result-title {
    font-size: 0.9rem;
    color: #2d3748;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-content {
    padding: 8px;
    background-color: #f8fafc;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 250px;
    overflow-y: auto;
}

/* 欢迎页面样式 - 更紧凑 */
.welcome-page {
    text-align: center;
    padding: 30px 15px;
}

.welcome-title {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.welcome-title i {
    color: #4a6cf7;
}

.welcome-description {
    color: #718096;
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.5;
    font-size: 0.9rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a6cf7;
    margin-bottom: 4px;
}

.stat-label {
    color: #718096;
    font-size: 0.85rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.feature-card {
    background-color: #f8fafc;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
    border-color: #4a6cf7;
}

.feature-icon {
    font-size: 1.5rem;
    color: #4a6cf7;
    margin-bottom: 10px;
}

.feature-title {
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 8px;
}

.feature-description {
    color: #718096;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 紧凑页脚样式 */
.footer {
    text-align: center;
    padding: 12px 0;
    color: #718096;
    border-top: 1px solid #e2e8f0;
    margin-top: 15px;
    font-size: 0.8rem;
}

.copyright {
    margin-bottom: 8px;
}

#total-tools {
    color: #4a6cf7;
    font-weight: 700;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #718096;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-links a:hover {
    color: #4a6cf7;
}

.footer-links i {
    font-size: 0.75rem;
}

/* 响应式设计 - 更紧凑 */
@media (max-width: 1200px) {
    .sidebar {
        flex: 0 0 140px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        display: none;
    }

    .main-content {
        gap: 0;
    }

    .ad-top .ad-placeholder,
    .ad-bottom .ad-placeholder,
    .ad-content-bottom .ad-placeholder {
        height: 60px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 6px;
    }

    .header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 6px 0;
    }

    .nav-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .content {
        padding: 12px;
        min-height: 450px;
        margin-bottom: 8px;
    }

    .tool-container {
        padding: 12px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats {
        gap: 15px;
        margin-bottom: 20px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .welcome-page {
        padding: 20px 10px;
    }
}

@media (max-width: 480px) {
    .nav-link {
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    .tool-title {
        font-size: 1.1rem;
    }

    .content {
        padding: 10px;
    }

    .tool-container {
        padding: 10px;
    }

    .ad-sidebar .ad-placeholder {
        height: 400px;
        font-size: 1rem;
    }

    .footer {
        padding: 10px 0;
        font-size: 0.75rem;
    }

    .footer-links {
        gap: 10px;
    }
}