/* 全局自定义样式 - 配合 Tailwind CSS CDN 使用 */
:root {
  --bg-primary: #0A0E1A;
  --bg-card: #141B2D;
  --bg-card-light: #1A2340;
  --primary: #3B82F6;
  --accent: #06B6D4;
  --danger: #EF4444;
  --success: #10B981;
  --warning: #F59E0B;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --divider: #1E293B;
  --type-a: #EF4444;
  --type-b: #3B82F6;
  --type-c: #10B981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 倒计时脉冲动画 */
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.countdown-urgent {
  animation: pulse-red 1s ease-in-out infinite;
}

/* 代码块样式 */
.code-block {
  background: #0D1117;
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #E6EDF3;
  white-space: pre;
  tab-size: 4;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  padding: 4px 12px;
  transition: color 0.2s;
}
.nav-item.active {
  color: var(--primary);
}
.nav-item svg {
  width: 22px;
  height: 22px;
}
.nav-item.center svg {
  width: 28px;
  height: 28px;
}

/* 页面容器 */
.page-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 80px;
  min-height: 100vh;
}

/* 卡片通用 */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

/* 题型标签 */
.type-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.type-a { background: rgba(239,68,68,0.15); color: var(--type-a); }
.type-b { background: rgba(59,130,246,0.15); color: var(--type-b); }
.type-c { background: rgba(16,185,129,0.15); color: var(--type-c); }

/* 难度星级 */
.star { color: var(--warning); }
.star-empty { color: var(--text-muted); }

/* 频率进度条 */
.freq-bar {
  height: 4px;
  background: var(--divider);
  border-radius: 2px;
  overflow: hidden;
}
.freq-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* 算法卡片 */
.algo-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--divider);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
  text-decoration: none;
  display: block;
}
.algo-card:hover {
  border-color: var(--primary);
}
.algo-card:active {
  transform: scale(0.98);
}

/* 任务卡片 */
.task-card {
  background: var(--bg-card-light);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--warning);
}
.task-card.priority-high { border-left-color: var(--danger); }
.task-card.priority-medium { border-left-color: var(--warning); }
.task-card.priority-low { border-left-color: var(--success); }

/* 看板列 */
.board-column {
  min-width: 280px;
  padding: 0 8px;
}

/* 筛选标签 */
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.filter-chip.active {
  border-color: currentColor;
}
.filter-chip.type-a.active { background: rgba(239,68,68,0.2); color: var(--type-a); }
.filter-chip.type-b.active { background: rgba(59,130,246,0.2); color: var(--type-b); }
.filter-chip.type-c.active { background: rgba(16,185,129,0.2); color: var(--type-c); }

.category-chip {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s;
}
.category-chip.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

/* 板块标题 */
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 10px;
}

/* 代码语言切换Tab */
.code-tab {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg-card-light);
  color: var(--text-secondary);
  border: 1.5px solid transparent;
  transition: all 0.2s;
}
.code-tab.active {
  background: rgba(59,130,246,0.2);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* 按钮 */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { opacity: 0.8; }

.btn-copy {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 浮动添加按钮 */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}
.modal-content {
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

/* 表单 */
.form-input {
  width: 100%;
  background: var(--bg-card-light);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--primary);
}
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-select {
  width: 100%;
  background: var(--bg-card-light);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--divider);
}
.data-table td {
  color: var(--text-primary);
  padding: 8px 12px;
  border-bottom: 1px solid var(--divider);
}
.data-table tr.highlight td {
  background: rgba(59,130,246,0.1);
  color: var(--primary);
  font-weight: 600;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Toast提示 */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 进度环容器 */
.progress-ring-container {
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
}

/* 快捷入口横向滚动 */
.quick-actions {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.quick-actions::-webkit-scrollbar { display: none; }
.quick-action-item {
  min-width: 72px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.quick-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-action-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

/* 小贴士卡片 */
.tip-card {
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(6,182,212,0.1));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
