/* @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;700&display=swap'); */

:root {
  --bg-gradient: radial-gradient(circle at center, #f8fafc 0%, #cbd5e1 100%);
  --text-color: #1e293b;

  --sand-color: #d97706;
  --chlorine-color: #10b981;
  --bacteria-color: #e11d48;

  --filter-pp: #f8fafc;
  --filter-carbon: #334155;
  --filter-ro: #0ea5e9;
  --filter-carbon-post: #0f172a;
}

/* * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            width: 100vw;
            height: 100vh;
            background-color: #050505;
            display: flex;
            justify-content: center;
            align-items: center;
            font-family: 'Noto Sans SC', sans-serif;
            overflow: hidden;
        } */

/* 16:9 电影画幅容器 */
#cinema-container {
  width: 100vw;
  height: 56.25vw;
  max-height: 100vh;
  /* max-width: 177.78vh; */
  background: var(--bg-gradient);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(255, 255, 255, 0.05);
}

.cinematic-bar {
  position: absolute;
  width: 100%;
  height: 8%;
  /* background: #000; */
  z-index: 90;
}
.cinematic-bar.top {
  top: 0;
}
.cinematic-bar.bottom {
  bottom: 0;
}

/* 字幕区域 */
#subtitle-container {
  position: absolute;
  bottom: 11%;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  text-align: center;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.subtitle-zh {
  font-size: 2vw;
  font-weight: 700;
  color: #0f172a;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.9),
    0 0 5px rgba(255, 255, 255, 1);
  letter-spacing: 2px;
}

.subtitle-en {
  font-size: 1.1vw;
  font-weight: 400;
  color: #475569;
  text-shadow: 0 1px 5px rgba(255, 255, 255, 0.8);
  letter-spacing: 1px;
}

/* 场景元素 */
.scene {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
}

/* 场景 1: 水滴与微观世界 */
#scene-intro {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.main-drop {
  width: 15vw;
  height: 15vw;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  box-shadow: inset 10px 20px 30px rgba(100, 116, 139, 0.2),
    10px 10px 20px rgba(100, 116, 139, 0.1),
    inset -10px -20px 30px rgba(255, 255, 255, 0.8);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.micro-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
}

/* 场景 2: 净化管道 */
.filter-station {
  position: absolute;
  top: 35%;
  width: 10vw;
  height: 25vw;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30; /* 提高层级 */
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.3s ease;
}

.filter-station:hover {
  transform: translateY(-5px) scale(1.02);
  z-index: 50;
}

/* Tooltip 提示框 */
.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 1vw;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100; /* 确保悬浮窗在最上层 */
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.filter-station:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tooltip-title {
  font-weight: bold;
  color: #38bdf8;
  margin-bottom: 5px;
  font-size: 1.1vw;
}

.filter-label {
  position: absolute;
  top: -20%;
  font-size: 1.1vw;
  font-weight: bold;
  color: var(--text-color);
  text-align: center;
  background: rgba(255, 255, 255, 0.85);
  padding: 5px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  pointer-events: none;
  z-index: 10;
}

/* 滤芯材质样式 */
.f-pp {
  left: 12vw;
  background: repeating-linear-gradient(
    90deg,
    var(--filter-pp),
    var(--filter-pp) 10px,
    #e2e8f0 10px,
    #e2e8f0 12px
  );
}

.f-carbon-pre {
  left: 32vw;
  background: var(--filter-carbon);
  background-image: radial-gradient(#475569 15%, transparent 16%),
    radial-gradient(#475569 15%, transparent 16%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
  border-color: #1e293b;
}

/* 修复 RO 膜样式：使用伪元素做条纹背景，避免 overflow:hidden 裁切弹窗 */
.f-ro {
  left: 52vw;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
  border-color: #bae6fd;
}
.f-ro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.3) 2px,
    rgba(255, 255, 255, 0.3) 4px
  );
  z-index: 0;
  pointer-events: none;
}

.f-carbon-post {
  left: 72vw;
  background: var(--filter-carbon-post);
  background-image: linear-gradient(
      135deg,
      rgba(6, 182, 212, 0.2) 0%,
      transparent 100%
    ),
    radial-gradient(#1e293b 15%, transparent 16%);
  background-size: 100% 100%, 8px 8px;
  border-color: #06b6d4;
  box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.3);
}

/* 管道连接线 */
.pipe-line {
  position: absolute;
  height: 4vw;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.3);
  border-top: 2px solid rgba(255, 255, 255, 0.9);
  border-bottom: 2px solid rgba(255, 255, 255, 0.9);
  z-index: 10;
  backdrop-filter: blur(2px);
  overflow: hidden;
}

/* 给每段管道加上背景色，体现水质变化 */
.pipe-line.p1 {
  background: rgba(148, 163, 184, 0.4);
} /* 浑浊 */
.pipe-line.p2 {
  background: rgba(186, 230, 253, 0.4);
} /* 浅蓝 */
.pipe-line.p3 {
  background: rgba(56, 189, 248, 0.4);
} /* 天蓝 */
.pipe-line.p4 {
  background: rgba(14, 165, 233, 0.4);
} /* 纯净蓝 */
.pipe-line.p5 {
  background: rgba(6, 182, 212, 0.4);
} /* 清甜青 */

.pipe-flow {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg width="40" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M 12 5 L 22 10 L 12 15" fill="none" stroke="rgba(255,255,255,0.5)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: repeat-x;
  background-position: 0 center;
  animation: flowArrows 1.5s linear infinite;
  opacity: 0.8;
}
@keyframes flowArrows {
  from {
    background-position: 0 center;
  }
  to {
    background-position: 40px center;
  }
}

/* 废弃水管 */
.waste-pipe {
  position: absolute;
  width: 3vw;
  height: 12vw;
  background: rgba(255, 255, 255, 0.3);
  border-left: 2px solid rgba(255, 255, 255, 0.8);
  border-right: 2px solid rgba(255, 255, 255, 0.8);
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

/* 粒子统一样式 */
.particle {
  position: absolute;
  border-radius: 50%;
  z-index: 15;
  pointer-events: none;
}

/* 杂质粒子 */
.p-sand {
  width: 1.5vw;
  height: 1.5vw;
  background: var(--sand-color);
  border-radius: 3px;
  transform: rotate(45deg);
  box-shadow: 0 0 5px rgba(217, 119, 6, 0.5);
}
.p-chlorine {
  width: 1vw;
  height: 1vw;
  background: var(--chlorine-color);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  box-shadow: 0 0 8px var(--chlorine-color);
}
.p-bacteria {
  width: 1.2vw;
  height: 1.2vw;
  background: var(--bacteria-color);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

/* 纯水杯 */
.glass-container {
  position: absolute;
  right: 3%;
  top: 35%;
  width: 10vw;
  height: 14vw;
  opacity: 0;
  z-index: 20;
}
.glass {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 255, 255, 0.8);
  border-top: none;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.5)
  );
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.glass-water {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: rgba(6, 182, 212, 0.5);
  box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.8);
  transition: background 1s;
}

/* 环境光 */
.ambient-light {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  opacity: 0.5;
}
