/* ==========================================================================
   十月飛雲工作室 ｜ October Flying Cloud Studio
   十月飛雲全響應式網站介面主樣式表 (Code(代碼)/css/style.css)
   網頁語言: 繁體中文 (zh-TW) | 日期格式: YYYY/MM/DD | 時區: UTC+8
   ========================================================================== */

/* 1. CSS 變數系統 (Design Tokens) */
:root {
  /* 主題色彩 Palette (科技暗色典雅與 Glassmorphism 基調) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111726;
  --bg-card: rgba(18, 26, 43, 0.75);
  --bg-card-hover: rgba(26, 38, 62, 0.85);
  --bg-input: #0e1524;

  /* 邊框與分割線 */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-light: rgba(255, 255, 255, 0.15);
  --border-color-hover: rgba(0, 102, 255, 0.4);

  /* 文字顏色 (Redesigned High-Contrast Description Color Tokens) */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1; /* 原 #94a3b8 -> 升級為高對比冰藍明亮銀白 */
  --text-muted: #94a3b8;     /* 原 #64748b -> 升級為清晰銀灰色 */
  --text-white: #ffffff;
  --text-desc: #e2e8f0;      /* 專屬卡片與內文描述高雅明亮色 */
  --text-cyan-glow: #a5f3fc; /* 副標題與特徵強調冰青微光色 */

  /* 品牌與狀態色彩 */
  --accent-primary: #0066ff;
  --accent-hover: #2563eb;
  --accent-light: rgba(0, 102, 255, 0.15);
  --accent-glow: rgba(0, 102, 255, 0.3);
  
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.12);
  --color-info: #06b6d4;
  --color-info-bg: rgba(6, 182, 212, 0.12);

  /* SCADA 工業點綴色 */
  --scada-cyan: #00f0ff;
  --scada-amber: #ffb000;
  --scada-green: #00ff66;
  --scada-red: #ff3344;

  /* 尺寸與間距 */
  --topbar-height: 60px;
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 68px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* 動畫與陰影 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 0 15px rgba(0, 102, 255, 0.3);
}

/* 2. 通用與 Bootstrap 風格工具類 (Utility Classes) */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }

.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-5 { margin-bottom: 24px !important; }

.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }

.w-100 { width: 100% !important; }
.font-mono { font-family: 'Consolas', 'Courier New', monospace !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }

.text-white { color: #ffffff !important; }
.text-secondary { color: #cbd5e1 !important; }
.text-muted { color: #94a3b8 !important; }
.text-primary { color: #0066ff !important; }
.text-success { color: #10b981 !important; }
.text-warning { color: #f59e0b !important; }
.text-danger { color: #ef4444 !important; }
.text-cyan { color: #00f0ff !important; }

/* 3. 全域基礎重置 (Global Reset) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 4. 主應用程式佈局 (App Layout) */
#app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 102, 255, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(0, 240, 255, 0.05) 0%, transparent 45%);
}

/* 5. 頂部導航欄 (Top Navigation Bar) */
.brand-logo,
.brand-logo span,
.site-selector,
.system-time-badge,
.system-status,
.user-profile,
.user-name {
  white-space: nowrap;
}

.topbar {
  height: var(--topbar-height);
  background-color: rgba(17, 23, 38, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  flex-shrink: 0;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-shrink: 0;
}

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.hamburger-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-white);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent-primary), #00d2ff);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 0 12px rgba(0, 102, 255, 0.5);
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.site-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.site-selector:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-light);
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.system-time-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(13, 19, 31, 0.8);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: var(--scada-cyan);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
}

/* 個人資料下拉選單 */
.user-profile-wrapper {
  position: relative;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-profile:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
  overflow: hidden;
  font-size: 14px;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
}

.user-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.user-profile-wrapper.open .user-arrow {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  padding: 8px 0;
  z-index: 200;
}

.user-dropdown.active {
  display: flex;
}

.dropdown-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-avatar {
  width: 34px;
  height: 34px;
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-white);
}

.dropdown-email {
  font-size: 11px;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12.5px;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--accent-primary);
}

.dropdown-item.text-danger:hover {
  color: var(--color-danger);
  background-color: var(--color-danger-bg);
}

/* 6. 核心主要區域 (Main Container) */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* 側邊遮罩 (手機端) */
.sidebar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 7. 左側導航選單 (Left Sidebar) */
.sidebar {
  width: var(--sidebar-width);
  background-color: rgba(17, 23, 38, 0.95);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width var(--transition-normal);
  z-index: 90;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35);
  font-weight: 600;
  border-radius: 8px;
}

.nav-item .icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: #38bdf8;
}

.nav-item:hover .icon,
.nav-item.active .icon {
  color: #ffffff;
}

.nav-item .badge {
  margin-left: auto;
  background-color: var(--accent-primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.nav-item.active .badge {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.sidebar.collapsed .nav-item span:not(.icon),
.sidebar.collapsed .nav-item .badge {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-footer .footer-text {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-footer .footer-text {
  display: none;
}

.sidebar-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.sidebar.collapsed .sidebar-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

/* 8. 主要內容區域 (Main Content Area) */
.content-area {
  flex: 1;
  background-color: transparent;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-cyan-glow);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

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

/* 頁籤內容控制 */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 22px;
}

.tab-content.active {
  display: flex;
}

/* 9. 控制台卡片與儀表板網格 */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.stat-card {
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

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

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.5px;
}

.stat-footer {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

/* 主題區塊卡片 */
.card-section {
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* 9. 全域統一按鈕設計系統 */
a, button, input[type="button"], input[type="submit"],
.btn, .btn-primary, .btn-secondary, .btn-warning, .btn-copy,
.btn-partner-primary, .btn-partner-cyan, .btn-partner-warning,
.btn-partner-facebook, .btn-partner-sub, .btn-card-action,
.btn-outline-info, .scada-service-link {
  text-decoration: none !important;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-warning,
.btn-copy,
.btn-partner-primary,
.btn-partner-cyan,
.btn-partner-warning,
.btn-partner-facebook,
.btn-partner-sub,
.btn-card-action,
.btn-outline-info,
.scada-service-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 7px 15px !important;
  height: 36px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  letter-spacing: 0.2px !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  user-select: none !important;
}

.btn-primary {
  background: rgba(0, 102, 255, 0.85) !important;
  border: 1px solid rgba(0, 180, 255, 0.4) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3) !important;
}

.btn-primary:hover {
  background: rgba(0, 102, 255, 1) !important;
  border-color: rgba(0, 240, 255, 0.7) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.4) !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--border-color-light) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* 10. 表格樣式 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.custom-table th {
  background-color: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.device-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-avatar {
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.device-name {
  font-weight: 600;
  color: var(--text-white);
}

.device-ip {
  font-size: 11.5px;
  color: var(--text-muted);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-online {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 11. 日誌與 Console 容器 (Audit Feed) */
.log-container {
  background-color: #060911;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 240px;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.6;
}

.log-entry {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
  padding-bottom: 3px;
}

.log-time {
  color: var(--text-muted);
}

.log-type {
  font-weight: 700;
  padding: 0 4px;
  border-radius: 2px;
}

.log-type.INFO { color: var(--color-info); }
.log-type.SEC { color: var(--color-success); }
.log-type.WARN { color: var(--color-warning); }

.log-msg {
  color: var(--text-primary);
}

/* 14. 響應式斷點 (Media Queries) */
@media (max-width: 768px) {
  .topbar {
    padding: 0 12px !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .topbar-left {
    max-width: calc(100% - 70px) !important;
    overflow: hidden !important;
    gap: 8px !important;
  }

  .site-selector,
  .topbar-right .system-status,
  .topbar-right .system-time-badge {
    display: none !important;
  }

  .brand-logo {
    font-size: 13.5px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .brand-logo span {
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .user-name {
    display: none !important;
  }

  .sidebar {
    position: absolute;
    top: 0;
    left: -260px;
    height: 100%;
    width: 250px !important;
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .sidebar-footer .sidebar-toggle-btn {
    display: none;
  }

  .content-area {
    padding: 14px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 15. 全域表單輸入框 (Input)、下拉選單 (Select) 與 Option 暗色美化適配 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  display: block;
}

.form-control,
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  background-color: #0b1120 !important;
  color: #f1f5f9 !important;
  border: 1px solid #1e293b !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13px !important;
  font-family: inherit !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}

/* 占位符文字 (Placeholder) 顏色適配 */
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #64748b !important;
  opacity: 0.85;
}

/* 輸入框與下拉選單焦點 (Focus) 高亮狀態 */
.form-control:focus,
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: #0066ff !important;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.25) !important;
  background-color: #0f172a !important;
}

/* 瀏覽器自動帶入 (Autofill) 背景修正 */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0b1120 inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* 下拉選單 (select) 特別美化與深色箭頭適配 */
select,
select.form-control {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px 14px !important;
  padding-right: 32px !important;
  cursor: pointer !important;
}

/* 選項 (option) 暗色適配 */
option {
  background-color: #0b1120 !important;
  color: #f1f5f9 !important;
  padding: 10px !important;
}

option:hover, option:checked {
  background-color: #0066ff !important;
  color: #ffffff !important;
}
