/* ============================================================
   首页 Hero 轮播 — 天翼云风格
   ============================================================ */

.k8-hero {
  position: relative;
  width: 100%;
  background: transparent;
}

.k8-hero__viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  height: clamp(480px, 38vw, 580px);
  --k8-hero-dock-h: 148px;
}

.k8-hero__track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.k8-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s ease;
  z-index: 1;
}

.k8-hero__slide--active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.k8-hero__bg,
.k8-hero__video {
  position: absolute;
  top: 0;
  left: 50%;
  width: 120%;
  height: 100%;
  transform: translateX(-50%);
  object-fit: cover;
  object-position: 54% 42%;
  display: block;
  border: none;
  pointer-events: none;
}

.k8-hero__inner {
  position: relative;
  z-index: 3;
  max-width: 1600px;
  height: 100%;
  margin: 0 auto;
  padding: calc(var(--k8-hero-dock-h) / 2) 56px;
  display: flex;
  align-items: center;
}

/* 轮播文案：纯文字，无磨砂底 */
.k8-hero__content {
  position: relative;
  max-width: 420px;
  margin-left: 36px;
  padding: 0;
  animation: k8-hero-fade-in 0.6s ease both;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.k8-hero__slide:not(.k8-hero__slide--active) .k8-hero__content {
  animation: none;
}

@keyframes k8-hero-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.k8-hero__title {
  margin: 0 0 14px;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.22;
  color: #1d2129;
  letter-spacing: -0.02em;
}

.k8-hero__desc {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.6;
  color: #4e5969;
}

.k8-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 40px;
  padding: 0 24px;
  border: 1px solid #1d2129;
  border-radius: 4px;
  background: transparent;
  color: #1d2129;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.k8-hero__btn:hover {
  background: #1d2129;
  color: #fff;
  border-color: #1d2129;
}

/* ========== 底栏：磨砂条（仅底栏模糊） ========== */

.k8-hero__glass-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(36px) saturate(1.7);
  -webkit-backdrop-filter: blur(36px) saturate(1.7);
  border-top: 1px solid rgba(255, 255, 255, 0.65);
}

.k8-hero__glass-panel {
  position: relative;
  background: transparent;
}

/* Tab 行 */
.k8-hero__tabs-wrap {
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.k8-hero__tabs {
  display: flex;
  align-items: stretch;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.k8-hero__tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 20px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: color 0.2s ease;
}

.k8-hero__tab-label {
  font-size: 15px;
  font-weight: 500;
  color: rgba(29, 33, 41, 0.55);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding-bottom: 14px;
  transition: color 0.2s ease;
}

.k8-hero__tab--active .k8-hero__tab-label {
  color: #1d2129;
  font-weight: 700;
}

.k8-hero__tab-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: rgba(29, 33, 41, 0.1);
  overflow: hidden;
}

.k8-hero__tab-progress {
  display: block;
  width: 0;
  height: 100%;
  background: #1d2129;
}

.k8-hero__tab--active .k8-hero__tab-progress {
  animation: k8-hero-progress var(--k8-hero-duration, 5s) linear forwards;
}

.k8-hero.k8-hero--paused .k8-hero__tab--active .k8-hero__tab-progress {
  animation-play-state: paused;
}

@keyframes k8-hero-progress {
  from { width: 0; }
  to { width: 100%; }
}

/* 快捷入口行（与 Tab 分开） */
.k8-hero-quick {
  background: transparent;
}

.k8-hero-quick__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1440px;
  margin: 0 auto;
}

.k8-hero-quick__item {
  display: block;
  padding: 16px 24px 18px;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.38);
  transition: background 0.2s ease;
}

.k8-hero-quick__item:last-child {
  border-right: none;
}

.k8-hero-quick__item:hover {
  background: rgba(255, 255, 255, 0.14);
}

.k8-hero-quick__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #1d2129;
  line-height: 1.35;
}

.k8-hero-quick__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(29, 33, 41, 0.62);
}

/* 大屏 */
@media (min-width: 1600px) {
  .k8-hero__viewport {
    height: 600px;
    --k8-hero-dock-h: 156px;
  }

  .k8-hero__bg,
  .k8-hero__video {
    width: 124%;
    object-position: 52% 40%;
  }

  .k8-hero__inner {
    max-width: 1680px;
    padding: calc(var(--k8-hero-dock-h) / 2) 64px;
  }

  .k8-hero__tabs,
  .k8-hero-quick__grid {
    max-width: 1600px;
  }

  .k8-hero__title {
    font-size: 42px;
  }
}

/* 平板 */
@media (max-width: 1024px) {
  .k8-hero__viewport {
    height: 400px;
    --k8-hero-dock-h: 128px;
  }

  .k8-hero__bg,
  .k8-hero__video {
    width: 112%;
    object-position: 56% 44%;
  }

  .k8-hero__inner {
    padding: calc(var(--k8-hero-dock-h) / 2) 32px;
  }

  .k8-hero__content {
    max-width: 360px;
  }

  .k8-hero__title {
    font-size: 30px;
  }

  .k8-hero__desc {
    font-size: 15px;
  }

  .k8-hero__tabs {
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .k8-hero__tabs::-webkit-scrollbar {
    display: none;
  }

  .k8-hero__tab {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 14px 16px 0;
  }

  .k8-hero-quick__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .k8-hero-quick__item:nth-child(2) {
    border-right: none;
  }

  .k8-hero-quick__item:nth-child(1),
  .k8-hero-quick__item:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.38);
  }
}

/* 手机 / 平板竖屏：轮播与底栏分离，避免磨砂条遮挡画面 */
@media (max-width: 991px) {
  .k8-hero {
    background: #f2f3f5;
  }

  .k8-hero__viewport {
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }

  .k8-hero__track {
    position: relative;
    flex-shrink: 0;
    height: clamp(168px, 46vw, 280px);
  }

  .k8-hero__bg,
  .k8-hero__video {
    width: 100%;
    left: 0;
    transform: none;
    object-position: 58% center;
  }

  .k8-hero__inner {
    padding: 0 16px 14px;
    align-items: flex-end;
  }

  .k8-hero__content {
    max-width: 100%;
    margin-left: 0;
  }

  .k8-hero__title {
    font-size: 18px;
    color: #fff;
    margin-bottom: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  }

  .k8-hero__desc,
  .k8-hero__btn {
    display: none;
  }

  /* 底栏移出轮播区，不再 absolute 覆盖 */
  .k8-hero__glass-dock {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
  }

  .k8-hero__tabs-wrap {
    border-bottom-color: rgba(29, 33, 41, 0.08);
  }

  .k8-hero__tabs {
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .k8-hero__tabs::-webkit-scrollbar {
    display: none;
  }

  .k8-hero__tab {
    flex: 0 0 auto;
    min-width: 76px;
    padding: 10px 12px 0;
  }

  .k8-hero__tab-label {
    font-size: 12px;
    padding-bottom: 8px;
  }

  /* 快捷入口：四宫格 2×2 */
  .k8-hero-quick__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
  }

  .k8-hero-quick__item {
    padding: 10px 12px;
    border-right: 1px solid rgba(29, 33, 41, 0.08);
    border-bottom: 1px solid rgba(29, 33, 41, 0.08);
  }

  .k8-hero-quick__item:nth-child(2n) {
    border-right: none;
  }

  .k8-hero-quick__item:nth-child(n + 3) {
    border-bottom: none;
  }

  .k8-hero-quick__title {
    font-size: 13px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .k8-hero-quick__desc {
    font-size: 11px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .k8-hero__glass-dock {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .k8-hero__slide,
  .k8-hero__content,
  .k8-hero__tab-progress {
    transition: none !important;
    animation: none !important;
  }

  .k8-hero__tab--active .k8-hero__tab-progress {
    width: 100%;
  }
}
