/* ============================================
   在线工具箱首页 - 简洁风格
   参考 scanner2 navigation-link-item 卡片样式
   ============================================ */

/* ---- 基础重置 ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #1b1b1b;
    background: linear-gradient(135deg, #f6f7fb 0%, #f0f4f9 100%);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- 顶部导航 - 渐变背景 ---- */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 14px 0;
}

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

.nav-logo {
    margin: 0;
    line-height: 1;
}

.logo-link {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.9;
}

.nav-right {
    /* 暂空，预留给未来导航项 */
}

/* ---- 工具列表主体 ---- */
.tools-main {
    padding: 32px 0 40px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ---- 工具卡片 - 参考 scanner2 navigation-link-item ---- */
.tool-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid rgba(102, 126, 234, 0.25);
    border-radius: 10px;
    padding: 24px 16px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.tool-card:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f6f7fb 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.tool-card:active {
    transform: translateY(0);
}

/* ---- 图标 ---- */
.tool-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-icon svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon svg {
    transform: scale(1.1);
}

/* ---- 标题 ---- */
.tool-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1b1b1b;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* ---- 说明文字（2行截断） ---- */
.tool-desc {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    min-height: 2.25em;
}

/* ---- 立即使用按钮 ---- */
.tool-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.2);
    margin-top: auto;
}

.tool-card:hover .tool-btn {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
    transform: translateY(-1px);
}

/* ---- SEO 描述区 ---- */
.seo-section {
    padding: 0 0 48px;
}

.seo-text {
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.8;
    max-width: 640px;
    margin: 0 auto;
}

/* ---- 页脚 ---- */
.footer {
    background: #1f2937;
    color: white;
    padding: 24px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 0.75rem;
    color: #f9fafb;
    font-size: 1rem;
}

.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.friend-links a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.friend-links a:hover {
    color: #60a5fa;
}

.footer-contact {
    white-space: nowrap;
}

.contact-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: #93c5fd;
}

/* ---- 微信弹窗 ---- */
.wx-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.wx-modal-active {
    display: flex;
}

.wx-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.wx-modal-body {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
}

.wx-modal-img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
}

/* ---- 响应式：平板 ---- */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---- 响应式：手机 ---- */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tool-card {
        padding: 18px 12px 16px;
    }

    .tool-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 8px;
    }

    .tool-icon svg {
        width: 24px;
        height: 24px;
    }

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

    .tool-desc {
        font-size: 0.75rem;
        margin-bottom: 10px;
    }

    .tool-btn {
        font-size: 0.75rem;
        padding: 5px 14px;
    }

    .seo-section {
        padding: 0 0 32px;
    }

    .seo-text {
        font-size: 0.75rem;
    }
}

/* ---- 响应式：小屏手机 ---- */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nav-container {
        padding: 0 16px;
    }

    .tools-main {
        padding: 20px 0 28px;
    }

    .tools-grid {
        gap: 10px;
    }

    .tool-card {
        padding: 14px 10px 14px;
    }

    .tool-icon {
        width: 22px;
        height: 22px;
        margin-bottom: 6px;
    }

    .tool-icon svg {
        width: 22px;
        height: 22px;
    }

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

    .tool-desc {
        font-size: 0.72rem;
        margin-bottom: 8px;
    }

    .tool-btn {
        font-size: 0.72rem;
        padding: 4px 12px;
    }

    .logo-link {
        font-size: 1.1rem;
    }

    .footer {
        padding: 20px 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.25rem;
    }

    .friend-links a {
        font-size: 0.75rem;
    }

    .contact-link {
        font-size: 0.75rem;
    }
}
