/* Phantom Commander - Modern Industrial Dark CSS */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --border-color: rgba(56, 189, 248, 0.2);
  --border-glow: rgba(0, 255, 102, 0.3);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-cyan: #38bdf8;
  --accent-green: #00ff66;
  --accent-purple: #c084fc;
  --accent-amber: #facc15;
  --accent-rose: #fb7185;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Noto Sans TC", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  width: 100vw;
}

/* Header */
.app-header {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: calc(var(--safe-top) + 8px) 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.brand-info h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--accent-green);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

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

.icon-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.95);
  background: var(--border-color);
}

/* Agent Selector Tabs */
.agent-bar-wrapper {
  background: var(--bg-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.agent-bar-wrapper::-webkit-scrollbar { display: none; }

.agent-tabs {
  display: flex;
  gap: 8px;
}

.agent-tab {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.agent-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* Chat Main Area */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.message-card {
  max-width: 90%;
  animation: fadeIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.message-user {
  align-self: flex-end;
}

.message-user .bubble {
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  color: #fff;
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
}

.message-agent {
  align-self: flex-start;
  width: 96%;
}

.agent-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.message-agent .bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  border-radius: 18px 18px 18px 4px;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.bubble h1, .bubble h2, .bubble h3 {
  color: var(--accent-cyan);
  margin: 10px 0 6px;
  font-size: 1.1rem;
}

.bubble ul, .bubble ol {
  padding-left: 20px;
  margin: 6px 0;
}

.bubble li {
  margin-bottom: 4px;
}

.bubble pre {
  background: #000;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.85rem;
  margin: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bubble code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: monospace;
  color: var(--accent-green);
}

.bubble img {
  max-width: 100%;
  border-radius: 12px;
  margin: 10px 0;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s;
}

.bubble img:active {
  transform: scale(0.98);
}

.bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.85rem;
}

.bubble th, .bubble td {
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  text-align: left;
}

.bubble th {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
}

.msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.action-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-chip:hover, .action-chip:active {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  border-color: var(--accent-cyan);
}

/* Typing indicator */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Quick Prompts Bar */
.quick-prompts-bar {
  padding: 6px 12px;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  gap: 8px;
  background: rgba(11, 15, 25, 0.95);
  scrollbar-width: none;
}
.quick-prompts-bar::-webkit-scrollbar { display: none; }

.prompt-chip {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}
.prompt-chip:active {
  background: var(--accent-cyan);
  color: #000;
}

/* Input Area */
.input-area {
  background: rgba(17, 24, 39, 0.95);
  border-top: 1px solid var(--border-color);
  padding: 8px 12px calc(var(--safe-bottom) + 8px);
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.input-box {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: #fff;
  padding: 10px 14px;
  font-size: 0.95rem;
  max-height: 100px;
  resize: none;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input-box:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.send-btn {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
  transition: transform 0.15s ease;
}

.send-btn:active {
  transform: scale(0.92);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.mic-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.mic-btn.recording {
  background: #e11d48;
  color: #fff;
  animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); }
}

/* Drawer / Sidebar */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100dvh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
}

.drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.drawer-header h2 {
  font-size: 1.1rem;
  color: var(--accent-cyan);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vault-item {
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vault-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.vault-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.vault-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.form-control {
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  border: 1px solid var(--accent-cyan);
}

.lightbox-close {
  position: absolute;
  top: calc(var(--safe-top) + 16px);
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Progress HUD & Matrix */
.progress-hud {
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 14px;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.progress-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Attach Button & Attachment Tray */
.attach-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.attach-btn:active {
  transform: scale(0.92);
  background: rgba(56, 189, 248, 0.2);
}

.attachment-tray {
  display: none;
  background: rgba(17, 24, 39, 0.98);
  border-top: 1px solid var(--border-color);
  padding: 8px 12px 0;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}
.attachment-tray.has-items {
  display: flex;
}
.attachment-chip {
  background: var(--bg-tertiary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #fff;
  flex-shrink: 0;
  max-width: 220px;
}
.attachment-chip img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 4px;
}
.attachment-chip .chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-chip .chip-remove {
  color: #f43f5e;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95rem;
  padding: 0 4px;
}

/* 徹底遮蔽 Netlify 原生浮水印與側邊抽屜微件 */
iframe[title*="Netlify" i],
iframe[id*="netlify" i],
.netlify-badge,
[data-netlify-badge],
div[class*="netlify-drawer" i],
div[id*="netlify-drawer" i] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}




/* ================================================================= */
/* MISSION OPERATIONS DECK (開工 / 收工 / 外掛技能庫) */
/* ================================================================= */
.mission-deck-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.mission-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.start-work-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}
.start-work-btn:hover, .start-work-btn:active {
  background: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
  transform: translateY(-1px);
}
.sign-off-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}
.sign-off-btn:hover, .sign-off-btn:active {
  background: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
  transform: translateY(-1px);
}
.skill-hub-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.3));
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.4);
}
.skill-hub-btn:hover, .skill-hub-btn:active {
  background: rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.4);
  transform: translateY(-1px);
}
.skill-badge-count {
  background: #a855f7;
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 0 6px #a855f7;
}

/* ================================================================= */
/* AGENT BUTTON TOKEN EXHAUSTED (GRAYOUT) & RESTORE STYLE */
/* ================================================================= */
.agent-tab.token-exhausted {
  background: #2d3748 !important;
  color: #94a3b8 !important;
  border: 1px dashed #64748b !important;
  opacity: 0.65 !important;
  filter: grayscale(85%) !important;
  position: relative !important;
  cursor: not-allowed;
}
.agent-tab.token-exhausted::after {
  content: "⏳耗盡";
  font-size: 0.62rem;
  background: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 700;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ================================================================= */
/* EQUIPPED SKILLS STRIP (已掛載技能浮動條) */
/* ================================================================= */
.equipped-skills-strip {
  background: rgba(17, 24, 39, 0.98);
  border-top: 1px solid rgba(168, 85, 247, 0.3);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}
.equipped-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.equipped-label b {
  color: #c084fc;
}
.equipped-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.equipped-chip {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #f3e8ff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.equipped-chip .chip-del {
  color: #f43f5e;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.8rem;
  margin-left: 2px;
}
.equipped-chip .chip-del:hover {
  color: #fb7185;
}
.add-skill-mini-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  color: #94a3b8;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.add-skill-mini-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border-color: #a855f7;
}

/* ================================================================= */
/* SKILL INVENTORY & ATTACHMENT MODAL */
/* ================================================================= */
.skill-modal-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 16px;
  width: 95%;
  max-width: 620px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.25);
  position: relative;
  margin: auto;
}
.skill-modal-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.95));
}
.skill-modal-header h3 {
  font-size: 1.05rem;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 8px;
}
.skill-filter-bar {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(11, 15, 25, 0.6);
}
.skill-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  outline: none;
}
.skill-search-input:focus {
  border-color: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}
.skill-category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}
.skill-cat-chip {
  padding: 3px 8px;
  font-size: 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.skill-cat-chip.active {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
  border-color: #a855f7;
}
.skill-list-container {
  padding: 12px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  flex: 1;
}
@media (min-width: 500px) {
  .skill-list-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
.skill-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.skill-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.5);
}
.skill-card.equipped {
  background: rgba(168, 85, 247, 0.12);
  border-color: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.25);
}
.skill-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.skill-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f3f4f6;
  display: flex;
  align-items: center;
  gap: 6px;
}
.skill-card.equipped .skill-card-title {
  color: #c084fc;
}
.skill-card-cat {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.skill-card-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.skill-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.skill-toggle-btn {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}
.skill-toggle-btn.btn-equip {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
.skill-toggle-btn.btn-equipped {
  background: #a855f7;
  color: #fff;
}

/* ================================================================= */
/* SIGN-OFF & SHARED MEMORY SYNC MODAL */
/* ================================================================= */
.signoff-modal-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  width: 95%;
  max-width: 580px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
  padding: 18px;
  position: relative;
  margin: auto;
}
.signoff-field {
  margin-bottom: 14px;
}
.signoff-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 6px;
}
.signoff-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.signoff-textarea:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.signoff-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 8px;
}
@media (min-width: 480px) {
  .signoff-checkbox-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.signoff-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.signoff-check-item input {
  accent-color: #fbbf24;
}

/* ================================================================= */
/* ROW 3: 第三列外掛技能專屬操作列 (SKILL ROW) */
/* ================================================================= */
.skills-row-bar {
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid rgba(168, 85, 247, 0.28);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.skills-row-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #c084fc;
  cursor: pointer;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.skills-row-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}
.skill-row-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 0.72rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.skill-row-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(168, 85, 247, 0.4);
}
.skill-row-chip.equipped {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(147, 51, 234, 0.35));
  border-color: #a855f7;
  color: #f3e8ff;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
  font-weight: 700;
}
.skill-row-chip.highlight-ocr {
  border-color: rgba(56, 189, 248, 0.5);
  color: #bae6fd;
}
.skill-row-chip.highlight-ocr.equipped {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}
