/* ============================================
 * 观鼎山首页 · 七巧板样式 tangram.css
 * 板块：七巧板
 * 包含：轮播区左右七巧板 + 四兽 + 廿八宿
 * ============================================ */

/* ---------- 轮播区三栏布局 ---------- */
.gds-carousel-wrap {
  position: relative;
  width: 100%;
  min-width: 100%;
  max-width: 700px;
  margin: 0 auto 12px auto;
  transition: all var(--transition);
}

.gds-carousel {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

/* ---------- 七巧板容器 ---------- */
.gds-tangram {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  position: relative;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  flex-shrink: 0;
}

.gds-tangram.active {
  opacity: 1;
  visibility: visible;
}

.gds-tangram svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 左侧七巧板 */
.gds-tangram--left {
  margin-right: 8px;
}

/* 右侧七巧板 */
.gds-tangram--right {
  margin-left: 8px;
}

/* ---------- 七巧板板块颜色 ---------- */
.gds-tangram .piece-1 { fill: #E74C3C; opacity: 0.85; }
.gds-tangram .piece-2 { fill: #E67E22; opacity: 0.85; }
.gds-tangram .piece-3 { fill: #F1C40F; opacity: 0.85; }
.gds-tangram .piece-4 { fill: #2ECC71; opacity: 0.85; }
.gds-tangram .piece-5 { fill: #3498DB; opacity: 0.85; }
.gds-tangram .piece-6 { fill: #9B59B6; opacity: 0.85; }
.gds-tangram .piece-7 { fill: #1ABC9C; opacity: 0.85; }

.gds-tangram .piece-border {
  fill: none;
  stroke: rgba(255,255,255,0.3);
  stroke-width: 0.5;
}

/* ---------- 四兽文字 ---------- */
.gds-tangram .symbol-text {
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  fill: #fff;
  text-shadow: 0 0 4px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* 四兽各自颜色 */
.gds-tangram .symbol-zhuque { fill: #E74C3C; }  /* 朱雀·红 */
.gds-tangram .symbol-xuanwu { fill: #8E44AD; }   /* 玄武·紫 */
.gds-tangram .symbol-qinglong { fill: #2ECC71; } /* 青龙·绿 */
.gds-tangram .symbol-baihu { fill: #ECF0F1; }    /* 白虎·白 */

/* ---------- 廿八宿文字 ---------- */
.gds-tangram .mansion-text {
  font-size: 5px;
  font-weight: 400;
  text-anchor: middle;
  dominant-baseline: central;
  fill: rgba(255,255,255,0.9);
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* 方向标签 */
.gds-tangram .direction-label {
  font-size: 7px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
  fill: rgba(255,255,255,0.6);
  pointer-events: none;
}

/* ---------- 右侧七巧板变体（镜像或颜色变化） ---------- */
.gds-tangram--right .piece-1 { fill: #2980B9; opacity: 0.85; }
.gds-tangram--right .piece-2 { fill: #27AE60; opacity: 0.85; }
.gds-tangram--right .piece-3 { fill: #D35400; opacity: 0.85; }
.gds-tangram--right .piece-4 { fill: #C0392B; opacity: 0.85; }
.gds-tangram--right .piece-5 { fill: #8E44AD; opacity: 0.85; }
.gds-tangram--right .piece-6 { fill: #16A085; opacity: 0.85; }
.gds-tangram--right .piece-7 { fill: #F39C12; opacity: 0.85; }

/* ============================================
 * 四兽面板 + 四兽图片（九宫格四周）
 * ============================================ */

/* ---------- 四兽文字面板（搜索栏下方左侧） ---------- */
.gds-beast-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  margin: 0 auto 8px auto;
  max-width: 700px;
  background: rgba(10, 12, 30, 0.6);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, max-height 0.4s ease;
  max-height: 0;
  overflow: hidden;
}

.gds-beast-panel.active {
  opacity: 1;
  visibility: visible;
  max-height: 80px;
}

.gds-beast-panel-title {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 700;
  color: #D4A843;
  white-space: nowrap;
  letter-spacing: 0.12em;
  padding-right: 12px;
  border-right: 1px solid rgba(212, 168, 67, 0.2);
}

.gds-beast-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
}

.gds-beast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gds-beast-name {
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
  font-weight: 600;
  color: #e8ddd0;
  font-size: 0.75rem;
}

.gds-beast-dir {
  font-size: 0.6rem;
  color: rgba(200, 208, 224, 0.5);
}

/* ---------- 四兽图片（九宫格四方位） ---------- */
.gds-beast-img {
  position: absolute;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  overflow: hidden;
}

.gds-beast-img svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gds-beast-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: 'KaiTi', 'STKaiti', '楷体', serif;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
}

.gds-beast-img.active {
  opacity: 0.85;
  visibility: visible;
}

/* 朱雀（上方） */
.gds-beast-img--top {
  left: 50%;
  top: -50px;
  transform: translateX(-50%) scale(0.45);
  width: 100px;
  height: 100px;
}

.gds-beast-img--top.active {
  transform: translateX(-50%) scale(0.65);
}

/* 玄武（下方） */
.gds-beast-img--bottom {
  left: 50%;
  bottom: -50px;
  transform: translateX(-50%) scale(0.45);
  width: 100px;
  height: 100px;
}

.gds-beast-img--bottom.active {
  transform: translateX(-50%) scale(0.65);
}

/* 青龙（左方） */
.gds-beast-img--left {
  top: 50%;
  left: -50px;
  transform: translateY(-50%) scale(0.45);
  width: 90px;
  height: 90px;
}

.gds-beast-img--left.active {
  transform: translateY(-50%) scale(0.65);
}

/* 白虎（右方） */
.gds-beast-img--right {
  top: 50%;
  right: -50px;
  transform: translateY(-50%) scale(0.45);
  width: 90px;
  height: 90px;
}

.gds-beast-img--right.active {
  transform: translateY(-50%) scale(0.65);
}

/* ---------- 昼夜模式适配 ---------- */
[data-theme="light"] .gds-beast-panel {
  background: rgba(250, 246, 238, 0.85);
  border-color: rgba(192, 168, 106, 0.3);
}

[data-theme="light"] .gds-beast-panel-title {
  color: #8B6914;
}

[data-theme="light"] .gds-beast-name {
  color: #2c2416;
}

[data-theme="light"] .gds-beast-dir {
  color: rgba(80, 70, 50, 0.5);
}

[data-theme="light"] .gds-tangram .symbol-text {
  text-shadow: 0 0 4px rgba(0,0,0,0.3);
}

[data-theme="light"] .gds-tangram .mansion-text {
  text-shadow: 0 0 2px rgba(0,0,0,0.3);
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  .gds-carousel-wrap {
    max-width: 100%;
  }
  .gds-tangram {
    width: 50px;
    height: 50px;
  }
  .gds-tangram--left {
    margin-right: 4px;
  }
  .gds-tangram--right {
    margin-left: 4px;
  }
  .gds-tangram .symbol-text {
    font-size: 6px;
  }
  .gds-tangram .mansion-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .gds-tangram {
    width: 40px;
    height: 40px;
  }
  .gds-tangram--left {
    margin-right: 2px;
  }
  .gds-tangram--right {
    margin-left: 2px;
  }
  .gds-tangram .symbol-text {
    font-size: 5px;
  }
}