/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f5;
  --border-color: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.12);
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent-purple: #7c3aed;
  --accent-purple-light: #a855f7;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --gradient-purple: linear-gradient(135deg, #7c3aed, #a855f7);
  --gradient-chat: linear-gradient(135deg, #9333ea, #c026d3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 20px rgba(124,58,237,0.2);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { display: block; max-width: 100%; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link, .nav-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.nav-link:hover, .nav-btn:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.06);
}

.nav-btn { display: flex; align-items: center; gap: 4px; }
.arrow { font-size: 10px; opacity: 0.7; }
.mobile-menu-toggle { display: none; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}



/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
}

.breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb .sep { color: var(--text-muted); }

/* ===== MAIN LAYOUT ===== */
.main-content {
  padding: 28px 0 60px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

/* ===== SIDEBAR ===== */
.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* User Header */
.user-header {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 16px 0;
}

.user-header-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

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

.avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: none;
  box-shadow: none;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}



/* Photo Gallery */
.photo-gallery {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gallery-main { position: relative; }

.gallery-main-img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  cursor: pointer;
}

.gallery-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
}

.gallery-nav {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.15);
  color: var(--text-primary);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  cursor: pointer;
}

.gallery-nav:hover { background: #ffffff; border-color: rgba(0,0,0,0.2); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

  .thumbs-list {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar Firefox */
  }
  .thumbs-list::-webkit-scrollbar { display: none; } /* Hide scrollbar Chrome/Safari */

.thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.thumb.active { border-color: var(--accent-purple); }
.thumb:hover { border-color: var(--accent-purple-light); }

/* Bio */
.bio-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bio-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== MAIN CONTENT RIGHT ===== */
.profile-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: none;
  padding-bottom: 0;
}

.tab {
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: all 0.2s;
  position: relative;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-purple);
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.tab.active {
  color: var(--accent-purple-light);
}

.tab.active::after { opacity: 1; }
.tab:hover { color: var(--text-primary); }

.tab-content { display: flex; flex-direction: column; gap: 20px; }
.tab-content.hidden { display: none; }





/* Game Info Section */
.game-info-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon { font-size: 18px; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Audio Player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.audio-player:hover {
  background: #ffffff;
  border-color: rgba(0,0,0,0.12);
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  height: 40px;
}

.wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--accent-purple);
  animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 30%; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 50%; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 70%; animation-delay: 0.3s; }
.wave-bar:nth-child(5) { height: 45%; animation-delay: 0.4s; }
.wave-bar:nth-child(6) { height: 80%; animation-delay: 0.5s; }
.wave-bar:nth-child(7) { height: 60%; animation-delay: 0.6s; }
.wave-bar:nth-child(8) { height: 35%; animation-delay: 0.7s; }
.wave-bar:nth-child(9) { height: 65%; animation-delay: 0.8s; }
.wave-bar:nth-child(10) { height: 40%; animation-delay: 0.9s; }
.wave-bar:nth-child(11) { height: 55%; animation-delay: 1.0s; }
.wave-bar:nth-child(12) { height: 25%; animation-delay: 1.1s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); opacity: 0.6; }
  50% { transform: scaleY(1.3); opacity: 1; }
}

.audio-duration {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-purple-light);
  flex-shrink: 0;
  min-width: 30px;
  text-align: center;
}

.game-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.game-screenshot {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: none;
}

.game-screenshot-img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  cursor: pointer;
}



/* Contact Section */
.contact-section {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.contact-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: visible;
}

.contact-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: transparent;
  transition: left 0.3s ease;
  z-index: -1;
}

.contact-link:hover {
  transform: scale(1.15);
}

.contact-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  transition: all 0.3s ease;
  display: block;
  border-radius: 50%;
}

.contact-link:hover .contact-icon {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}



/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Empty State */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}



/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .skill-cards-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .navbar-left .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .navbar-right .icon-btn:not(:last-child) {
    display: none;
  }


}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,50,0.95);
  border: 1px solid var(--accent-purple);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

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

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .container {
    max-width: 960px;
  }
  .profile-layout {
    grid-template-columns: 300px 1fr;
    gap: 20px;
  }
}

/* Small Tablet / Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .navbar-inner {
    height: 56px;
    padding: 0 16px;
  }
  
  .mobile-menu-toggle {
    display: block;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 12px;
  }

  .nav-links {
    display: none; /* Hide desktop nav links on mobile */
  }

  .nav-links.active {
    display: flex;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    gap: 8px;
    z-index: 101;
  }
  
  .nav-links.active .nav-link, 
  .nav-links.active .nav-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    border-radius: 8px;
  }
  
  .profile-layout {
    grid-template-columns: 1fr; /* Switch to single column */
    gap: 16px;
  }
  
  .profile-sidebar {
    order: 1; /* Sidebar content (avatar, photos) stays at top */
  }
  
  .profile-main {
    order: 2;
  }
  
  .gallery-main-img {
    height: 240px;
  }
  
  .tab-bar {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab {
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .user-header {
    padding: 16px;
  }
  
  .avatar {
    width: 64px;
    height: 64px;
  }
  
  .user-name {
    font-size: 18px;
  }
  
  .gallery-main-img {
    height: 200px;
  }
  
  .gallery-thumbs {
    padding: 8px;
  }
  
  .thumb {
    width: 50px;
    height: 50px;
  }
  
  .game-info-section {
    padding: 16px;
  }
  
  .audio-player {
    padding: 14px 18px;
  }
  
  .game-screenshot-img {
    height: auto;
    max-height: 240px;
  }
  
  .contact-links {
    gap: 12px;
    justify-content: center;
  }
  
  .contact-icon {
    width: 40px;
    height: 40px;
  }
}
