/* 统一设计语言 - 现代简约科技风 */

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

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(51, 65, 85, 0.9);
  --border-light: rgba(148, 163, 184, 0.12);
  --border-medium: rgba(148, 163, 184, 0.2);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --glass-bg: rgba(15, 23, 42, 0.95);
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-accent: linear-gradient(135deg, #60a5fa 0%, #34d399 100%);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
}

/* 顶部导航 */
.tech-nav {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.tech-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.tech-nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tech-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid var(--border-light);
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-secondary);
  white-space: nowrap;
}

.tech-nav-link:hover:not(.active) {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.tech-nav-link:active {
  transform: translateY(0);
}

.tech-nav-link.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.tech-title {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

/* 页面内容容器 */
.page-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* 卡片样式 */
.section, .stat-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

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

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

/* 按钮样式 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* 输入框样式 */
input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-secondary);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-light);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

tr:hover {
  background: rgba(15, 23, 42, 0.4);
}

tr:last-child td {
  border-bottom: none;
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.tag-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.tag-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.tag-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.tag-primary {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.tag-muted {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

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

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(30, 41, 59, 0.98);
  border: 1px solid var(--border-light);
  padding: 24px;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(107, 114, 128, 0.2);
  color: var(--text-primary);
}

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

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

/* Toast 提示 */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.98);
  color: var(--text-primary);
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  z-index: 9999;
  display: none;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-value.negative {
  color: #fb7185;
}

.stat-value.positive {
  color: #4ade80;
}

.stat-value.neutral {
  color: #60a5fa;
}

/* 进度条 */
.progress-bar {
  height: 8px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-fill.success {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.progress-fill.warning {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-fill.danger {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .tech-nav {
    padding: 10px 12px;
  }
  
  .tech-nav-links {
    gap: 6px;
  }
  
  .tech-nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .tech-title {
    font-size: 18px;
  }
  
  .page-content {
    padding: 16px 12px;
  }
  
  .section, .stat-card {
    padding: 16px;
    border-radius: 16px;
  }
  
  .stats-grid {
    gap: 12px;
  }
  
  .stat-value {
    font-size: 22px;
  }
  
  table {
    display: block;
    overflow-x: auto;
  }
  
  .modal-content {
    padding: 20px;
    border-radius: 16px;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .stat-card {
    padding: 14px;
  }
  
  .stat-value {
    font-size: 20px;
  }
  
  .stat-label {
    font-size: 12px;
  }
  
  .tech-nav-links {
    justify-content: center;
  }
}

/* 隐藏元素 */
.hidden {
  display: none !important;
}

/* 通用工具类 */
.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mt-4 {
  margin-top: 16px;
}

.w-full {
  width: 100%;
}

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

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.7);
}
