
    @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');
    
    * { 
      box-sizing: border-box; 
      margin: 0;
      padding: 0;
    }
    
    body {
      font-family: 'Orbitron', sans-serif;
      background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
      color: #fff;
      overflow: hidden;
      position: relative;
    }
    
    /* 動態背景效果 */
    body::before {
	  content: '';
	  position: fixed;
	  top: 0; left: 0; right: 0; bottom: 0;
	  background: linear-gradient(135deg, rgba(5,5,5,0.8), rgba(10,10,20,0.9));
	  z-index: -2;
	}
    
    @keyframes backgroundFlow {
      0%, 100% { transform: rotate(0deg) scale(1); }
      33% { transform: rotate(120deg) scale(1.1); }
      66% { transform: rotate(240deg) scale(0.9); }
    }

    /* 粒子背景效果 */
    .particles {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
    }

    .particle {
      position: absolute;
      width: 2px;
      height: 2px;
      background: rgba(0, 255, 255, 0.6);
      border-radius: 50%;
      animation: float 6s infinite linear;
    }

    @keyframes float {
      0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
      }
      10% {
        opacity: 1;
      }
      90% {
        opacity: 1;
      }
      100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
      }
    }

    /* 進入遮罩主容器 */
    #loadingOverlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(135deg, 
        rgba(10, 10, 10, 0.95) 0%, 
        rgba(26, 26, 46, 0.95) 50%, 
        rgba(22, 33, 62, 0.95) 100%);
      backdrop-filter: blur(10px);
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      transition: all 1s ease-out;
    }

    #loadingOverlay.fade-out {
      opacity: 0;
      transform: scale(1.1);
      pointer-events: none;
    }

    /* 主標題 */
    .game-title {
      font-size: 4rem;
      font-weight: 900;
      text-align: center;
      margin-bottom: 2rem;
      background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
      background-size: 400% 400%;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      animation: gradientShift 3s ease-in-out infinite;
      text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
      letter-spacing: 0.1em;
    }

    @keyframes gradientShift {
      0%, 100% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
    }

    /* 副標題 */
    .game-subtitle {
      font-size: 1.2rem;
      font-weight: 400;
      text-align: center;
      margin-bottom: 3rem;
      color: rgba(255, 255, 255, 0.8);
      letter-spacing: 0.05em;
    }

    /* 點擊開始按鈕 - SFL 風格 */
    .start-button {
      position: relative;
      background: linear-gradient(135deg, rgba(0, 255, 255, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
      border: 2px solid rgba(0, 255, 255, 0.5);
      padding: 18px 50px;
      border-radius: 12px;
      color: #00ffff;
      font-family: 'Orbitron', sans-serif;
      font-size: 1.4rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
      letter-spacing: 0.1em;
      text-transform: uppercase;
      text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
      overflow: hidden;
    }

    .start-button::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
      transition: left 0.5s;
    }

    .start-button:hover {
      transform: translateY(-3px);
      background: linear-gradient(135deg, rgba(0, 255, 255, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
      border-color: rgba(0, 255, 255, 0.8);
      box-shadow:
        0 8px 30px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.3);
    }

    .start-button:hover::before {
      left: 100%;
    }

    .start-button:active {
      transform: translateY(-1px);
      box-shadow: 0 4px 20px rgba(0, 255, 255, 0.4);
    }

    /* 載入動畫 */
    .loading-animation {
      margin-top: 2rem;
      display: flex;
      gap: 8px;
    }

    .loading-dot {
      width: 12px;
      height: 12px;
      background: linear-gradient(45deg, #00ffff, #ff00ff);
      border-radius: 50%;
      animation: loadingPulse 1.5s ease-in-out infinite;
    }

    .loading-dot:nth-child(2) { animation-delay: 0.2s; }
    .loading-dot:nth-child(3) { animation-delay: 0.4s; }

    @keyframes loadingPulse {
      0%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
      }
      50% { 
        transform: scale(1.2);
        opacity: 1;
      }
    }

    /* 版本信息 */
    .version-info {
      position: absolute;
      bottom: 30px;
      right: 30px;
      font-size: 0.9rem;
      color: rgba(255, 255, 255, 0.6);
      font-weight: 400;
    }

    /* 主遊戲內容（隱藏狀態） */
    #gameContent {
      opacity: 0;
      visibility: hidden;
      transition: all 1s ease-in;
    }

    #gameContent.show {
      opacity: 1;
      visibility: visible;
    }

    /* 原有的遊戲樣式 */
    #topbar {
      position: fixed;
      top: 0; left: 0; right: 0;
      background: linear-gradient(135deg, rgba(15, 15, 35, 0.95) 0%, rgba(25, 25, 55, 0.95) 100%);
      backdrop-filter: blur(10px);
      padding: 15px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 2px solid rgba(0, 255, 255, 0.3);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
      font-size: 0.95em;
      z-index: 1000;
    }
    
    #topbar .user-info {
      display: flex;
      align-items: center;
      gap: 10px;
      color: #00ffff;
      text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    }
    
    #topbar .controls {
      display: flex;
      gap: 10px;
    }
    
    #topbar button {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: none;
      padding: 8px 16px;
      border-radius: 20px;
      color: white;
      font-family: 'Orbitron', sans-serif;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    
    #topbar button:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    }

    #mainFrame {
      width: 100%;
      height: calc(100vh - 60px - 40px);
      border: none;
      position: absolute;
      top: 60px;
      left: 0;
    }
    
    .audio-controls {
      margin-left: 20px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .audio-controls input[type=range] {
      width: 100px;
    }

    /* 響應式設計 */
    @media (max-width: 768px) {
      /* 重新計算 topbar 高度並調整 mainFrame */
      #mainFrame {
		/* 使用 margin-bottom 而不是純粹的高度計算 */
		margin-bottom: 60px; /* 預留更多空間 */
		height: calc(100vh - 50px - 60px);
	  }
      
      .start-button {
        padding: 15px 40px;
        font-size: 1.2rem;
      }
    }

#topbar {
    padding: 8px 12px;
    font-size: 0.75em;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px; /* 固定最小高度 */
    box-sizing: border-box;
  }

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

#container-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #121212;
  color: #ccc;
  text-align: center;
  padding: 12px 16px;
  font-size: 0.9em;
  z-index: 99;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#container-footer a {
  color: #00bcd4; /* 冰藍色連結 */
  text-decoration: none;
  transition: color 0.3s ease;
}

#container-footer a:hover {
  color: #ffcc00; /* 滑過時改為亮金色 */
}


@media (max-width: 768px) {
  /* 重新計算 topbar 高度並調整 mainFrame */
  #mainFrame {
    height: calc(100vh - 50px - 60px); /* 增加 footer 預留空間 */
    top: 50px; /* 調整為實際的手機版 topbar 高度 */
  }
  
  /* topbar 整體調整 */
  #topbar {
    padding: 8px 12px;
    font-size: 0.75em;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px; /* 固定最小高度 */
    box-sizing: border-box;
  }
  
  /* 確保 topbar 內容垂直居中 */
  #topbar .user-info,
  .topbar-right {
    align-items: center;
    min-height: 34px; /* 確保按鈕有足夠空間 */
  }
  
  /* 調整按鈕大小確保觸摸友好 */
  #topbar button {
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    min-height: 32px; /* 觸摸友好的最小高度 */
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }
  
  /* 音頻控制調整 */
  .audio-controls {
    margin-left: 8px;
    gap: 6px;
  }
  
  .audio-controls input[type=range] {
    width: 60px;
    height: 20px;
  }
  
  #toggleSound {
    padding: 4px 8px !important;
    font-size: 0.9em !important;
    min-width: 32px;
    min-height: 32px;
  }
}

  
  /* 極小屏幕優化 (小於 480px) */
  @media (max-width: 480px) {
  #mainFrame {
    height: calc(100vh - 48px - 40px);
    top: 48px;
  }
  
  #topbar {
    padding: 6px 8px;
    font-size: 0.7em;
    min-height: 48px;
  }
  
  #topbar .user-info {
    font-size: 0.85em;
    flex: 1;
    min-width: 0;
    min-height: 36px;
  }
  
  /* 用戶名可能過長時的處理 */
  #topbar .user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px; /* 限制最大寬度 */
  }
  
  .topbar-right {
    flex-shrink: 0;
    min-height: 36px;
  }
  
  #topbar button {
    padding: 4px 8px;
    font-size: 0.8em;
    border-radius: 8px;
    min-height: 30px;
  }
  
  .audio-controls {
    margin-left: 4px;
  }
  
  .audio-controls input[type=range] {
    width: 50px;
  }
  
  #toggleSound {
    padding: 3px 6px !important;
    font-size: 0.85em !important;
    min-width: 28px;
    min-height: 30px;
  }
  
  #container-footer {
    padding: 6px 12px;
    font-size: 0.75em;
    min-height: 35px;
  }
}
  
 /* 橫屏手機優化 */
@media (max-width: 768px) and (orientation: landscape) {
  #mainFrame {
    height: calc(100vh - 45px - 35px); /* 橫屏時減少空間佔用 */
    top: 45px;
  }
  
  #topbar {
    padding: 4px 10px;
    font-size: 0.7em;
    min-height: 45px;
  }
  
  #topbar button {
    padding: 4px 8px;
    font-size: 0.8em;
    min-height: 28px;
  }
  
  /* 橫屏時頁尾調整 */
  #container-footer {
    padding: 4px 16px;
    font-size: 0.7em;
    min-height: 30px;
  }
}

/* 針對觸控設備的額外優化 */
@media (hover: none) and (pointer: coarse) {
  #topbar button {
    min-height: 32px;
    min-width: 44px; /* Apple 建議的最小觸控面積 */
  }
  
  #toggleSound {
    min-height: 32px !important;
    min-width: 32px !important;
  }
}

/* 3. 針對 iPhone 16 Pro 等較新設備的特殊處理 */
@media (max-width: 768px) and (min-height: 850px) {
  /* iPhone 16 Pro 的螢幕高度約 956px */
  #mainFrame {
    height: calc(100vh - 50px - 55px); /* 稍微增加 footer 預留空間 */
  }
  
  #container-footer {
    padding: 10px 16px;
    min-height: 45px;
  }
}

/* 超大屏幕時保持原有樣式 */
@media (min-width: 769px) {
  #topbar {
    /* 保持原有的桌面樣式 */
    padding: 15px 20px;
    font-size: 0.95em;
  }
  
  #topbar button {
    padding: 8px 16px;
    border-radius: 20px;
  }
}

@media (max-width: 768px) {
	#mainFrame {
		height: calc(100vh - 50px - 50px); /* topbar 50px + footer 50px */
		top: 50px;
	  }
  /* 移除可能造成間隙的 margin */
  #content {
    margin-top: 0 !important; /* 移除原本的 2.5px margin */
    padding: 15px 10px; /* 縮小手機版 padding */
    gap: 15px;
  }
  
  /* 確保內容區域從頂部開始 */
  body {
    padding-top: 0;
    margin-top: 0;
  }
  
  #container-footer {
    padding: 8px 12px;
    font-size: 0.8em;
    /* 確保不會太高 */
    min-height: 40px;
    max-height: 50px;
    overflow: hidden;
  }
}

/* 6. 安全區域處理（針對有 Home Indicator 的設備）*/
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #container-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  
  @media (max-width: 768px) {
    #mainFrame {
      height: calc(100vh - 50px - 50px - env(safe-area-inset-bottom));
    }
  }
}

/* 效能設定按鈕樣式 */
    #performanceBtn {
      background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
      border: none;
      padding: 8px 12px;
      border-radius: 20px;
      color: white;
      font-family: 'Orbitron', sans-serif;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
      font-size: 0.9em;
      margin-left: 5px;
    }
    
    #performanceBtn:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    }
    
    /* ===== 設定面板滾動修復 ===== */
    
    /* 設定面板遮罩 - 修正滾動問題 */
    #settingsOverlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(5px);
      z-index: 999999;
      
      /* 關鍵修復：使 overlay 本身可滾動 */
      overflow-y: auto !important;
      overflow-x: hidden !important;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      
      /* 使用 flex 布局來居中 */
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px 10px;
      box-sizing: border-box;
      
      animation: fadeIn 0.3s ease;
    }
    
    /* 顯示時的狀態 */
    #settingsOverlay.show {
      display: flex !important;
    }
    
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    
    /* 設定面板主體 - 修正高度限制 */
    #settingsPanel {
      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
      border: 2px solid #00ffff;
      border-radius: 20px;
      padding: 30px;
      width: 90%;
      max-width: 500px;
      
      /* 關鍵修復：限制最大高度並允許內部滾動 */
      max-height: 90vh !important;
      overflow-y: auto !important;
      overflow-x: hidden !important;
      -webkit-overflow-scrolling: touch;
      
      color: white;
      font-family: 'Orbitron', sans-serif;
      box-shadow: 0 20px 60px rgba(0, 255, 255, 0.3);
      position: relative;
      animation: slideIn 0.3s ease;
      
      /* 確保內容不會被截斷 */
      box-sizing: border-box;
    }
    
    @keyframes slideIn {
      from { 
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
      }
      to { 
        transform: scale(1) translateY(0);
        opacity: 1;
      }
    }
    
    /* 設定標題 */
    .settings-title {
      font-size: 1.8em;
      color: #00ffff;
      text-align: center;
      margin-bottom: 25px;
      text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    }
    
    /* 設定組 */
    .setting-group {
      margin-bottom: 25px;
      padding: 15px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      border: 1px solid rgba(0, 255, 255, 0.2);
    }
    
    .setting-label {
      font-size: 1.1em;
      color: #ffd93d;
      margin-bottom: 10px;
      display: block;
      text-shadow: 0 0 5px rgba(255, 217, 61, 0.3);
    }
    
    .setting-description {
      font-size: 0.9em;
      color: #b8e6ff;
      margin-bottom: 15px;
      line-height: 1.4;
    }
    
    /* 效能選項按鈕 */
    .performance-options {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
      gap: 10px;
    }
    
    .perf-option {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: 2px solid transparent;
      padding: 12px 8px;
      border-radius: 10px;
      color: white;
      cursor: pointer;
      transition: all 0.3s ease;
      text-align: center;
      font-weight: 600;
      font-size: 0.9em;
    }
    
    .perf-option:hover {
      transform: translateY(-2px);
      box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }
    
    .perf-option.active {
      background: linear-gradient(135deg, #00ffff 0%, #0099cc 100%);
      border-color: #00ffff;
      box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    }
    
    .perf-option.auto {
      background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    }
    
    .perf-option.auto.active {
      background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
      border-color: #00ff88;
    }
    
    /* 系統資訊 */
    .system-info {
      background: rgba(0, 0, 0, 0.3);
      padding: 15px;
      border-radius: 10px;
      margin: 20px 0;
      font-size: 0.9em;
    }
    
    .system-info h4 {
      color: #ffd93d;
      margin: 0 0 10px 0;
    }
    
    .info-item {
      display: flex;
      justify-content: space-between;
      margin: 5px 0;
      padding: 2px 0;
    }
    
    .info-label {
      color: #b8e6ff;
    }
    
    .info-value {
      color: #fff;
      font-weight: 600;
    }
    
    /* 按鈕組 */
    .button-group {
      display: flex;
      gap: 15px;
      justify-content: center;
      margin-top: 25px;
    }
    
    .settings-btn {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: none;
      padding: 12px 25px;
      border-radius: 25px;
      color: white;
      font-family: 'Orbitron', sans-serif;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 1em;
    }
    
    .settings-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }
    
    .settings-btn.primary {
      background: linear-gradient(135deg, #00ffff 0%, #0099cc 100%);
    }
    
    .settings-btn.danger {
      background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    }
    
    /* 關閉按鈕 */
    .close-btn {
      position: absolute;
      top: 15px;
      right: 20px;
      background: none;
      border: none;
      color: #ff6b6b;
      font-size: 1.5em;
      cursor: pointer;
      transition: all 0.3s ease;
    }
    
    .close-btn:hover {
      color: #ff4444;
      transform: scale(1.2);
    }
    
    /* 即時效果預覽 */
    .effect-preview {
      margin-top: 15px;
      padding: 10px;
      background: rgba(0, 255, 255, 0.1);
      border-left: 3px solid #00ffff;
      border-radius: 5px;
    }
    
    .effect-preview h5 {
      color: #00ffff;
      margin: 0 0 8px 0;
      font-size: 0.9em;
    }
    
    .effect-item {
      font-size: 0.8em;
      color: #b8e6ff;
      margin: 3px 0;
    }
    
    /* 自定義滾動條樣式 */
    #settingsPanel::-webkit-scrollbar {
      width: 8px;
    }
    
    #settingsPanel::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
    }
    
    #settingsPanel::-webkit-scrollbar-thumb {
      background: linear-gradient(135deg, #00ffff, #0099cc);
      border-radius: 4px;
    }
    
    #settingsPanel::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(135deg, #00ccff, #0077aa);
    }
    
    /* 防止 body 背景滾動 */
    body.settings-open {
      overflow: hidden;
      position: fixed;
      width: 100%;
      height: 100%;
    }
    
    /* 滾動指示器 */
    .scroll-indicator {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      color: #00ffff;
      font-size: 0.8em;
      opacity: 0.7;
      animation: bounce 2s infinite;
      pointer-events: none;
      display: none;
    }
    
    #settingsPanel.scrollable .scroll-indicator {
      display: block;
    }
    
    @keyframes bounce {
      0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
      }
      40% {
        transform: translateX(-50%) translateY(-5px);
      }
      60% {
        transform: translateX(-50%) translateY(-3px);
      }
    }
    
    /* ===== 移動設備響應式修復 ===== */
    
    /* 移動設備特殊處理 */
    @media (max-height: 700px) {
      #settingsOverlay {
        padding: 10px 5px;
        align-items: flex-start;
      }
      
      #settingsPanel {
        max-height: 95vh !important;
        margin-top: 10px;
      }
    }
    
    @media (max-height: 600px) {
      #settingsOverlay {
        padding: 5px;
        align-items: flex-start;
      }
      
      #settingsPanel {
        max-height: 98vh !important;
        margin: 5px 0;
        border-radius: 15px;
        padding: 20px;
      }
    }
    
    @media (max-height: 500px) {
      #settingsPanel {
        max-height: 99vh !important;
        padding: 15px;
        border-radius: 10px;
      }
      
      .settings-title {
        font-size: 1.4em !important;
        margin-bottom: 15px !important;
      }
      
      .setting-group {
        margin-bottom: 15px !important;
        padding: 10px !important;
      }
      
      .performance-options {
        gap: 5px !important;
      }
      
      .perf-option {
        padding: 8px 4px !important;
        font-size: 0.8em !important;
      }
    }
    
    /* 寬度響應式設計 */
    @media (max-width: 768px) {
      #settingsPanel {
        margin: 10px;
        padding: 40px 20px 80px 20px; /* 手機端上下 padding 加大 */
        width: calc(100% - 20px);
      }

      .settings-title {
        font-size: 1.5em;
      }

      .performance-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }

      .button-group {
        flex-direction: column;
        align-items: center;
        gap: 10px;
      }

      .settings-btn {
        width: 100%;
        max-width: 200px;
      }

      .perf-option {
        padding: 10px 6px;
        font-size: 0.85em;
      }
    }
    
    @media (max-width: 480px) {
      #settingsPanel {
        padding: 30px 15px 70px 15px; /* 手機端上下 padding 加大 */
        border-radius: 15px;
      }

      .performance-options {
        grid-template-columns: 1fr;
        gap: 6px;
      }

      .settings-title {
        font-size: 1.3em;
      }

      .setting-group {
        padding: 12px;
        margin-bottom: 20px;
      }
    }
    
    /* ===== 性能優化 CSS 類別 ===== */
    
    /* 低效能模式 */
    .perf-low * {
      animation: none !important;
      transition: none !important;
      backdrop-filter: none !important;
      filter: none !important;
    }
    
    .perf-low body::before {
      display: none;
    }
    
    .perf-low .section::before {
      display: none;
    }
    
    .perf-low .particle {
      display: none;
    }
    
    /* 中效能模式 */
    .perf-medium body::before {
      animation-duration: 30s;
    }
    
    .perf-medium .section::before {
      animation-duration: 8s;
    }
    
    .perf-medium .particle:nth-child(n+6) {
      display: none;
    }

/* ===== 開場過場動畫系統 ===== */

/* 過場動畫容器 */
.intro-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
  overflow: hidden;
}

/* === 科技風格 (Tech) === */
.intro-tech {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.tech-scanline {
  position: absolute;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 255, 255, 0.8) 50%,
    transparent 100%);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
  animation: techScan 0.8s ease-out forwards;
}

@keyframes techScan {
  0% { top: 0; opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.tech-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridFade 1.2s ease-out forwards;
}

@keyframes gridFade {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; }
  100% { opacity: 0; transform: scale(1.1); }
}

.tech-glitch {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  animation: techGlitch 0.6s steps(10) forwards;
}

@keyframes techGlitch {
  0%, 10% {
    clip-path: inset(40% 0 61% 0);
    background: rgba(0, 255, 255, 0.1);
  }
  20%, 30% {
    clip-path: inset(10% 0 85% 0);
    background: rgba(139, 92, 246, 0.1);
  }
  40%, 50% {
    clip-path: inset(70% 0 15% 0);
    background: rgba(0, 255, 255, 0.05);
  }
  60%, 70% {
    clip-path: inset(30% 0 40% 0);
    background: transparent;
  }
  80%, 100% {
    clip-path: inset(0 0 0 0);
    background: transparent;
  }
}

.tech-blocks {
  position: absolute;
  width: 100%;
  height: 100%;
}

.tech-block {
  position: absolute;
  background: rgba(0, 255, 255, 0.15);
  border: 1px solid rgba(0, 255, 255, 0.3);
  animation: blockDissolve 0.8s ease-out forwards;
}

@keyframes blockDissolve {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8) translateY(-20px); }
}

/* === 魔法風格 (Magic) === */
.intro-magic {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.magic-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border: 2px solid rgba(139, 92, 246, 0.6);
  border-radius: 50%;
  animation: magicCircleExpand 1s ease-out forwards;
}

.magic-circle::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 50%;
  animation: magicRotate 1s linear forwards;
}

.magic-circle::after {
  content: '✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color: rgba(139, 92, 246, 0.8);
  animation: magicSymbol 0.8s ease-out forwards;
}

@keyframes magicCircleExpand {
  0% {
    width: 100px;
    height: 100px;
    opacity: 1;
    border-width: 3px;
  }
  60% {
    width: 400px;
    height: 400px;
    opacity: 0.8;
  }
  100% {
    width: 600px;
    height: 600px;
    opacity: 0;
    border-width: 1px;
  }
}

@keyframes magicRotate {
  0% { transform: rotate(0deg); opacity: 1; }
  100% { transform: rotate(180deg); opacity: 0; }
}

@keyframes magicSymbol {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.magic-runes {
  position: absolute;
  width: 100%;
  height: 100%;
}

.magic-rune {
  position: absolute;
  font-size: 24px;
  color: rgba(139, 92, 246, 0.7);
  animation: runeFloat 1.2s ease-out forwards;
}

@keyframes runeFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(0.5);
  }
}

.magic-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.8) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: magicBurst 0.8s ease-out forwards;
}

@keyframes magicBurst {
  0% {
    width: 10px;
    height: 10px;
    opacity: 1;
  }
  100% {
    width: 200vmax;
    height: 200vmax;
    opacity: 0;
  }
}

/* === 星空風格 (Stellar) === */
.intro-stellar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* 星雲漩渦 */
.stellar-nebula {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: radial-gradient(ellipse,
    rgba(100, 149, 237, 0.8) 0%,
    rgba(138, 43, 226, 0.5) 40%,
    rgba(25, 25, 112, 0.3) 70%,
    transparent 100%);
  border-radius: 50%;
  animation: nebulaExpand 1.2s ease-out forwards;
}

@keyframes nebulaExpand {
  0% {
    width: 50px;
    height: 50px;
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
  }
  50% {
    width: 120vmax;
    height: 120vmax;
    opacity: 0.7;
    transform: translate(-50%, -50%) rotate(90deg);
  }
  100% {
    width: 200vmax;
    height: 200vmax;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg);
  }
}

/* 流星容器 */
.stellar-meteors {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 流星 */
.stellar-meteor {
  position: absolute;
  width: 2px;
  height: 80px;
  background: linear-gradient(to bottom,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(100, 149, 237, 0.6) 50%,
    transparent 100%);
  border-radius: 2px;
  animation: meteorFall 0.8s ease-out forwards;
}

.stellar-meteor::before {
  content: '';
  position: absolute;
  top: 0;
  left: -1px;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.8);
}

@keyframes meteorFall {
  0% {
    opacity: 0;
    transform: translateY(-100px) translateX(0);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) translateX(100px);
  }
}

/* 閃爍星點容器 */
.stellar-stars {
  position: absolute;
  width: 100%;
  height: 100%;
}

/* 閃爍星點 */
.stellar-star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.8);
  animation: starTwinkle 1s ease-out forwards;
}

@keyframes starTwinkle {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  30% {
    opacity: 1;
    transform: scale(1.5);
  }
  60% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* 中心光芒 */
.stellar-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow:
    0 0 20px 10px rgba(100, 149, 237, 0.8),
    0 0 40px 20px rgba(138, 43, 226, 0.4);
  animation: corePulse 1s ease-out forwards;
}

@keyframes corePulse {
  0% {
    width: 8px;
    height: 8px;
    opacity: 1;
  }
  50% {
    width: 30px;
    height: 30px;
    opacity: 0.9;
  }
  100% {
    width: 60px;
    height: 60px;
    opacity: 0;
  }
}

/* === 效能模式調整 === */
/* 低效能模式：JS 直接跳過過場動畫，不需要 CSS 規則 */

/* 中效能 - 減少元素數量 */
.perf-medium .intro-transition * {
  animation-duration: 0.8s !important;
}

.perf-medium .tech-block:nth-child(n+10),
.perf-medium .magic-rune:nth-child(n+5),
.perf-medium .stellar-star:nth-child(n+8),
.perf-medium .stellar-meteor:nth-child(n+4) {
  display: none !important;
}

/* 自動戰鬥按鈕樣式 */
    .auto-battle-btn {
      background: linear-gradient(135deg, #4CAF50, #45a049);
      color: white;
      border: none;
      padding: 8px 12px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 12px;
      margin-right: 8px;
      transition: all 0.3s ease;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
      font-weight: bold;
    }
    
    .auto-battle-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }
    
    /* 關閉狀態：桃紅色 */
    .auto-battle-btn.disabled {
      background: linear-gradient(135deg, #FF1493, #DC143C);
    }
    
    /* 開啟狀態：橙色背景，綠色文字 */
    .auto-battle-btn.active {
      background: linear-gradient(135deg, #ff9800, #f57c00);
      animation: pulse 2s infinite;
    }
    
    /* 文字顏色控制 */
    .auto-battle-text-enabled {
      color: #00FF00 !important; /* 亮綠色 */
      text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    }
    
    .auto-battle-text-disabled {
      color: #FF69B4 !important; /* 桃紅色 */
      text-shadow: 0 0 5px rgba(255, 105, 180, 0.5);
    }
    
    @keyframes pulse {
      0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7); }
      70% { box-shadow: 0 0 0 10px rgba(255, 152, 0, 0); }
      100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
    }

/* 屬性克制表模態框樣式 */
.element-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-in-out;
}

.element-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  margin: 5% auto;
  padding: 0;
  border: 2px solid #00ffff;
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 255, 255, 0.3);
  animation: slideIn 0.4s ease-out;
}

.element-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px 30px;
  border-radius: 18px 18px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.element-modal-header h2 {
  margin: 0;
  color: white;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8em;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.element-close {
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: all 0.3s ease;
}

.element-close:hover {
  color: #ff6b6b;
  transform: scale(1.2);
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.8);
}

.element-modal-body {
  padding: 30px;
  color: white;
  font-family: 'Orbitron', sans-serif;
}

.advantage-section, .disadvantage-section {
  margin-bottom: 30px;
}

.advantage-section h3, .disadvantage-section h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.4em;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.advantage-section h3 {
  color: #4ecdc4;
}

.disadvantage-section h3 {
  color: #ff6b6b;
}

.element-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
}

.element-item {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid;
  border-radius: 12px;
  padding: 15px 20px;
  text-align: center;
  font-weight: 600;
  font-size: 1.1em;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.element-item::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.element-item:hover::before {
  left: 100%;
}

.element-item.advantage {
  border-color: #4ecdc4;
  color: #4ecdc4;
}

.element-item.advantage:hover {
  background: rgba(78, 205, 196, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(78, 205, 196, 0.3);
}

.element-item.disadvantage {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.element-item.disadvantage:hover {
  background: rgba(255, 107, 107, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.element-item.special {
  border-color: #ffd93d;
  color: #ffd93d;
  background: rgba(255, 217, 61, 0.08);
}

.element-item.special:hover {
  background: rgba(255, 217, 61, 0.2);
  box-shadow: 0 8px 25px rgba(255, 217, 61, 0.4);
}

.element-item span {
  display: block;
  font-size: 0.9em;
  margin-top: 5px;
  opacity: 0.9;
}

.tip-section {
  text-align: center;
  margin-top: 30px;
  padding: 20px;
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 12px;
}

.tip-section p {
  margin: 0;
  font-size: 1.1em;
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

/* 動畫效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { 
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
  }
  to { 
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* 響應式設計 */
@media (max-width: 768px) {
  .element-modal-content {
    width: 95%;
    margin: 2% auto;
    max-height: 95vh;
  }
  
  .element-modal-header {
    padding: 15px 20px;
  }
  
  .element-modal-header h2 {
    font-size: 1.4em;
  }
  
  .element-modal-body {
    padding: 30px 20px 80px 20px; /* 手機端上下 padding 加大 */
  }
  
  .element-grid {
    grid-template-columns: 1fr;
  }
  
  .element-item {
    font-size: 1em;
    padding: 12px 15px;
  }
}

/* 屬性克制表滾軸樣式 */
.element-modal-content::-webkit-scrollbar {
    width: 10px;
}

.element-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 255, 255, 0.04);
    border-radius: 8px;
}

.element-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00ffff 0%, #0099cc 100%);
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0,255,255,0.2);
}

.element-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #00e0ff 0%, #0077aa 100%);
}

/* Firefox 滾軸支援 */
.element-modal-content {
    scrollbar-width: thin;
    scrollbar-color: #00ffff #202038;
}

    /* SFL 浮動按鈕樣式 */
    #sflFloatingBtn {
      position: fixed;
      width: 45px;  /* 從 60px 縮小 */
      height: 45px; /* 從 60px 縮小 */
      background: linear-gradient(135deg, #00ffff 0%, #0099ff 50%, #00ffff 100%);
      background-size: 200% 200%;
      animation: sflGradientShift 3s ease infinite;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.3);
      box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
      cursor: move;
      z-index: 9999;
      display: none;
      align-items: center;
      justify-content: center;
      font-family: 'Orbitron', sans-serif;
      font-weight: 900;
      font-size: 14px; /* 從 18px 縮小 */
      color: #ffffff;
      text-shadow: 
        0 0 8px rgba(0, 0, 0, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.8);
      user-select: none;
      transition: transform 0.2s ease, opacity 0.3s ease;
    }
    
    /* 手機版本進一步縮小 */
    @media (max-width: 768px) {
      #sflFloatingBtn {
        width: 35px;
        height: 35px;
        font-size: 12px;
        border-width: 1.5px;
      }
    }
    
    #sflFloatingBtn:hover {
      transform: scale(1.1);
      box-shadow: 
        0 0 25px rgba(0, 255, 255, 0.7),
        0 5px 15px rgba(0, 0, 0, 0.4);
    }
    
    #sflFloatingBtn.dragging {
      transform: scale(0.95);
      opacity: 0.8;
    }
    
    #sflFloatingBtn.hidden {
      opacity: 0;
      pointer-events: none;
    }
    
    @keyframes sflGradientShift {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }
    
    /* SFL 清單選單 */
    #sflMenu {
      position: fixed;
      background: linear-gradient(135deg, rgba(10, 10, 30, 0.95) 0%, rgba(20, 20, 50, 0.95) 100%);
      border: 2px solid rgba(0, 255, 255, 0.3);
      border-radius: 12px;
      padding: 8px;
      box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(0, 255, 255, 0.3);
      display: none;
      z-index: 10000;
      backdrop-filter: blur(10px);
      min-width: 160px;
    }
    
    /* 手機版本選單調整 */
    @media (max-width: 768px) {
      #sflMenu {
        min-width: 140px;
        padding: 6px;
      }
    }
    
    #sflMenu.show {
      display: block;
      animation: sflMenuSlide 0.3s ease;
    }
    
    @keyframes sflMenuSlide {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    .sfl-menu-item {
      display: block;
      width: 100%;
      padding: 10px 14px;
      margin: 4px 0;
      background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 150, 255, 0.1) 100%);
      border: 1px solid rgba(0, 255, 255, 0.2);
      border-radius: 6px;
      color: #00ffff;
      font-family: 'Orbitron', sans-serif;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      text-align: left;
      text-decoration: none;
      text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    }
    
    /* 手機版本選單項目調整 */
    @media (max-width: 768px) {
      .sfl-menu-item {
        padding: 8px 12px;
        font-size: 12px;
        margin: 3px 0;
      }
    }
    
    .sfl-menu-item:hover {
      background: linear-gradient(135deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 150, 255, 0.2) 100%);
      border-color: rgba(0, 255, 255, 0.5);
      transform: translateX(3px);
      box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
    }
    
    /* 長按提示 */
    .sfl-hold-hint {
      position: fixed;
      background: rgba(0, 0, 0, 0.9);
      color: #00ffff;
      padding: 6px 10px;
      border-radius: 5px;
      font-size: 11px;
      pointer-events: none;
      z-index: 10001;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    
    .sfl-hold-hint.show {
      opacity: 1;
    }

    /* 重置提示動畫 */
    @keyframes fadeInOut {
      0% {
        opacity: 0;
        transform: translateX(-10px);
      }
      20% {
        opacity: 1;
        transform: translateX(0);
      }
      80% {
        opacity: 1;
        transform: translateX(0);
      }
      100% {
        opacity: 0;
        transform: translateX(10px);
      }
    }

    /* ===== 設定面板 - 頁籤系統 ===== */
    .settings-tabs {
      display: flex;
      gap: 10px;
      margin-bottom: 20px;
      border-bottom: 2px solid rgba(0, 255, 255, 0.2);
      padding-bottom: 10px;
    }

    .settings-tab {
      background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
      border: 2px solid rgba(0, 255, 255, 0.3);
      color: #00ffff;
      padding: 12px 20px;
      border-radius: 10px;
      cursor: pointer;
      font-family: 'Orbitron', sans-serif;
      font-weight: 600;
      font-size: 0.95em;
      transition: all 0.3s ease;
      flex: 1;
      text-align: center;
    }

    .settings-tab:hover {
      background: linear-gradient(135deg, rgba(0, 255, 255, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
      border-color: rgba(0, 255, 255, 0.5);
      transform: translateY(-2px);
    }

    .settings-tab.active {
      background: linear-gradient(135deg, rgba(0, 255, 255, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
      border-color: #00ffff;
      box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    }

    .settings-tab-content {
      display: none;
    }

    .settings-tab-content.active {
      display: block;
      animation: fadeIn 0.3s ease;
    }

    /* ===== 效能模式 - 左右佈局 ===== */
    .performance-layout {
      display: flex;
      gap: 20px;
    }

    .performance-left {
      flex: 1;
      min-width: 0;
    }

    .performance-right {
      flex: 1;
      min-width: 0;
    }

    .performance-options-vertical {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    /* ===== SFL 風格效能按鈕 ===== */
    .sfl-perf-btn {
      width: 100%;
      padding: 12px 15px;
      border-radius: 10px;
      cursor: pointer;
      font-family: 'Orbitron', sans-serif;
      font-weight: 600;
      font-size: 0.95em;
      transition: all 0.3s ease;
      text-align: left;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.08) 100%);
      border: 2px solid rgba(102, 126, 234, 0.4);
      color: #a78bfa;
    }

    .sfl-perf-btn small {
      font-size: 0.75em;
      opacity: 0.8;
      font-weight: 400;
    }

    .sfl-perf-btn:hover {
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.15) 100%);
      border-color: rgba(102, 126, 234, 0.6);
      transform: translateX(3px);
      box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }

    .sfl-perf-btn.active {
      background: linear-gradient(135deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 150, 255, 0.1) 100%);
      border-color: #00ffff;
      color: #00ffff;
      box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    }

    .sfl-perf-btn.auto {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
      border-color: rgba(16, 185, 129, 0.4);
      color: #10b981;
    }

    .sfl-perf-btn.auto:hover {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 182, 212, 0.15) 100%);
      border-color: rgba(16, 185, 129, 0.6);
    }

    .sfl-perf-btn.auto.active {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(6, 182, 212, 0.2) 100%);
      border-color: #10b981;
      color: #10b981;
      box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    }

    /* ===== SFL 風格設定按鈕 ===== */
    .sfl-settings-btn {
      padding: 12px 25px;
      border-radius: 10px;
      cursor: pointer;
      font-family: 'Orbitron', sans-serif;
      font-weight: 600;
      font-size: 0.95em;
      transition: all 0.3s ease;
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.08) 100%);
      border: 2px solid rgba(102, 126, 234, 0.4);
      color: #a78bfa;
    }

    .sfl-settings-btn:hover {
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.15) 100%);
      border-color: rgba(102, 126, 234, 0.6);
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }

    .sfl-settings-btn.primary {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
      border-color: rgba(16, 185, 129, 0.5);
      color: #10b981;
    }

    .sfl-settings-btn.primary:hover {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 182, 212, 0.15) 100%);
      border-color: rgba(16, 185, 129, 0.7);
      box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    }

    .sfl-settings-btn.danger {
      background: linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, rgba(248, 113, 113, 0.08) 100%);
      border-color: rgba(248, 113, 113, 0.4);
      color: #f87171;
    }

    .sfl-settings-btn.danger:hover {
      background: linear-gradient(135deg, rgba(248, 113, 113, 0.25) 0%, rgba(248, 113, 113, 0.15) 100%);
      border-color: rgba(248, 113, 113, 0.6);
      box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3);
    }

    /* ===== 快取清除頁籤 ===== */
    .cache-actions {
      margin: 20px 0;
    }

    .sfl-cache-btn {
      width: 100%;
      padding: 20px;
      border-radius: 12px;
      cursor: pointer;
      font-family: 'Orbitron', sans-serif;
      transition: all 0.3s ease;
      text-align: center;
      background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
      border: 2px solid rgba(251, 191, 36, 0.4);
      color: #fbbf24;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }

    .sfl-cache-btn:hover {
      background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(245, 158, 11, 0.15) 100%);
      border-color: rgba(251, 191, 36, 0.7);
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
    }

    .cache-btn-icon {
      font-size: 2em;
    }

    .cache-btn-text {
      font-size: 1.1em;
      font-weight: 700;
    }

    .sfl-cache-btn small {
      font-size: 0.8em;
      opacity: 0.8;
      font-weight: 400;
    }

    .cache-info {
      margin-top: 20px;
      padding: 15px;
      background: rgba(0, 255, 255, 0.05);
      border: 1px solid rgba(0, 255, 255, 0.2);
      border-radius: 10px;
    }

    .cache-info p {
      margin: 8px 0;
      font-size: 0.9em;
      color: #b8e6ff;
      line-height: 1.5;
    }

    /* ===== 響應式 - 手機版維持左右佈局 ===== */
    @media (max-width: 600px) {
      /* 頁籤維持同一行 */
      .settings-tabs {
        flex-direction: row;
        gap: 8px;
      }

      .settings-tab {
        padding: 8px 12px;
        font-size: 0.8em;
      }

      /* 效能模式維持左右佈局 */
      .performance-layout {
        flex-direction: row;
        gap: 12px;
      }

      .performance-left,
      .performance-right {
        flex: 1;
      }

      .sfl-perf-btn {
        padding: 8px 10px;
        font-size: 0.8em;
      }

      .performance-options-vertical {
        gap: 6px;
      }

      .effect-preview {
        padding: 8px;
      }

      .effect-preview h5 {
        font-size: 0.85em;
        margin-bottom: 6px;
      }

      .effect-item {
        font-size: 0.7em;
        margin: 2px 0;
      }

      .system-info {
        padding: 8px;
        margin-top: 10px;
      }

      .system-info h4 {
        font-size: 0.85em;
        margin-bottom: 6px;
      }

      .info-item {
        font-size: 0.75em;
        padding: 1px 0;
      }

      .button-group {
        flex-direction: row;
        gap: 8px;
      }

      .sfl-settings-btn {
        padding: 10px 15px;
        font-size: 0.85em;
      }
    }

    /* 極小螢幕 */
    @media (max-width: 400px) {
      .settings-tabs {
        gap: 5px;
      }

      .settings-tab {
        padding: 6px 8px;
        font-size: 0.75em;
      }

      .performance-layout {
        gap: 8px;
      }

      .sfl-perf-btn {
        padding: 6px 8px;
        font-size: 0.75em;
      }

      .sfl-perf-btn small {
        font-size: 0.65em;
      }

      .effect-item {
        font-size: 0.65em;
      }

      .info-item {
        font-size: 0.7em;
      }

      .button-group {
        flex-direction: column;
      }

      .sfl-settings-btn {
        width: 100%;
        padding: 8px 12px;
        font-size: 0.8em;
      }
    }
