/* ─── CSS 变量 ─────────────────────────────────────────────────────────────── */
:root {
  --bg-primary: #060a14;
  --bg-secondary: #0d1525;
  --bg-glass: rgba(15, 20, 35, 0.85);
  --bg-glass-hover: rgba(15, 20, 35, 0.9);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hover: rgba(0, 240, 255, 0.4);
  --accent-cyan: #00f0ff;
  --accent-cyan-dim: rgba(0, 240, 255, 0.2);
  --accent-purple: #a855f7;
  --accent-purple-dim: rgba(168, 85, 247, 0.2);
  --accent-green: #00ff88;
  --accent-red: #ff4444;
  --accent-yellow: #ffaa00;
  --accent-blue: #3b82f6;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.55);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --blur-amount: 8px;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── 重置与基础 ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.3);
}

/* ─── 背景层 ─────────────────────────────────────────────────────────────── */
#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 100, 180, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 60%, rgba(100, 0, 180, 0.1) 0%, transparent 60%),
    linear-gradient(135deg, #060a14 0%, #0d1525 50%, #060a14 100%);
  background-attachment: fixed;
}

#bg-layer.has-image {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(6,10,20,0.3) 0%, rgba(6,10,20,0) 30%, rgba(6,10,20,0) 70%, rgba(6,10,20,0.7) 100%),
    radial-gradient(ellipse at center, transparent 0%, rgba(6,10,20,0.4) 100%);
  pointer-events: none;
}

/* ─── 玻璃面板 ───────────────────────────────────────────────────────────── */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ─── 主容器 ─────────────────────────────────────────────────────────────── */
#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  gap: 24px;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  color: var(--accent-cyan);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(0,240,255,0.4)); }
  50%       { filter: drop-shadow(0 0 12px rgba(0,240,255,0.8)); }
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.refresh-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.refresh-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.refresh-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-refresh svg {
  width: 16px;
  height: 16px;
  transition: transform 0.5s ease;
}

.btn-refresh:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.btn-refresh:hover svg {
  transform: rotate(180deg);
}

.btn-refresh.spinning svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── Section ────────────────────────────────────────────────────────────── */
.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.steam-icon, .ts-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.steam-icon svg { fill: #c7d5e0; }
.ts-icon {
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
  border-radius: 4px;
  object-fit: contain;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.page-indicator {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.page-indicator .current-page {
  color: var(--accent-cyan);
  font-weight: 600;
}

.ts-online-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.ts-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-join-ts {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: linear-gradient(135deg, rgba(0,240,255,0.12), rgba(168,85,247,0.12));
  border: 1px solid rgba(0,240,255,0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.btn-join-ts:hover {
  background: linear-gradient(135deg, rgba(0,240,255,0.2), rgba(168,85,247,0.2));
  border-color: rgba(0,240,255,0.4);
  box-shadow: 0 0 16px rgba(0,240,255,0.2), 0 0 8px rgba(168,85,247,0.15);
  transform: translateY(-1px);
}

.btn-join-ts svg {
  transition: transform 0.3s ease;
}

.btn-join-ts:hover svg {
  transform: rotate(45deg);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.online-sep { color: var(--text-muted); }

/* ─── Steam Carousel ─────────────────────────────────────────────────────── */
.steam-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.carousel-btn svg {
  width: 20px;
  height: 20px;
}

.carousel-btn:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.carousel-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.steam-card-wrapper {
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius);
}

.steam-cards-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Steam Card ─────────────────────────────────────────────────────────── */
.steam-card {
  flex: 0 0 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
  padding: 28px;
  border-radius: var(--radius);
  animation: cardFadeIn 0.5s ease-out;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.steam-card-left {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  min-width: 180px;
  transition: all var(--transition);
}

.steam-card:hover .steam-card-left {
  border-color: rgba(0, 240, 255, 0.15);
}

.steam-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}

.steam-avatar {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  border: 2px solid var(--glass-border);
  transition: border-color var(--transition);
}

.steam-status-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.status-online   { background: var(--accent-green); }
.status-offline  { background: var(--text-muted); }
.status-busy     { background: var(--accent-red); }
.status-away     { background: var(--accent-yellow); }
.status-snooze   { background: var(--accent-yellow); }
.status-trade    { background: var(--accent-purple); }
.status-play     { background: var(--accent-cyan); }

.steam-nickname {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  word-break: break-word;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.steam-state-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
}

.state-online  { color: var(--accent-green); background: rgba(0,255,136,0.1); }
.state-offline { color: var(--text-muted);   background: rgba(255,255,255,0.05); }
.state-busy    { color: var(--accent-red);   background: rgba(255,68,68,0.1); }
.state-away    { color: var(--accent-yellow);background: rgba(255,170,0,0.1); }
.state-snooze  { color: var(--accent-yellow);background: rgba(255,170,0,0.1); }
.state-trade   { color: var(--accent-purple);background: rgba(168,85,247,0.1); }
.state-play    { color: var(--accent-cyan);  background: rgba(0,240,255,0.1); }

.steam-friendcode {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-purple);
  background: rgba(168,85,247,0.1);
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 4px;
}

/* Steam 卡片右侧：游戏区 */
.steam-card-right {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 账号信息行 */
.account-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.account-info-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  transition: all var(--transition);
}

.account-info-item:hover {
  background: rgba(0, 240, 255, 0.08);
  color: var(--accent-cyan);
}

.account-info-item.online {
  color: var(--accent-green);
  background: rgba(0, 255, 136, 0.08);
}

.account-info-item .info-icon {
  font-size: 0.85rem;
}

.current-game {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(0,240,255,0.06) 0%, rgba(168,85,247,0.06) 100%);
  border: 1px solid rgba(0,240,255,0.1);
  border-radius: var(--radius-sm);
}

.current-game-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.current-game-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.no-game {
  color: var(--text-secondary);
  font-style: italic;
}

.games-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0 4px;
}

.games-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.game-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.game-item:hover {
  background: var(--bg-glass-hover);
  border-color: rgba(0,240,255,0.15);
  transform: translateY(-1px);
}

.game-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.game-icon-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(0,240,255,0.1), rgba(168,85,247,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.game-info {
  flex: 1;
  min-width: 0;
}

.game-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-top: 2px;
}

.game-rank {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}

/* ─── Page Dots ──────────────────────────────────────────────────────────── */
.page-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px 0;
}

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.page-dot.active {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0,240,255,0.5);
  width: 24px;
  border-radius: 4px;
}

.page-dot:hover:not(.active) {
  background: rgba(255,255,255,0.3);
}

/* ─── TeamSpeak Grid ─────────────────────────────────────────────────────── */
.ts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.ts-server-card {
  grid-column: 1;
  grid-row: 1;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(0,240,255,0.05) 0%, rgba(168,85,247,0.05) 100%);
  border-color: rgba(0,240,255,0.12);
  transition: all var(--transition);
}

.ts-server-card:hover {
  border-color: rgba(0,240,255,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 24px rgba(0,240,255,0.05);
}

.ts-server-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ts-server-name::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: dotPulse 2s ease-in-out infinite;
}

.ts-server-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.ts-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ts-stat-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.ts-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 频道卡片 */
.ts-channels-card {
  grid-column: 2;
  grid-row: 1;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
  max-height: 280px;
  overflow: hidden;
}

.card-subtitle {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.channels-list, .clients-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.channel-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(0,240,255,0.2);
  transition: all var(--transition);
}

.channel-item:hover {
  background: rgba(255,255,255,0.04);
  border-left-color: var(--accent-cyan);
}

.channel-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-icon {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.channel-icon svg {
  width: 14px;
  height: 14px;
}

.channel-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  background: rgba(0,240,255,0.08);
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.channel-count.empty {
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
}

/* 频道内成员列表 */
.channel-members {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 24px;
  border-left: 1px solid rgba(0,255,136,0.15);
  margin-left: 6px;
}

.ch-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--transition);
  cursor: default;
}

.ch-user-row:hover {
  background: rgba(0,255,136,0.05);
}

.ch-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(0,255,136,0.15), rgba(0,240,255,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent-green);
  flex-shrink: 0;
}

.ch-user-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-user-idle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.client-channel {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 在线用户卡片 */
.ts-clients-card {
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 160px;
  max-height: 320px;
  overflow: hidden;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.client-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.client-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(168,85,247,0.2);
  transform: translateY(-1px);
}

.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-cyan-dim), var(--accent-purple-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.client-info {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-idle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.client-id-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}

/* ─── Skeleton / Loading ─────────────────────────────────────────────────── */
.loading-card {
  padding: 28px;
  min-height: 200px;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  margin-bottom: 10px;
}

.skeleton-line.short { width: 40%; }

.shimmer-block {
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  margin-top: 16px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-sep {
  opacity: 0.4;
}

.footer-icp {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-icp:hover {
  color: var(--accent-cyan);
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(16px);
  color: var(--accent-cyan);
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  pointer-events: none;
}

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

/* ─── 响应式 ─────────────────────────────────────────────────────────────── */
@media (min-width: 769px) {
  /* 桌面端：隐藏移动端布局，显示桌面布局 */
  .steam-card .desktop-layout { display: grid; }
  .steam-card .mobile-layout { display: none; }

  /* 桌面端卡片容器 */
  .steam-card .desktop-layout {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto;
    gap: 20px;
    padding: 28px;
    border-radius: var(--radius);
  }

  /* 桌面端左侧 */
  .steam-card .desktop-layout .steam-card-left {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    min-width: 180px;
  }

  /* 桌面端右侧 */
  .steam-card .desktop-layout .steam-card-right {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  #app { padding: 12px; gap: 16px; }

  .header {
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  .site-title { font-size: 1.1rem; }

  /* Steam 轮播：横向切换，每次只显示一张 */
  .steam-carousel-container {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .steam-card-wrapper {
    flex: 1;
    width: 100%;
    overflow: hidden;
    position: relative;
  }

  .steam-cards-track {
    display: flex;
    flex-direction: row;
    width: 100%;
    will-change: transform;
  }

  /* Steam 卡片：每张占满容器宽度 */
  .steam-card {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 14px;
    display: flex;
    flex-direction: column;
  }

  /* 移动端：隐藏桌面布局，显示移动端布局 */
  .steam-card .desktop-layout { display: none; }
  .steam-card .mobile-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
  }

  .mobile-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-row-1 {
    justify-content: flex-start;
  }

  .mobile-row-2 {
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(0,240,255,0.06) 0%, rgba(168,85,247,0.06) 100%);
    border-radius: var(--radius-sm);
  }

  .mobile-row-3 {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .mobile-row-4 {
    justify-content: center;
  }

  .mobile-row .steam-nickname {
    font-size: 1rem;
    font-weight: 700;
  }

  .mobile-row .current-game-label {
    font-size: 0.7rem;
    color: var(--accent-cyan);
    font-weight: 600;
    text-transform: uppercase;
  }

  .mobile-row .current-game-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
    margin-left: 8px;
  }

  .mobile-row .games-section-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .mobile-row .games-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-row .game-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
  }

  .mobile-row .game-icon {
    width: 28px;
    height: 28px;
  }

  .mobile-row .game-name {
    font-size: 0.8rem;
    flex: 1;
  }

  .mobile-row .game-time {
    font-size: 0.7rem;
    color: var(--text-muted);
  }

  .mobile-row .steam-friendcode {
    font-size: 0.75rem;
    color: var(--accent-purple);
    background: rgba(168,85,247,0.1);
    padding: 4px 10px;
    border-radius: 20px;
  }

  .steam-avatar-wrap { width: 48px; height: 48px; flex-shrink: 0; }
  .steam-avatar { width: 48px; height: 48px; }

  .carousel-btn {
    display: none;
  }

  /* TS：改为上下单列 */
  .ts-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .ts-server-card,
  .ts-channels-card {
    grid-column: unset;
    grid-row: unset;
  }

  .ts-server-stats { gap: 14px; flex-wrap: wrap; }
  .ts-stat-value { font-size: 1rem; }
}

@media (max-width: 480px) {
  /* Header */
  .header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .refresh-info {
    align-items: flex-start;
  }

  .btn-refresh span { display: none; }
  .btn-refresh { padding: 8px; }

  /* Steam cards */
  .steam-card {
    padding: 14px;
    gap: 10px;
  }

  .steam-avatar-wrap { width: 52px; height: 52px; }
  .steam-avatar { width: 52px; height: 52px; }

  .game-item { padding: 10px; }
  .game-icon { width: 36px; height: 36px; }
  .game-name { font-size: 0.82rem; }
  .game-playtime { font-size: 0.7rem; }

  /* TS header */
  .ts-header-right {
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn-join-ts {
    padding: 6px 12px;
    font-size: 0.78rem;
    letter-spacing: 0;
  }

  /* TS server card */
  .ts-server-stats {
    gap: 12px;
  }

  .ts-stat-value { font-size: 1rem; }
  .ts-stat-label { font-size: 0.7rem; }

  /* Channel members */
  .channel-item {
    padding: 8px 10px;
  }

  .channel-name {
    font-size: 0.82rem;
    white-space: normal;
    word-break: break-all;
  }

  .ch-user-row {
    flex-wrap: nowrap;
    gap: 6px;
    overflow: hidden;
  }

  .ch-user-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
  }

  .ch-user-idle { display: none; }

  /* Footer */
  .footer {
    font-size: 0.7rem;
    padding: 10px 14px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  /* Carousel buttons */
  .carousel-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .carousel-btn svg {
    width: 16px;
    height: 16px;
  }

  .steam-carousel-container {
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .site-title { font-size: 0.95rem; }
  .steam-nickname { font-size: 0.9rem; }
  .ts-online-count { font-size: 0.85rem; }
  .btn-join-ts span:last-child { display: none; }
}
