/* 基础样式重置 - 紧凑版 */
* {
    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-bottom {
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
}

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

.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: 100px;
}

.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;
    flex-wrap: wrap;
    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: 40px;
}

.sidebar {
    flex: 0 0 160px;
}

.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: 8px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
    position: relative;
}

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

.feature-card.recent {
    border-color: #f59e0b;
    background-color: #fffbeb;
}

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

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

.feature-category {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

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

.recent-badge {
    display: inline-block;
    background-color: #f59e0b;
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* 紧凑页脚样式 */
.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;
    }
}

/* 联系我弹窗样式 */
.contact-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.contact-modal {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(74, 108, 247, 0.1);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.contact-modal-header {
    background: linear-gradient(135deg, #4a6cf7 0%, #6a85ff 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.contact-modal-header i {
    font-size: 1.3rem;
}

.contact-modal-header span {
    font-size: 1.1rem;
    font-weight: 600;
}

.contact-modal-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.contact-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.contact-modal-body {
    padding: 30px 24px;
    text-align: center;
}

.contact-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.contact-icon i {
    font-size: 2.5rem;
    color: #d97706;
}

.contact-modal-body p {
    color: #64748b;
    line-height: 1.6;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.contact-email i {
    font-size: 1.1rem;
}

.contact-note {
    font-size: 0.85rem !important;
    color: #f59e0b !important;
    font-weight: 500;
}

.contact-modal-footer {
    padding: 20px 24px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.contact-modal-btn {
    background: linear-gradient(135deg, #4a6cf7 0%, #6a85ff 100%);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
}

.contact-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 108, 247, 0.4);
}

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

@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;
    }
}