/* 主样式文件 - CodeYMate IDE 官网
 * Cyber-Logic Terminal 设计系统实现
 */

/* 导入其他样式文件 */
@import url('./variables.css');
@import url('./themes.css');
@import url('./animations.css');

/* Google Fonts 导入 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;600;700&family=JetBrains+Mono:wght@400;450;700&family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body-md);
  line-height: var(--line-height-body-md);
  color: var(--color-on-background);
  background-color: var(--color-background);
  overflow-x: hidden;
  text-wrap: pretty;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Material Symbols 图标字体 */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
}

/* 容器 */
.container {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

/* ========== Header ========== */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(19, 19, 19, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--spacing-sm) var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
}

[data-theme="light"] .header {
  background: rgba(248, 249, 250, 0.8);
  border-bottom: 1px solid var(--color-border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.brand {
  font-family: var(--font-heading);
  font-size: var(--font-size-headline-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* 返回产品族首页链接 */
.home-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-default);
  color: var(--color-on-surface-variant);
  text-decoration: none;
  transition: all var(--transition-fast);
  margin-right: 4px;
}

.home-back-link:hover {
  color: var(--color-primary);
  background: var(--color-surface-container);
}

[data-theme="dark"] .home-back-link:hover {
  color: #00dbe7;
}

.home-back-link .material-symbols-outlined {
  font-size: 18px;
}

.nav {
  display: flex;
  gap: var(--spacing-md);
}

.nav-link {
  font-family: var(--font-body);
  font-size: var(--font-size-body-md);
  color: var(--color-on-surface-variant);
  text-decoration: none;
  padding: var(--spacing-xs) 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-on-surface);
}

.nav-link.active {
  border-bottom-color: var(--color-secondary);
}

[data-theme="dark"] .nav-link.active {
  border-bottom-color: #00f1fe;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* 语言选择器 */
.language-selector {
  position: relative;
}

.language-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-default);
  cursor: pointer;
  font-size: 12px;
  color: var(--color-on-surface-variant);
  transition: all var(--transition-base);
}

.language-button:hover {
  background: var(--color-surface-container);
}

.language-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  min-width: 128px;
  background: var(--color-surface-container-highest);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  z-index: var(--z-dropdown);
  display: none;
  animation: slideDown 0.2s ease-out;
}

.language-dropdown.active {
  display: block;
}

.language-option {
  display: block;
  width: 100%;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--color-on-surface);
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.language-option:hover {
  background: var(--color-primary-container);
  color: var(--color-on-primary);
}

/* Download 按钮 */
.btn-download {
  padding: 8px 24px;
  background: var(--color-primary-container);
  color: var(--color-on-primary);
  border: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-download:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.btn-download:active {
  transform: scale(0.95);
}

[data-theme="dark"] .btn-download {
  background: #0066ff;
  color: #f8f7ff;
}

/* ========== Hero Section ========== */
.hero {
  position: relative;
  min-height: 600px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--spacing-3xl);
  padding: var(--spacing-3xl) var(--spacing-lg);
  max-width: var(--container-max);
  margin: 0 auto;
  overflow: hidden;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-tag {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(0, 102, 255, 0.1);
  border: 1px solid rgba(179, 197, 255, 0.3);
  border-radius: var(--radius-full);
  font-family: var(--font-code);
  font-size: var(--font-size-label-caps);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-label-caps);
  margin-bottom: var(--spacing-md);
}

[data-theme="dark"] .hero-tag {
  background: rgba(179, 197, 255, 0.1);
  border-color: rgba(179, 197, 255, 0.3);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 64px;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-on-surface);
  margin-bottom: var(--spacing-lg);
}

.hero-title .neon-glow {
  text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

[data-theme="light"] .hero-title .neon-glow {
  text-shadow: 0 0 10px rgba(0, 102, 255, 0.3);
}

.hero-description {
  max-width: 800px;
  font-family: var(--font-body);
  font-size: var(--font-size-body-lg);
  line-height: var(--line-height-body-lg);
  color: var(--color-on-surface-variant);
  margin-bottom: var(--spacing-xl);
}

.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-start;
  margin-top: var(--spacing-md);
}

/* Hero 产品展示图 */
.hero-image-wrapper {
  position: relative;
  padding: 6px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.hero-image-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(0, 219, 231, 0.08) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

[data-theme="light"] .hero-image-glow {
  background: radial-gradient(ellipse, rgba(0, 102, 255, 0.06) 0%, transparent 70%);
}

/* Hero 数据亮点 */
.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-value {
  font-family: var(--font-code);
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary-fixed-dim);
  letter-spacing: -0.02em;
}

[data-theme="light"] .hero-stat-value {
  color: var(--color-primary);
}

.hero-stat-label {
  font-size: 12px;
  color: var(--color-on-surface-variant);
  white-space: nowrap;
}

.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--color-border);
}

/* ========== Section Dividers ========== */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-border) 20%,
    var(--color-secondary-fixed-dim) 50%,
    var(--color-border) 80%,
    transparent 100%
  );
  opacity: 0.6;
  margin: 0 auto;
  max-width: var(--container-max);
}

[data-theme="dark"] .section-divider {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.06) 20%,
    rgba(0,219,231,0.3) 50%,
    rgba(255,255,255,0.06) 80%,
    transparent 100%
  );
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--color-secondary);
  color: var(--color-on-secondary);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-base);
}

[data-theme="dark"] .btn-primary {
  background: #00f1fe;
  color: #00363a;
}

.btn-primary:hover {
  box-shadow: 0 0 20px rgba(0, 241, 254, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: transparent;
  color: var(--color-on-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-secondary:hover {
  background: var(--color-surface-container);
}

/* ========== Features Section ========== */
.features {
  padding: var(--spacing-4xl) var(--spacing-lg);
}

.features-header {
  text-align: center;
  margin-bottom: var(--spacing-3xl);
}

.features-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-headline-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-on-surface);
  margin-bottom: var(--spacing-md);
}

.features-divider {
  width: 80px;
  height: 4px;
  background: var(--color-primary-container);
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-md);
  max-width: var(--container-max);
  margin: 0 auto;
}

.feature-card {
  padding: var(--spacing-lg);
  background: var(--glass-panel);
  border: 1px solid var(--color-border);
  border-top: 3px solid transparent;
  border-radius: var(--radius-xl);
  transition: all var(--transition-slow);
  position: relative;
}

/* 卡片差异化色调 — 使用 tertiary 色系变体 */
.feature-card:nth-child(1) { border-top-color: rgba(0, 219, 231, 0.5); }
.feature-card:nth-child(2) { border-top-color: rgba(99, 102, 241, 0.5); }
.feature-card:nth-child(3) { border-top-color: rgba(132, 71, 255, 0.5); }
.feature-card:nth-child(4) { border-top-color: rgba(0, 219, 231, 0.5); }
.feature-card:nth-child(5) { border-top-color: rgba(99, 102, 241, 0.5); }
.feature-card:nth-child(6) { border-top-color: rgba(132, 71, 255, 0.5); }

[data-theme="light"] .feature-card:nth-child(1),
[data-theme="light"] .feature-card:nth-child(4) { border-top-color: rgba(0, 102, 255, 0.4); }
[data-theme="light"] .feature-card:nth-child(2),
[data-theme="light"] .feature-card:nth-child(5) { border-top-color: rgba(99, 102, 241, 0.4); }
[data-theme="light"] .feature-card:nth-child(3),
[data-theme="light"] .feature-card:nth-child(6) { border-top-color: rgba(132, 71, 255, 0.4); }

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(179, 197, 255, 0.1);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-md);
  font-size: 32px;
  color: var(--color-primary);
}

[data-theme="dark"] .feature-icon {
  background: rgba(0, 242, 255, 0.1);
  color: #00dbe7;
}

.feature-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-headline-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-on-surface);
  margin-bottom: var(--spacing-sm);
}

.feature-description {
  font-family: var(--font-body);
  font-size: var(--font-size-body-md);
  line-height: var(--line-height-body-md);
  color: var(--color-on-surface-variant);
  margin-bottom: var(--spacing-md);
}

/* Feature Header - Icon + Title inline */
.feature-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.feature-header .feature-icon {
  width: 36px;
  height: 36px;
  font-size: 24px;
  margin-bottom: 0;
}

.feature-header .feature-title {
  margin-bottom: 0;
}

/* Feature Image */
.feature-image-wrapper {
  margin-top: var(--spacing-sm);
  overflow: hidden;
  border-radius: var(--radius-md);
}

.feature-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-secondary-fixed-dim);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.feature-image:hover {
  box-shadow: 0 0 16px rgba(0, 219, 231, 0.25);
  cursor: zoom-in;
  transform: scale(1.01);
}

[data-theme="light"] .feature-image {
  border-color: var(--color-primary-light);
}

[data-theme="light"] .feature-image:hover {
  box-shadow: 0 0 16px rgba(0, 102, 255, 0.2);
}

/* ========== Lightbox ========== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-secondary-fixed-dim);
  box-shadow: 0 0 30px rgba(0, 219, 231, 0.25);
}

[data-theme="light"] .lightbox-image {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 30px rgba(0, 102, 255, 0.2);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-close .material-symbols-outlined {
  font-size: 24px;
}

/* ========== Footer ========== */
.footer {
  background: var(--color-surface-container-lowest);
  border-top: 1px solid var(--color-border-light);
  padding: var(--spacing-3xl) var(--spacing-lg);
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: var(--font-size-headline-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-on-surface);
  margin-bottom: var(--spacing-md);
}

.footer-tagline {
  font-family: var(--font-code);
  font-size: var(--font-size-code-sm);
  line-height: var(--line-height-code-sm);
  color: var(--color-outline);
  max-width: 400px;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}

.footer-links-title {
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  color: var(--color-on-surface);
  margin-bottom: var(--spacing-sm);
}

.footer-link {
  display: block;
  font-family: var(--font-code);
  font-size: var(--font-size-code-sm);
  color: var(--color-outline);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-secondary);
}

[data-theme="dark"] .footer-link:hover {
  color: #00dbe7;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    text-align: center;
  }

  .hero-content {
    align-items: center;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    max-width: 560px;
    margin: 0 auto;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 48px;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
  }

  .hero-stat-divider {
    width: 24px;
    height: 1px;
  }

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

  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer-links-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .hero {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
  }
}