/* ==========================================================================
   Alen Skill Manager v2 - 全面重构样式表 (styles.css)
   卡片网格 | 详情页 | 环形仪表盘 | Toggle 开关
   ========================================================================== */

/* === 设计变量 === */
:root {
  --bg-cyber: #020409;
  --sidebar-bg: rgba(6, 8, 18, 0.72);
  --panel-bg: rgba(10, 18, 36, 0.38);
  --panel-hover: rgba(15, 26, 52, 0.5);
  --panel-active: rgba(18, 32, 64, 0.62);
  --border-light: rgba(255, 255, 255, 0.05);
  --border-glow: rgba(0, 242, 254, 0.16);
  --text-white: #ffffff;
  --text-primary: #d0d8e8;
  --text-muted: #7a8ba6;
  --neon-cyan: #00f2fe;
  --neon-cyan-glow: rgba(0, 242, 254, 0.32);
  --neon-pink: #ff0844;
  --neon-green: #10b981;
  --neon-green-glow: rgba(16, 185, 129, 0.32);
  --neon-yellow: #f59e0b;
  --neon-blue: #3b82f6;
  --neon-purple: #8b5cf6;
  --ease: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* Agent 特征色令牌 */
  --agent-claude: #e67e22;
  --agent-codex: #74aa9c;
  --agent-gemini: #4285f4;
  --agent-antigravity-start: #00f2fe;
  --agent-antigravity-end: #8b5cf6;
  --agent-hermes: #b0b0b0;
}

/* === 全局重置 === */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg-cyber);
  color: var(--text-primary);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100vh; width: 100vw;
  overflow: hidden; display: flex; position: relative;
}

/* === 滚动条 === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--neon-cyan), var(--neon-blue)); }

/* === 背景装饰 (低性能消耗) === */
body::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,242,254,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,242,254,0.012) 1px, transparent 1px);
  background-size: 50px 50px; z-index: 1; pointer-events: none;
}

body::after {
  content: ""; position: absolute; top: -15%; left: 60%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,242,254,0.05) 0%, transparent 75%);
  z-index: 1; pointer-events: none; filter: blur(80px);
  transform: translate3d(0,0,0); will-change: transform;
}

.body-glow-pink {
  position: absolute; bottom: -15%; left: 15%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,8,68,0.035) 0%, transparent 70%);
  z-index: 1; pointer-events: none; filter: blur(80px);
  transform: translate3d(0,0,0); will-change: transform;
}

/* ==========================================================================
   侧栏 Sidebar
   ========================================================================== */
.sidebar {
  width: 240px; background: var(--sidebar-bg);
  border-right: 1px solid var(--border-light);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  padding: 20px 14px; display: flex; flex-direction: column;
  height: 100%; z-index: 10; flex-shrink: 0;
  transform: translate3d(0,0,0);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 18px; border-bottom: 1px solid var(--border-light); margin-bottom: 18px;
}

.brand-glow {
  width: 8px; height: 8px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  border-radius: 50%; box-shadow: 0 0 10px var(--neon-cyan);
}

.brand-text {
  font-weight: 800; font-size: 14px; letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff, var(--neon-cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-group { margin-bottom: 18px; }

.group-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding-left: 10px; margin-bottom: 6px;
}

.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 7px; font-size: 13px; font-weight: 600;
  color: var(--text-primary); cursor: pointer; transition: var(--ease);
  user-select: none; border: 1px solid transparent; margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04); color: var(--text-white); transform: translateX(2px);
}

.nav-item.active {
  background: rgba(0,242,254,0.07); color: var(--neon-cyan);
  border: 1px solid var(--border-glow); box-shadow: 0 0 12px rgba(0,242,254,0.05);
}

.nav-item-left { display: flex; align-items: center; gap: 8px; }

.icon-svg {
  width: 14px; height: 14px; stroke-width: 2; stroke: currentColor;
  fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

.nav-item.active .icon-svg {
  stroke: var(--neon-cyan); filter: drop-shadow(0 0 4px var(--neon-cyan-glow));
}

.sidebar-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 5px;
  background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border-light);
}

.nav-item.active .sidebar-badge {
  background: rgba(0,242,254,0.12); color: var(--neon-cyan); border-color: rgba(0,242,254,0.2);
}

/* Agent 侧栏指示灯 */
.agent-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); transition: var(--ease); flex-shrink: 0;
}
.agent-dot.active {
  background: var(--neon-green); box-shadow: 0 0 6px var(--neon-green);
}

/* ==========================================================================
   Toggle 开关 (通用 + 迷你)
   ========================================================================== */
.toggle-switch {
  position: relative; display: inline-block; width: 34px; height: 18px; cursor: pointer; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0; background: rgba(255,255,255,0.08);
  border-radius: 18px; transition: 0.3s;
}
.toggle-slider::before {
  content: ""; position: absolute; width: 14px; height: 14px;
  left: 2px; bottom: 2px; background: var(--text-muted);
  border-radius: 50%; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(16,185,129,0.2);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px); background: var(--neon-green);
  box-shadow: 0 0 6px var(--neon-green-glow);
}

/* 侧栏迷你 Toggle */
.toggle-mini {
  position: relative; display: inline-block; width: 26px; height: 14px; cursor: pointer; flex-shrink: 0;
}
.toggle-mini input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-mini-slider {
  position: absolute; inset: 0; background: rgba(255,255,255,0.06);
  border-radius: 14px; transition: 0.3s;
}
.toggle-mini-slider::before {
  content: ""; position: absolute; width: 10px; height: 10px;
  left: 2px; bottom: 2px; background: var(--text-muted);
  border-radius: 50%; transition: 0.3s;
}
.toggle-mini input:checked + .toggle-mini-slider {
  background: rgba(16,185,129,0.2);
}
.toggle-mini input:checked + .toggle-mini-slider::before {
  transform: translateX(12px); background: var(--neon-green);
  box-shadow: 0 0 4px var(--neon-green-glow);
}

/* ==========================================================================
   主内容区
   ========================================================================== */
.main-content {
  flex: 1; display: flex; flex-direction: column;
  height: 100%; overflow-y: auto; z-index: 2;
  padding: 28px 32px;
}

/* ==========================================================================
   Dashboard 仪表盘
   ========================================================================== */
.dashboard-view { display: flex; flex-direction: column; gap: 24px; height: 100%; }

.welcome-header { margin-bottom: 0; }
.welcome-title {
  font-size: 22px; font-weight: 800; color: var(--text-white);
  letter-spacing: -0.5px; margin-bottom: 4px;
}
.welcome-stats {
  font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
}
.welcome-stats span { color: var(--neon-cyan); font-weight: 700; }

/* 环形图区域 */
.ring-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}

.ring-card {
  background: var(--panel-bg); border: 1px solid var(--border-light);
  border-radius: 14px; padding: 20px; text-align: center;
  transition: var(--ease); position: relative; overflow: hidden;
}
.ring-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.ring-card:hover::before { opacity: 1; }
.ring-card:hover { border-color: rgba(255,255,255,0.1); transform: translateY(-2px); }

.ring-chart { width: 88px; height: 88px; margin: 0 auto 10px; }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.04); stroke-width: 6; }
.ring-fill {
  fill: none; stroke-width: 6; stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-in-out;
}
.ring-value {
  font-family: 'Outfit', sans-serif; font-size: 20px; font-weight: 800;
  fill: var(--text-white); text-anchor: middle;
}
.ring-sub {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  fill: var(--text-muted); text-anchor: middle;
}
.ring-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.8px;
  margin-top: 4px;
}

/* 排行与快速操作双栏 */
.dash-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }

.dash-panel {
  background: var(--panel-bg); border: 1px solid var(--border-light);
  border-radius: 14px; padding: 20px;
}

.dash-panel-title {
  font-size: 13px; font-weight: 700; color: var(--text-white);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
}

/* TOP 排行条目 */
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.rank-item:last-child { border-bottom: none; }

.rank-badge {
  width: 24px; height: 24px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 800;
  flex-shrink: 0;
}
.rank-badge.r1 { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.rank-badge.r2 { background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue)); color: #fff; }
.rank-badge.r3 { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border-light); }

.rank-info { flex: 1; min-width: 0; }
.rank-name {
  font-size: 12px; font-weight: 600; color: var(--text-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-cat {
  font-size: 9px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px;
}
.rank-count {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  font-weight: 700; color: var(--neon-cyan); flex-shrink: 0;
}

/* 快速操作 */
.quick-actions { display: flex; flex-direction: column; gap: 10px; }

.action-btn {
  background: var(--panel-bg); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 12px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  transition: var(--ease);
}
.action-btn:hover {
  background: var(--panel-hover); border-color: rgba(255,255,255,0.1);
  color: var(--text-white); transform: translateX(3px);
}
.action-btn .icon-svg { width: 16px; height: 16px; }

/* 最近入库 */
.recent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}

.recent-item {
  background: var(--panel-bg); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 14px; display: flex;
  align-items: center; gap: 12px; cursor: pointer; transition: var(--ease);
}
.recent-item:hover {
  border-color: rgba(255,255,255,0.1); background: var(--panel-hover); transform: translateX(3px);
}

.avatar-box {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(0,242,254,0.08), rgba(59,130,246,0.08));
  border: 1px solid rgba(0,242,254,0.12); color: var(--neon-cyan);
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  flex-shrink: 0;
}

.recent-meta { flex: 1; min-width: 0; }
.recent-name {
  font-size: 12px; font-weight: 600; color: var(--text-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-desc {
  font-size: 10px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-scope {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: var(--neon-green); flex-shrink: 0;
}

.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-white);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}

/* ==========================================================================
   卡片网格 (技能/规则 Grid View)
   ========================================================================== */
.catalog-view { display: flex; flex-direction: column; height: 100%; gap: 16px; }

.catalog-header { flex-shrink: 0; }
.catalog-header h1 {
  font-size: 20px; font-weight: 800; color: var(--text-white);
  letter-spacing: -0.5px; margin-bottom: 12px;
}

.catalog-toolbar {
  display: flex; gap: 12px; align-items: center; margin-bottom: 10px; flex-wrap: wrap;
}

.search-box {
  flex: 1; min-width: 200px; max-width: 400px;
  background: rgba(1,2,6,0.6); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 8px 12px; color: var(--text-white);
  font-family: 'Outfit', sans-serif; font-size: 13px; outline: none;
  transition: var(--ease);
}
.search-box:focus { border-color: var(--neon-cyan); box-shadow: 0 0 8px rgba(0,242,254,0.1); }
.search-box::placeholder { color: var(--text-muted); }

.scope-tabs { display: flex; gap: 4px; }
.scope-tabs button {
  font-size: 10.5px; font-family: 'JetBrains Mono', monospace; font-weight: 600;
  padding: 5px 12px; border-radius: 6px;
  border: 1px solid var(--border-light); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: var(--ease);
}
.scope-tabs button.active, .scope-tabs button:hover {
  border-color: var(--neon-cyan); color: var(--neon-cyan);
  background: rgba(0,242,254,0.04);
}

.category-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.cat-btn {
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  padding: 4px 8px; border-radius: 5px;
  border: 1px solid var(--border-light); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: var(--ease);
}
.cat-btn.active, .cat-btn:hover {
  border-color: var(--neon-cyan); color: var(--neon-cyan); background: rgba(0,242,254,0.04);
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px; overflow-y: auto; flex: 1; padding-bottom: 20px;
  align-content: start;
}

.item-card {
  background: var(--panel-bg); border: 1px solid var(--border-light);
  border-radius: 12px; padding: 18px 20px; cursor: pointer;
  transition: var(--ease); position: relative; overflow: hidden;
  min-height: 145px; display: flex; flex-direction: column;
}
.item-card::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 3px; height: 100%; background: transparent; transition: var(--ease);
}
.item-card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,242,254,0.1), transparent);
}
.item-card:hover {
  border-color: rgba(0,242,254,0.18); background: var(--panel-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.item-card:hover::before {
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-blue));
}

.card-top-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 8px;
}

.card-name {
  font-size: 14.5px; font-weight: 700; color: var(--text-white);
  word-break: break-word; line-height: 1.3; flex: 1;
}

.card-intro {
  font-size: 12.5px; color: rgba(255, 255, 255, 0.72); line-height: 1.65;
  margin-bottom: 14px; flex: 1;
  word-break: break-word;
  white-space: normal;
}

.card-footer {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.03);
  margin-top: auto;
}

.card-badge {
  font-size: 9px; font-family: 'JetBrains Mono', monospace; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
}
.card-badge.scope {
  background: rgba(0,242,254,0.06); color: var(--neon-cyan);
  border: 1px solid rgba(0,242,254,0.12);
}
.card-badge.scope.global {
  background: rgba(16,185,129,0.06); color: var(--neon-green);
  border: 1px solid rgba(16,185,129,0.12);
}
.card-badge.category {
  background: rgba(139,92,246,0.06); color: var(--neon-purple);
  border: 1px solid rgba(139,92,246,0.12);
}

.card-version {
  font-size: 9px; font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted); margin-left: auto;
}

.health-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--neon-green); box-shadow: 0 0 4px var(--neon-green);
}
.health-dot.warning {
  background: var(--neon-yellow); box-shadow: 0 0 4px var(--neon-yellow);
}
.health-dot.error {
  background: var(--neon-pink); box-shadow: 0 0 4px var(--neon-pink);
}

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--text-muted); gap: 12px; text-align: center;
}
.empty-state p { font-size: 13px; }

/* 禁用态卡片 */
.item-card.disabled {
  opacity: 0.45;
}

/* ==========================================================================
   详情页 Detail View
   ========================================================================== */
.detail-view {
  display: flex; flex-direction: column; height: 100%;
}

.back-btn {
  background: transparent; border: 1px solid var(--border-light);
  border-radius: 8px; padding: 8px 16px; color: var(--text-primary);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--ease);
  align-self: flex-start; margin-bottom: 20px;
  display: flex; align-items: center; gap: 6px;
}
.back-btn:hover {
  background: rgba(255,255,255,0.04); color: var(--text-white);
  border-color: rgba(255,255,255,0.1);
}

.detail-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 18px; margin-bottom: 24px;
}

.detail-header h1 {
  font-size: 22px; font-weight: 800; color: var(--text-white);
  letter-spacing: -0.5px; margin-bottom: 8px;
}

.detail-meta {
  display: flex; gap: 12px; align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--neon-cyan); margin-bottom: 12px;
}

.scope-tag {
  background: rgba(0,242,254,0.06); padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--border-glow);
}

.chinese-intro-box {
  padding: 10px 14px; border-radius: 8px;
  background: rgba(0,242,254,0.03); border: 1px solid rgba(0,242,254,0.1);
  border-left: 3px solid var(--neon-cyan);
  font-size: 12px; line-height: 1.6; color: var(--text-primary);
}

.detail-body {
  flex: 1; overflow-y: auto;
}

/* ==========================================================================
   Markdown 渲染样式
   ========================================================================== */
.md-body { line-height: 1.8; font-size: 14px; color: var(--text-primary); overflow-y: auto; flex: 1; }
.md-body h1, .md-body h2, .md-body h3 {
  color: var(--text-white); font-weight: 700;
  margin: 24px 0 12px 0; padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}
.md-body h1 { font-size: 20px; }
.md-body h2 { font-size: 16px; }
.md-body h3 { font-size: 14px; border-bottom: none; }
.md-body p { margin-bottom: 12px; }
.md-body ul, .md-body ol { margin-left: 20px; margin-bottom: 12px; }
.md-body li { margin-bottom: 4px; }
.md-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: rgba(0,242,254,0.05); color: var(--neon-cyan);
  padding: 1.5px 5px; border-radius: 4px; border: 1px solid rgba(0,242,254,0.08);
}
.md-body pre {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(1,2,6,0.85); border: 1px solid var(--border-light);
  padding: 14px; border-radius: 8px; overflow-x: auto; margin: 16px 0;
}
.md-body pre code {
  background: transparent; color: #e2e8f0; padding: 0; border: none; font-size: 12px;
}

/* Alert 彩条 */
.alert-block {
  margin: 16px 0; padding: 12px 16px; border-radius: 8px;
  border: 1px solid transparent; border-left-width: 3px;
  font-size: 13px; line-height: 1.55;
}
.alert-block p { margin-bottom: 0 !important; }
.alert-title-row {
  display: flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px;
}
.alert-block.note { background: rgba(59,130,246,0.03); border-color: rgba(59,130,246,0.12); border-left-color: var(--neon-blue); }
.alert-block.note .alert-title-row { color: #60a5fa; }
.alert-block.tip { background: rgba(16,185,129,0.03); border-color: rgba(16,185,129,0.12); border-left-color: var(--neon-green); }
.alert-block.tip .alert-title-row { color: #34d399; }
.alert-block.important { background: rgba(245,158,11,0.03); border-color: rgba(245,158,11,0.12); border-left-color: var(--neon-yellow); }
.alert-block.important .alert-title-row { color: #fbbf24; }
.alert-block.warning, .alert-block.caution { background: rgba(255,8,68,0.03); border-color: rgba(255,8,68,0.12); border-left-color: var(--neon-pink); }
.alert-block.warning .alert-title-row, .alert-block.caution .alert-title-row { color: #fca5a5; }

/* ==========================================================================
   安装页 & 设置页
   ========================================================================== */
.page-section {
  max-width: 800px; display: flex; flex-direction: column; gap: 20px;
}

.info-card {
  background: var(--panel-bg); border: 1px solid var(--border-light);
  border-radius: 12px; padding: 18px 20px;
}

.info-label {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}

.code-block {
  background: rgba(1,2,6,0.85); padding: 14px; border-radius: 8px;
  border: 1px solid var(--border-light); overflow-x: auto; margin-top: 8px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}
.code-block code {
  font-family: 'JetBrains Mono', monospace; color: var(--neon-cyan); font-size: 12px;
}

/* Agent 管理器 */
.agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

.agent-form {
  background: var(--panel-bg); border: 1px solid var(--border-light);
  border-radius: 12px; padding: 20px;
}

.form-group { margin-bottom: 12px; }
.form-label {
  font-size: 11px; font-weight: 700; color: var(--text-white);
  margin-bottom: 5px; display: block;
}
.form-input {
  width: 100%; background: rgba(2,4,10,0.85);
  border: 1px solid var(--border-light); border-radius: 6px;
  padding: 7px 10px; color: var(--text-white); outline: none; font-size: 12px;
}
.form-input:focus { border-color: var(--neon-cyan); }

.checkbox-group { display: flex; gap: 6px; flex-wrap: wrap; }
.checkbox-tag {
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  padding: 3px 7px; border-radius: 4px;
  border: 1px solid var(--border-light); background: transparent;
  color: var(--text-muted); cursor: pointer; user-select: none;
  transition: var(--ease);
}
.checkbox-tag.checked {
  border-color: var(--neon-green); color: var(--neon-green);
  background: rgba(16,185,129,0.05);
}

.agent-list { display: flex; flex-direction: column; gap: 8px; max-height: 350px; overflow-y: auto; }

.agent-row {
  background: rgba(2,4,10,0.4); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 10px 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.agent-row-left { display: flex; align-items: center; gap: 10px; }
.agent-row-name { font-size: 12px; font-weight: 700; color: var(--text-white); }
.agent-row-sub {
  font-size: 9px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px;
}
.agent-row-right { display: flex; align-items: center; gap: 8px; }

.btn-sm {
  background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2);
  color: var(--neon-green); padding: 7px 14px; border-radius: 7px;
  font-weight: 600; font-size: 11px; cursor: pointer; transition: var(--ease);
}
.btn-sm:hover {
  background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.35);
}

.btn-delete {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; transition: var(--ease);
}
.btn-delete:hover { color: var(--neon-pink); }

.badge-sm {
  font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border-light);
}

/* Settings 双栏 */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ==========================================================================
   Agent Logo SVG (侧栏 + 卡片迷你头像)
   ========================================================================== */
.agent-logo {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.agent-logo svg { width: 14px; height: 14px; }
.agent-logo-mini {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.08);
  transition: var(--ease); cursor: default;
}
.agent-logo-mini:hover {
  border-color: rgba(255,255,255,0.25);
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(0,242,254,0.15);
}
.agent-logo-mini svg { width: 12px; height: 12px; }
.agent-avatars {
  display: flex; gap: 3px; margin-left: auto; align-items: center;
}

/* 侧栏 Agent 分组标题 */
.agent-group-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 1px; padding: 6px 10px 4px; margin-top: 6px;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  user-select: none; transition: var(--ease);
}
.agent-group-title:hover { color: var(--text-primary); }
.agent-group-title .chevron {
  font-size: 8px; transition: transform 0.2s;
}
.agent-group-title .chevron.collapsed {
  transform: rotate(-90deg);
}

/* ==========================================================================
   Agent 控制台视图
   ========================================================================== */
.agent-detail-view {
  display: flex; flex-direction: column; height: 100%; gap: 20px;
}
.agent-detail-header {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 18px; border-bottom: 1px solid var(--border-light);
}
.agent-detail-logo {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.08);
}
.agent-detail-logo svg { width: 28px; height: 28px; }
.agent-detail-info h1 {
  font-size: 22px; font-weight: 800; color: var(--text-white);
  letter-spacing: -0.5px; margin-bottom: 4px;
}
.agent-detail-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--text-muted); display: flex; gap: 12px;
}
.agent-skill-section {
  margin-top: 4px;
}
.agent-skill-section-title {
  font-size: 14px; font-weight: 700; color: var(--text-white);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
}
.agent-skill-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 45vh; overflow-y: auto;
}
.agent-skill-row {
  background: var(--panel-bg); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center;
  transition: var(--ease);
}
.agent-skill-row:hover {
  border-color: rgba(255,255,255,0.1); background: var(--panel-hover);
}
.agent-skill-row-left {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.agent-skill-row-name {
  font-size: 13px; font-weight: 600; color: var(--text-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-skill-row-desc {
  font-size: 10px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ==========================================================================
   卡片 Hover 操作条
   ========================================================================== */
.card-hover-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 4px; opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}
.item-card:hover .card-hover-actions { opacity: 1; }

.card-action-btn {
  width: 24px; height: 24px; border-radius: 5px;
  background: rgba(2,4,10,0.7); border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--ease); backdrop-filter: blur(8px);
}
.card-action-btn:hover {
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2);
}
.card-action-btn.drag-handle { cursor: grab; }
.card-action-btn.drag-handle:active { cursor: grabbing; }
.card-action-btn.delete:hover {
  border-color: rgba(255,8,68,0.4); background: rgba(255,8,68,0.08);
}
.card-action-btn.delete:hover svg { stroke: var(--neon-pink); }
.card-action-btn svg {
  width: 12px; height: 12px; stroke: var(--text-muted);
  stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* 拖拽态 */
.item-card.dragging {
  opacity: 0.4; transform: scale(0.95);
}
.item-card.drag-over {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 16px rgba(0,242,254,0.12);
}

/* ==========================================================================
   全局控制按钮 (搜索栏右侧)
   ========================================================================== */
.toolbar-actions {
  display: flex; gap: 6px; align-items: center; margin-left: auto;
}
.toolbar-btn {
  display: flex; align-items: center; gap: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border-light); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: var(--ease);
  white-space: nowrap;
}
.toolbar-btn:hover {
  border-color: var(--neon-cyan); color: var(--neon-cyan);
  background: rgba(0,242,254,0.04);
}
.toolbar-btn svg {
  width: 12px; height: 12px; stroke: currentColor;
  stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* ==========================================================================
   Toast 提示
   ========================================================================== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: rgba(10, 18, 36, 0.92); border: 1px solid var(--border-glow);
  backdrop-filter: blur(16px); border-radius: 10px;
  padding: 12px 18px; font-size: 12px; color: var(--text-white);
  font-weight: 600; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease-out forwards;
  display: flex; align-items: center; gap: 8px;
}
.toast.leaving { animation: toastOut 0.3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(20px); } }

/* ==========================================================================
   确认弹窗
   ========================================================================== */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(2,4,9,0.7);
  backdrop-filter: blur(6px); z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.confirm-box {
  background: rgba(10, 18, 36, 0.95); border: 1px solid var(--border-glow);
  border-radius: 14px; padding: 24px; max-width: 360px; width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5); text-align: center;
}
.confirm-box h3 {
  font-size: 15px; font-weight: 700; color: var(--text-white); margin-bottom: 8px;
}
.confirm-box p {
  font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px;
}
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions button {
  padding: 8px 20px; border-radius: 7px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--ease); border: 1px solid transparent;
}
.btn-cancel {
  background: rgba(255,255,255,0.05); border-color: var(--border-light) !important;
  color: var(--text-muted);
}
.btn-cancel:hover { background: rgba(255,255,255,0.08); color: var(--text-white); }
.btn-danger {
  background: rgba(255,8,68,0.1); border-color: rgba(255,8,68,0.3) !important;
  color: var(--neon-pink);
}
.btn-danger:hover { background: rgba(255,8,68,0.2); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   合集分组 Bundle Group
   ========================================================================== */
.bundle-group {
  margin-top: 20px;
  background: rgba(10, 18, 36, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  overflow: hidden;
  transition: var(--ease);
}
.bundle-group:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.bundle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  transition: var(--ease);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.bundle-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.bundle-icon {
  font-size: 18px;
  line-height: 1;
}

.bundle-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.3px;
}

.bundle-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.bundle-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  transition: var(--ease);
}
.bundle-toggle svg {
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}
.bundle-toggle.collapsed svg {
  transform: rotate(-90deg);
}
.bundle-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.bundle-cards {
  padding: 12px 14px 16px;
  animation: bundleExpand 0.3s ease-out;
}

@keyframes bundleExpand {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.item-card.bundle-child {
  border-left-width: 3px;
  min-height: 130px;
}

.bundle-badge-row {
  margin-bottom: 6px;
}

.bundle-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Markdown 表格样式 (技能档案索引页) */
.md-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 12px;
}
.md-body th,
.md-body td {
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  text-align: left;
}
.md-body th {
  background: rgba(0, 242, 254, 0.04);
  color: var(--neon-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.md-body td {
  color: var(--text-primary);
}
.md-body tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.md-body a {
  color: var(--neon-cyan);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 242, 254, 0.3);
  transition: var(--ease);
}
.md-body a:hover {
  border-bottom-color: var(--neon-cyan);
}
