/* ========================================
   神影视频网站 - 公共样式表
   ======================================== */

/* 全局样式 */
:root {
  --primary-color: #e50914;
  --secondary-color: #141414;
  --text-color: #ffffff;
  --text-gray: #b3b3b3;
  --hover-color: #f40612;
  --bg-dark: #000000;
  --bg-card: #1f1f1f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', 'Microsoft YaHei', sans-serif;
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
  word-break: keep-all; /* 防止中文字符被分割 */
  overflow-wrap: break-word; /* 允许长单词或URL在必要时换行 */
}

/* 为所有文本元素添加中文字符换行保护 */
p, span, div, h1, h2, h3, h4, h5, h6, li, td, th, a, button, input, textarea, label {
  word-break: keep-all; /* 防止中文字符被分割 */
  overflow-wrap: break-word; /* 允许长单词或URL在必要时换行 */
}

/* 导航栏样式 */
.navbar {
  background-color: rgba(0, 0, 0, 0.9) !important;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.navbar-brand {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color) !important;
  display: flex;
  align-items: center;
}

.navbar-brand .logo-icon {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}

.nav-link {
  color: var(--text-color) !important;
  margin: 0 15px;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

.btn-primary {
  background-color: var(--primary-color);
  border: none;
  padding: 8px 20px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px);
}

/* Hero Section - 轮播图 */
.hero-section {
  position: relative;
  margin-bottom: 50px;
  margin-top: 76px; /* 为固定导航栏留出空间 */
}

.hero-section .carousel {
  height: 600px; /* 固定轮播图高度 */
}

.hero-section .carousel-item {
  height: 600px;
}

.hero-section .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7); /* 使图片稍暗，以便文字更清晰 */
}

.hero-section .carousel-caption {
  bottom: 30%;
  text-align: center;
}

.hero-section .carousel-caption h2 {
  font-size: 3.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  color: white;
}

.hero-section .carousel-caption p {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--text-gray);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.hero-section .carousel-indicators {
  bottom: 20px;
}

.hero-section .carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
}

.hero-section .carousel-indicators button.active {
  background-color: var(--primary-color);
}

.hero-section .carousel-control-prev,
.hero-section .carousel-control-next {
  width: 5%;
}

.hero-section .carousel-control-prev-icon,
.hero-section .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  background-size: 60%;
}

/* 电影卡片样式 */
.movie-card {
  background-color: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 20px;
  cursor: pointer;
  position: relative;
}

.movie-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 10px 30px rgba(229, 9, 20, 0.3);
}

.movie-card img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* 图片懒加载样式 */
.movie-card img.lazy {
  opacity: 0;
}

.movie-card img.loaded {
  opacity: 1;
}

/* 收藏按钮 */
.favorite-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.favorite-btn:hover {
  background: rgba(229, 9, 20, 0.9);
  transform: scale(1.1);
}

.favorite-btn.active {
  background: var(--primary-color);
  color: white;
}

.movie-card-body {
  padding: 12px;
}

.movie-card-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-color);
}

.movie-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-gray);
  font-size: 0.85rem;
}

.movie-rating {
  color: #ffc107;
  font-weight: bold;
}

/* Section标题 */
.section-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
}

/* 页脚样式 */
footer {
  background-color: var(--bg-dark);
  color: var(--text-gray);
  padding: 40px 0 20px;
  margin-top: 50px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 20px;
}

.footer-section h3 {
  color: var(--text-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: var(--text-gray);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #333;
  font-size: 0.9rem;
}

/* 表单样式 */
.form-control {
  background-color: #333;
  border: 1px solid #555;
  color: var(--text-color);
  padding: 12px;
  border-radius: 4px;
}

.form-control:focus {
  background-color: #444;
  border-color: var(--primary-color);
  color: var(--text-color);
  box-shadow: 0 0 0 0.2rem rgba(229, 9, 20, 0.25);
}

.form-label {
  color: var(--text-color);
  margin-bottom: 8px;
  font-weight: 500;
}

/* 表格样式 */
.table-dark {
  background-color: var(--bg-card);
  color: var(--text-color);
}

.table-dark thead {
  background-color: var(--bg-dark);
}

.table-dark tbody tr:hover {
  background-color: #2a2a2a;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .movie-card img {
    height: 250px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .navbar-brand {
    font-size: 1.3rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    min-height: 400px;
    padding-top: 80px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .footer-content {
    flex-direction: column;
  }
}

/* 加载动画 */
.loading-spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 4px solid var(--text-gray);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 搜索建议框 */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-suggestions.show {
  display: block;
}

.search-suggestion-item {
  padding: 10px 15px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-suggestion-item:hover {
  background-color: rgba(229, 9, 20, 0.1);
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

/* 骨架屏加载效果 */
.skeleton {
  background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-img {
  width: 100%;
  height: 350px;
}

/* ================================
   电影详情页专用样式（减少留白，优化布局）
   ================================ */
.movie-detail-container {
  margin-top: 70px; /* 减少顶端空白 */
  margin-bottom: 20px; /* 减少底部空白 */
  max-width: 1100px; /* 限制内容宽度，视觉更紧凑 */
  padding-left: 12px;
  padding-right: 12px;
}

.movie-poster-section {
  padding-right: 8px; /* 缩小左右间距 */
}

.movie-poster-section img {
  width: 100%;
  height: auto;
  display: block;
}

.movie-info-section h1 {
  font-size: 1.9rem; /* 稍微压缩标题高度 */
  margin-bottom: 8px;
}

.movie-meta .badge {
  font-size: 0.88rem;
  padding: 5px 10px;
  margin-right: 8px;
}

.table-responsive .table td {
  padding: 6px 8px; /* 减少表格行高度 */
  vertical-align: middle;
}

.movie-description p {
  margin-bottom: 8px;
  line-height: 1.6;
}

.movie-tags .badge {
  font-size: 0.82rem;
  padding: 4px 8px;
}

.movie-info-section .row.text-center {
  margin-top: 12px; /* 缩短统计区与上方内容的间距 */
}

.stat-box {
  padding: 8px;
}

.comment-form-card, .comments-list .card {
  margin-bottom: 12px; /* 缩短评论间距 */
  background: var(--bg-card);
  border: none;
}

.comment-card .card-body {
  padding: 12px;
}

/* 在较大屏幕上让海报和信息更紧凑地并列 */
@media (min-width: 992px) {
  .col-lg-5, .col-lg-7 {
    padding-top: 6px;
    padding-bottom: 6px;
  }
}

/* 小屏幕时微调海报高度和间距 */
@media (max-width: 767.98px) {
  .movie-detail-container { margin-top: 56px; }
  .movie-poster-section img { height: auto; }
  .section-title { margin-bottom: 18px; }
}


.skeleton-text {
  height: 20px;
  margin: 10px 0;
}

.skeleton-text.short {
  width: 60%;
}

/* 筛选器样式 */
.filter-container {
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.filter-group {
  margin-bottom: 15px;
}

.filter-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-gray);
  font-weight: 500;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  background-color: #333;
  border: 1px solid #555;
  border-radius: 4px;
  color: var(--text-color);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* 徽章样式 */
.badge-new {
  background-color: var(--primary-color);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.badge-hot {
  background-color: #ff9800;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

/* 按钮动画 */
.btn-animated {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn-animated:hover::before {
  left: 100%;
}

/* ========================================
   评论区优化样式
   ======================================== */

/* 评论卡片优化 */
.comment-card {
  background-color: var(--bg-card);
  border: 1px solid #343a40;
  border-radius: 10px;
  transition: all 0.3s ease;
  margin-bottom: 20px;
  overflow: hidden;
}

.comment-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(229, 9, 20, 0.2);
  border-color: var(--primary-color);
}

/* 评论卡片头部 */
.comment-card .card-body {
  padding: 20px;
}

/* 用户头像优化 */
.comment-card .avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 2px solid;
  transition: all 0.3s ease;
}

.comment-card:hover .avatar {
  transform: scale(1.05);
}

/* 评论内容文字优化 */
.comment-card p {
  color: #f8f9fa !important;
  line-height: 1.7;
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* 评论元信息 */
.comment-card small {
  color: #adb5bd !important;
  font-size: 0.85rem;
}

/* 评论标题 */
.comment-card h6 {
  color: #ffffff !important;
  font-weight: 600;
  margin-bottom: 5px;
}

/* 评分徽章优化 */
.comment-card .badge {
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* 评论操作按钮 */
.comment-card .btn-outline-light {
  border-color: #6c757d;
  color: #e9ecef;
  padding: 5px 12px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.comment-card .btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #adb5bd;
  color: #ffffff;
}

/* 评论表单优化 */
.comment-form-card {
  background: linear-gradient(135deg, rgba(31, 31, 31, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
}

.comment-form-card:hover {
  border-color: rgba(229, 9, 20, 0.5);
  box-shadow: 0 12px 40px rgba(229, 9, 20, 0.2);
  transform: translateY(-2px);
}

.comment-form-card .card-header {
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.2) 0%, rgba(229, 9, 20, 0.1) 100%);
  border-bottom: 1px solid rgba(229, 9, 20, 0.3);
  padding: 18px 25px;
  border-radius: 12px 12px 0 0 !important;
}

.comment-form-card .card-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
}

.comment-form-card .card-title i {
  color: var(--primary-color);
  font-size: 1.4rem;
}

.comment-form-card .card-body {
  padding: 25px;
  background-color: transparent;
}

#comment-form .form-control {
  background-color: rgba(26, 26, 26, 0.8);
  border: 1px solid rgba(229, 9, 20, 0.3);
  color: #ffffff;
  min-height: 140px;
  resize: vertical;
  border-radius: 8px;
  padding: 15px;
  font-size: 1.05rem;
  transition: all 0.3s ease;
}

#comment-form .form-control:focus {
  background-color: rgba(33, 37, 41, 0.9);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 0 0 0.3rem rgba(229, 9, 20, 0.25);
  outline: none;
}

#comment-form .form-control::placeholder {
  color: #adb5bd;
  font-style: italic;
}

#comment-form .form-text {
  color: #adb5bd;
  font-size: 0.9rem;
  margin-top: 8px;
  font-style: italic;
}

#comment-form .form-select {
  background-color: rgba(26, 26, 26, 0.8);
  border: 1px solid rgba(229, 9, 20, 0.3);
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

#comment-form .form-select:focus {
  background-color: rgba(33, 37, 41, 0.9);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 0 0 0.3rem rgba(229, 9, 20, 0.25);
  outline: none;
}

#comment-form .form-select option {
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 10px;
}

#comment-form .form-select option:hover {
  background-color: var(--primary-color);
}

#comment-form label {
  color: #ffffff;
  font-weight: 500;
  font-size: 1.05rem;
}

#comment-form .btn-danger {
  background: linear-gradient(135deg, var(--primary-color) 0%, #c40812 100%);
  border: none;
  border-radius: 8px;
  padding: 12px 30px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

#comment-form .btn-danger:hover {
  background: linear-gradient(135deg, #f40612 0%, var(--primary-color) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
}

#comment-form .btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(229, 9, 20, 0.3);
}

#comment-form .btn-danger i {
  font-size: 1.2rem;
}

/* 评分选择器样式优化 */
.comment-rating-select {
  min-width: 180px;
}

.comment-rating-select option {
  padding: 12px 15px;
  font-size: 1.05rem;
}

.comment-rating-select option[value*="⭐⭐⭐⭐⭐"] {
  color: #ffc107;
}

.comment-rating-select option[value*="⭐⭐⭐⭐"] {
  color: #ffc107;
}

.comment-rating-select option[value*="⭐⭐⭐"] {
  color: #ffc107;
}

.comment-rating-select option[value*="⭐⭐"] {
  color: #ffc107;
}

.comment-rating-select option[value*="⭐"] {
  color: #ffc107;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .comment-form-card .card-body {
    padding: 20px;
  }
  
  #comment-form .form-control {
    min-height: 120px;
    font-size: 1rem;
  }
  
  #comment-form .btn-danger {
    padding: 10px 25px;
    font-size: 1rem;
  }
  
  .comment-form-card .card-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 576px) {
  .comment-form-card {
    border-radius: 10px;
  }
  
  .comment-form-card .card-header {
    padding: 15px 20px;
  }
  
  .comment-form-card .card-body {
    padding: 15px;
  }
  
  #comment-form .row {
    flex-direction: column;
  }
  
  #comment-form .col-md-6 {
    width: 100%;
    margin-bottom: 15px;
  }
  
  #comment-form .col-md-6.text-md-end {
    text-align: left !important;
  }
  
  #comment-form .btn-danger {
    width: 100%;
  }
}

/* 评论区域标题 */
.section-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(229, 9, 20, 0.3);
}

.section-title {
  color: #ffffff !important;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.section-header p {
  color: #adb5bd !important;
  font-size: 1rem;
}

/* 评论列表标题 */
.comments-list h5 {
  color: #ffffff !important;
  font-weight: 600;
  font-size: 1.3rem;
}

/* 加载更多按钮 */
.comments-list .btn-outline-light {
  border-color: #6c757d;
  color: #e9ecef;
  padding: 8px 25px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.comments-list .btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #adb5bd;
  color: #ffffff;
  transform: translateY(-2px);
}

/* 评论分隔线 */
.comment-card .border-top {
  border-color: #495057 !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .comment-card .card-body {
    padding: 15px;
  }
  
  .comment-card .avatar {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .comment-card p {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .comment-card {
    margin-bottom: 15px;
  }
  
  .comment-card .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }
  
  .comment-card .text-end {
    text-align: left !important;
    margin-top: 10px;
    width: 100%;
  }
  
  .comment-card .badge {
    display: inline-block;
    margin-bottom: 5px;
  }
}
