/* ============================================================
   趣味与互动引擎 · fun-portal.css  v1.0.0
   站点：zgdgt.cn  祝刚 · 数字文旅
   特性：深色现代文旅国潮风，零外部依赖，极速加载，移动端全适配
   ============================================================ */

:root {
  --fp-primary: #2dd4bf;
  --fp-primary-dark: #14b8a6;
  --fp-accent: #f0b35e;
  --fp-accent-glow: rgba(240, 179, 94, 0.4);
  --fp-glow: #22d3ee;
  --fp-bg: #070d18;
  --fp-card: #0d1830;
  --fp-soft: #0e1d38;
  --fp-ink: #dbe7f4;
  --fp-muted: #8ba0b8;
  --fp-line: rgba(34, 211, 238, 0.18);
  --fp-gold: #fbbf24;
}

/* 悬浮入口触发器 (左下角，避开右下角 HUD) */
.fp-launcher {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 99980;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(13, 24, 48, 0.95), rgba(7, 13, 24, 0.95));
  border: 1px solid var(--fp-line);
  border-radius: 999px;
  color: var(--fp-ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(45, 212, 191, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.fp-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--fp-primary);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(45, 212, 191, 0.4);
}
.fp-launcher:active {
  transform: translateY(0) scale(0.98);
}
.fp-launcher-icon {
  font-size: 18px;
  animation: fp-float 2.4s ease-in-out infinite;
  display: inline-block;
}
@keyframes fp-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}
.fp-launcher-tag {
  background: linear-gradient(135deg, var(--fp-accent), #f59e0b);
  color: #1a0f02;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 模态遮罩与主容器 */
.fp-overlay {
  position: fixed;
  inset: 0;
  z-index: 99995;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.fp-overlay.fp-active {
  opacity: 1;
  pointer-events: auto;
}
.fp-modal {
  background: linear-gradient(170deg, #0d1b33 0%, #081122 100%);
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(34, 211, 238, 0.15);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--fp-ink);
}
.fp-overlay.fp-active .fp-modal {
  transform: scale(1) translateY(0);
}

/* 弹窗头部 */
.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fp-line);
  background: rgba(13, 24, 48, 0.5);
}
.fp-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.fp-header-title span.badge {
  background: rgba(45, 212, 191, 0.15);
  color: var(--fp-primary);
  border: 1px solid rgba(45, 212, 191, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.fp-close-btn {
  background: transparent;
  border: none;
  color: var(--fp-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 8px;
  transition: all 0.2s;
}
.fp-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* 选项卡导航 */
.fp-tabs {
  display: flex;
  padding: 8px 16px 0;
  gap: 6px;
  border-bottom: 1px solid var(--fp-line);
  background: rgba(7, 13, 24, 0.4);
  overflow-x: auto;
  scrollbar-width: none;
}
.fp-tabs::-webkit-scrollbar {
  display: none;
}
.fp-tab-btn {
  background: transparent;
  border: none;
  color: var(--fp-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.fp-tab-btn:hover {
  color: var(--fp-ink);
  background: rgba(45, 212, 191, 0.05);
}
.fp-tab-btn.active {
  color: var(--fp-primary);
  border-bottom-color: var(--fp-primary);
  background: rgba(45, 212, 191, 0.1);
}

/* 选项卡内容区 */
.fp-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.fp-pane {
  display: none;
  animation: fp-fade-in 0.25s ease forwards;
}
.fp-pane.active {
  display: block;
}
@keyframes fp-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Tab 1: 文旅灵感抽签 ========== */
.fp-fortune-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.fp-tube-wrap {
  position: relative;
  width: 140px;
  height: 180px;
  margin: 10px auto 18px;
  cursor: pointer;
  perspective: 600px;
}
.fp-tube {
  width: 100px;
  height: 140px;
  margin: 40px auto 0;
  background: linear-gradient(135deg, #a16207 0%, #78350f 45%, #451a03 100%);
  border-radius: 12px 12px 24px 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(253, 224, 71, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d97706;
  transform-origin: bottom center;
  transition: transform 0.15s ease;
}
.fp-tube::before {
  content: "黔中靈簽";
  writing-mode: vertical-rl;
  color: #fef08a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  opacity: 0.9;
}
/* 露出的签 */
.fp-stick {
  position: absolute;
  top: -32px;
  width: 12px;
  height: 60px;
  background: linear-gradient(to right, #fde047, #ca8a04);
  border-radius: 4px 4px 0 0;
  border: 1px solid #a16207;
  transition: transform 0.25s ease;
}
.fp-stick:nth-child(1) { left: 32px; transform: rotate(-8deg); }
.fp-stick:nth-child(2) { left: 45px; transform: rotate(2deg) translateY(-8px); }
.fp-stick:nth-child(3) { left: 58px; transform: rotate(10deg); }

/* 摇签动画 */
.fp-shaking .fp-tube {
  animation: fp-tube-shake 0.8s ease-in-out infinite;
}
@keyframes fp-tube-shake {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg) translateY(-8px); }
  40% { transform: rotate(12deg) translateY(-4px); }
  60% { transform: rotate(-8deg) translateY(-6px); }
  80% { transform: rotate(8deg) translateY(-2px); }
  100% { transform: rotate(0deg); }
}

.fp-btn-primary {
  background: linear-gradient(135deg, #2dd4bf 0%, #06b6d4 100%);
  color: #042f2e;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3);
  transition: all 0.2s;
}
.fp-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.45);
}
.fp-btn-secondary {
  background: rgba(30, 41, 59, 0.7);
  color: var(--fp-ink);
  border: 1px solid var(--fp-line);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.fp-btn-secondary:hover {
  background: rgba(45, 212, 191, 0.15);
  border-color: var(--fp-primary);
}

/* 抽签结果卡片 */
.fp-card-result {
  background: linear-gradient(160deg, #13223f 0%, #091326 100%);
  border: 1px solid rgba(240, 179, 94, 0.35);
  border-radius: 16px;
  padding: 22px;
  margin-top: 16px;
  width: 100%;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(240, 179, 94, 0.12);
  position: relative;
  overflow: hidden;
  animation: fp-card-reveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes fp-card-reveal {
  0% { transform: scale(0.9) translateY(15px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.fp-card-result::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(240, 179, 94, 0.2) 0%, transparent 70%);
}
.fp-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.fp-card-badge {
  background: rgba(240, 179, 94, 0.15);
  color: var(--fp-accent);
  border: 1px solid rgba(240, 179, 94, 0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}
.fp-card-xp {
  font-size: 12px;
  color: var(--fp-primary);
  font-weight: 600;
}
.fp-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.fp-card-poem {
  font-size: 14.5px;
  line-height: 1.6;
  color: #fef08a;
  font-style: italic;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--fp-accent);
}
.fp-card-desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--fp-muted);
  margin-bottom: 16px;
}
.fp-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== Tab 2: 随机漫游传送门 ========== */
.fp-portal-box {
  text-align: center;
}
.fp-compass-wrap {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 10px auto 20px;
}
.fp-compass {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(45, 212, 191, 0.4);
  background: radial-gradient(circle, rgba(13, 24, 48, 0.9) 0%, rgba(7, 13, 24, 0.95) 75%);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 3s cubic-bezier(0.12, 0.8, 0.32, 1);
}
.fp-compass-needle {
  width: 6px;
  height: 80px;
  background: linear-gradient(to bottom, #ef4444 50%, #38bdf8 50%);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  transform-origin: center;
}
.fp-compass-center {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #f0b35e;
  border-radius: 50%;
  border: 3px solid #0d1830;
  box-shadow: 0 0 8px rgba(240, 179, 94, 0.8);
}
.fp-portal-dest {
  background: rgba(13, 24, 48, 0.7);
  border: 1px solid var(--fp-line);
  border-radius: 14px;
  padding: 18px;
  text-align: left;
  margin-top: 14px;
}
.fp-portal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fp-portal-desc {
  font-size: 13px;
  color: var(--fp-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* ========== Tab 3: 声景伴读播放器 ========== */
.fp-audio-box {
  background: rgba(13, 24, 48, 0.75);
  border: 1px solid var(--fp-line);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
.fp-wave-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
  margin: 16px 0;
}
.fp-wave-bar {
  width: 4px;
  height: 12px;
  background: var(--fp-primary);
  border-radius: 2px;
  transition: height 0.15s ease;
}
.fp-audio-playing .fp-wave-bar {
  animation: fp-wave-jump 0.8s ease-in-out infinite alternate;
}
.fp-wave-bar:nth-child(2) { animation-delay: 0.15s; }
.fp-wave-bar:nth-child(3) { animation-delay: 0.3s; }
.fp-wave-bar:nth-child(4) { animation-delay: 0.45s; }
.fp-wave-bar:nth-child(5) { animation-delay: 0.6s; }
.fp-wave-bar:nth-child(6) { animation-delay: 0.25s; }
.fp-wave-bar:nth-child(7) { animation-delay: 0.4s; }
.fp-wave-bar:nth-child(8) { animation-delay: 0.55s; }

@keyframes fp-wave-jump {
  0% { height: 8px; opacity: 0.4; }
  100% { height: 42px; opacity: 1; background: var(--fp-glow); }
}

.fp-sound-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.fp-sound-btn {
  background: rgba(11, 20, 36, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 8px;
  color: var(--fp-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.fp-sound-btn.active {
  border-color: var(--fp-primary);
  background: rgba(45, 212, 191, 0.12);
  color: #fff;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.2);
}
.fp-sound-btn span.emoji {
  font-size: 18px;
}
.fp-timer-wrap {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--fp-muted);
}
.fp-timer-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fp-muted);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
}
.fp-timer-btn.active {
  color: var(--fp-accent);
  border-color: var(--fp-accent);
  background: rgba(240, 179, 94, 0.12);
}

/* ========== Tab 4: 穿越测试卡片 ========== */
.fp-persona-teaser {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.3) 0%, rgba(13, 24, 48, 0.8) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
}
.fp-persona-teaser h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
}
.fp-persona-teaser p {
  font-size: 13px;
  color: var(--fp-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.fp-archetypes-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.fp-arch-tag {
  background: rgba(255, 255, 255, 0.07);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #e9d5ff;
}

/* 底部开关选项 */
.fp-footer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(7, 13, 24, 0.6);
  border-top: 1px solid var(--fp-line);
  font-size: 12px;
  color: var(--fp-muted);
}
.fp-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.fp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.fp-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  transition: 0.3s;
}
.fp-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}
.fp-switch input:checked + .fp-slider {
  background-color: var(--fp-primary);
}
.fp-switch input:checked + .fp-slider:before {
  transform: translateX(16px);
}

/* 彩蛋弹窗 */
.fp-egg-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(3, 7, 18, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(12px);
}
.fp-egg-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  border: 2px solid #fbbf24;
  border-radius: 24px;
  padding: 32px;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(251, 191, 36, 0.35);
  animation: fp-card-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #fff;
}
.fp-egg-badge {
  display: inline-block;
  background: #fbbf24;
  color: #1e1b4b;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.fp-egg-card h2 {
  font-size: 22px;
  margin-bottom: 12px;
  color: #fef08a;
}
.fp-egg-card p {
  font-size: 14px;
  line-height: 1.7;
  color: #e2e8f0;
  margin-bottom: 24px;
}

/* 粒子画布 */
#fp-fireworks-canvas {
  position: fixed;
  inset: 0;
  z-index: 99998;
  pointer-events: none;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .fp-launcher {
    left: 14px;
    bottom: 14px;
    padding: 8px 14px;
    font-size: 12.5px;
  }
  .fp-modal {
    max-height: 85vh;
  }
  .fp-sound-selector {
    grid-template-columns: 1fr;
  }
}
