/* 88tool工具网 — 主样式 */

:root {
    --primary: #4A6CF7;
    --primary-dark: #3a5ce5;
    --primary-light: #e8edff;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
}

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

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

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-block { display: block; width: 100%; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

/* ========== 导航 ========== */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.nav-logo { display: flex; align-items: baseline; gap: 2px; }
.logo-text { font-size: 24px; font-weight: 800; color: var(--primary); }
.logo-suffix { font-size: 18px; font-weight: 600; color: var(--gray-700); }
.nav-menu { display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--gray-700); font-size: 15px; padding: 6px 12px; border-radius: 6px; transition: all 0.2s; }
.nav-link:hover { background: var(--gray-100); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.points-badge { background: #fff8e1; color: #f57c00; padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.username { color: var(--gray-700); font-size: 14px; }

/* 汉堡菜单按钮 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* 移动端导航菜单 */
.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 99;
    padding: 8px 0;
}
.mobile-nav.show { display: block; }
.mobile-nav-link {
    display: block;
    padding: 14px 24px;
    color: var(--gray-700);
    font-size: 16px;
    transition: background 0.2s;
}
.mobile-nav-link:hover { background: var(--gray-100); }

/* ========== 消息提示 ========== */
.flash-container { max-width: 1100px; margin: 16px auto; padding: 0 20px; }
.flash { padding: 12px 20px; border-radius: 8px; margin-bottom: 8px; font-size: 15px; }
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ========== 首页横幅 ========== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    padding: 80px 20px;
    text-align: center;
}
.hero-title { font-size: 48px; font-weight: 800; margin-bottom: 12px; }
.hero-slogan { font-size: 24px; margin-bottom: 8px; }
.hero-desc { font-size: 17px; opacity: 0.9; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { background: #fff; color: var(--primary); }
.hero-actions .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,0.1); }

/* ========== 搜索区域（横幅与工具之间） ========== */
.search-section {
    background: #fff;
    padding: 24px 0 12px;
    border-bottom: 1px solid var(--gray-200);
}
.search-section .container { max-width: 680px; }
.search-section .search-wrapper {
    position: relative;
    width: 100%;
}
.search-section .search-input {
    width: 100%;
    padding: 16px 52px 16px 52px;
    border: 1.5px solid var(--gray-300);
    border-radius: 50px;
    font-size: 17px;
    background: var(--gray-50);
    color: var(--gray-900);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-section .search-input::placeholder { color: var(--gray-500); }
.search-section .search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: #fff;
}
.search-section .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    color: var(--gray-500);
}
.search-section .search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gray-300);
    color: #fff;
    font-size: 14px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}
.search-section .search-clear:hover { background: var(--gray-500); }
.search-section .search-result-info {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
}
.search-section .search-result-info.has-result { color: var(--primary); }
.search-section .search-result-info.no-result { color: var(--danger); }

/* ========== 工具卡片 ========== */
.tools-section { padding: 48px 0; }
.category-block { margin-bottom: 48px; }
.category-title { font-size: 22px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.category-icon { font-size: 26px; }

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

.tool-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tool-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--primary); }
.tool-card-coming { opacity: 0.6; cursor: default; }
.tool-card-header { display: flex; justify-content: space-between; align-items: center; }
.tool-name { font-size: 18px; font-weight: 600; }
.tool-desc { color: var(--gray-500); font-size: 14px; }
.tool-arrow { color: var(--primary); font-size: 14px; font-weight: 500; }
.tool-tag { padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tool-tag-free { background: #f0fdf4; color: #166534; }
.tool-tag-paid { background: #fff8e1; color: #92400e; }
.tool-tag-mixed { background: #eff6ff; color: #1e40af; }

/* ========== 积分说明 ========== */
.points-info { background: #fff; padding: 48px 0; border-top: 1px solid var(--gray-200); }
.points-info h2 { text-align: center; font-size: 28px; margin-bottom: 32px; }
.points-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.points-card { text-align: center; padding: 24px; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.points-icon { font-size: 36px; display: block; margin-bottom: 12px; }
.points-card h3 { font-size: 16px; margin-bottom: 6px; }
.points-card p { color: var(--gray-500); font-size: 14px; }

/* ========== 底部 ========== */
.footer { background: var(--gray-900); color: var(--gray-300); padding: 32px 0; text-align: center; }
.footer-container p { margin-bottom: 4px; font-size: 14px; }

/* ========== 用户认证页面 ========== */
.auth-container { display: flex; justify-content: center; padding: 60px 20px; }
.auth-box { background: #fff; border-radius: var(--radius); padding: 40px; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); }
.auth-title { font-size: 28px; text-align: center; margin-bottom: 24px; }
.register-bonus { background: var(--primary-light); color: var(--primary); padding: 14px; border-radius: 8px; text-align: center; margin-bottom: 24px; font-size: 15px; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.auth-form input { width: 100%; padding: 12px 16px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 15px; }
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.auth-switch { text-align: center; margin-top: 20px; color: var(--gray-500); font-size: 14px; }
.auth-switch a { color: var(--primary); font-weight: 500; }

/* ========== 充值页面 ========== */
.balance-card { background: linear-gradient(135deg, #fff8e1, #ffe0b2); border-radius: var(--radius); padding: 32px; text-align: center; margin-bottom: 32px; }
.balance-label { color: var(--gray-700); font-size: 16px; margin-bottom: 8px; }
.balance-amount { font-size: 36px; font-weight: 800; color: #f57c00; }
.recharge-packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.recharge-card { background: #fff; border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 28px; text-align: center; position: relative; }
.recharge-card.recommended { border-color: var(--primary); }
.recommended-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 2px 12px; border-radius: 20px; font-size: 12px; }
.recharge-card h3 { font-size: 20px; margin-bottom: 6px; }
.recharge-card p { color: var(--gray-500); font-size: 14px; margin-bottom: 16px; }
.recharge-note { margin-top: 32px; padding: 16px; background: var(--gray-100); border-radius: 8px; text-align: center; color: var(--gray-500); font-size: 14px; }

/* ========== 通用页面 ========== */
.tool-container { max-width: 800px; margin: 0 auto; padding: 20px; }
.page-title { font-size: 32px; margin-bottom: 8px; }
.page-desc { color: var(--gray-500); margin-bottom: 32px; font-size: 16px; }

/* ========== 工具页面 ========== */
.tool-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid var(--gray-200); }
.tab-btn { padding: 12px 24px; border: none; background: none; cursor: pointer; font-size: 15px; color: var(--gray-500); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.tool-panel { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; }
.tool-panel h3 { margin-bottom: 12px; }
.tool-panel p { color: var(--gray-500); margin-bottom: 16px; }

.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.upload-area { border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 48px; text-align: center; cursor: pointer; transition: all 0.2s; }
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area p { color: var(--gray-500); }

.output-area { min-height: 300px; padding: 20px; background: var(--gray-50); border-radius: 8px; }
.placeholder { color: var(--gray-500); text-align: center; padding-top: 100px; }

.meme-templates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.meme-template-item { aspect-ratio: 1; background: var(--gray-100); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid transparent; }
.meme-template-item:hover { border-color: var(--primary); }
.meme-preview { min-height: 300px; background: var(--gray-100); border-radius: 8px; display: flex; align-items: center; justify-content: center; }

.test-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 20px 0; }
.test-type-card { background: #fff; border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 20px; cursor: pointer; }
.test-type-card.active { border-color: var(--primary); }
.test-type-card h4 { margin-bottom: 6px; }
.test-type-card p { font-size: 14px; color: var(--gray-500); margin-bottom: 8px; }
.test-tag { background: #f0fdf4; color: #166534; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.test-note { margin-top: 16px; color: var(--gray-500); font-size: 14px; }

/* ========== 响应式 ========== */
/* 平板端 */
@media (max-width: 1024px) {
    .container { max-width: 100%; }
    .tools-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* 手机端 */
@media (max-width: 768px) {
    /* 导航 */
    .nav-menu { display: none; }
    .hamburger { display: flex; }
    .nav-container { padding: 0 16px; }

    /* 首页横幅 */
    .hero { padding: 48px 16px; }
    .hero-title { font-size: 28px; }
    .hero-slogan { font-size: 16px; }
    .hero-desc { font-size: 14px; margin-bottom: 24px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 280px; }

    /* 搜索区域 */
    .search-section { padding: 16px 0 8px; }
    .search-section .container { max-width: 100%; padding: 0 16px; }
    .search-section .search-input { padding: 14px 48px 14px 48px; font-size: 16px; }

    /* 工具卡片 */
    .tools-section { padding: 32px 0; }
    .container { padding: 0 16px; }
    .tools-grid { grid-template-columns: 1fr; gap: 12px; }
    .tool-card { padding: 18px; }
    .category-title { font-size: 18px; }

    /* 工具页面容器 - 移动端全宽 */
    .tool-container { max-width: 100% !important; padding: 16px; margin: 0; }

    /* 双面板布局改为单栏 */
    .tool-layout { grid-template-columns: 1fr; }

    /* 首页关于区域 */
    .points-info { padding: 32px 0; }
    .points-info h2 { font-size: 22px; }
    .points-grid { grid-template-columns: 1fr 1fr; }

    /* 表单元素 */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* 防止iOS自动缩放 */
    }

    /* 按钮 */
    .btn-lg { padding: 12px 24px; font-size: 16px; }
    .btn-block-mobile { width: 100%; }

    /* 标签页 */
    .tool-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-btn { padding: 10px 16px; font-size: 14px; white-space: nowrap; }

    /* 充值页面 */
    .recharge-packages { grid-template-columns: 1fr; }
    .auth-box { padding: 24px 20px; }

    /* 底部 */
    .footer { padding: 24px 16px; }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .hero-title { font-size: 24px; }
    .hero-slogan { font-size: 14px; }
    .points-grid { grid-template-columns: 1fr; }
    .meme-templates { grid-template-columns: repeat(2, 1fr); }
    .test-types { grid-template-columns: 1fr; }
}
