/* 韩国大尺度影视网站样式 */
/* 重置和基础样式 */
:root {
  --primary-red: #dc2626;
  --primary-red-hover: #b91c1c;
  --secondary-purple: #7c3aed;
  --accent-blue: #2563eb;
  --text-gray: #374151;
  --bg-gray: #f9fafb;
  --border-gray: #e5e7eb;
}

/* 确保页面在各种设备上正确显示 */
* {
  box-sizing: border-box;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  line-height: 1.6;
  color: var(--text-gray);
  margin: 0;
  padding: 0;
  opacity: 0;
  background-color: var(--bg-gray);
}

/* 改善文本可读性 */
p, li, span {
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

/* 链接样式优化 */
a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-red);
}

/* 导航栏滚动效果增强 */
#navbar {
  transition: all 0.3s ease-in-out;
  backdrop-filter: blur(10px);
}

#navbar.scroll {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* 移动端菜单优化 */
#mobileMenu {
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

#mobileMenu.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* 卡片悬停效果增强 */
.movie-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backface-visibility: hidden;
  transform: translateZ(0);
}

.movie-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 分类卡片动画 */
.category-card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category-card::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;
}

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

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* 响应式图片和媒体 */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-red-hover);
}

/* 文本截断样式 */
.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;
}

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

/* 动画关键帧 */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

@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% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* 加载动画 */
.animate-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out forwards;
}

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

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 按钮样式增强 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
}

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

/* 移动端优化 */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }
  
  body {
    overflow-x: hidden;
  }
  
  /* 导航栏移动端优化 */
  #navbar {
    position: fixed;
    transition: transform 0.3s ease;
  }
  
  /* 触摸设备优化 */
  .movie-card {
    touch-action: manipulation;
  }
  
  .movie-card:active {
    transform: scale(0.98);
  }
  
  /* 文字大小调整 */
  .hero-title {
    font-size: 2.5rem !important;
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 1.125rem !important;
  }
  
  /* 按钮移动端优化 */
  .btn {
    min-height: 44px;
    padding: 0.875rem 1.5rem;
  }
  
  /* 卡片间距调整 */
  .movie-grid {
    gap: 1rem !important;
  }
  
  /* 表单元素优化 */
  input[type="text"], input[type="search"] {
    font-size: 16px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  .hero-title {
    font-size: 2rem !important;
  }
  
  .section-title {
    font-size: 1.75rem !important;
  }
}

/* 平板设备优化 */
@media (min-width: 641px) and (max-width: 1024px) {
  .tablet-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .tablet-text-lg {
    font-size: 1.125rem;
  }
}

/* 大屏设备优化 */
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
  
  .xl-grid-6 {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 可访问性优化 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-gray: #111827;
    --text-gray: #f3f4f6;
    --border-gray: #374151;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }
  
  .movie-card {
    border: 1px solid var(--border-gray);
  }
}

/* 打印样式 */
@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
}

/* SEO和性能优化 */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy-load.loaded {
  opacity: 1;
}

/* 确保关键内容优先加载 */
.critical-content {
  font-display: swap;
}

/* 优化字体加载 */
@font-face {
  font-display: swap;
}

/* 提升渲染性能 */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
}

/* 隐藏元素但保留屏幕阅读器访问 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}