/* ============================================
   global.css - 全局样式
   Body 默认 / 排版 / 区块标题 / 面包屑 / 横幅 / 工具类
   ============================================ */

/* ---- Body 默认 ---- */
body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-body);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---- 容器 ---- */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container-fluid {
  width: 100%;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container-narrow {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* ---- 排版 - 标题 ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-6xl);
}

h2 {
  font-size: var(--font-size-5xl);
}

h3 {
  font-size: var(--font-size-4xl);
}

h4 {
  font-size: var(--font-size-3xl);
}

h5 {
  font-size: var(--font-size-2xl);
}

h6 {
  font-size: var(--font-size-xl);
}

/* ---- 排版 - 段落 ---- */
p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

/* ---- 排版 - 链接 ---- */
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--text-link-hover);
}

/* ---- 排版 - 其他 ---- */
strong,
b {
  font-weight: var(--font-weight-bold);
}

em,
i {
  font-style: italic;
}

small {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

blockquote {
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  border-left: 4px solid var(--primary-cyan);
  background-color: var(--gray-50);
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---- 区块标题 (.section-title) ---- */
.section-title {
  text-align: center;
  margin-bottom: var(--space-12);
  position: relative;
  padding-bottom: var(--space-5);
}

.section-title h2 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  position: relative;
  display: inline-block;
}

.section-title p {
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  margin-bottom: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-pill);
}

.section-title.section-title--left {
  text-align: left;
}

.section-title.section-title--left::after {
  left: 0;
  transform: none;
}

.section-title.section-title--white h2 {
  color: var(--white);
}

.section-title.section-title--white p {
  color: rgba(255, 255, 255, 0.8);
}

.section-title.section-title--white::after {
  background: var(--white);
}

/* ---- 区块通用 ---- */
.section {
  padding: var(--space-section) 0;
}

.section--gray {
  background-color: var(--bg-section);
}

.section--white {
  background-color: var(--bg-white);
}

.section--gradient {
  background: var(--gradient-primary);
  color: var(--white);
}

.section--dark {
  background-color: var(--bg-dark);
  color: var(--white);
}

/* ---- 面包屑 (.breadcrumb) ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: var(--space-4) 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  display: inline-block;
  margin: 0 var(--space-2);
  color: var(--text-light);
}

.breadcrumb-item a {
  color: var(--text-muted);
  transition: color var(--transition-base);
}

.breadcrumb-item a:hover {
  color: var(--primary-blue);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.breadcrumb-item .icon-home {
  font-size: var(--font-size-lg);
  margin-right: var(--space-1);
}

/* ---- 页面横幅 (.page-banner) ---- */
.page-banner {
  position: relative;
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--primary-blue);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-overlay);
  z-index: 1;
}

.page-banner__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
}

.page-banner__title {
  font-size: var(--font-size-hero);
  font-weight: var(--font-weight-bold);
  color: var(--white);
  margin-bottom: var(--space-3);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-banner__subtitle {
  font-size: var(--font-size-xl);
  color: rgba(255, 255, 255, 0.9);
  font-weight: var(--font-weight-normal);
}

.page-banner__breadcrumb {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
}

.page-banner__breadcrumb .breadcrumb {
  padding: var(--space-3) 0;
}

.page-banner__breadcrumb .breadcrumb-item,
.page-banner__breadcrumb .breadcrumb-item a {
  color: rgba(255, 255, 255, 0.8);
}

.page-banner__breadcrumb .breadcrumb-item a:hover {
  color: var(--white);
}

.page-banner__breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.5);
}

.page-banner__breadcrumb .breadcrumb-item.active {
  color: var(--white);
}

/* ============================================
   工具类 (Utility Classes)
   ============================================ */

/* ---- 文本对齐 ---- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ---- 文本颜色 ---- */
.text-primary { color: var(--primary-blue); }
.text-cyan { color: var(--primary-cyan); }
.text-green { color: var(--primary-green); }
.text-white { color: var(--white); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

/* ---- 文本样式 ---- */
.text-bold { font-weight: var(--font-weight-bold); }
.text-medium { font-weight: var(--font-weight-medium); }
.text-normal { font-weight: var(--font-weight-normal); }
.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Flexbox ---- */
.flex { display: flex; }
.flex-inline { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }
.flex-none { flex: none; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ---- Grid ---- */
.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

/* ---- 显示隐藏 ---- */
.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }
.overflow-hidden { overflow: hidden; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ---- 定位 ---- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* ---- 宽高 ---- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-auto { width: auto; }
.h-auto { height: auto; }
.min-h-screen { min-height: 100vh; }

/* ---- Margin 间距 ---- */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }
.ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }
.mr-auto { margin-right: auto; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* ---- Padding 间距 ---- */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.pt-0 { padding-top: 0; }
.pt-4 { padding-top: var(--space-4); }
.pt-6 { padding-top: var(--space-6); }
.pt-8 { padding-top: var(--space-8); }

.pb-0 { padding-bottom: 0; }
.pb-4 { padding-bottom: var(--space-4); }
.pb-6 { padding-bottom: var(--space-6); }
.pb-8 { padding-bottom: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }

/* ---- 背景 ---- */
.bg-white { background-color: var(--bg-white); }
.bg-light { background-color: var(--bg-light); }
.bg-section { background-color: var(--bg-section); }
.bg-gradient { background: var(--gradient-primary); }
.bg-dark { background-color: var(--bg-dark); }

/* ---- 圆角 ---- */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ---- 阴影 ---- */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ---- 鼠标 ---- */
.cursor-pointer { cursor: pointer; }

/* ---- 过渡动画 ---- */
.transition {
  transition: all var(--transition-base);
}

/* ---- 淡入动画 ---- */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---- 分隔线 ---- */
.divider {
  height: 1px;
  background-color: var(--border-color);
  margin: var(--space-6) 0;
}

.divider--gradient {
  height: 2px;
  background: var(--gradient-primary);
  border: none;
}

/* ---- 图片包裹 ---- */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---- 无障碍: 屏幕阅读器专属 ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
