/*
 * 官网接入：引入本文件即可。样式均挂在 .php-banner-slot / .hero-banner-wrap 下。
 * 若下方内容盖住轮播，在插槽上调 --hbw-z（默认 1）。
 * 本地预览用的 body / mock 样式写在 index.html 的 <head> 里，不会进本文件。
 */

/* ── 组件根：高度与线上插槽一致时改 --banner-height ── */
.php-banner-slot {
  --banner-height: 1080px;
  --hbw-z: 1;
  position: relative;
  width: 100%;
  height: var(--banner-height);
  z-index: var(--hbw-z);
  isolation: isolate;
}

.hero-banner-wrap,
.hero-banner-wrap * {
  box-sizing: border-box;
}

.hero-banner-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0A0E17;
  isolation: isolate;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.hero-banner-wrap #canvas-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-banner-wrap .banner-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.hero-banner-wrap .banner-bg.active {
  opacity: 1;
  visibility: visible;
}

/* 画布铺满：高优先级选择器，不用全局 !important；若官网仍有 canvas!important，由 JS 锁定 */
.hero-banner-wrap #canvas-container > canvas,
.hero-banner-wrap .banner-bg > canvas {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.hero-banner-wrap .hbw-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(10,14,23,0.92) 0%, rgba(10,14,23,0.53) 38%, transparent 52%),
    radial-gradient(ellipse 65% 55% at 80% 48%, transparent 0%, rgba(10,14,23,0.32) 55%, rgba(10,14,23,0.72) 100%);
}

.hero-banner-wrap .hero-text {
  position: absolute;
  left: 8%;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  pointer-events: none;
  z-index: 10;
  margin: 0;
}

.hero-banner-wrap .hero-text--center-top {
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: auto;
  max-width: min(92vw, 960px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-banner-wrap .hero-text--center-top p {
  max-width: none;
  margin-inline: auto;
  white-space: nowrap;
  text-align: center;
  width: fit-content;
}

.hero-banner-wrap .hero-text--center-top .hero-tags {
  justify-content: center;
}

.hero-banner-wrap .hero-text h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  color: #fff;
}

.hero-banner-wrap .hero-text h2 {
  font-size: clamp(1.8rem, 4.2vw, 2.7rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
  color: #fff;
}

.hero-banner-wrap .hero-text p {
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  color: #fff;
  line-height: 1.8;
  margin: 0;
}

.hero-banner-wrap .hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.hero-banner-wrap .hero-tags span {
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 4px;
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  color: #fff;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hero-banner-wrap .hero-image {
  position: absolute;
  right: 14%;
  top: 50%;
  width: min(50vw, 720px);
  height: auto;
  transform: translateY(-50%) perspective(900px) rotateY(-6deg) rotateX(4deg);
  pointer-events: none;
  z-index: 10;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
}

.hero-banner-wrap .hero-carousel {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hero-banner-wrap .hbw-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.hero-banner-wrap .hbw-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-banner-wrap .hbw-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.hero-banner-wrap .hbw-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
  pointer-events: auto;
}

.hero-banner-wrap .hbw-dot:hover {
  border-color: rgba(255, 165, 60, 0.8);
}

.hero-banner-wrap .hbw-dot.active {
  background: #ff9a3c;
  border-color: #ff9a3c;
  transform: scale(1.15);
}

/* ── 调试面板（本地用，类名已加前缀） ── */
.dev-slide-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.dev-slide-tab {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid rgba(77, 212, 255, 0.25);
  border-radius: 5px;
  background: rgba(0, 60, 100, 0.25);
  color: rgba(203, 213, 225, 0.75);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.dev-slide-tab:hover {
  border-color: rgba(77, 212, 255, 0.45);
  color: #cbd5e1;
}

.dev-slide-tab.active {
  background: rgba(0, 100, 160, 0.45);
  border-color: rgba(77, 212, 255, 0.55);
  color: #7dd3fc;
}

.dev-slide-group[hidden] {
  display: none;
}

.dev-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  padding: 8px 14px;
  border: 1px solid rgba(77, 212, 255, 0.35);
  border-radius: 6px;
  background: rgba(10, 22, 40, 0.75);
  color: #7dd3fc;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s;
}

.dev-toggle:hover {
  background: rgba(0, 100, 160, 0.45);
  border-color: rgba(77, 212, 255, 0.6);
}

.dev-panel {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 200;
  width: 280px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 14px 16px 16px;
  border: 1px solid rgba(77, 212, 255, 0.25);
  border-radius: 10px;
  background: rgba(10, 18, 32, 0.88);
  backdrop-filter: blur(12px);
  color: #cbd5e1;
  font-size: 12px;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.dev-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.dev-panel h3 {
  font-size: 13px;
  font-weight: 600;
  color: #7dd3fc;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.dev-group {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(77, 212, 255, 0.1);
}

.dev-group:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.dev-group-title {
  font-size: 11px;
  color: rgba(125, 211, 252, 0.65);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dev-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.dev-row label {
  flex: 0 0 72px;
  color: rgba(203, 213, 225, 0.85);
}

.dev-row input[type="range"] {
  flex: 1;
  height: 4px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.dev-row input[type="color"] {
  flex: 1;
  height: 28px;
  border: 1px solid rgba(77, 212, 255, 0.25);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

.dev-val {
  flex: 0 0 36px;
  text-align: right;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.dev-panel::-webkit-scrollbar {
  width: 4px;
}

.dev-panel::-webkit-scrollbar-thumb {
  background: rgba(77, 212, 255, 0.25);
  border-radius: 2px;
}

.dev-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(77, 212, 255, 0.15);
}

.dev-copy-btn {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(77, 212, 255, 0.35);
  border-radius: 6px;
  background: rgba(0, 100, 160, 0.35);
  color: #7dd3fc;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.dev-copy-btn:hover {
  background: rgba(0, 120, 190, 0.5);
  border-color: rgba(77, 212, 255, 0.6);
}

.dev-copy-btn.copied {
  border-color: rgba(74, 222, 128, 0.5);
  color: #86efac;
  background: rgba(22, 101, 52, 0.35);
}

.dev-copy-hint {
  margin-top: 6px;
  font-size: 10px;
  color: rgba(125, 211, 252, 0.45);
  text-align: center;
  line-height: 1.4;
}

/* ── 手机端 ── */
@media (max-width: 768px) {
  .php-banner-slot {
    --banner-height: 620px;
  }

  .hero-banner-wrap .hbw-overlay {
    background:
      linear-gradient(
        to bottom,
        rgba(10, 14, 23, 0.78) 0%,
        rgba(10, 14, 23, 0.28) 28%,
        transparent 42%,
        transparent 58%,
        rgba(10, 14, 23, 0.55) 78%,
        rgba(10, 14, 23, 0.88) 100%
      );
  }

  .hero-banner-wrap .hero-text {
    left: 50%;
    top: 38%;
    right: auto;
    transform: translate(-50%, -50%);
    text-align: center;
    width: min(92vw, 420px);
    padding: 1.25rem 1rem;
    isolation: isolate;
  }

  .hero-banner-wrap .hero-text::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120%;
    height: 130%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
      ellipse 70% 60% at 50% 45%,
      rgba(10, 14, 23, 0.82) 0%,
      rgba(10, 14, 23, 0.55) 45%,
      rgba(10, 14, 23, 0) 72%
    );
    z-index: -1;
    pointer-events: none;
  }

  .hero-banner-wrap .hero-text h1,
  .hero-banner-wrap .hero-text h2,
  .hero-banner-wrap .hero-text p {
    text-shadow:
      0 1px 2px rgba(0, 0, 0, 0.85),
      0 2px 16px rgba(0, 0, 0, 0.55);
  }

  .hero-banner-wrap .hero-tags span {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
    background: rgba(10, 14, 23, 0.35);
  }

  .hero-banner-wrap .hero-text--center-top {
    top: 36%;
    max-width: min(92vw, 420px);
  }

  .hero-banner-wrap .hero-text--center-top p {
    white-space: normal;
    max-width: 100%;
  }

  .hero-banner-wrap .hero-text h1 {
    font-size: clamp(1.55rem, 7vw, 2.1rem);
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
  }

  .hero-banner-wrap .hero-text h2 {
    font-size: clamp(1.05rem, 4.5vw, 1.45rem);
    margin-bottom: 0.75rem;
  }

  .hero-banner-wrap .hero-text p {
    font-size: clamp(0.72rem, 3.2vw, 0.88rem);
    line-height: 1.65;
  }

  .hero-banner-wrap .hero-text p br {
    display: none;
  }

  .hero-banner-wrap .hero-tags {
    justify-content: center;
    gap: 8px;
    margin-bottom: 0.75rem;
  }

  .hero-banner-wrap .hero-tags span {
    padding: 4px 10px;
    font-size: clamp(0.68rem, 2.8vw, 0.82rem);
    white-space: nowrap;
  }

  .hero-banner-wrap .hero-image {
    right: 50%;
    top: 68%;
    width: min(78vw, 360px);
    transform: translate(50%, -50%) perspective(700px) rotateY(0deg) rotateX(2deg);
  }

  .hero-banner-wrap .hbw-dots {
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }

  .hero-banner-wrap .hbw-dot {
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 8px transparent;
  }

  .dev-toggle {
    top: auto;
    bottom: 16px;
    right: 12px;
    font-size: 12px;
    padding: 6px 10px;
  }

  .dev-panel {
    top: auto;
    bottom: 56px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: min(70vh, 480px);
    transform: translateY(calc(100% + 24px));
  }

  .dev-panel.open {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .php-banner-slot {
    --banner-height: 520px;
  }

  .hero-banner-wrap .hero-text {
    top: 36%;
  }

  .hero-banner-wrap .hero-tags span {
    padding: 3px 8px;
  }
}

@media (max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
  .php-banner-slot {
    --banner-height: 360px;
  }

  .hero-banner-wrap .hbw-overlay {
    background:
      linear-gradient(to right, rgba(10, 14, 23, 0.88) 0%, rgba(10, 14, 23, 0.45) 36%, transparent 52%),
      radial-gradient(ellipse 65% 55% at 80% 48%, transparent 0%, rgba(10, 14, 23, 0.32) 55%, rgba(10, 14, 23, 0.72) 100%);
  }

  .hero-banner-wrap .hero-text {
    top: 48%;
    width: min(55vw, 380px);
    left: 6%;
    transform: translateY(-50%);
    text-align: left;
  }

  .hero-banner-wrap .hero-tags {
    justify-content: flex-start;
  }

  .hero-banner-wrap .hero-text h1 {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
  }

  .hero-banner-wrap .hero-text h2 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
  }

  .hero-banner-wrap .hero-text p {
    font-size: 0.7rem;
    line-height: 1.5;
  }

  .hero-banner-wrap .hbw-dots {
    bottom: 10px;
  }
}
