/* 全局变量 - 夜视监控+荧光配色主题 */
:root {
  --color-bg: #0A0E12;
  --color-card: #1A1E24;
  --color-primary: #20F3B0;
  --color-accent: #FF2EC6;
  --color-white: #FFFFFF;
  --color-gray: #9CA3AF;
  --radius-xl: 1.25rem;
  --radius-lg: 0.75rem;
  --shadow-deep: 0 6px 24px -4px rgba(32,243,176,0.25);
  --font-bebas: 'Bebas Neue', sans-serif;
  --font-inter: 'Inter', system-ui, sans-serif;
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-inter);
  background-color: var(--color-bg);
  color: var(--color-white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

/* 标题系统 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-family: var(--font-bebas);
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  margin-bottom: 1rem;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-bg);
  box-shadow: var(--shadow-deep);
}

.btn-primary:hover {
  background-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px -4px rgba(255,46,198,0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

/* 卡片 */
.card {
  background-color: var(--color-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
}

/* 英雄区域 */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(32,243,176,0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* 导航栏 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(10, 14, 18, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--color-primary);
}

/* 网格系统 */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 章节间距 */
section {
  padding: 5rem 0;
}

/* 文本样式 */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--color-primary);
}

.text-accent {
  color: var(--color-accent);
}

.text-gray {
  color: var(--color-gray);
}

/* 代码块 */
.code-block {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(32, 243, 176, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* 响应式视频 */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.video-container video,
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 表单元素 */
.input {
  background-color: var(--color-card);
  border: 1px solid rgba(32, 243, 176, 0.3);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1.25rem;
  color: var(--color-white);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* 页脚 */
.footer {
  background-color: var(--color-card);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
}

/* 标签 */
.tag {
  display: inline-block;
  background-color: rgba(32, 243, 176, 0.2);
  color: var(--color-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 骨架屏加载 */
.skeleton {
  background-color: var(--color-card);
  animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
  0% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

/* 工具类 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }

.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* 列表样式 */
.list-decimal {
  list-style-type: decimal;
  padding-left: 1.5rem;
}

.list-disc {
  list-style-type: disc;
  padding-left: 1.5rem;
}

/* 图片效果 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-hover {
  transition: all 0.3s ease;
  filter: brightness(0.9);
}

.img-hover:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

/* 特殊效果 - 夜视监控风格 */
.night-vision {
  position: relative;
  overflow: hidden;
}

.night-vision::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(32, 243, 176, 0.03) 2px,
    rgba(32, 243, 176, 0.03) 4px
  );
  pointer-events: none;
}

/* 响应式隐藏 */
@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none;
  }
}

/* 额外的优化样式 */

/* 链接默认样式 */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-accent);
}

/* 选中文本样式 */
::selection {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

::-moz-selection {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* 焦点可见性 - 无障碍优化 */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 性能优化 - 减少重绘 */
.card,
.btn,
.img-hover,
.nav-link {
  will-change: transform;
}

/* 打印样式 */
@media print {
  .navbar,
  .footer,
  .btn,
  .hide-print {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式字体大小 */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #00FF88;
    --color-accent: #FF0099;
  }
}

/* 暗色模式优化（虽然已经是暗色主题） */
@media (prefers-color-scheme: light) {
  /* 为喜欢亮色的用户提供选择 */
  body.light-mode {
    --color-bg: #FFFFFF;
    --color-card: #F3F4F6;
    --color-white: #111827;
    --color-gray: #6B7280;
  }
}

/* 减少动画 - 无障碍 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 修复移动端导航栏 */
@media (max-width: 768px) {
  .navbar-content {
    flex-wrap: wrap;
  }
  
  .nav-menu {
    width: 100%;
    justify-content: space-around;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
  }
}

/* 按钮组样式 */
.btn-group {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background-color: var(--color-accent);
  color: var(--color-white);
}

/* 提示框样式 */
.alert {
  padding: 1rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  border: 1px solid;
}

.alert-success {
  background-color: rgba(32, 243, 176, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.alert-error {
  background-color: rgba(255, 46, 198, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Flexbox工具类 */
.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: 1rem;
}

/* 文本工具类 */
.font-semibold {
  font-weight: 600;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

/* 光标样式 */
.cursor-pointer {
  cursor: pointer;
}

/* 防止文本选中 */
.select-none {
  user-select: none;
}

/* 截断文本 */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, var(--color-card) 0%, rgba(32, 243, 176, 0.1) 100%);
}

/* 模糊背景 */
.blur-bg {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}