/**
 * 主题配色样式文件
 * 定义CSS变量和主题相关的样式
 */

/* ==================== CSS变量定义 ==================== */
:root {
  /* 主色调 */
  --color-primary: #FF375F;
  /* 次要色 */
  --color-secondary: #9757FF;
  /* 背景色 */
  --color-background: #000000;
  /* 表面色（卡片、容器等） */
  --color-surface: #222222;
  /* 文字颜色 */
  --color-text: #FFFFFF;
  /* 次要文字颜色 */
  --color-text-secondary: #D1D1D1;
  /* 强调色 */
  --color-accent: #EF963B;
  /* 边框颜色 */
  --color-border: #333333;
  /* 悬停颜色 */
  --color-hover: #FF5577;
}

/* ==================== 应用主题颜色到元素 ==================== */

/* 背景色应用 */
body {
  background-color: var(--color-background);
  color: var(--color-text);
}

/* ==================== 页头菜单样式 ==================== */

/* 头部背景 - 增强对比度和层次感 */
.bg-\[\#222\],
.header {
  background: linear-gradient(180deg, var(--color-surface) 0%, rgba(0, 0, 0, 0.95) 100%) !important;
  border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex !important; /* 确保使用flex布局 */
  align-items: center !important; /* 确保所有子元素垂直居中 */
}

/* 头部悬停效果 */
.header:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 移动端菜单按钮 - 增强视觉效果 */
.mob_menu {
  padding: 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
  cursor: pointer; /* 确保显示手型光标 */
}

.mob_menu:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mob_menu:active {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(0.95);
}

.mob_menu svg {
  color: var(--color-text) !important;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  display: block; /* 确保SVG正常显示 */
}

.mob_menu:hover svg {
  color: var(--color-primary) !important;
  transform: scale(1.1);
}

/* Logo区域 - 增加发光效果 */
.header .logo-link {
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.header .logo-link:hover {
  opacity: 0.9;
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px var(--color-primary));
}

/* 导航菜单 */
.nav {
  gap: 15px;
  align-items: center; /* 确保所有菜单项垂直居中对齐 */
}

.nav a {
  color: #FFFFFF !important;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
  display: inline-flex; /* 使用inline-flex确保内容垂直居中 */
  align-items: center; /* 垂直居中对齐文字 */
  line-height: 1.2; /* 统一行高 */
  white-space: nowrap; /* 防止文字换行 */
}

/* 确保所有菜单项都是白色 */
.nav a,
.nav a:link,
.nav a:visited {
  color: #FFFFFF !important;
}

/* 导航菜单悬停效果 - 更明显的视觉反馈 */
.nav a:hover {
  color: var(--color-primary) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 导航菜单激活状态 - 更突出的高亮 */
.nav a.active,
.nav a.router-link-active,
.nav a.nav-cate-link.active {
  color: var(--color-primary) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  box-shadow: 0 0 15px rgba(255, 55, 95, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

/* 导航菜单下划线效果 - 更粗更明显 */
.nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--color-primary);
}

.nav a:hover::after,
.nav a.active::after,
.nav a.nav-cate-link.active::after {
  width: 90%;
}

/* 搜索图标 - 增强视觉效果 */
.icon-sousuo4 {
  color: var(--color-text) !important;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.icon-sousuo4:hover {
  color: var(--color-primary) !important;
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 4px 8px var(--color-primary));
}

/* 移动端菜单内容 */
.mobile_menu_content {
  background-color: var(--color-surface) !important;
  backdrop-filter: blur(10px);
}

.mobile_menu_content .nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 20px;
}

.mobile_menu_content .nav li {
  margin-bottom: 0;
}

.mobile_menu_content .nav a {
  color: #FFFFFF !important;
  font-size: 18px;
  font-weight: 500;
  padding: 15px 20px;
  display: flex; /* 使用flex布局确保对齐 */
  align-items: center; /* 垂直居中对齐 */
  border-radius: 8px;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.2; /* 统一行高 */
}

/* 确保动态添加的分类链接也是白色 */
.mobile_menu_content .nav a,
.mobile_menu_content .nav a:link,
.mobile_menu_content .nav a:visited {
  color: #FFFFFF !important;
}

.mobile_menu_content .nav a:hover {
  color: var(--color-primary) !important;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.mobile_menu_content .nav a.active {
  color: var(--color-primary) !important;
  background-color: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

/* 移动端菜单关闭按钮 */
.mobile_menu-close {
  cursor: pointer;
  background-color: transparent;
}

.mobile_menu-close .close {
  color: #FFFFFF !important; /* 使用明确的白色 */
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 28px;
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
}

.mobile_menu-close .close:hover {
  color: var(--color-primary) !important;
  transform: rotate(90deg) scale(1.2);
}

.mobile_menu-close .close:active {
  transform: rotate(90deg) scale(0.9);
}

/* 主色调应用 */
.actives1 {
  color: var(--color-text) !important;
  background-color: var(--color-primary) !important;
  border-radius: 50px;
}

/* 按钮样式 */
.btn-content {
  background: var(--color-accent);
  color: var(--color-text);
  box-shadow: 0 0 0.4em 0 var(--color-accent);
}

/* 文字颜色 */
.text-white {
  color: var(--color-text) !important;
}

.text-\[\#D1D1D1\] {
  color: var(--color-text-secondary) !important;
}

/* ==================== 页脚样式 ==================== */

footer {
  background-color: var(--color-surface) !important;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
}

footer a {
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
}

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

footer h2 {
  color: var(--color-text);
  transition: all 0.3s ease;
}

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

/* ==================== 移动端菜单完整样式 ==================== */

.mobile_menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 0; /* 初始宽度为0，通过JavaScript动态设置 */
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  z-index: 9999;
  overflow: hidden;
  opacity: 0; /* 初始透明 */
  visibility: hidden; /* 初始隐藏 */
}

/* 当菜单打开时 */
.mobile_menu.show {
  width: 100vw;
  opacity: 1;
  visibility: visible;
}

/* 菜单内容面板 */
.mobile_menu_content {
  position: absolute;
  right: 0;
  top: 0;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background-color: #222222 !important; /* 使用明确的颜色值作为后备 */
  background-color: var(--color-surface) !important;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  overflow-y: auto;
  transform: translateX(100%); /* 初始隐藏在右侧 */
  z-index: 10000; /* 确保在遮罩层之上 */
}

/* 当菜单打开时，内容滑入 */
.mobile_menu.show .mobile_menu_content {
  transform: translateX(0);
}

/* 移动端菜单内的导航列表 */
.mobile_menu_content .nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 20px;
  list-style: none;
}

.mobile_menu_content .nav li {
  margin: 0;
  padding: 0;
}

/* 移动端菜单中的分类链接激活状态 */
.mobile_menu_content .nav a.nav-cate-link.active {
  color: var(--color-primary) !important;
  background-color: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

/* ==================== 响应式优化 ==================== */

@media (max-width: 768px) {
  .header {
    padding: 0 12px;
  }
  
  .nav a {
    font-size: 14px;
    padding: 6px 12px;
  }
}

/* ==================== 主题选择器样式 ==================== */

.theme-selector {
  padding: 20px;
  background-color: var(--color-surface);
  border-radius: 12px;
  margin: 20px 0;
}

.theme-selector-title {
  color: var(--color-text);
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
}

.theme-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
}

.theme-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: var(--color-background);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-item.active {
  border-color: var(--color-primary);
  background-color: rgba(255, 55, 95, 0.1);
}

.theme-preview {
  display: flex;
  gap: 8px;
  margin-right: 15px;
  flex-shrink: 0;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  transition: transform 0.2s ease;
}

.theme-item:hover .color-dot {
  transform: scale(1.1);
}

.theme-info {
  flex: 1;
}

.theme-name {
  color: var(--color-text);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 5px 0;
}

.theme-description {
  color: var(--color-text-secondary);
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
}

/* ==================== 主题切换按钮样式 ==================== */

.theme-toggle-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
}

.theme-toggle-btn:hover {
  background-color: var(--color-hover);
  transform: scale(1.1);
}

.theme-toggle-btn svg {
  width: 24px;
  height: 24px;
  fill: var(--color-text);
}

/* ==================== 主题面板样式 ==================== */

.theme-panel {
  position: fixed;
  bottom: 140px;
  right: 20px;
  width: 320px;
  max-height: 500px;
  background-color: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.theme-panel.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.theme-panel-header {
  padding: 15px 20px;
  background-color: var(--color-primary);
  color: var(--color-text);
  font-size: 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.theme-panel-close {
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.theme-panel-close:hover {
  opacity: 1;
}

.theme-panel-body {
  padding: 15px;
  max-height: 420px;
  overflow-y: auto;
}

.theme-panel-body::-webkit-scrollbar {
  width: 6px;
}

.theme-panel-body::-webkit-scrollbar-track {
  background: var(--color-background);
}

.theme-panel-body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.theme-panel-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
  .theme-panel {
    width: calc(100vw - 40px);
    right: 20px;
    left: 20px;
    bottom: 120px;
  }
  
  .theme-list {
    grid-template-columns: 1fr;
  }
  
  .theme-toggle-btn {
    bottom: 60px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

/* ==================== 动画效果 ==================== */

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

.theme-item {
  animation: fadeIn 0.3s ease forwards;
}

.theme-item:nth-child(1) { animation-delay: 0.05s; }
.theme-item:nth-child(2) { animation-delay: 0.1s; }
.theme-item:nth-child(3) { animation-delay: 0.15s; }
.theme-item:nth-child(4) { animation-delay: 0.2s; }
.theme-item:nth-child(5) { animation-delay: 0.25s; }
.theme-item:nth-child(6) { animation-delay: 0.3s; }

