/* ============================================
   Base Components - 基础组件
   ============================================ */

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-white {
  background: var(--bg-white);
  color: var(--text-main);
}

.btn-white:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 12px;
}

.btn-lg {
  padding: var(--space) var(--space-md);
  font-size: 16px;
}

/* 卡片 */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-hover {
  transition: all var(--transition);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-body {
  padding: var(--space);
}

.card-body-sm {
  padding: var(--space-sm);
}

/* 链接 */
.link {
  color: var(--primary);
  transition: color var(--transition-fast);
}

.link:hover {
  color: var(--primary-hover);
}

.link-underline {
  text-decoration: underline;
}

/* 文本 */
.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--text-muted);
}

.text-light {
  color: var(--text-light);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-sm {
  font-size: 14px;
}

.text-lg {
  font-size: 18px;
}

.text-xl {
  font-size: 20px;
}

.text-2xl {
  font-size: 24px;
}

.text-3xl {
  font-size: 30px;
}

.text-4xl {
  font-size: 36px;
}

.font-bold {
  font-weight: bold;
}

.font-medium {
  font-weight: 500;
}

.font-black {
  font-weight: 900;
}

/* 溢出隐藏 */
.line-clamp-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 分隔线 */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-default);
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--border-default);
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  font-size: 12px;
  border-radius: var(--radius-full);
  background: var(--primary-alpha-10);
  color: var(--primary);
}

.tag-red {
  background: var(--primary);
  color: var(--text-white);
}

/* 图片占位 */
.img-placeholder {
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

/* 隐藏/显示 */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

.overflow-hidden {
  overflow: hidden;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.animate-fadeIn {
  animation: fadeIn var(--transition) ease-out;
}

.animate-fadeInUp {
  animation: fadeInUp var(--transition) ease-out;
}

.animate-bounce {
  animation: bounce 1.5s infinite;
}

.animate-float {
  animation: float 2s ease-in-out infinite;
}

/* ============================================
   列表分页组件（统一公共样式）
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination__info {
  display: none;
  font-size: 14px;
  color: var(--text-muted);
  margin-right: 8px;
  white-space: nowrap;
}

.pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  background: var(--bg-white);
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.pagination__btn:hover:not(.disabled):not(.active) {
  border-color: var(--border-dark);
  background: var(--bg-gray-light);
}

.pagination__btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-white);
}

.pagination__btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination__btn svg {
  width: 16px;
  height: 16px;
}

/* 首页/尾页 */
.pagination__first,
.pagination__last {
  display: none;
}

/* 跳转区域 */
.pagination__jump {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  white-space: nowrap;
}

.pagination__jump-text {
  font-size: 14px;
  color: var(--text-muted);
}

.pagination__jump-input {
  width: 48px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  font-size: 14px;
  text-align: center;
  color: var(--text-main);
  outline: none;
  -moz-appearance: textfield;
}

.pagination__jump-input::-webkit-inner-spin-button,
.pagination__jump-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pagination__jump-input:focus {
  border-color: var(--primary);
}

.pagination__jump-btn {
  height: 36px;
  padding: 0 12px;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-white);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.pagination__jump-btn:hover {
  background: var(--primary-hover);
}

/* ============================================
   桌面端分页扩展（≥768px）
   ============================================ */
@media (min-width: 992px) {
  .pagination__info {
    display: inline;
  }

  .pagination__first,
  .pagination__last,
  .pagination__jump {
    display: flex;
  }

  .pagination {
    flex-wrap: nowrap;
  }
}

/* ============================================
   板块出场动画
   ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: none;
}

.fade-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.fade-left.visible {
  opacity: 1;
  transform: none;
}

.fade-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.fade-right.visible {
  opacity: 1;
  transform: none;
}


.home-section__container {
  max-width: 1400px;
  margin: 0 auto;
}

@media(max-width: 1919px) {
  .home-section__container {
    max-width: 1200px;
  }
}

@media(max-width:1200px) {
  .home-section__container {
    padding: 0 16px;
  }
}


/* common-hero */
.common-hero {
  position: relative;
}

.common-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 140px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 60%, #fff 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-swiper {
  -webkit-aspect-ratio: 1920 / 694;
  aspect-ratio: 1920 / 694;
}

.hero-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 公共移动端样式 */
@media (max-width: 991px) {
  .home-section__container {
    padding: 0 16px;
    margin: 0 auto;
    margin-bottom: 20px;
  }

  .fade-up {
    opacity: 1;
    transform: none;
  }

  .fade-left {
    opacity: 1;
    transform: none;
  }

  .fade-right {
    opacity: 1;
    transform: none;
  }

  .common-hero::after {
    display: none;
  }
}

/* common-hero 移动端适配 */
@media (max-width: 991px) {

  .common-hero {
    height: auto;
  }

  .common-hero img {
    height: 100%;
    object-fit: cover;
  }

  .common-hero::after {
    height: 80px;
  }

  .pagination {
    gap: 6px;
  }
}

/* ============================================
   公共页面结构组件
   ============================================ */

/* 通用卡片容器 */
.section-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

/* 通用过滤器栏 */
.section-filter {
  border-bottom: 1px solid var(--border-light);
}

/* 通用标签栏 */
.section-tabs {
  display: flex;
  height: 56px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.section-tabs::-webkit-scrollbar {
  display: none;
}

/* 通用标签项 */
.section-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  position: relative;
  z-index: 20;
}

.section-tab:hover {
  color: var(--primary);
}

.section-tab.active {
  background: var(--primary);
  color: var(--text-white);
}

.section-tab:first-child.active {
  border-top-left-radius: var(--radius-lg);
}

@media (max-width: 991px) {
  .section-tabs {
    height: 48px;
  }

  .section-tab {
    padding: 0 20px;
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .common-hero {
    height: auto;
  }

  .common-hero .banner-title h3 {
    font-size: 20px;
  }

  .common-hero .banner-title p {
    font-size: 12px;
  }
}

html,
body {
  min-width: 1200px;
  overflow-x: visible;
}

@media (max-width: 991px) {

  html,
  body {
    min-width: unset;
    overflow-x: hidden;
    /* 移动端恢复正常 100% 布局 */
  }
}

/* ============================================
   Loading 加载组件 - 公共样式
   ============================================ */

/* 加载容器 */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
}

/* 加载旋转动画 */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-default);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 加载文字 */
.loading-text {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* 行内加载状态 */
.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-inline .loading-spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* 表格加载状态 */
.loading-table {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* 放大镜鼠标悬停 */
.cursor-zoom-in {
  cursor: url('../images/magnifier.svg'), zoom-in;
}

/* ============================================
   面包屑导航组件 - 公共样式
   ============================================ */
.page-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 12px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.page-breadcrumb__item {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.page-breadcrumb__item:hover {
  color: var(--primary);
}

.page-breadcrumb__item--current {
  color: var(--text-main);
  font-weight: 500;
}

.page-breadcrumb__icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.page-breadcrumb__sep {
  width: 14px;
  height: 14px;
  color: var(--text-light);
  flex-shrink: 0;
}