/* ===== 友站宇宙：網絡圖元件（可單獨嵌入任何主題） ===== */
.fu-u {
  --fu-bg: #020617;
  position: relative;
  width: 100%;
  height: min(72vh, 640px);
  min-height: 320px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(ellipse at 75% 80%, rgba(236, 72, 153, 0.14), transparent 50%),
    radial-gradient(ellipse at center, #0b1033 0%, var(--fu-bg) 70%);
  color: #e2e8f0;
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  touch-action: none;
  user-select: none;
}
.fu-u-canvas { display: block; cursor: grab; }
.fu-u-canvas:active { cursor: grabbing; }
.fu-u-stats {
  position: absolute; top: 14px; left: 14px;
  display: flex; gap: 8px; flex-wrap: wrap; max-width: calc(100% - 80px);
  pointer-events: none;
}
.fu-u-stat {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 6px 12px; border-radius: 12px;
  background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(6px);
}
.fu-u-stat b { font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; color: #f8fafc; }
.fu-u-stat span { font-size: 11px; color: #94a3b8; }
.fu-u-legend {
  position: absolute; left: 14px; bottom: 12px;
  display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #cbd5e1;
  pointer-events: none;
}
.fu-u-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fu-u-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }
.fu-u-legend i.fu-u-dot { width: 6px; height: 6px; }
.fu-u-controls {
  position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px;
}
.fu-u-controls button {
  width: 34px; height: 34px; border-radius: 10px; font-size: 18px; line-height: 1;
  color: #e2e8f0; background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25); cursor: pointer;
}
.fu-u-controls button:hover { background: rgba(51, 65, 85, 0.8); }
.fu-u-controls button:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
.fu-u-tooltip {
  position: absolute; left: 0; top: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 2px;
  max-width: 260px; padding: 8px 12px; border-radius: 10px;
  background: rgba(15, 23, 42, 0.92); border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 13px; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.fu-u-tooltip[hidden] { display: none; }
.fu-u-tip-host { color: #94a3b8; font-size: 12px; }
.fu-u-tip-status { color: #5eead4; font-size: 12px; }
.fu-u-status {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #94a3b8; font-size: 14px; pointer-events: none;
}
.fu-u-status[hidden] { display: none; }

/* ===== 內建的 /friends 頁面 ===== */
.fu-page {
  --fu-text: #e2e8f0;
  --fu-muted: #94a3b8;
  --fu-card: rgba(15, 23, 42, 0.72);
  --fu-border: rgba(148, 163, 184, 0.18);
  --fu-accent: #5eead4;
  margin: 0;
  min-height: 100vh;
  background: #020617 radial-gradient(ellipse at top, #111a44 0%, #020617 60%) no-repeat;
  color: var(--fu-text);
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
}
.fu-page *, .fu-page *::before, .fu-page *::after { box-sizing: border-box; }
.fu-page a { color: inherit; }
.fu-hero { max-width: 1120px; margin: 0 auto; padding: 32px 16px 20px; }
.fu-back { font-size: 14px; color: var(--fu-muted); text-decoration: none; }
.fu-back:hover { color: var(--fu-text); }
.fu-hero h1 {
  margin: 12px 0 6px; font-size: clamp(28px, 5vw, 44px); letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fde68a, #5eead4 50%, #c4b5fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fu-hero p { margin: 0; color: var(--fu-muted); }
.fu-main { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.fu-card {
  background: var(--fu-card); border: 1px solid var(--fu-border); border-radius: 18px; padding: 20px;
}
.fu-universe-card { padding: 0; overflow: hidden; }
.fu-section { margin-top: 40px; }
.fu-section h2 { margin: 0; font-size: 22px; }
.fu-section h3 { margin: 24px 0 12px; font-size: 15px; color: var(--fu-muted); font-weight: 600; }
.fu-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.fu-filter { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--fu-card); border: 1px solid var(--fu-border); }
.fu-filter button {
  border: 0; background: transparent; color: var(--fu-muted); padding: 6px 14px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 14px;
}
.fu-filter button.is-active { background: rgba(94, 234, 212, 0.14); color: var(--fu-accent); }
.fu-empty { color: var(--fu-muted); }
.fu-list {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.fu-friend[hidden], .fu-group[hidden] { display: none; }
.fu-friend a {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 12px 14px; border-radius: 14px; text-decoration: none;
  background: var(--fu-card); border: 1px solid var(--fu-border);
  transition: transform .15s ease, border-color .15s ease;
}
.fu-friend a:hover { transform: translateY(-2px); border-color: rgba(94, 234, 212, 0.45); }
.fu-avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: #1e293b; color: var(--fu-accent); font-weight: 700;
}
.fu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fu-friend-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.fu-friend-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-friend-desc {
  font-size: 13px; color: var(--fu-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fu-badge { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; color: #94a3b8; }
.fu-badge.is-found { color: #5eead4; }
.fu-badge.is-missing { color: #f0abfc; }
.fu-join-grid { display: grid; gap: 16px; margin-top: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.fu-join h3 { margin-top: 0; color: var(--fu-text); }
.fu-siteinfo { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 16px; font-size: 14px; }
.fu-siteinfo dt { color: var(--fu-muted); }
.fu-siteinfo dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.fu-siteinfo code { font-size: 13px; }
.fu-hint { font-size: 13px; color: var(--fu-muted); margin-bottom: 0; }
.fu-form { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.fu-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--fu-muted); }
.fu-form input {
  font: inherit; font-size: 14px; color: var(--fu-text);
  background: rgba(2, 6, 23, 0.6); border: 1px solid var(--fu-border); border-radius: 10px; padding: 8px 10px;
}
.fu-form input:focus { outline: 2px solid rgba(94, 234, 212, 0.5); outline-offset: 0; border-color: transparent; }
.fu-span { grid-column: 1 / -1; }
.fu-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.fu-form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fu-form-result { margin: 0; font-size: 14px; color: var(--fu-accent); }
.fu-form-result.is-error { color: #fda4af; }
.fu-button {
  font: inherit; font-weight: 600; cursor: pointer; padding: 9px 18px; border-radius: 10px; border: 0;
  color: #042f2e; background: linear-gradient(90deg, #5eead4, #a5b4fc);
}
.fu-button:disabled { opacity: .6; cursor: progress; }
.fu-button-ghost { color: var(--fu-text); background: transparent; border: 1px solid var(--fu-border); }
.fu-footer { text-align: center; padding: 24px 16px 40px; color: #475569; font-size: 13px; }
@media (max-width: 760px) {
  .fu-join-grid, .fu-form { grid-template-columns: 1fr; }
  .fu-u { height: 70vh; border-radius: 0; }
  .fu-universe-card { border-radius: 14px; }
}
