/* ============================================
   WECAPS.EU — 设计系统
   品牌色：黑 #1A1A1A / 蓝渐变 #1A8FD1→#4BB8E8
   字体：Inter
   风格参考：Apple.com
   ============================================ */

/* --- Google Fonts 引入 --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS 变量（设计令牌） --- */
:root {
  /* 品牌色 */
  --color-black:      #1A1A1A;
  --color-blue-start: #1A8FD1;
  --color-blue-end:   #4BB8E8;
  --color-white:      #FFFFFF;
  --color-gray-light: #F5F5F7;
  --color-gray-mid:   #6E6E73;
  --color-gray-dark:  #3A3A3C;

  /* 渐变 */
  --gradient-blue: linear-gradient(135deg, var(--color-blue-start), var(--color-blue-end));
  --gradient-dark: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 100%);

  /* 字体 */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* 字号（苹果风格大字排版） */
  --text-hero:    clamp(2.5rem, 6vw, 5rem);
  --text-h1:      clamp(2rem, 4vw, 3.5rem);
  --text-h2:      clamp(1.5rem, 3vw, 2.5rem);
  --text-h3:      clamp(1.2rem, 2vw, 1.5rem);
  --text-body:    1rem;
  --text-small:   0.875rem;

  /* 间距 */
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   2rem;
  --space-lg:   4rem;
  --space-xl:   8rem;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* 动画 */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* 导航高度 */
  --nav-height: 60px;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-main);
  color: var(--color-black);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- 导航栏 --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--transition), backdrop-filter var(--transition);
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-small);
  font-weight: 400;
  color: var(--color-white);
  transition: opacity var(--transition);
}

.nav.scrolled .nav-links a {
  color: var(--color-black);
}

.nav-links a:hover {
  opacity: 0.7;
}

.nav-cta {
  background: var(--gradient-blue);
  color: var(--color-white) !important;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-weight: 500;
  font-size: var(--text-small);
  transition: opacity var(--transition), transform var(--transition);
}

.nav-cta:hover {
  opacity: 0.85 !important;
  transform: scale(1.02);
}

/* --- Hero 区 --- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.25) 60%,
    rgba(0,0,0,0.5) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--color-white);
  max-width: 800px;
  padding: var(--space-md);
}

.hero-eyebrow {
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: var(--space-sm);
}

.hero-title {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.hero-title span {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.hero-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--gradient-blue);
  color: var(--color-white);
  padding: 0.875rem 2rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: var(--text-body);
  transition: transform var(--transition), opacity var(--transition);
  display: inline-block;
}

.btn-primary:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

.btn-secondary {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0.875rem 2rem;
  border-radius: 100px;
  font-weight: 500;
  font-size: var(--text-body);
  transition: background var(--transition);
  display: inline-block;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.25);
}

/* --- Section 通用 --- */
.section {
  padding: var(--space-xl) var(--space-md);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-blue-start);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--color-gray-mid);
  line-height: 1.7;
  max-width: 600px;
}

/* --- 业务亮点 3列 --- */
.features {
  background: var(--color-gray-light);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.feature-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: var(--gradient-blue);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  fill: white;
}

.feature-title {
  font-size: var(--text-h3);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.feature-text {
  color: var(--color-gray-mid);
  line-height: 1.7;
  font-size: var(--text-body);
}

/* --- 数据展示区 --- */
.stats {
  background: var(--color-black);
  color: var(--color-white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  text-align: center;
}

.stat-number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--text-body);
  color: rgba(255,255,255,0.65);
  font-weight: 400;
}

/* --- Footer --- */
.footer {
  background: var(--color-black);
  color: rgba(255,255,255,0.7);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand img {
  height: 28px;
  margin-bottom: var(--space-sm);
  filter: brightness(10);
}

.footer-brand p {
  font-size: var(--text-small);
  line-height: 1.8;
}

.footer-col h4 {
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  font-size: var(--text-small);
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: var(--color-white);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  font-size: var(--text-small);
}

/* --- 社交媒体图标 --- */
.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background var(--transition), transform var(--transition);
}

.footer-social a:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: rgba(255,255,255,0.7);
}

.footer-social a:hover svg {
  fill: var(--color-white);
}

/* --- 语言选择器（Apple 风格） --- */
.lang-switcher {
  position: relative;
  margin-left: var(--space-sm);
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: var(--text-small);
  font-weight: 400;
  color: var(--color-white);
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.nav.scrolled .lang-trigger {
  color: var(--color-black);
}

.lang-trigger:hover {
  background: rgba(255,255,255,0.12);
}

.nav.scrolled .lang-trigger:hover {
  background: rgba(0,0,0,0.05);
}

.lang-flag {
  font-size: 1.125rem;
  line-height: 1;
}

.lang-code {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lang-chevron {
  width: 10px;
  height: 10px;
  transition: transform var(--transition);
}

.lang-switcher.open .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
  padding: 0.375rem;
  z-index: 1100;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-switcher.open .lang-dropdown {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-small);
  font-weight: 400;
  color: var(--color-black);
  transition: background 0.15s ease;
  white-space: nowrap;
}

.lang-option:hover {
  background: rgba(0,0,0,0.04);
}

.lang-option.active {
  font-weight: 600;
  color: var(--color-blue-start);
  background: rgba(26,143,209,0.06);
}

.lang-option .lang-opt-flag {
  font-size: 1.25rem;
  line-height: 1;
  width: 1.5rem;
  text-align: center;
}

.lang-option .lang-opt-name {
  flex: 1;
}

.lang-option .lang-opt-check {
  width: 16px;
  height: 16px;
  opacity: 0;
}

.lang-option.active .lang-opt-check {
  opacity: 1;
  color: var(--color-blue-start);
}

/* --- Scroll-reveal 动画类 --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- ERP 接口预留标记（Phase 2 对接用） --- */
[data-erp-source] {
  /* 带此属性的元素，Phase 2 将由 api.js 动态填充 */
}

/* ============================================
   数字人 Nora 预留样式（Phase W2/W3 填充）
   ============================================ */

.dh-trigger {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  background: var(--gradient-blue);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-main);
  font-size: var(--text-small);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 32px rgba(26,143,209,0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}

.dh-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(26,143,209,0.45);
}

.dh-mount {
  position: fixed;
  bottom: 5rem;
  right: 2rem;
  z-index: 901;
  width: 380px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
  overflow: hidden;
}

.dh-avatar {
  width: 100%;
  height: 240px;
  background: var(--color-gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-mid);
  font-size: var(--text-small);
}

.dh-messages {
  height: 160px;
  overflow-y: auto;
  padding: 1rem;
  font-size: var(--text-small);
}

.dh-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.dh-text-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: var(--text-small);
  background: transparent;
}

.dh-voice-btn, .dh-send-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
}

.dh-voice-btn[data-state="recording"] {
  color: red;
  animation: pulse-mic 1s ease infinite;
}

@keyframes pulse-mic {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}

/* ============================================
   汉堡菜单（移动端，JS 动态插入按钮）
   ============================================ */

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-white);
  padding: 0.25rem;
  line-height: 1;
}

.nav.scrolled .nav-hamburger {
  color: var(--color-black);
}

/* ============================================
   响应式 — 平板（≤ 1024px）
   ============================================ */

@media (max-width: 1024px) {

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

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

  /* ueber-uns 历史区双列 → 单列 */
  .section-inner[style*="grid-template-columns:1fr 1fr"] {
    /* 由内联样式控制，无法直接覆盖 — 通过通用类处理 */
  }

}

/* ============================================
   响应式 — 手机（≤ 768px）
   ============================================ */

@media (max-width: 768px) {

  /* 语言选择器移动端 */
  .lang-switcher {
    margin-left: 0;
  }

  .lang-trigger {
    color: var(--color-black);
  }

  .lang-dropdown {
    right: auto;
    left: 0;
  }

  /* 导航：汉堡菜单 */
  .nav-hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-sm) var(--space-md);
    gap: 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a,
  .nav.scrolled .nav-links a {
    color: var(--color-black);
    font-size: var(--text-body);
  }

  .nav-cta {
    display: inline-block;
    text-align: center;
    margin-top: 0.25rem;
  }

  /* Hero */
  .hero {
    min-height: 500px;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-buttons a {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }

  /* Section 间距缩小 */
  .section {
    padding: var(--space-lg) var(--space-sm);
  }

  /* 业务亮点 → 1列 */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* 数据展示 → 2列 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* Footer → 1列 */
  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  /* Kontakt 双列 → 单列（内联 grid 覆盖） */
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Impressum/Datenschutz 内边距 */
  [style*="max-width:800px"] {
    padding: 0 var(--space-sm);
  }

  /* Nora 按钮不遮挡 */
  .dh-trigger {
    bottom: 1rem;
    right: 1rem;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }

  .dh-mount {
    bottom: 4rem;
    right: 1rem;
    width: calc(100vw - 2rem);
    max-width: 380px;
  }

}

/* ============================================
   响应式 — 小屏（≤ 480px）
   ============================================ */

@media (max-width: 480px) {

  .hero {
    min-height: 450px;
  }

  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .section {
    padding: var(--space-md) var(--space-sm);
  }

  .section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

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

  .stat-number {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .feature-card {
    padding: var(--space-sm);
  }

  /* 证书网格 → 2列 */
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .dh-mount {
    width: calc(100vw - 1rem);
    right: 0.5rem;
    bottom: 3.5rem;
  }
}
