/* ========== 按钮样式 ========== */
.btn-primary {
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px 0 rgba(59,130,246,0.10);
}

.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
}

/* ========== 返回顶部按钮 ========== */
.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1050;
  width: 60px;
  height: 60px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  /* 初始隐藏状态 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  /* 平滑过渡 */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
  transform: translateY(-2px) scale(1.05);
}

.back-to-top-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 20px rgba(79, 70, 229, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.3s ease;
}

.back-to-top-btn:hover .back-to-top-container {
  box-shadow: 
    0 8px 30px rgba(79, 70, 229, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.back-to-top-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  z-index: 1;
}

.back-to-top-progress-bg {
  transition: stroke 0.3s ease;
}

.back-to-top-progress-bar {
  transition: stroke-dashoffset 0.3s ease;
}

.back-to-top-icon {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 24px;
  color: #4f46e5;
  transition: all 0.3s ease;
}

.back-to-top-btn:hover .back-to-top-icon {
  color: #3730a3;
  transform: translateY(-1px);
}

/* 深色主题适配 */
[data-theme="dark"] .back-to-top-container {
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 4px 20px rgba(79, 70, 229, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .back-to-top-btn:hover .back-to-top-container {
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 
    0 8px 30px rgba(79, 70, 229, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .back-to-top-progress-bg {
  stroke: rgba(255, 255, 255, 0.1);
}

/* ========== 站内搜索样式 ==========
.site-search {
  position: relative;
  min-width: 220px;
  max-width: 280px;
  margin-left: 15px;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 40px 6px 12px;
  font-size: 13px;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.search-input:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.6);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.search-btn {
  position: absolute;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 2;
  font-size: 12px;
}

.search-btn:hover {
  color: #4f46e5;
  background: rgba(255, 255, 255, 0.1);
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  padding: 3px;
  border-radius: 50%;
  transition: all 0.3s ease;
  font-size: 10px;
  z-index: 3;
}

.search-clear-btn:hover {
  color: #ef4444;
  background: rgba(255, 255, 255, 0.1);
}

/* 搜索结果下拉框 */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 8px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.search-results-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border-color);
  background: var(--header-bg);
  border-radius: 12px 12px 0 0;
}

.search-results-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-item {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item:focus {
  background: var(--hover-bg);
}

.search-result-link {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
}

.search-result-link:hover {
  color: inherit;
  text-decoration: none;
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.search-result-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--primary-color);
}

.search-result-section {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-snippet {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.search-result-snippet mark {
  background: rgba(79, 70, 229, 0.2);
  color: var(--primary-color);
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 600;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

.search-no-results p {
  margin: 0;
  font-size: 14px;
}

.search-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* 深色主题适配 */
[data-theme="light"] .search-input {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-color);
}

[data-theme="light"] .search-input:focus {
  background: rgba(0, 0, 0, 0.08);
  border-color: #4f46e5;
}

[data-theme="light"] .search-input::placeholder {
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .search-btn {
  color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .search-btn:hover {
  color: #4f46e5;
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .search-clear-btn {
  color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .search-clear-btn:hover {
  color: #ef4444;
  background: rgba(0, 0, 0, 0.1);
} */

/* ========== 合作伙伴 Logo 滚动 ========== */
footer .partner-logos-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px 0;
  margin-top: 10px;
  position: relative;
  mask: linear-gradient(
    90deg,
    transparent,
    white 20px,
    white calc(100% - 20px),
    transparent
  );
  -webkit-mask: linear-gradient(
    90deg,
    transparent,
    white 20px,
    white calc(100% - 20px),
    transparent
  );
}

footer .partner-logos-slider {
  display: inline-flex;
  animation: scroll-left 30s linear infinite;
  will-change: transform;
}

footer .partner-logo {
  flex-shrink: 0;
  margin: 0 30px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  transition: all 0.3s ease;
}

footer .partner-logo img {
  max-height: 50px;
  max-width: 120px;
  width: auto;
  height: auto;
  filter: brightness(0.8) contrast(1.2);
  transition: all 0.3s ease;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

footer .partner-logo:hover {
  transform: translateY(-2px);
}

footer .partner-logo:hover img {
  filter: brightness(1) contrast(1);
  transform: scale(1.1);
}

/* 暂停动画在悬停时 */
footer .partner-logos-container:hover .partner-logos-slider {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0) translateZ(0);
  }
  100% {
    transform: translateX(-50%) translateZ(0);
  }
}

/* 响应式处理 */
@media (max-width: 768px) {
  footer .partner-logos-slider {
    animation-duration: 25s; /* 移动端稍快一些 */
  }
  
  footer .partner-logo {
    width: 120px;
    margin: 0 20px;
  }
  
  footer .partner-logo img {
    max-height: 40px;
    max-width: 100px;
  }
}

@media (max-width: 480px) {
  footer .partner-logos-slider {
    animation-duration: 20s;
  }
  
  footer .partner-logo {
    width: 100px;
    margin: 0 15px;
  }
  
  footer .partner-logo img {
    max-height: 35px;
    max-width: 80px;
  }
}

/* ========== 联系方式样式 ========== */
footer .contact-link {
  color: #fff !important;
  text-decoration: none !important;
  transition: color 0.3s ease;
}

footer .contact-link:hover {
  color: #3b82f6 !important;
  text-decoration: none !important;
}

footer .contact-icon {
  color: #3b82f6 !important;
  transition: color 0.3s ease;
}

footer .contact-link:hover .contact-icon {
  color: #2563eb !important;
}

footer .space-y-3 span {
  font-weight: bold !important;
  color: #fff !important;
}

/* ========== 友情链接样式 ========== */
footer .hover-link {
  transition: color 0.3s ease;
  display: inline-block;
  margin-bottom: 8px;
  color: #e0e7ff !important;
}

footer .hover-link:hover {
  color: #3b82f6 !important;
  text-decoration: none !important;
}

/* ========== 间距辅助类 ========== */
.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.gap-2 {
  gap: 0.5rem;
}

/* ========== 自定义滚动条 ==========
.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
} */

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  .back-to-top-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
  }
  
  .back-to-top-icon {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .back-to-top-btn {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
  
  .back-to-top-icon {
    width: 18px;
    height: 18px;
  }
}

/* @media (max-width: 991.98px) {
  .site-search {
    display: none !important;
  }
}

@media (max-width: 1199.98px) {
  .site-search {
    min-width: 250px;
  }
  
  .search-input {
    font-size: 13px;
    padding: 6px 40px 6px 14px;
  }
} */

/* ========== 仿生阅读按钮 ========== */
.bionic-reading-btn {
  position: fixed;
  bottom: 3rem;
  left: 1rem;
  z-index: 1050;
  width: 50px;
  height: 50px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 12px;
  /* 平滑过渡 */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bionic-reading-btn:hover {
  transform: translateY(-2px) scale(1.05);
}

.bionic-reading-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.bionic-reading-icon {
  color: #4f46e5;
  font-size: 20px;
  transition: all 0.3s ease;
}

.bionic-reading-btn:hover .bionic-reading-icon {
  color: #3730a3;
  transform: scale(1.1);
}

.bionic-reading-btn.active {
  transform: scale(1.1);
}

.bionic-reading-btn.active .bionic-reading-container {
  background: rgba(79, 70, 229, 0.2);
  border-color: rgba(79, 70, 229, 0.4);
}

.bionic-reading-btn.active .bionic-reading-icon {
  color: #fff;
  text-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

/* 仿生阅读文本样式 */
.bionic-bold {
  font-weight: 700;
  color: inherit;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .bionic-reading-btn {
    bottom: 2rem;
    left: 1rem;
    width: 45px;
    height: 45px;
  }
  
  .bionic-reading-icon {
    font-size: 18px;
  }
}