/* ============================================================
   app.css — 统一品牌风格 · Indigo-Purple 品牌色系
   ============================================================ */

/* ===== CSS 变量 ===== */
:root {
    --brand:        #6366f1;
    --brand-dark:   #4f46e5;
    --brand-light:  #818cf8;
    --accent:       #8b5cf6;
    --accent-2:     #ec4899;
    --bg-primary:   #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary:  #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted:   #94a3b8;
    --border:       #e2e8f0;
    --border-hover: #c7d2fe;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg:    0 12px 40px rgba(0,0,0,0.08);
    --shadow-brand: 0 8px 30px rgba(99,102,241,0.12);
    --shadow-brand-lg: 0 16px 50px rgba(99,102,241,0.18);
    --radius:       16px;
    --radius-sm:    10px;
    --radius-lg:    24px;
    --ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== 全局 ===== */
* {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s var(--ease);
}

/* ===== 毛玻璃 ===== */
.glass {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

header {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ===== 导航栏 ===== */
.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.nav-icon { font-size: 1rem; line-height: 1; }

.nav-badge {
    font-size: 0.6875rem; font-weight: 700; line-height: 1;
    padding: 0.15rem 0.45rem; border-radius: 9999px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff; min-width: 1.25rem; text-align: center;
    box-shadow: 0 1px 3px rgba(99,102,241,0.3);
    transition: all 0.2s var(--ease);
}
.nav-link.active .nav-badge {
    background: #fff; color: var(--brand-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.nav-link:hover { color: var(--brand-dark); background: #eef2ff; }
.nav-link:hover .nav-badge { transform: scale(1.1); }
.nav-link.active { color: var(--brand-dark); font-weight: 600; }
.nav-link.active::after {
    content: ''; position: absolute; bottom: -2px; left: 50%;
    transform: translateX(-50%);
    width: 1.25rem; height: 2px; border-radius: 9999px;
    background: var(--brand-dark);
}

/* ===== CTA 按钮 ===== */
.btn-cta {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.5rem 1.25rem; border-radius: 9999px;
    font-size: 0.875rem; font-weight: 600;
    transition: all 0.25s var(--ease);
    text-decoration: none; cursor: pointer; border: none;
    position: relative; overflow: hidden;
}
.btn-cta-primary {
    background: var(--brand-dark); color: white;
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.btn-cta-primary:hover {
    background: #4338ca; transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,0.35);
}
.btn-cta-secondary {
    background: white; color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.btn-cta-secondary:hover {
    border-color: var(--border-hover); color: var(--brand-dark);
    background: #f8fafc; transform: translateY(-1px);
}

/* ===== 语言切换 ===== */
.lang-btn {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.375rem 0.625rem; border-radius: 9999px;
    border: 1.5px solid var(--border); background: white;
    font-size: 0.875rem; cursor: pointer; transition: all 0.2s var(--ease);
    color: var(--text-secondary);
}
.lang-btn:hover { border-color: var(--border-hover); background: #f8fafc; }

.lang-dropdown {
    position: absolute; top: calc(100% + 0.5rem); right: 0;
    background: white; border: 1px solid var(--border);
    border-radius: 0.75rem; box-shadow: var(--shadow-lg);
    padding: 0.375rem; min-width: 10rem; z-index: 60;
    animation: dropIn 0.2s var(--ease) forwards;
}
.lang-dropdown a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; border-radius: 0.5rem;
    font-size: 0.875rem; color: var(--text-secondary);
    text-decoration: none; transition: all 0.15s;
}
.lang-dropdown a:hover { background: #eef2ff; color: var(--brand-dark); }
.lang-dropdown a.active { background: #eef2ff; color: var(--brand-dark); font-weight: 600; }

/* ===== 移动菜单 ===== */
.mobile-menu-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: 0.5rem;
    font-size: 1rem; font-weight: 500; color: #1e293b;
    text-decoration: none; transition: all 0.15s;
}
.mobile-menu-link:hover { background: #eef2ff; color: var(--brand-dark); }

/* ===== 渐变文字 ===== */
.gradient-text {
    background: linear-gradient(135deg, var(--brand), var(--accent), var(--accent-2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 卡片系统 ===== */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: var(--shadow-md);
    transition: all 0.35s var(--ease);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.04), transparent);
    transition: left 0.6s var(--ease);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-brand-lg);
    border-color: rgba(99,102,241,0.18);
}

.card:hover::before {
    left: 100%;
}

/* ===== 工具卡片 ===== */
.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.3s var(--ease);
    text-decoration: none;
    display: block;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.tool-card::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
.tool-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-brand);
    transform: translateY(-3px);
}
.tool-card:hover::after { opacity: 1; }

/* ===== 统计卡片 ===== */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

/* ===== 侧边栏 ===== */
.sidebar-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 1rem; border-radius: 0.5rem;
    color: var(--text-secondary); text-decoration: none;
    transition: all 0.15s; font-size: 0.875rem;
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(99,102,241,0.1); color: var(--brand);
}

/* ===== 按钮系统 ===== */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white; font-weight: 600; border-radius: 0.75rem;
    transition: all 0.3s var(--ease); text-decoration: none;
    border: none; cursor: pointer; font-size: 0.875rem;
    box-shadow: 0 4px 15px rgba(99,102,241,0.35);
    position: relative; overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s var(--ease);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.5);
}
.btn-primary:hover::after { left: 100%; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.625rem 1.5rem;
    background: white; color: var(--brand);
    border: 2px solid rgba(99,102,241,0.15);
    border-radius: 0.75rem;
    font-weight: 600; font-size: 0.875rem;
    transition: all 0.3s var(--ease); cursor: pointer;
    text-decoration: none;
}
.btn-secondary:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99,102,241,0.2);
}

/* ===== 徽章 ===== */
.badge {
    display: inline-block;
    padding: 4px 12px; border-radius: 8px;
    font-size: 11px; font-weight: 600;
    background: rgba(99,102,241,0.08); color: var(--brand);
}
.pro-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white; font-size: 0.625rem; font-weight: 700;
    padding: 2px 8px; border-radius: 9999px; text-transform: uppercase;
}
.ai-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white; font-size: 0.625rem; font-weight: 700;
    padding: 2px 8px; border-radius: 9999px; text-transform: uppercase;
}
.free-badge {
    background: #10b981; color: white;
    font-size: 0.625rem; font-weight: 700;
    padding: 2px 8px; border-radius: 9999px; text-transform: uppercase;
}

/* ===== 输入框 ===== */
.input-field {
    width: 100%; padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s var(--ease);
    outline: none;
}
.input-field:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: white;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    background: white;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.2s var(--ease);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

/* ===== 搜索框 ===== */
.search-glow:focus-within {
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12), 0 10px 40px rgba(99,102,241,0.1);
}

/* ===== 光晕 ===== */
.hero-glow {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.15; pointer-events: none;
}

/* ===== 列表 ===== */
.list-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: all 0.2s var(--ease);
}
.list-item:hover {
    background-color: rgba(99,102,241,0.02);
    transform: translateX(4px);
}
.list-item:last-child { border-bottom: none; }

/* ===== 表格 ===== */
table {
    width: 100%; border-collapse: collapse;
    background: white; border-radius: 12px; overflow: hidden;
}
thead th {
    padding: 16px; text-align: left;
    font-size: 13px; font-weight: 600; color: #64748b;
    background: rgba(99,102,241,0.03);
    border-bottom: 2px solid rgba(99,102,241,0.1);
}
tbody td {
    padding: 16px; color: #1a1a1a;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: background-color 0.2s ease;
}
tbody tr:hover td { background-color: rgba(99,102,241,0.02); }

/* ===== 页脚 ===== */
/* 页脚由 Tailwind class 控制，不再有全局默认样式 */

/* ===== 文本截断 ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 按钮点击脉冲 ===== */
button:active {
    transform: scale(0.98);
}

/* ============================================================
   动画系统
   ============================================================ */

/* 淡入上移 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.6s var(--ease) forwards;
    opacity: 0;
}

/* 脉冲光晕 */
@keyframes pulseGlow {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(1.08); }
}
.animate-pulse-glow {
    animation: pulseGlow 6s ease-in-out infinite;
}

/* 浮动 */
@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    33%      { transform: translateY(-16px) translateX(8px); }
    66%      { transform: translateY(-8px) translateX(-6px); }
}
.animate-float {
    animation: float 14s ease-in-out infinite;
}

/* 下拉弹出 */
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 交错淡入 */
.stagger-item { opacity: 0; animation: fadeInUp 0.4s ease-out forwards; }
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }

/* 数字滚动 */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-count-up { animation: countUp 0.6s ease-out forwards; }

/* 文本渐入 */
@keyframes textFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-text-fade { animation: textFadeIn 0.6s ease-out forwards; }

/* 装饰链接下划线 */
.decorative-link { position: relative; }
.decorative-link::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    transition: width 0.3s ease;
}
.decorative-link:hover::after { width: 100%; }

/* ============================================================
   滚动触发动画（配合 Intersection Observer）
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease-spring);
}
.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}
.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 640px) {
    .card { padding: 20px; border-radius: 12px; }
    .mobile-nav-open { overflow: hidden; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1536px) {
    .max-w-7xl { max-width: 1400px; }
}

/* 隐藏滚动条但保持可滚动 */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
