/* =============================================
   影视聚合网站 - 主样式文件（优化版）
   ============================================= */

/* 全局变量 */
:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #64748b;
  --success-color: #22c55e;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #06b6d4;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* 全局样式 */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 链接样式 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* ========== Logo样式 ========== */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  padding: 0.25rem 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.site-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

/* ========== 导航栏样式 ========== */
.navbar {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  box-shadow: var(--shadow-lg);
}

/* 登录按钮 */
.nav-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--primary-color);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.nav-login-btn:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.nav-login-btn i {
  font-size: 1rem;
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color) !important;
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-color) !important;
}

/* 搜索框样式 */
.search-box .form-control {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 0.5rem 1rem;
}

.search-box .form-control:focus {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}

.search-box .form-control::placeholder {
  color: var(--text-secondary);
}

.search-box .btn {
  border-radius: var(--radius-lg);
  padding: 0.5rem 1rem;
}

/* 下拉菜单样式 */
.dropdown-menu {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

/* ========== 轮播图样式 ========== */
.hero-section {
  padding-top: 1rem;
}

.carousel {
  border-radius: var(--radius-xl) !important;
  overflow: hidden;
}

.carousel-image {
  height: 450px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  transition: transform 0.5s ease;
}

.carousel-item:hover .carousel-image {
  transform: scale(1.02);
}

.carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

.carousel-content {
  animation: slideUp 0.5s ease;
}

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

.carousel-title {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.5rem;
}

.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  transition: all var(--transition-normal);
}

.carousel:hover .carousel-control-prev,
.carousel:hover .carousel-control-next {
  opacity: 1;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev {
  left: 1rem;
}

.carousel-control-next {
  right: 1rem;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.carousel-indicators {
  margin-bottom: 1rem;
}

.carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 5px;
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.carousel-indicators button.active {
  opacity: 1;
  width: 30px;
  border-radius: 5px;
}

/* ========== 详情页播放源样式 ========== */
.source-tabs-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.source-tab-detail {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.source-tab-detail:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.source-tab-detail.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* 详情页官方源样式 */
.source-tab-detail.official {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  font-weight: 600;
}

.source-tab-detail.official:hover {
  background: rgba(251, 191, 36, 0.25);
  border-color: #fbbf24;
}

.source-tab-detail.official.active {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #000;
}

/* ========== 筛选菜单样式 ========== */
.filter-section {
  margin-bottom: 1.5rem;
}

.filter-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.filter-tag:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.filter-tag.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ========== 区块样式 ========== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-icon {
  font-size: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.025em;
}

/* 区块动画 */
.section-animate {
  animation: fadeInUp 0.6s ease;
}

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

/* ========== 视频卡片样式 ========== */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  height: 100%;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.card-img-top-wrapper {
  position: relative;
  overflow: hidden;
  padding-top: 140%; /* 2:3 比例 */
  background-color: var(--bg-secondary);
}

.card-img-top-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.video-card:hover .card-img-top-wrapper img {
  transform: scale(1.08);
}

/* 悬浮遮罩 */
.card-img-top-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.video-card:hover .card-img-top-wrapper::after {
  opacity: 1;
}

/* 播放按钮 */
.card-img-top-wrapper .play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all var(--transition-normal);
}

.video-card:hover .card-img-top-wrapper .play-overlay {
  transform: translate(-50%, -50%) scale(1);
}

.play-overlay i {
  color: white;
  font-size: 1.25rem;
  margin-left: 3px;
}

/* 标签样式 */
.card-img-top-wrapper .badge {
  position: absolute;
  z-index: 2;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.35em 0.65em;
}

.card-img-top-wrapper .badge-tag {
  top: 0.5rem;
  left: 0.5rem;
}

.card-img-top-wrapper .badge-score {
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(4px);
  color: #ffffff !important;
}

.card-img-top-wrapper .badge-score i {
  color: #fbbf24 !important;
}

/* 卡片内容 */
.card-body {
  padding: 0.75rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.video-card:hover .card-title {
  color: var(--primary-color);
}

.card-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 分页样式 ========== */
.pagination {
  gap: 0.5rem;
}

.page-link {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  transition: all var(--transition-fast);
}

.page-link:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.page-item.active .page-link {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ========== 按钮样式 ========== */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ========== 详情页样式 ========== */
.detail-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.detail-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.detail-info-table {
  background: transparent !important;
  margin: 0;
}

.detail-info-table td,
.detail-info-table th {
  padding: 0.5rem 1rem;
  border: none !important;
  background: transparent !important;
  color: var(--text-primary) !important;
}

.detail-info-table td:first-child {
  color: var(--text-secondary) !important;
  white-space: nowrap;
  font-weight: 500;
  width: 80px;
}

.detail-info-table td:last-child {
  color: var(--text-primary) !important;
}

/* 强制所有表格背景透明 */
.table,
.table td,
.table th,
.table-borderless,
.table-borderless td,
.table-borderless th,
.table-borderless > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--text-primary) !important;
  background-image: none !important;
}

/* 针对详情页的强制修复 */
.detail-info-table,
.detail-info-table *,
.detail-info-table td,
.detail-info-table th,
.detail-info-table tr,
.detail-info-table tbody,
.detail-info-table thead {
  background-color: transparent !important;
  background: transparent !important;
  color: var(--text-primary) !important;
}

/* 移除所有可能的白色背景 */
[class*="detail"] table,
[class*="detail"] table *,
[class*="info"] table,
[class*="info"] table * {
  background-color: transparent !important;
  background: transparent !important;
}

/* 确保所有表格文字颜色正确 */
.table {
  color: var(--text-primary);
}

.table td,
.table th {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.table-borderless td,
.table-borderless th {
  border: none;
}

/* ========== 播放器样式 ========== */
.player-wrapper {
  position: relative;
  padding-top: 56.25%; /* 16:9 比例 */
  background-color: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.player-wrapper iframe,
.player-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ========== 页脚样式 ========== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

footer h5 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

footer a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

/* ========== 响应式调整 ========== */
@media (max-width: 1200px) {
  .carousel-image {
    height: 400px;
  }
}

@media (max-width: 992px) {
  .carousel-image {
    height: 350px;
  }

  .carousel-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .carousel-image {
    height: 250px;
  }

  .carousel-title {
    font-size: 1.25rem;
  }

  .carousel-overlay {
    padding: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .video-card .card-title {
    font-size: 0.8rem;
  }

  .video-card .card-text {
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {
  .carousel-image {
    height: 200px;
  }

  .carousel-title {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.1rem;
  }
}

/* ========== 加载动画 ========== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 淡入动画 */
.fade-in {
  animation: fadeIn 0.5s ease;
}

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

/* 列表项动画 */
.col {
  animation: fadeInUp 0.5s ease both;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

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

/* ========== 全局加载动画 ========== */
.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.global-loading.show {
  display: flex;
}

.loading-spinner-wrapper {
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-text {
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
}

/* 按钮禁用状态 */
.btn.loading-state {
  pointer-events: none;
  opacity: 0.7;
}

/* ========== 选中样式 ========== */
::selection {
  background: var(--primary-color);
  color: white;
}

/* ========== 用户页面样式 ========== */
.user-page {
  min-height: calc(100vh - 200px);
}

/* 返回链接 */
.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--primary-color);
}

/* 用户信息卡片 */
.user-profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.user-avatar {
  width: 64px;
  height: 64px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.user-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* 统计卡片 */
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.stat-arrow {
  margin-left: auto;
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
}

.stat-card:hover .stat-arrow {
  transform: translateX(4px);
  color: var(--primary-color);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
}

.stat-info h4 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.stat-info p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.85rem;
}

.stat-link {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: color var(--transition-fast);
}

.stat-link:hover {
  color: var(--primary-color);
}

/* 用户菜单 */
.user-menu-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
}

.user-menu-item:last-child {
  border-bottom: none;
}

.user-menu-item:hover {
  background: rgba(99, 102, 241, 0.05);
}

.menu-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
}

/* 页面图标 */
.page-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* 个人资料卡片 */
.profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.profile-header {
  text-align: center;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  margin: 0 auto 1rem;
}

/* 收藏列表 */
.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.favorite-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.favorite-item:hover {
  border-color: var(--primary-color);
}

.favorite-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.favorite-title {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

.favorite-title:hover {
  color: var(--primary-color);
}

.favorite-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 历史列表 */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.history-item:hover {
  border-color: var(--primary-color);
}

.history-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  color: var(--text-primary);
  text-decoration: none;
}

.history-title {
  font-weight: 500;
  margin: 0;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: var(--text-secondary);
}

.empty-state h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.btn-empty-action {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  background: var(--primary-color);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-empty-action:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-100%);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease both;
}

/* ========== 登录/注册页面样式 ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), #818cf8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.auth-header p {
  color: var(--text-secondary);
  margin: 0;
}

.auth-form .input-group {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.auth-form .input-group:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-form .input-group-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
}

.auth-form .form-control {
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.auth-form .form-control:focus {
  box-shadow: none;
  color: var(--text-primary);
}

.auth-form .form-control::placeholder {
  color: var(--text-secondary);
}

.auth-form .btn-primary {
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-color), #818cf8);
  border: none;
  transition: all var(--transition-fast);
}

.auth-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.auth-footer p {
  color: var(--text-secondary);
  margin: 0;
}

.auth-footer a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* 新Logo样式 */
.auth-logo-new {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-circle {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  position: relative;
  overflow: hidden;
}

.logo-circle::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  animation: logoShine 3s ease-in-out infinite;
}

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

.logo-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.logo-bar {
  width: 4px;
  height: 24px;
  background: white;
  border-radius: 2px;
}

.logo-bar:nth-child(2) {
  height: 32px;
}

.auth-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* 错误和成功提示 */
.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #ef4444;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.auth-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #22c55e;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

/* ========== 卡片和表格文字颜色修复 ========== */
.card {
  color: var(--text-primary);
}

.card-header {
  color: var(--text-primary);
  background-color: transparent;
  border-bottom-color: var(--border-color);
}

.card-body {
  color: var(--text-primary);
}

.card-title,
.card-text {
  color: var(--text-primary);
}

/* 确保所有文字在深色背景下可见 */
.text-white {
  color: #ffffff !important;
}

.text-light {
  color: var(--text-primary) !important;
}

/* 表单标签颜色 */
.form-label {
  color: var(--text-secondary);
}

/* 表单控件颜色 */
.form-control {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.form-control:focus {
  background-color: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
  color: var(--text-secondary);
}

/* 输入组样式 */
.input-group-text {
  background-color: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

/* 下拉菜单文字颜色 */
.dropdown-item {
  color: var(--text-secondary);
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--text-primary);
  background-color: rgba(99, 102, 241, 0.1);
}

/* 面包屑导航颜色 */
.breadcrumb-item a {
  color: var(--text-secondary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
}

/* 分页文字颜色 */
.page-link {
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

.page-link:hover {
  color: var(--text-primary);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.page-item.active .page-link {
  color: white;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}