/* =========================================================
   永算智能官网 - 设计系统样式
   基于 DESIGN.md：Modern Minimalism + Glassmorphism
   ========================================================= */

:root {
  --c-primary: #001f3f;
  --c-primary-800: #00305f;
  --c-primary-900: #001129;
  --c-primary-950: #000a18;
  --c-cyan: #00d4ff;
  --c-cyan-deep: #0087a8;
  --c-blue: #2f7bff;
  --c-surface: #f8f9ff;
  --c-surface-alt: #eef3ff;
  --c-white: #ffffff;
  --c-text: #0b1c30;
  --c-text-2: #43474e;
  --c-text-3: #74777f;
  --c-border: rgba(11, 28, 48, 0.10);
  --c-border-strong: rgba(11, 28, 48, 0.16);
  --shadow-card: 0 4px 20px rgba(0, 31, 63, 0.06);
  --shadow-card-hover: 0 18px 44px rgba(0, 31, 63, 0.13);
  --font-display: "Hanken Grotesk", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-label: "Geist", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --container: 1280px;
  --gutter: 24px;
  --section-gap: 120px;
  --nav-h: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--c-primary);
  color: var(--c-white);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.eyebrow {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-cyan-deep);
}

/* ---------------- Header / Nav ---------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(248, 249, 255, 0.68);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: var(--c-border);
  box-shadow: 0 1px 0 rgba(11, 28, 48, 0.04);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--c-primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.main-nav a {
  position: relative;
  padding: 8px 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-2);
  transition: color 0.25s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s var(--ease-out);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--c-primary);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.lang-toggle svg {
  width: 16px;
  height: 16px;
}

.lang-toggle:hover {
  border-color: var(--c-cyan);
  color: var(--c-primary);
  background: rgba(255, 255, 255, 0.9);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--c-primary);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

.nav-toggle .icon-close {
  display: none;
}

/* ---------------- Buttons / Links ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 30px;
  border-radius: 10px;
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
  transition: transform 0.3s var(--ease-out);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--light {
  background: var(--c-white);
  color: var(--c-primary);
  box-shadow: 0 8px 30px rgba(0, 10, 24, 0.25);
}

.btn--light:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(0, 10, 24, 0.32);
}

.btn--primary {
  background: var(--c-primary);
  color: var(--c-white);
}

.btn--primary:hover {
  background: var(--c-primary-800);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 31, 63, 0.25);
}

.link-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-cyan-deep);
  transition: color 0.25s ease;
}

.link-ghost svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease-out);
}

.link-ghost:hover {
  color: var(--c-primary);
}

.link-ghost:hover svg {
  transform: translateX(4px);
}

.link-ghost--light {
  color: #8feaff;
}

.link-ghost--light:hover {
  color: var(--c-white);
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--c-primary-950);
  color: var(--c-white);
}

.hero-slides,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.hero-slide.is-active {
  opacity: 1;
  animation: ken-burns 12s var(--ease-out) forwards;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes ken-burns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.07);
  }
}

.hero-overlay {
  background:
    radial-gradient(ellipse at center, rgba(0, 10, 24, 0.18) 0%, rgba(0, 10, 24, 0.52) 100%),
    linear-gradient(180deg, rgba(0, 10, 24, 0.35) 0%, rgba(0, 10, 24, 0.05) 30%, rgba(0, 10, 24, 0.25) 70%, rgba(0, 10, 24, 0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: var(--nav-h);
  text-align: center;
}

.hero-content .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.hero-content h1 {
  margin: 18px 0 22px;
  font-size: clamp(2.7rem, 6vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 38px;
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.86);
}

.hero-progress {
  position: absolute;
  bottom: 36px;
  left: 50%;
  z-index: 2;
  width: 220px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.hero-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--c-cyan);
}

/* ---------------- Sections ---------------- */

.section {
  padding-block: var(--section-gap);
  background: var(--c-white);
}

.section-alt {
  background: var(--c-surface);
}

.section-dark {
  position: relative;
  background:
    radial-gradient(ellipse 900px 480px at 85% 0%, rgba(0, 212, 255, 0.12), transparent 60%),
    radial-gradient(ellipse 900px 560px at 10% 100%, rgba(47, 123, 255, 0.14), transparent 60%),
    var(--c-primary-900);
  color: var(--c-white);
}

.section-head {
  max-width: 780px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-head h2 {
  margin: 14px 0 18px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
}

.section-head p:last-child {
  font-size: 17px;
  line-height: 1.75;
  color: var(--c-text-2);
}

.section-dark .section-head p:last-child {
  color: rgba(255, 255, 255, 0.72);
}

.section-dark .eyebrow {
  color: #8feaff;
}

.section-foot {
  margin-top: 48px;
  text-align: center;
}

.media-frame {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-card);
  background: var(--c-primary-950);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--portrait {
  aspect-ratio: 4 / 3;
}

@media (min-width: 900px) {
  .media-frame {
    aspect-ratio: 21 / 9;
  }
  .media-frame--portrait {
    aspect-ratio: 4 / 3.4;
  }
}

/* ---------------- Cards ---------------- */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 860px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-white);
  box-shadow: var(--shadow-card);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s ease, border-color 0.45s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 212, 255, 0.65);
  box-shadow: var(--shadow-card-hover);
}

.card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--c-primary-950);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.card-body {
  padding: 26px 28px 30px;
  text-align: center;
}

.card-body h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.card-body p {
  font-size: 14.5px;
  color: var(--c-text-2);
}

/* ---------------- Video frame ---------------- */

.media-frame--video {
  cursor: pointer;
}

.media-frame--video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 10, 24, 0.05), rgba(0, 10, 24, 0.4));
  pointer-events: none;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--c-white);
  transition: background 0.3s ease, transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

.play-btn svg {
  width: 30px;
  height: 30px;
  margin-left: 3px;
}

.play-btn:hover {
  background: var(--c-white);
  color: var(--c-primary);
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.12);
}

/* ---------------- Education ---------------- */

.education-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}

@media (min-width: 1024px) {
  .education-grid {
    grid-template-columns: 1fr 1.08fr;
    gap: 72px;
  }
}

.education-copy h2 {
  margin: 14px 0 42px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
}

.edu-item {
  padding: 22px 0 24px 26px;
  border-left: 3px solid rgba(11, 28, 48, 0.18);
  transition: transform 0.35s var(--ease-out), border-color 0.35s ease;
}

.edu-item + .edu-item {
  margin-top: 14px;
}

.edu-item:hover {
  transform: translateY(-4px);
  border-left-color: var(--c-cyan);
}

.edu-item h3 {
  margin-bottom: 10px;
  font-size: 21px;
}

.edu-item p {
  margin-bottom: 14px;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--c-text-2);
}

/* ---------------- Footer ---------------- */

.site-footer {
  padding: 72px 0 32px;
  background: var(--c-surface-alt);
  border-top: 1px solid var(--c-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 28px;
  padding-bottom: 56px;
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  }
}

.footer-brand p {
  margin-top: 18px;
  max-width: 280px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text-2);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col h4 {
  margin-bottom: 6px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
}

.footer-col a {
  font-size: 14px;
  color: var(--c-text-2);
  transition: color 0.25s ease;
}

.footer-col a:hover {
  color: var(--c-cyan-deep);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  border-top: 1px solid var(--c-border);
  font-size: 13px;
  color: var(--c-text-3);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

/* ---------------- Video modal ---------------- */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.video-modal[hidden] {
  display: none;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 10, 24, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fade-in 0.25s ease;
}

.video-modal-card {
  position: relative;
  width: min(100%, 480px);
  padding: 44px 40px 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 10, 24, 0.35);
  text-align: center;
  animation: pop-in 0.35s var(--ease-out);
}

.video-modal-card h3 {
  margin: 12px 0 10px;
  font-size: 24px;
}

.video-modal-card p:not(.eyebrow) {
  margin-bottom: 26px;
  font-size: 15px;
  color: var(--c-text-2);
}

.video-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--c-text-2);
  transition: background 0.25s ease, color 0.25s ease;
}

.video-modal-close:hover {
  background: rgba(0, 31, 63, 0.08);
  color: var(--c-primary);
}

.video-modal-close svg {
  width: 18px;
  height: 18px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------------- Reveal on scroll ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

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

.card-grid .reveal:nth-child(2) {
  transition-delay: 0.08s;
}

.card-grid .reveal:nth-child(3) {
  transition-delay: 0.16s;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1023px) {
  :root {
    --section-gap: 88px;
  }

  .main-nav {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px 20px;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--c-border);
    box-shadow: 0 18px 40px rgba(0, 31, 63, 0.12);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0.3s;
  }

  .main-nav a {
    padding: 15px 4px;
    font-size: 16px;
    border-bottom: 1px solid var(--c-border);
  }

  .main-nav a::after {
    display: none;
  }

  .main-nav a.is-active {
    color: var(--c-cyan-deep);
  }

  .site-header.is-open .main-nav {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-header.is-open .nav-toggle .icon-menu {
    display: none;
  }

  .site-header.is-open .nav-toggle .icon-close {
    display: block;
  }
}

@media (max-width: 680px) {
  :root {
    --section-gap: 72px;
    --gutter: 16px;
  }

  .lang-toggle span {
    display: none;
  }

  .lang-toggle {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }

  .section-head {
    margin-bottom: 44px;
  }

  .media-frame {
    border-radius: var(--radius-lg);
  }

  .play-btn {
    width: 64px;
    height: 64px;
  }

  .play-btn svg {
    width: 24px;
    height: 24px;
  }
}

/* ---------------- Accessibility ---------------- */

:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
