/* 91漫画 - 全局样式 */

/* 基础重置和变量 */
:root {
    --primary: #3B82F6;
    --secondary: #10B981;
    --accent: #F59E0B;
    --dark: #0F172A;
    --dark-blue: #1E293B;
    --light-blue: #60A5FA;
    --neon-green: #00FF88;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-blue) 50%, #0F1419 100%);
    color: white;
    line-height: 1.7;
    overflow-x: hidden;
}

/* 现代卡片效果 */
.modern-card {
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* 悬停提升效果 */
.hover-lift {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hover-lift:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.4);
}

/* 动画定义 */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(60px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 导航栏样式 */
#navbar {
    backdrop-filter: blur(25px);
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

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

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 评分星星 */
.rating-stars {
    color: #fbbf24;
}

.rating-stars i {
    margin-right: 3px;
}

/* 脉冲动画 */
.animate-pulse {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--secondary), var(--accent));
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hover-lift:hover {
        transform: translateY(-8px) scale(1.02);
    }
    
    .text-7xl {
        font-size: 4rem;
    }
    
    .text-9xl {
        font-size: 5rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1.2s ease-in-out infinite;
}

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

/* 表单样式 */
input, select, textarea {
    transition: all 0.4s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(59, 130, 246, 0.5);
    border-color: var(--primary);
    transform: scale(1.02);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--dark-blue);
    padding: 3rem;
    border-radius: 1.5rem;
    max-width: 600px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal.active .modal-content {
    transform: scale(1);
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-blue);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--dark-blue);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    transition: width 0.4s ease;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    border-radius: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 3rem;
}

.pagination button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.pagination button:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: var(--primary);
    transform: scale(1.05);
}

.pagination button.active {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-color: var(--primary);
}

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dark-blue);
    border-radius: 0.75rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.search-suggestion {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-suggestion:hover {
    background: rgba(59, 130, 246, 0.15);
}

.search-suggestion:last-child {
    border-bottom: none;
}

/* 动画类 */
.fade-in {
    animation: fadeInScale 0.6s ease-in;
}

.slide-up {
    animation: slideInUp 0.6s ease-out;
}

/* 特殊效果 */
.neon-glow {
    box-shadow: 0 0 8px var(--primary), 0 0 16px var(--primary), 0 0 24px var(--primary);
}

.gradient-border {
    position: relative;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    padding: 3px;
    border-radius: 1.5rem;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--dark);
    border-radius: calc(1.5rem - 3px);
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .modern-card {
        background: rgba(255, 255, 255, 0.15);
        border: 2px solid rgba(255, 255, 255, 0.4);
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 自定义动画 */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-25px);
    }
}

.animate-glow {
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    0% {
        text-shadow: 0 0 8px var(--primary), 0 0 16px var(--primary), 0 0 24px var(--primary);
    }
    100% {
        text-shadow: 0 0 16px var(--primary), 0 0 32px var(--primary), 0 0 48px var(--primary);
    }
}

/* 边框动画 */
.border-animate {
    position: relative;
    overflow: hidden;
}

.border-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
    transition: left 0.5s;
}

.border-animate:hover::before {
    left: 100%;
}

/* 卡片阴影效果 */
.card-shadow {
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.card-shadow:hover {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease infinite;
}

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

/* 按钮特效 */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    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;
}

.btn-glow:hover::before {
    left: 100%;
}

/* 图片懒加载 */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* 自定义滚动动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 粒子效果背景 */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    animation: particleFloat 8s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* 网格动画 */
.grid-animate {
    animation: gridFade 0.6s ease-in-out;
}

@keyframes gridFade {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 文字打字效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary);
    }
}

/* 波浪效果 */
.wave {
    position: relative;
    overflow: hidden;
}

.wave::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    animation: wave 2s infinite;
}

@keyframes wave {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 3D 翻转效果 */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* 磁性按钮效果 */
.magnetic-btn {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.magnetic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4);
}

/* 霓虹灯效果 */
.neon {
    color: var(--primary);
    text-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        0 0 15px var(--primary),
        0 0 20px var(--primary);
    animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 
            0 0 5px var(--primary),
            0 0 10px var(--primary),
            0 0 15px var(--primary),
            0 0 20px var(--primary);
    }
    50% {
        text-shadow: 
            0 0 2px var(--primary),
            0 0 5px var(--primary),
            0 0 8px var(--primary),
            0 0 12px var(--primary);
    }
}