/* ===================================
   CSS变量定义 - 统一管理颜色和尺寸
   =================================== */
:root {
  /* 颜色系统 */
  --primary-color: #1a1a1a;
  --secondary-color: #4a4a4a;
  --accent-color: #2563eb;
  --brand-blue: #0066cc;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --background-primary: #ffffff;
  --background-secondary: #f8f9fa;
  --border-color: #e5e7eb;
  
  /* 字体系统 */
  --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  
  /* 尺寸系统 */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 1rem;     /* 16px */
  --spacing-md: 1.5rem;   /* 24px */
  --spacing-lg: 2rem;     /* 32px */
  --spacing-xl: 3rem;     /* 48px */
  --spacing-xxl: 4rem;    /* 64px */
  
  /* 响应式断点 */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  
  /* 圆角和阴影 */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ===================================
   重置和基础样式
   =================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   主容器 - 居中对称布局
   =================================== */
.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
  background-color: transparent;
}

/* ===================================
   头部区域 - 左右分居布局
   =================================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: var(--font-weight-bold);
  color: var(--brand-blue);
  margin-bottom: 0;
  letter-spacing: 0.05em;
}

/* 导航样式 */
.navigation {
  margin-top: 0;
}

.nav-list {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-lg);
  list-style: none;
  padding: 0;
}

.nav-item {
  font-size: 1.125rem;
  font-weight: var(--font-weight-medium);
  color: var(--primary-color);
  cursor: pointer;
  transition: color 0.3s ease;
  position: relative;
  padding: var(--spacing-xs) var(--spacing-sm);
}

.nav-item:hover,
.nav-item:focus {
  color: var(--brand-blue);
  outline: none;
}

.nav-item.active {
  color: var(--brand-blue);
  font-weight: var(--font-weight-bold);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background-color: var(--brand-blue);
  border-radius: var(--border-radius-sm);
}

/* ===================================
   主要内容区域
   =================================== */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--spacing-lg) 0;
}

.content-module {
  width: 100%;
  text-align: center;
  display: none;
}

.content-module.active {
  display: block;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

/* 文本内容样式 */
.text-content {
  text-align: left;
  padding: var(--spacing-sm);
}

.main-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: var(--font-weight-bold);
  color: var(--brand-blue);
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
  white-space: nowrap;
}

.subtitle {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

.description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.description-paragraph {
  margin-bottom: var(--spacing-sm);
}

.description-paragraph:last-child {
  margin-bottom: 0;
}

/* 图片内容样式 */
.visual-content {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-sm);
}

/* AI旋转魔方样式 */
.ai-cube-container {
  width: 150px;
  height: 150px;
  perspective: 1000px;
  position: relative;
}

.ai-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateCube 12s infinite linear;
}

@keyframes rotateCube {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  100% {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

.cube-face {
  position: absolute;
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #3399ff 50%, var(--accent-color) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
  backdrop-filter: blur(5px);
}

.cube-face.front {
  transform: translateZ(75px);
}

.cube-face.back {
  transform: rotateY(180deg) translateZ(75px);
}

.cube-face.right {
  transform: rotateY(90deg) translateZ(75px);
}

.cube-face.left {
  transform: rotateY(-90deg) translateZ(75px);
}

.cube-face.top {
  transform: rotateX(90deg) translateZ(75px);
}

.cube-face.bottom {
  transform: rotateX(-90deg) translateZ(75px);
}

.cube-text {
  position: relative;
  z-index: 1;
  letter-spacing: 0.2em;
}

/* ===================================
   联系方式区域
   =================================== */
.contact-section {
  margin-top: auto;
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  text-align: left;
}

.contact-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

.contact-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
}

.contact-item {
  padding: 0;
}

.contact-value {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
}

/* 公司信息样式 */
.company-info {
  text-align: center;
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border-color);
}

.company-name,
.icp-number {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.icp-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.icp-link:hover {
  color: var(--brand-blue);
  text-decoration: underline;
}

/* ===================================
   响应式设计
   =================================== */

/* 平板设备 (768px 及以下) */
@media (max-width: 768px) {
  .page-container {
    padding: var(--spacing-md) var(--spacing-sm);
  }
  
  .header {
    flex-direction: column;
    text-align: center;
  }
  
  .brand-logo {
    margin-bottom: var(--spacing-sm);
  }
  
  .nav-list {
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
  }
  
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    text-align: center;
  }
  
  .text-content {
    text-align: center;
    padding: var(--spacing-md);
  }
  
  .contact-container {
    gap: var(--spacing-sm);
  }
  
  .contact-title {
    text-align: center;
  }
  
  .contact-item {
    text-align: center;
  }
  
  .ai-cube-container {
    width: 120px;
    height: 120px;
  }
  
  .cube-face {
    width: 120px;
    height: 120px;
    font-size: 2rem;
  }
  
  .cube-face.front {
    transform: translateZ(60px);
  }
  
  .cube-face.back {
    transform: rotateY(180deg) translateZ(60px);
  }
  
  .cube-face.right {
    transform: rotateY(90deg) translateZ(60px);
  }
  
  .cube-face.left {
    transform: rotateY(-90deg) translateZ(60px);
  }
  
  .cube-face.top {
    transform: rotateX(90deg) translateZ(60px);
  }
  
  .cube-face.bottom {
    transform: rotateX(-90deg) translateZ(60px);
  }
}

/* 手机设备 (640px 及以下) */
@media (max-width: 640px) {
  .page-container {
    padding: var(--spacing-sm) var(--spacing-xs);
  }
  
  .brand-logo {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
  }
  
  .main-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
  }
  
  .subtitle {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
  }
  
  .nav-item {
    font-size: 1rem;
    padding: var(--spacing-xs);
  }
  
  .text-content,
  .visual-content {
    padding: var(--spacing-sm);
  }
  
  .contact-title {
    font-size: 1.5rem;
  }
}

/* 大屏幕优化 (1280px 及以上) */
@media (min-width: 1280px) {
  .page-container {
    padding: var(--spacing-xxl) var(--spacing-xl);
  }
  
  .content-wrapper {
    gap: var(--spacing-xxl);
  }
  
  .main-title {
    font-size: 2.5rem;
  }
  
  .subtitle {
    font-size: 1.5rem;
  }
}

/* ===================================
   打印样式
   =================================== */
@media print {
  .page-container {
    max-width: none;
  }
  
  .nav-item {
    color: var(--primary-color);
  }
  
  .nav-item.active {
    color: var(--brand-blue);
  }
  
  .content-module {
    display: block;
  }
  
  .ai-cube {
    animation: none;
  }
}

/* ===================================
   可访问性增强
   =================================== */

/* 焦点样式改进 */
.nav-item:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --border-color: #666666;
  }
  
  .nav-item.active {
    color: #0000ff;
  }
  
  .nav-item.active::after {
    background-color: #0000ff;
  }
}