:root {
  --bg: #07111f;
  --bg-soft: #0d1830;
  --card: rgba(255,255,255,0.07);
  --line: rgba(255,255,255,0.12);
  --text: #eff6ff;
  --muted: #9fb1c9;
  --brand: #60a5fa;
  --brand2: #8b5cf6;
  --brand3: #22d3ee;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #ef4444;
  --radius: 10px;
  --spacing: 4px;
  --spacing-md: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* 导航栏 */
.nav,
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,17,31,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 1%;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 1%;
  max-width: 100%;
}

.brand {
  font-size: 24px;
  font-weight: 900;
  color: var(--brand);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 16px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
}

/* 主布局 - 98%宽度 */
.main-layout,
.main-container {
  display: flex;
  width: 98%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
  gap: var(--spacing-md);
  padding: var(--spacing-md) 0;
}

/* 侧边栏 - 固定200px宽度 */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--spacing-md);
  height: fit-content;
  position: sticky;
  top: calc(68px + var(--spacing-md));
}

/* 侧边栏导航 */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
}

.sidebar-nav a,
.sidebar-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: var(--line);
}

.sidebar-nav a.active,
.sidebar-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* 主内容区 */
.main-content,
.content-area {
  flex: 1;
  min-width: 0;
}

.module-content {
  display: none;
}

.module-content.active {
  display: block;
}

/* 模块标题 */
.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.module-title {
  font-size: 20px;
  font-weight: 700;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--text);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 4px 10px rgba(96,165,250,0.22);
}

.btn-primary:hover { box-shadow: 0 6px 14px rgba(96,165,250,0.28); }

.btn-secondary {
  background: rgba(255,255,255,0.04);
  border-color: var(--line);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--line);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm { min-height: 24px; padding: 0 8px; font-size: 12px; }

/* 卡片网格布局 - 紧凑间距 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--spacing-md);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 var(--spacing) 0;
}

.card-body {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.card-meta {
  display: flex;
  gap: var(--spacing);
  margin-top: var(--spacing);
  font-size: 12px;
  color: var(--muted);
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(96,165,250,0.12);
  border: 1px solid rgba(96,165,250,0.18);
  font-size: 12px;
  color: #dbeafe;
}


/* 列表项 */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.list-item-meta {
  font-size: 12px;
  color: var(--muted);
}

.list-item-url {
  color: var(--brand);
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}

.list-item-actions {
  display: flex;
  gap: 4px;
}

/* 表单样式 */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  min-height: 30px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font: inherit;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(96,165,250,0.12);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

/* 分类标签筛选 */
.category-tabs {
  display: flex;
  gap: var(--spacing);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
}

.category-tab {
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.category-tab:hover {
  color: var(--text);
  border-color: var(--brand);
}

.category-tab.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
}

.modal-close:hover {
  color: var(--text);
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 980px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .container { width: 96%; }
  .main-layout {
    flex-direction: column;
    width: 100%;
    padding: var(--spacing) 0;
  }
  .sidebar {
    width: 100%;
    position: static;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Toast 通知 */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  animation: toast-slide 0.3s ease-out;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--brand); }

@keyframes toast-slide {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* 下载列表 */
.download-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.download-info {
  flex: 1;
  min-width: 0;
}

.download-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.download-meta {
  font-size: 12px;
  color: var(--muted);
}

.download-actions {
  display: flex;
  gap: 6px;
}

/* Skill 列表 */
.skill-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.skill-info {
  flex: 1;
  min-width: 0;
}

.skill-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.skill-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.skill-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* 应用列表 */
.app-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.app-version {
  font-size: 12px;
  color: var(--muted);
}

/* 日志列表 */
.log-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}

.log-header {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
}

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

.log-level {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.log-level.debug { background: rgba(156,163,175,0.15); color: #9ca3af; }
.log-level.info { background: rgba(59,130,246,0.15); color: #60a5fa; }
.log-level.warn { background: rgba(251,191,36,0.15); color: #fbbf24; }
.log-level.error { background: rgba(239,68,68,0.15); color: #ef4444; }

.log-content {
  color: var(--text);
  word-break: break-all;
}

/* 导航列表 */
.nav-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

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

.nav-item-icon {
  font-size: 16px;
}

.nav-item-name {
  flex: 1;
  font-size: 14px;
}

.nav-item-url {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

/* 过滤器容器 */
.filter-container {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* 搜索输入框 */
.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand);
}

/* 图标按钮 */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: var(--muted);
}

.btn-icon:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.btn-icon:active {
  transform: scale(0.95);
}

/* 复制按钮 */
.btn-copy {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}

.btn-copy:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--brand);
  color: var(--brand);
}

/* 空状态图标 */
.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.4;
}

/* 模态框遮罩 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
}

.modal-overlay.active {
  display: block;
}

/* 应用操作按钮组 */
.app-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* 下载按钮 */
.btn-download {
  background: var(--success);
  color: white;
  border: 1px solid transparent;
}

.btn-download:hover {
  background: #10b981;
  box-shadow: 0 2px 8px rgba(52,211,153,0.3);
}

/* 日志消息内容 */
.log-message {
  color: var(--text);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

/* 导航链接 */
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

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

.nav-link.active {
  background: var(--brand);
  color: white;
}

/* 导航标题 */
.nav-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

/* 导航 URL */
.nav-url {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* 过滤选择器 */
.filter-select {
  min-width: 150px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--brand);
}

.filter-select option {
  background: var(--bg-soft);
  color: var(--text);
}

/* 卡片头部 */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

/* 卡片标签 */
.card-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.18);
  font-size: 11px;
  font-weight: 600;
  color: #c4b5fd;
}

/* 卡片操作按钮组 */
.card-actions {
  display: flex;
  gap: 4px;
  margin-top: var(--spacing-md);
}

/* 卡片项（用于列表视图） */
.card-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  transition: all 0.2s;
}

.card-item:hon  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(96,165,250,0.15);
}

/* 响应式优化 - 移动端 */
@media (max-width: 640px) {
  .toast-container {
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  .filter-container {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  .nav-url {
    max-width: 120px;
  }

  .card-actions {
    flex-wrap: wrap;
  }
}

/* 顶部导航菜单 */
.nav-menu {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-menu a:hover {
  color: var(--text);
}
