/* 全局样式 */
:root {
  --primary: #165dff;
}

body {
  font-family: "Inter", sans-serif;
}

a {
  text-decoration: none;
}

/* 导航栏滚动效果 */
#navbar.scroll {
  background-color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* 轮播图 */
.carousel-item.active {
  opacity: 1;
  z-index: 1;
}

/* 移动端菜单 */
#mobileMenu.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* 漫画卡片悬停效果 */
.comic-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 分类卡片悬停效果 */
.category-card:hover .category-image {
  transform: scale(1.05);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Line clamp 样式 */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

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

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

/* 自定义动画 */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-shimmer {
  animation: shimmer 2s linear infinite;
}

/* 响应式阴影 */
.shadow-3xl {
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.25);
}

/* 自定义圆角 */
.rounded-4xl {
  border-radius: 2rem;
}

.rounded-5xl {
  border-radius: 2.5rem;
}

/* 自定义边框 */
.border-3 {
  border-width: 3px;
}

/* 漫蛙漫画网站自定义样式 */
/* 2025年最新设计风格 */

/* 基础重置和优化 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: #333;
  background-color: #f9fafb;
}

/* 2025年流行的渐变背景 */
.gradient-bg-2025 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 现代化卡片设计 */
.modern-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 增强的按钮样式 */
.btn-primary-2025 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary-2025::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-primary-2025:hover::before {
  left: 100%;
}

.btn-primary-2025:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* 移动端优化 */
@media (max-width: 768px) {
  .mobile-optimized {
    padding: 1rem;
  }
  
  .mobile-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .mobile-text {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .mobile-title {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  
  .mobile-hero {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .mobile-card {
    padding: 1rem;
    margin: 0.5rem;
  }
  
  .mobile-nav {
    padding: 0.5rem;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  .xs-mobile-title {
    font-size: 1.2rem;
  }
  
  .xs-mobile-hero {
    font-size: 1.5rem;
  }
  
  .xs-mobile-card {
    padding: 0.75rem;
  }
  
  .xs-mobile-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* 平板优化 */
@media (min-width: 769px) and (max-width: 1024px) {
  .tablet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tablet-card {
    padding: 1.5rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .touch-optimized {
    min-height: 44px;
    min-width: 44px;
  }
  
  .touch-card:active {
    transform: scale(0.98);
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* 动画类 */
.animate-fade-in {
  animation: fadeInUp 0.8s ease-out;
}

.animate-slide-in {
  animation: slideInLeft 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 2025年流行的玻璃形态设计 */
.glass-morphism {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 新拟态设计 */
.neumorphism {
  background: #e0e5ec;
  border-radius: 16px;
  box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
}

.neumorphism-inset {
  background: #e0e5ec;
  border-radius: 16px;
  box-shadow: inset 9px 9px 16px #a3b1c6, inset -9px -9px 16px #ffffff;
}

/* 渐变文字效果 */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* 悬浮效果 */
.hover-float {
  transition: transform 0.3s ease;
}

.hover-float:hover {
  transform: translateY(-8px);
}

/* 聚焦效果 */
.focus-ring {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus-ring:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* 响应式字体 */
.responsive-text {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.responsive-title {
  font-size: clamp(1.5rem, 4vw, 3rem);
}

.responsive-hero {
  font-size: clamp(2rem, 6vw, 5rem);
}

/* 网格布局优化 */
.responsive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.responsive-grid-sm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* 容器优化 */
.container-fluid {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 图片优化 */
.responsive-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

/* 视频优化 */
.responsive-video {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* 表格优化 */
.responsive-table {
  width: 100%;
  overflow-x: auto;
}

.responsive-table table {
  width: 100%;
  min-width: 600px;
}

/* 导航优化 */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 页脚优化 */
.footer-responsive {
  padding: 2rem 0;
}

@media (max-width: 768px) {
  .footer-responsive {
    padding: 1.5rem 0;
  }
  
  .footer-responsive .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* 无障碍访问优化 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .dark-mode-auto {
    background-color: #1a1a1a;
    color: #ffffff;
  }
  
  .dark-mode-auto .modern-card {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

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

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .high-contrast {
    border: 2px solid;
    background: white;
    color: black;
  }
}

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

/* 性能优化 */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* 选择文本样式 */
::selection {
  background: #667eea;
  color: white;
}

::-moz-selection {
  background: #667eea;
  color: white;
}

/* 输入框优化 */
input, textarea, select {
  font-size: 16px; /* 防止iOS缩放 */
}

/* 链接优化 */
a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #764ba2;
}

a:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* 按钮优化 */
button {
  font-size: 16px; /* 防止iOS缩放 */
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

/* 表单优化 */
.form-group {
  margin-bottom: 1rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 工具类 */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-inline {
  display: inline !important;
}

.d-inline-block {
  display: inline-block !important;
}

.d-flex {
  display: flex !important;
}

.d-grid {
  display: grid !important;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.m-0 {
  margin: 0;
}

.p-0 {
  padding: 0;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.pt-1 {
  padding-top: 0.25rem;
}

.pb-1 {
  padding-bottom: 0.25rem;
}

/* 响应式工具类 */
@media (max-width: 767px) {
  .mobile-hidden {
    display: none !important;
  }
  
  .mobile-visible {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .desktop-hidden {
    display: none !important;
  }
  
  .desktop-visible {
    display: block !important;
  }
}