/* ===== 全局样式 ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    margin-bottom: 0;
    background-color: #f8fafc;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

/* ===== 导航栏 ===== */
.site-navbar {
    background: var(--gradient-primary) !important;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.2);
}

.site-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    transition: color 0.2s;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
    color: #fff !important;
}

.navbar-brand { color: #fff !important; }

/* ===== Hero 区域 ===== */
.hero-section {
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
}

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

.hero-section .input-group {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

.hero-section .form-control,
.hero-section .input-group-text {
    border: none;
    padding: 0.875rem 1rem;
}

.hero-section .form-control:focus {
    box-shadow: none;
}

.hero-section .btn-warning {
    background: #fbbf24;
    border: none;
    font-weight: 600;
    padding: 0 2rem;
}

.hero-section .btn-warning:hover {
    background: #f59e0b;
}

/* ===== 分类卡片 ===== */
.category-card {
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
    border-color: var(--primary-light);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    margin: 0 auto;
}

/* ===== 工具卡片 ===== */
.tool-card {
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.tool-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}

.tool-logo-lg {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}

.tool-logo-sm {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #f1f5f9;
}

.sponsored-flag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 1;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

/* ===== 工具详情页 ===== */
.visit-btn {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s;
}

.visit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* ===== 统计卡片 ===== */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* ===== 会员定价卡片 ===== */
.pricing-card {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.3s;
}

.pricing-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
}

.pricing-featured {
    border-color: var(--warning);
    position: relative;
    transform: scale(1.05);
}

.pricing-featured::before {
    content: '热门';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning);
    color: #fff;
    padding: 2px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== 头像 ===== */
.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.5rem;
}

/* ===== 广告位 ===== */
.ad-zone {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px dashed #f59e0b;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.ad-zone-sidebar {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

/* ===== 后台管理 ===== */
.admin-sidebar {
    background: #1e293b;
    min-height: calc(100vh - 56px);
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 2px 8px;
}

.admin-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background: var(--primary);
}

/* ===== 页脚 ===== */
.site-footer {
    background: #1e293b;
    color: #cbd5e1;
}

.site-footer a:hover { color: #fff; }

/* ===== 工具类 ===== */
.min-w-0 { min-width: 0; }

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Toast 提示 ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    background: #fff;
    border-left: 4px solid var(--success);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
    .pricing-featured { transform: scale(1); }
    .hero-section h1 { font-size: 1.75rem; }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
