/**
 * 铝单板建材官网 - 自定义样式
 * 与原Next.js版本保持一致 - 完整版
 */

/* ===== 主题变量系统 ===== */
:root {
  --radius: 0.5rem;
  --background: #f8f9fc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --primary: #6366f1;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #6366f1;
  --accent-foreground: #ffffff;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: #6366f1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --bg-primary: #f8f9fc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.dark {
  --background: #0a0e27;
  --foreground: #f8fafc;
  --card: #1a1f3a;
  --card-foreground: #f8fafc;
  --primary: #818cf8;
  --primary-foreground: #ffffff;
  --secondary: #1e293b;
  --secondary-foreground: #f8fafc;
  --muted: #1e293b;
  --muted-foreground: #94a3b8;
  --accent: #a78bfa;
  --accent-foreground: #ffffff;
  --border: #334155;
  --input: #334155;
  --ring: #818cf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --bg-primary: #0a0e27;
  --bg-secondary: #1a1f3a;
  --bg-card: #1a1f3a;
  --border-color: #334155;
}

/* ===== 基础样式 ===== */
* {
  border-color: var(--border-color);
}

body {
  background-color: var(--bg-primary);
  color: var(--foreground);
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', ui-sans-serif, system-ui, sans-serif;
}

/* ===== 主题自适应设计系统 ===== */

/* 渐变背景 */
.tech-gradient {
  background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 50%, #f0f4ff 100%);
}

.dark .tech-gradient {
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1429 100%);
}

/* 网格背景 */
.tech-grid {
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
  background-size: 50px 50px;
}

.dark .tech-grid {
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
}

/* 发光效果 */
.glow-effect {
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.15),
    0 0 40px rgba(99, 102, 241, 0.05);
}

.dark .glow-effect {
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.3),
    0 0 40px rgba(99, 102, 241, 0.1);
}

/* 霓虹边框 */
.neon-border {
  border: 1px solid rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.03);
}

.dark .neon-border {
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

/* 科技感卡片 */
.tech-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.12);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.dark .tech-card {
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.8) 0%, rgba(15, 20, 41, 0.9) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: none;
}

.tech-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.12);
  transform: translateY(-4px);
}

.dark .tech-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow:
    0 0 30px rgba(99, 102, 241, 0.2),
    0 8px 30px rgba(0, 0, 0, 0.3);
}

/* 渐变文字 */
.text-gradient-tech {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 强调渐变 */
.accent-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* 分割线 */
.tech-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.2), transparent);
}

.dark .tech-line {
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
}

/* 装饰圆 */
.deco-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.08);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
}

.dark .deco-circle {
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

/* 装饰方块 */
.deco-square {
  position: absolute;
  border: 1px solid rgba(99, 102, 241, 0.06);
  background: rgba(99, 102, 241, 0.01);
}

.dark .deco-square {
  border: 1px solid rgba(99, 102, 241, 0.15);
  background: rgba(99, 102, 241, 0.05);
}

/* 动画 */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.6s ease-out forwards;
}

/* 点状背景 */
.tech-dots {
  background-image: radial-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px);
  background-size: 30px 30px;
}

.dark .tech-dots {
  background-image: radial-gradient(rgba(99, 102, 241, 0.15) 1px, transparent 1px);
}

/* 波浪背景 */
.tech-waves {
  background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
}

.dark .tech-waves {
  background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
}

/* 按钮样式 */
.btn-tech {
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
  border-radius: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-tech::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;
}

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

.btn-tech:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

/* 导航栏样式 */
.nav-tech {
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.dark .nav-tech {
  background: rgba(10, 14, 39, 0.92);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* 区块分割线 */
.section-divider {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15), transparent);
}

.dark .section-divider {
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.section-divider::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.dark .section-divider::before {
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* 计数器盒子 */
.counter-box {
  position: relative;
  padding: 2rem;
  text-align: center;
}

.counter-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, transparent);
  transition: width 0.5s ease;
}

.counter-box:hover::after {
  width: 80%;
}

/* Hero 区域图片容器 */
.hero-image-container {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.2);
}

.dark .hero-image-container {
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* 打字机效果 */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== 工具类 ===== */
.bg-theme { background-color: var(--bg-primary); }
.bg-theme-secondary { background-color: var(--bg-secondary); }
.bg-theme-card { background-color: var(--bg-card); }
.text-theme-primary { color: var(--text-primary); }
.text-theme-secondary { color: var(--text-secondary); }
.text-theme-muted { color: var(--text-muted); }
.bg-theme-gradient { background: var(--brand-gradient); }

/* 响应式隐藏 */
@media (max-width: 1023px) {
  .lg\:hidden { display: none !important; }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex !important; }
  .lg\:grid { display: grid !important; }
  .hidden\.lg\:block { display: none !important; }
}

/* 过渡效果 */
.transition-all {
  transition: all 0.3s ease;
}

.transition-colors {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* 焦点样式 */
.focus\:ring-2:focus {
  ring: 2px;
  ring-color: var(--ring);
}

.focus\:border-transparent:focus {
  border-color: transparent;
}

.outline-none:focus {
  outline: none;
}
