:root {
  /* Light Theme Variables */
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  
  /* Brand Colors */
  --wa-primary: #1ebd5a; 
  --wa-hover: #179e49;
  --btn-primary-text: #ffffff;
  --btn-secondary: #f3f4f6;
  --btn-secondary-text: #374151;
  --btn-secondary-hover: #e5e7eb;
  
  /* Structural & Elements */
  --border-color: #e5e7eb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  
  /* Overlays */
  --tiktok-hover-color: #000000;
}

[data-theme="dark"] {
  /* Dark Theme Variables */
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --btn-secondary: #334155;
  --btn-secondary-text: #f8fafc;
  --btn-secondary-hover: #475569;
  
  --border-color: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  
  --tiktok-hover-color: #f8fafc;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

.theme-toggle:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.sun-icon { display: block; }
.moon-icon { display: none; }

[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/* Language Switcher */
.lang-switch {
  display: flex;
  gap: 8px;
}

.lang-switch button {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.lang-switch button.active {
  background: var(--text-main);
  color: var(--bg-color);
  border-color: var(--text-main);
}

.lang-switch button:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

/* Profile Block */
.profile-block {
  text-align: center;
  margin-bottom: 32px;
}

.profile-image-container {
  width: 100px;
  height: 100px;
  margin: 0 auto 16px auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.profile-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease, background-color 0.3s ease;
}

.social-btn:hover, .social-btn:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.social-btn.instagram:hover {
  color: #E1306C;
  border-color: #E1306C;
}

.social-btn.tiktok:hover {
  color: var(--tiktok-hover-color);
  border-color: var(--tiktok-hover-color);
}

/* Groups Section */
main {
  flex-grow: 1;
}

.section-label {
  font-size: 15px;
  color: var(--text-main);
  margin: 0 0 16px 4px;
  font-weight: 600;
  line-height: 1.4;
}

.groups-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.group-header {
  display: flex;
  align-items: center;
}

.group-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

.group-actions {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity 0.2s, background-color 0.3s ease, color 0.3s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--wa-primary);
  outline-offset: 2px;
}

.btn-join {
  background: var(--wa-primary);
  color: var(--btn-primary-text);
  box-shadow: 0 2px 4px rgba(30, 189, 90, 0.2);
}

.btn-join:hover, .btn-join:active {
  background: var(--wa-hover);
}

.btn-copy {
  background: var(--btn-secondary);
  color: var(--btn-secondary-text);
}

.btn-copy:hover, .btn-copy:active {
  background: var(--btn-secondary-hover);
}

/* TikTok Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-arrow {
  position: absolute;
  top: 60px;
  right: 40px;
  width: 90px;
  height: 140px;
  z-index: 1001;
  pointer-events: none;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #ffffff;
  padding: 20px;
  max-width: 420px;
  text-align: center;
  margin-top: -15vh;
}

.overlay-main-text {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 40px 0;
  line-height: 1.3;
}

.overlay-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.step-row {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  gap: 12px;
  line-height: 1.4;
  text-align: left;
}

.dots-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  flex-shrink: 0;
}

.dots-icon span {
  display: block;
  width: 5px;
  height: 5px;
  background-color: #000000;
  border-radius: 50%;
}

/* 完美重写的极简版小提示框 (Toast) */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  
  /* 核心隐藏逻辑 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  
  transition: all 0.2s ease-out;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 40px;
  padding-bottom: 20px;
}

.footer-helper {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 auto;
  max-width: 380px;
  line-height: 1.6;
}