/* ========================================
   风屿汐 (Fengyuxi) - 主题增强样式
   全局UI动效、背景动效、按钮动效
   ======================================== */

/* ===== 1. 全局基础增强 ===== */
html {
    scroll-behavior: smooth;
}

::selection {
    background: rgba(6, 182, 212, 0.4);
    color: #fff;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
    transition: background 0.3s;
}

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

/* ===== 2. 导航栏玻璃态增强 ===== */
.navbar {
    background: rgba(3, 7, 18, 0.6) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(6, 182, 212, 0.08) !important;
    transition: background 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
    background: rgba(3, 7, 18, 0.85) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(6, 182, 212, 0.12) !important;
}

body.light-theme .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85) !important;
}

/* ===== 3. 导航链接动效增强 ===== */
.nav-links a::after {
    height: 2px;
    border-radius: 1px;
    box-shadow: 0 0 8px var(--accent-cyan-glow);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===== 4. 按钮高级动效 ===== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.96) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-cyan)) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-primary:hover {
    animation: gradientShift 2s ease infinite, btnPulseGlow 2s ease-in-out infinite !important;
    transform: translateY(-2px);
}

@keyframes btnPulseGlow {
    0%, 100% { box-shadow: 0 4px 20px var(--accent-cyan-glow); }
    50% { box-shadow: 0 8px 35px var(--accent-cyan-glow), 0 0 60px rgba(139, 92, 246, 0.2); }
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    z-index: -1;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.3s;
}

.btn-primary:hover::after {
    opacity: 0.5;
}

.btn-secondary {
    position: relative;
    isolation: isolate;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-secondary:hover::before {
    opacity: 1;
}

/* ===== 5. 涟漪动效 (按钮点击) ===== */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== 6. 卡片入场动效 ===== */
.feature-card,
.model-card,
.api-info-card,
.code-block {
    animation: cardFadeIn 0.6s ease forwards;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-card:nth-child(4) { animation-delay: 0.2s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 7. 卡片悬浮增强 ===== */
.feature-card,
.model-card,
.api-info-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card::before,
.model-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s;
    filter: blur(12px);
}

.feature-card:hover,
.model-card:hover {
    transform: translateY(-6px);
    border-color: transparent !important;
    background: linear-gradient(var(--bg-dark), var(--bg-dark)) padding-box,
                linear-gradient(135deg, var(--accent-cyan), var(--accent-purple)) border-box !important;
}

.api-info-card:hover {
    border-color: var(--accent-cyan) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ===== 8. Modal弹窗动效 ===== */
.modal-overlay.active {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.active .modal {
    animation: modalSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== 9. Toast通知动效 ===== */
.toast {
    transform: translateX(120px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.toast.visible {
    transform: translateX(0) !important;
}

/* ===== 10. 表单输入聚焦增强 ===== */
.form-input:focus {
    box-shadow: 0 0 0 3px var(--accent-cyan-glow), 0 0 30px rgba(6, 182, 212, 0.08) !important;
}

/* ===== 11. Hero区域动效 ===== */
.hero-center-icon {
    animation: heroPulse 3s ease-in-out infinite !important;
}

@keyframes heroPulse {
    0%, 100% {
        box-shadow: 0 0 40px var(--accent-cyan-glow);
    }
    50% {
        box-shadow: 0 0 80px var(--accent-cyan-glow), 0 0 120px rgba(139, 92, 246, 0.15);
    }
}

/* ===== 12. 徽章动效 ===== */
.model-badge {
    position: relative;
    overflow: hidden;
}

.model-badge.hot::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* ===== 13. 统计数字动画 ===== */
.stat-number {
    display: inline-block;
    animation: statFadeIn 0.8s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.hero-stats .stat-item:nth-child(1) .stat-number { animation-delay: 0.2s; }
.hero-stats .stat-item:nth-child(2) .stat-number { animation-delay: 0.35s; }
.hero-stats .stat-item:nth-child(3) .stat-number { animation-delay: 0.5s; }

@keyframes statFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 14. 下拉菜单动效 ===== */
.user-dropdown {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-origin: top right;
    transform: scale(0.95) !important;
    opacity: 0 !important;
    display: block !important;
    pointer-events: none;
}

.user-dropdown.active {
    transform: scale(1) !important;
    opacity: 1 !important;
    pointer-events: auto;
}

/* ===== 15. 工具集成卡片 ===== */
#tools-section > .container > div > div {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardFadeIn 0.6s ease forwards;
    opacity: 0;
}

#tools-section > .container > div > div:nth-child(1) { animation-delay: 0.05s; }
#tools-section > .container > div > div:nth-child(2) { animation-delay: 0.1s; }
#tools-section > .container > div > div:nth-child(3) { animation-delay: 0.15s; }
#tools-section > .container > div > div:nth-child(4) { animation-delay: 0.2s; }

#tools-section > .container > div > div:hover {
    transform: translateY(-4px);
    border-color: transparent !important;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                linear-gradient(135deg, var(--accent-cyan), var(--accent-purple)) border-box !important;
}

/* ===== 16. 滑块验证码增强 ===== */
.slider-captcha-track {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(139, 92, 246, 0.05)) !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.slider-captcha-thumb {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple)) !important;
    box-shadow: 0 2px 10px var(--accent-cyan-glow) !important;
    transition: transform 0.1s, box-shadow 0.3s !important;
}

.slider-captcha-thumb:hover {
    box-shadow: 0 4px 20px var(--accent-cyan-glow), 0 0 30px rgba(139, 92, 246, 0.2) !important;
}

.slider-captcha-thumb.checked {
    background: linear-gradient(135deg, var(--accent-green), #059669) !important;
    box-shadow: 0 2px 15px rgba(16, 185, 129, 0.5) !important;
}

.slider-captcha-bg {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple)) !important;
    opacity: 0.15 !important;
}

/* ===== 17. Logo微动效 ===== */
.logo-icon {
    transition: transform 0.3s, box-shadow 0.3s;
}

.logo:hover .logo-icon {
    transform: scale(1.05) rotate(-5deg);
    box-shadow: 0 0 30px var(--accent-cyan-glow);
}

/* ===== 18. 侧栏导航增强 ===== */
.sidebar {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px);
}

.sidebar a,
.sidebar .nav-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar a:hover,
.sidebar .nav-item:hover {
    transform: translateX(4px);
}

/* ===== 19. 响应式优化 ===== */
@media (max-width: 768px) {
    .navbar {
        background: rgba(3, 7, 18, 0.85) !important;
    }
}

/* ===== 20. 页面加载渐入 ===== */
.app-container {
    animation: pageFadeIn 0.5s ease;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== 21. Code block复制按钮动效 ===== */
.copy-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--accent-cyan-glow);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* ===== 22. Hero标题打字机风格光效 ===== */
.hero-left h1 span {
    position: relative;
}

.hero-left h1 span::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 10%;
    height: 80%;
    width: 2px;
    background: var(--accent-cyan);
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
