/**
 * ============================================
 * 🐮 牛马百宝袋 - 主样式表 v2.0
 * ============================================
 * 现代设计 · 网格布局 · 精致动效
 */

/* ========== CSS变量 ========== */
:root {
    --primary: #667eea;
    --primary-light: #a5b4fc;
    --secondary: #f093fb;
    --accent: #FF6B6B;
    --accent-hover: #ee5a5a;
    --success: #10B981;
    --warning: #F59E0B;
    --text-dark: #1a1a2e;
    --text-medium: #4a5568;
    --text-light: #94a3b8;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px rgba(102,126,234,0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-main);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* ========== 容器 ========== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    height: 64px;
    box-shadow: var(--shadow-md);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-icon {
    font-size: 32px;
    -webkit-text-fill-color: initial;
}

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

.nav-link {
    padding: 10px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
    transition: var(--transition);
}

.nav-link:hover {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(240,147,251,0.1));
    color: var(--primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* ========== Hero区域 ========== */
.hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    background: linear-gradient(180deg, #f0f4ff 0%, #fdf4ff 50%, var(--bg-main) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(102,126,234,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(240,147,251,0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, 2%) rotate(1deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.9);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.hero-badge::before {
    content: '✨';
}

.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-slogan {
    font-size: 18px;
    color: var(--text-medium);
    margin-bottom: 40px;
    max-width: 500px;
}

/* ========== 搜索框 ========== */
.search-wrapper {
    width: 100%;
    max-width: 580px;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 60px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.search-input {
    flex: 1;
    padding: 20px 28px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--text-dark);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    padding: 20px 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* 热门标签 */
.hot-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.hot-tags .tag {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 13px;
    color: var(--text-medium);
    cursor: pointer;
    transition: var(--transition);
}

.hot-tags .tag:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* 统计 */
.hero-stats {
    display: flex;
    gap: 40px;
    font-size: 14px;
    color: var(--text-light);
}

.hero-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-stats strong {
    color: var(--primary);
    font-weight: 600;
}

/* ========== 分类标签 ========== */
.category-section {
    padding: 60px 0 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.category-tab {
    padding: 12px 24px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-md);
}

/* ========== 工具网格 - 核心样式 ========== */
.tools-section {
    padding: 0 0 80px;
}

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

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card.hot::after {
    content: '🔥';
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 18px;
}

.tool-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(240,147,251,0.1));
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    transition: var(--transition);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, rgba(102,126,234,0.2), rgba(240,147,251,0.2));
}

.tool-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.tool-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 加载更多 ========== */
.load-more {
    text-align: center;
    padding: 40px 0;
}

.load-more-btn {
    padding: 16px 48px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ========== 页脚 ========== */
.footer {
    padding: 48px 0;
    background: white;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-text {
    font-size: 14px;
    color: var(--text-light);
}

/* ========== 弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
    position: relative;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-light);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-main);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--accent);
    color: white;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-medium);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 14px 28px;
    background: var(--text-dark);
    color: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: var(--transition);
    z-index: 3000;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .navbar {
        height: 64px;
    }
    
    .hero {
        padding: 100px 20px 60px;
        min-height: 60vh;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-slogan {
        font-size: 15px;
    }
    
    .search-input {
        padding: 16px 20px;
        font-size: 14px;
    }
    
    .search-btn {
        padding: 16px 20px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tool-card {
        flex-direction: row;
        text-align: left;
        padding: 20px;
        gap: 16px;
    }
    
    .tool-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .tool-info {
        flex: 1;
        min-width: 0;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-tab {
        flex-shrink: 0;
    }
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: var(--bg-main);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-dark);
    transition: var(--transition);
    border-radius: 2px;
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ========== 选中文字样式 ========== */
::selection {
    background: var(--primary);
    color: white;
}
