/* ============================================
   玄晶引擎3.0 - 组件样式
   ============================================ */

/* ============================================
   导航栏
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-base);
  background: transparent;
}

.navbar.scrolled {
  background: var(--color-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--border-glass);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.navbar__logo {
  height: 40px;
  width: auto;
}

.navbar__title {
  font-size: var(--text-xl);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.navbar__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  position: relative;
  padding: var(--space-xs) 0;
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width var(--transition-base);
}

.navbar__link:hover::after,
.navbar__link.active::after {
  width: 100%;
}

.navbar__link:hover,
.navbar__link.active {
  color: var(--color-text-primary);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* 导航栏按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn--ghost {
  color: var(--color-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--ghost:hover {
  color: var(--color-text-primary);
  border-color: var(--color-accent);
  background: rgba(0, 255, 198, 0.1);
}

.btn--gradient {
  background: var(--gradient-primary);
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn--gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn--gradient:hover::before {
  left: 100%;
}

.btn--gradient:hover {
  box-shadow: 0 0 20px rgba(65, 105, 225, 0.5);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn--outline:hover {
  background: rgba(0, 255, 198, 0.1);
  box-shadow: var(--shadow-glow);
}

/* 移动端菜单按钮 */
.navbar__menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  background: none;
  border: none;
  cursor: pointer;
}

.navbar__menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  transition: all var(--transition-base);
}

/* ============================================
   3D背景画布
   ============================================ */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-bg);
  pointer-events: none;
}

/* ============================================
   语音助手
   ============================================ */
.voice-assistant {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: var(--z-voice);
}

.voice-assistant__toggle {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  border: 2px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  color: white;
  box-shadow: var(--shadow-glow);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 255, 198, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 255, 198, 0.7);
  }
}

.voice-assistant__toggle:hover {
  transform: scale(1.1);
}

.voice-assistant__panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 360px;
  background: var(--color-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
}

.voice-assistant__panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.voice-assistant__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.voice-assistant__title {
  font-size: var(--text-lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.voice-assistant__status {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.voice-assistant__close {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-size: var(--text-xl);
  cursor: pointer;
}

.voice-assistant__close:hover {
  color: var(--color-text-primary);
}

.voice-assistant__messages {
  height: 200px;
  overflow-y: auto;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.voice-assistant__message {
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.voice-assistant__message--bot {
  background: rgba(65, 105, 225, 0.2);
  margin-right: 20%;
}

.voice-assistant__message--user {
  background: rgba(0, 255, 198, 0.2);
  margin-left: 20%;
  text-align: right;
}

.voice-assistant__input-area {
  display: flex;
  gap: var(--space-sm);
}

.voice-assistant__input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
}

.voice-assistant__input::placeholder {
  color: var(--color-text-muted);
}

.voice-assistant__send,
.voice-assistant__mic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-assistant__mic {
  background: rgba(0, 255, 198, 0.2);
  border: 1px solid var(--color-accent);
}

.voice-assistant__mic.recording {
  animation: recording-pulse 1s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% { background: rgba(255, 0, 0, 0.3); }
  50% { background: rgba(255, 0, 0, 0.6); }
}

.voice-assistant__quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.voice-assistant__quick-btn {
  padding: var(--space-xs) var(--space-sm);
  background: rgba(255, 255, 255, 0.05);
  border: var(--border-glass);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.voice-assistant__quick-btn:hover {
  background: rgba(0, 255, 198, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ============================================
   卡片组件
   ============================================ */
.card {
  background: var(--color-bg-secondary);
  border: var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: rgba(65, 105, 225, 0.3);
}

.card:hover::before {
  opacity: 1;
}

.card--glow {
  border: var(--border-glow);
}

.card--glow:hover {
  box-shadow: var(--shadow-glow);
}

.card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  color: white;
  margin-bottom: var(--space-lg);
}

.card__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.card__description {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: 1.6;
}

/* ============================================
   数据计数器
   ============================================ */
.counter {
  text-align: center;
}

.counter__value {
  font-size: var(--text-4xl);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: var(--font-mono);
}

.counter__label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-xs);
}

/* ============================================
   标签
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(65, 105, 225, 0.15);
  border: 1px solid rgba(65, 105, 225, 0.3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary-light);
}

.tag--success {
  background: rgba(0, 255, 198, 0.15);
  border-color: rgba(0, 255, 198, 0.3);
  color: var(--color-accent);
}

.tag--warning {
  background: rgba(255, 165, 0, 0.15);
  border-color: rgba(255, 165, 0, 0.3);
  color: #FFA500;
}

.tag--error {
  background: rgba(255, 0, 0, 0.15);
  border-color: rgba(255, 0, 0, 0.3);
  color: #FF4444;
}

/* ============================================
   模态框
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal__content {
  position: relative;
  background: var(--color-bg-secondary);
  border: var(--border-glass);
  border-radius: var(--radius-2xl);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-2xl);
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.modal.active .modal__content {
  transform: scale(1);
}

.modal__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: var(--border-glass);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
}

.modal__close:hover {
  background: rgba(255, 0, 0, 0.2);
  color: #FF4444;
}

/* ============================================
   表单
   ============================================ */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.2);
}

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

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* ============================================
   页脚
   ============================================ */
.footer {
  padding: var(--space-3xl) var(--space-xl);
  background: var(--color-bg-secondary);
  border-top: var(--border-glass);
}

.footer__content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2xl);
}

.footer__brand {
  grid-column: span 1;
}

.footer__logo {
  height: 48px;
  margin-bottom: var(--space-md);
}

.footer__description {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: 1.6;
}

.footer__section-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.footer__link:hover {
  color: var(--color-accent);
}

.footer__bottom {
  max-width: 1400px;
  margin: var(--space-2xl) auto 0;
  padding-top: var(--space-xl);
  border-top: var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__copyright {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer__social {
  display: flex;
  gap: var(--space-md);
}

.footer__social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: all var(--transition-fast);
}

.footer__social-link:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  transform: translateY(-2px);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1024px) {
  .navbar__nav {
    gap: var(--space-lg);
  }
  
  .footer__content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: var(--space-sm) var(--space-md);
  }
  
  .navbar__nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-bg-glass);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }
  
  .navbar__nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .navbar__actions {
    display: none;
  }
  
  .navbar__menu-btn {
    display: flex;
  }
  
  .voice-assistant__panel {
    width: calc(100vw - var(--space-xl) * 2);
    right: calc(-1 * var(--space-xl));
  }
  
  .footer__content {
    grid-template-columns: 1fr;
  }
  
  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}
