/* ==========================================
   TyaimL Linktree - 頂級暗黑霓虹與動態特效樣式表
   ========================================== */

:root {
  --bg-dark: #080c14;
  --card-bg: rgba(16, 22, 36, 0.75);
  --card-border: rgba(255, 255, 255, 0.1);
  --neon-cyan: #00d2ff;
  --neon-purple: #9d4edd;
  --neon-magenta: #f72585;
  --neon-gold: #ffb703;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* 🌌 動態深空環境背景光暈 */
body::before {
  content: "";
  position: fixed;
  top: -20%;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.12) 0%, rgba(157, 78, 221, 0.08) 40%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -2;
  animation: ambientFloat 18s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  bottom: -10%;
  right: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(247, 37, 133, 0.1) 0%, rgba(0, 210, 255, 0.06) 50%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: -2;
  animation: ambientFloat 22s ease-in-out infinite alternate-reverse;
}

@keyframes ambientFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.15); }
  100% { transform: translate(-40px, 50px) scale(0.95); }
}

/* 🌠 全域粒子畫布 (滑鼠游標拖尾) */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* 🌠 流星容器 */
.meteor-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.meteor {
  position: absolute;
  width: 2px;
  height: 90px;
  background: linear-gradient(45deg, #00d2ff, rgba(255, 255, 255, 0.9), transparent);
  opacity: 0.85;
  transform: rotate(45deg);
  animation: meteorMove 1.4s linear forwards;
  filter: drop-shadow(0 0 6px #00d2ff);
}

@keyframes meteorMove {
  0% { opacity: 0; transform: translate(0, 0) rotate(45deg); }
  25% { opacity: 1; }
  100% { transform: translate(-800px, 800px) rotate(45deg); opacity: 0; }
}

/* 🌟 星星閃爍 */
.twinkle-star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  animation: twinkleAnim 1.6s ease-out forwards;
}

@keyframes twinkleAnim {
  0% { opacity: 0; transform: scale(0.4); box-shadow: 0 0 0 transparent; }
  50% { opacity: 1; transform: scale(1.8); box-shadow: 0 0 12px currentColor; }
  100% { opacity: 0; transform: scale(0.6); box-shadow: 0 0 0 transparent; }
}

/* 🌌 主版面佈局容器 */
.linktree-main {
  flex: 1;
  padding: 100px 20px 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}

.linktree-container {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

/* 🔗 右上角一鍵分享按鈕 */
.share-action-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.share-btn:hover {
  background: rgba(0, 210, 255, 0.18);
  border-color: var(--neon-cyan);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.share-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* 👤 品牌 Profile Header 區塊 */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(16, 22, 36, 0.75);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease-out;
}

/* 頭像光環包裹器 */
.avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
}

.avatar-glow-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--neon-cyan), var(--neon-purple), var(--neon-magenta), var(--neon-cyan));
  animation: spinRing 6s linear infinite;
  filter: blur(4px);
  opacity: 0.85;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.avatar-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0d1322;
  border: 2px solid rgba(255, 255, 255, 0.9);
  z-index: 1;
}

/* 官方認證打勾小徽章 */
.verified-badge {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #00d2ff, #0077ff);
  border: 2px solid #0b0f19;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  z-index: 2;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
}

/* 標題與全像流光 */
.profile-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.profile-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #fff 0%, #00d2ff 40%, #ff80df 80%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: holographicShine 5s linear infinite;
}

@keyframes holographicShine {
  to { background-position: 200% center; }
}

.profile-bio {
  margin: 0 0 16px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
}

/* 標籤群組 */
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tag-badge:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  background: rgba(0, 210, 255, 0.12);
}

/* 🎴 連結卡片列表 */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* 單張 3D 懸浮與聚光燈卡片 */
.link-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
  --brand-color: #00d2ff;
  --brand-glow: rgba(0, 210, 255, 0.25);

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--text-main);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
  transform-style: preserve-3d;
  transition: transform 0.22s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.4);
}

/* 游標跟隨動態聚光燈層 */
.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle 220px at var(--mouse-x) var(--mouse-y),
    var(--brand-glow),
    transparent 80%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.link-card:hover::before {
  opacity: 1;
}

.link-card:hover {
  border-color: var(--brand-color);
  box-shadow: 0 15px 35px -5px var(--brand-glow), 0 0 15px 0 var(--brand-glow);
}

/* 卡片品牌主題色調設定 */
.card-youtube {
  --brand-color: #ff0033;
  --brand-glow: rgba(255, 0, 51, 0.25);
}
.card-discord {
  --brand-color: #5865f2;
  --brand-glow: rgba(88, 101, 242, 0.28);
}
.card-instagram {
  --brand-color: #e1306c;
  --brand-glow: rgba(225, 48, 108, 0.28);
}
.card-sq {
  --brand-color: #00d2ff;
  --brand-glow: rgba(0, 210, 255, 0.28);
}
.card-sponsor {
  --brand-color: #ffb703;
  --brand-glow: rgba(255, 183, 3, 0.28);
}
.card-website {
  --brand-color: #a855f7;
  --brand-glow: rgba(168, 85, 247, 0.28);
}

/* 卡片內部佈局 */
.card-left {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

/* 圖示包裝器 */
.card-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s, border-color 0.3s;
}

.card-icon-box svg {
  width: 24px;
  height: 24px;
  fill: var(--brand-color);
  transition: transform 0.3s ease;
}

.link-card:hover .card-icon-box {
  transform: scale(1.1) rotate(-4deg);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--brand-color);
  box-shadow: 0 0 18px var(--brand-glow);
}

/* 卡片文字區域 */
.card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* 卡片右側箭頭/動作標籤 */
.card-right {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.card-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.3s ease;
}

.link-card:hover .card-arrow {
  background: var(--brand-color);
  border-color: var(--brand-color);
  color: #fff;
  transform: translateX(4px) scale(1.08);
  box-shadow: 0 0 14px var(--brand-glow);
}

/* 🍞 Toast 複製提示 */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 10px 30px rgba(0, 210, 255, 0.35);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 🦶 頁尾版權 */
footer {
  background: transparent;
  color: #64748b;
  text-align: center;
  padding: 24px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 1;
}

/* 📱 RWD 響應式優化 (手機/平板) */
@media (max-width: 640px) {
  .linktree-main {
    padding: 85px 16px 40px 16px;
  }

  .profile-card {
    padding: 24px 16px;
  }

  .profile-title {
    font-size: 1.55rem;
  }

  .link-card {
    padding: 14px 16px;
  }

  .card-icon-box {
    width: 42px;
    height: 42px;
  }

  .card-icon-box svg {
    width: 20px;
    height: 20px;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .card-desc {
    font-size: 0.76rem;
  }
}
