/* ============================================================
   Vector 官网首页样式
   结构参考 buildtool.cn 首页（ScrollExpand hero + ContainerScroll
   + DisplayCards + 数据统计 + 阿里云风页脚），已删除定价区。
   主题：默认浅色（body.light），body 无 light 类时切换为深色。
   ============================================================ */

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

html { overflow-x: hidden; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ---------- 主题变量：默认深色 ---------- */
body {
  --bg: #05070a;
  --bg-soft: #0a0f14;
  --ink: #e6f7ef;
  --ink-2: #b6cfc4;
  --muted: #7c8f97;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --accent: #22f5a3;
  --accent-2: #10b981;
  --accent-deep: #059669;
  --accent-ink: #03140d;
  --accent-soft: rgba(34, 245, 163, 0.10);
  --nav-bg: rgba(8, 12, 10, 0.72);
  --nav-line: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* ---------- 主题变量：浅色（默认） ---------- */
body.light {
  --bg: #f5faf7;
  --bg-soft: #eef7f2;
  --ink: #0f1f1a;
  --ink-2: #33473f;
  --muted: #64748b;
  --line: rgba(6, 78, 59, 0.10);
  --line-strong: rgba(6, 78, 59, 0.20);
  --card: #ffffff;
  --card-hover: #ffffff;
  --accent: #059669;
  --accent-2: #10b981;
  --accent-deep: #047857;
  --accent-ink: #ffffff;
  --accent-soft: rgba(16, 185, 129, 0.10);
  --nav-bg: rgba(250, 253, 251, 0.82);
  --nav-line: rgba(6, 78, 59, 0.08);
  --shadow-card: 0 18px 50px rgba(6, 60, 46, 0.10);
}

/* ============================================================
   顶部导航
   ============================================================ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9990;
  background: var(--nav-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nav-line);
  transition: background 0.3s, border-color 0.3s;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.25rem;
  height: 58px; display: flex; align-items: center; gap: 1.5rem;
}
.nav-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.nav-logo img { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; }
.nav-logo span { font-size: 1.05rem; font-weight: 700; color: var(--ink); letter-spacing: 0.3px; }
.nav-links { display: flex; gap: 1.35rem; flex: 1; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; white-space: nowrap; }
.nav-links a:hover { color: var(--accent); }
.nav-user { display: flex; align-items: center; gap: 0.7rem; }
.nav-user a {
  padding: 0.42rem 1rem; border-radius: 8px; font-size: 0.875rem;
  text-decoration: none; transition: all 0.2s; white-space: nowrap;
}
.nav-login-btn { color: var(--ink-2); border: 1px solid var(--line-strong); }
.nav-login-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-register-btn {
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent;
  font-weight: 600;
}
.nav-register-btn:hover { background: var(--accent-2); }
/* 已登录时的用户中心入口（默认隐藏，auth-check 命中后加 .show） */
.nav-user a.nav-user-chip {
  display: none; align-items: center; gap: 0.5rem;
  padding: 0.28rem 0.85rem 0.28rem 0.32rem;
  border-radius: 9999px; border: 1px solid var(--line-strong);
  color: var(--ink); font-size: 0.875rem; font-weight: 600;
  background: var(--bg-soft); max-width: 11rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.nav-user a.nav-user-chip.show { display: inline-flex; }
.nav-user a.nav-user-chip:hover { border-color: var(--accent); color: var(--accent); }
.nav-user-avatar {
  position: relative; overflow: hidden;
  width: 1.6rem; height: 1.6rem; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #22F5A3, #0ea77a);
  color: #04241c; font-size: 0.82rem; font-weight: 800; line-height: 1;
}
.nav-user-avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%; display: block;
}
.nav-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-burger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 0.4rem; color: var(--ink);
}
.nav-burger svg { width: 24px; height: 24px; display: block; }
.mobile-menu {
  display: none; flex-direction: column; gap: 0.2rem;
  padding: 0.6rem 1.25rem 1rem;
  background: var(--bg-soft);
  border-top: 1px solid var(--nav-line);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--ink); text-decoration: none; font-size: 0.95rem;
  padding: 0.7rem 0.4rem; border-radius: 8px;
}
.mobile-menu a:hover { background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   主题切换按钮
   ============================================================ */
.theme-toggle {
  position: fixed; top: 1.25rem; right: 1.25rem; z-index: 10001;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--nav-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; color: var(--ink);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-icon {
  position: absolute; width: 1.25rem; height: 1.25rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.theme-icon-dark { opacity: 1; transform: rotate(0deg); }
.theme-icon-light { opacity: 0; transform: rotate(-90deg); }
body.light .theme-icon-dark { opacity: 0; transform: rotate(90deg); }
body.light .theme-icon-light { opacity: 1; transform: rotate(0deg); }

/* 放射圆波纹 */
.theme-ripple {
  position: fixed; border-radius: 50%;
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none; z-index: 9999;
}
.theme-ripple.expanding { transform: scale(1); }

/* ============================================================
   首屏 ScrollExpandMedia
   ============================================================ */
.scroll-expand { position: relative; width: 100%; min-height: 100dvh; }

.bg-layer { position: fixed; inset: 0; z-index: 0; will-change: opacity; }
.bg-image {
  position: absolute; inset: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.bg-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.1); }
body.light .bg-overlay { background: rgba(255, 255, 255, 0.04); }

.media-container {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 2rem 0;
}
.media-wrapper {
  position: relative; border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  will-change: width, height;
  background: #0a0f14;
}
body.light .media-wrapper { box-shadow: 0 26px 70px rgba(6, 60, 46, 0.18); }
.media-video,
.media-image,
.media-bilibili { width: 100%; height: 100%; }
.media-wrapper video,
.media-wrapper img,
.media-wrapper iframe { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-overlay {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3);
  pointer-events: none; will-change: opacity;
}
.media-meta {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-top: 1rem; position: relative; z-index: 10;
}
.media-date { font-size: 1.5rem; color: var(--accent); will-change: transform; }
.media-hint { color: var(--accent); font-weight: 500; will-change: transform; font-size: 0.95rem; }

.title-area {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  flex-wrap: wrap; width: 100%; position: relative; z-index: 10; padding: 0 1rem;
}
.title-first, .title-rest {
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 700; color: var(--accent); will-change: transform;
}
.title-area.blend { mix-blend-mode: difference; }

.content-area {
  position: relative; z-index: 10; width: 100%; padding: 3rem 2rem;
  opacity: 0; transition: opacity 0.7s ease; pointer-events: none;
}
.content-area.visible { opacity: 1; pointer-events: auto; }
.content-inner { max-width: 760px; margin: 0 auto; }
.content-inner h3 { font-size: 1.75rem; margin-bottom: 1rem; color: var(--accent); }
.content-inner p { font-size: 1.03rem; line-height: 1.85; color: var(--ink-2); }
.content-inner p + p { margin-top: 0.8rem; }

/* ============================================================
   ContainerScroll 卡片
   ============================================================ */
.container-scroll {
  position: relative; z-index: 10; height: 60rem;
  display: flex; align-items: center; justify-content: center;
  padding: 0.5rem;
}
.cs-perspective { perspective: 1000px; width: 100%; padding: 2.5rem 0; position: relative; }
.cs-header { max-width: 64rem; margin: 0 auto; text-align: center; will-change: transform; }
.cs-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; color: var(--accent); }
.cs-card {
  max-width: 64rem; margin: -3rem auto 0; width: 100%; height: 30rem;
  border: 4px solid var(--line-strong);
  padding: 0.5rem; background: var(--bg-soft); border-radius: 30px;
  box-shadow:
    0 9px 20px rgba(0, 0, 0, 0.25), 0 37px 37px rgba(0, 0, 0, 0.18),
    0 84px 50px rgba(0, 0, 0, 0.10), 0 149px 60px rgba(0, 0, 0, 0.04);
  transform-origin: top center; will-change: transform;
}
body.light .cs-card {
  box-shadow:
    0 9px 24px rgba(6, 60, 46, 0.10), 0 37px 48px rgba(6, 60, 46, 0.08),
    0 84px 60px rgba(6, 60, 46, 0.05);
}
.cs-card-inner { height: 100%; width: 100%; overflow: hidden; border-radius: 16px; background: var(--bg-soft); }
.cs-card-inner img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   DisplayCards 堆叠卡片
   ============================================================ */
.display-cards-section { position: relative; z-index: 10; padding: 6rem 1rem 8rem; }
.dc-heading {
  font-size: clamp(1.6rem, 3.5vw, 2.35rem);
  font-weight: 700; color: var(--ink); text-align: center;
  max-width: 72rem; margin: 0 auto 3.4rem; padding: 0 1rem;
}
.dc-heading .dc-heading-accent { color: var(--accent); }
.dc-grid { display: grid; grid-template-areas: "stack"; place-items: center; opacity: 1; }
.dc-card {
  grid-area: stack; position: relative;
  width: 22rem; height: 9rem;
  border: 2px solid var(--line); border-radius: 12px;
  background: var(--card);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 0.75rem 1rem;
  display: flex; flex-direction: column; justify-content: space-between;
  transform: skewY(-8deg);
  transition: all 0.7s ease; cursor: default;
  filter: grayscale(100%);
  user-select: none;
}
.dc-card::after {
  content: ""; position: absolute; right: -1px; top: -5%;
  height: 110%; width: 20rem;
  background: linear-gradient(to left, var(--bg), transparent);
  pointer-events: none;
}
.dc-card:hover {
  border-color: var(--line-strong);
  background: var(--card-hover);
  filter: grayscale(0);
  box-shadow: var(--shadow-card);
}
.dc-card:hover::after { opacity: 0; transition: opacity 0.7s ease; }
.dc-card-1 { transform: skewY(-8deg); }
.dc-card-1:hover { transform: skewY(-8deg) translateY(-40px); }
.dc-card-2 { transform: skewY(-8deg) translateX(64px) translateY(40px); }
.dc-card-2:hover { transform: skewY(-8deg) translateX(64px) translateY(0px); }
.dc-card-3 { transform: skewY(-8deg) translateX(128px) translateY(80px); }
.dc-card-3:hover { transform: skewY(-8deg) translateX(128px) translateY(40px); }
.dc-card-row { display: flex; align-items: center; gap: 0.5rem; }
.dc-icon {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 9999px; padding: 0.3rem;
}
.dc-title { font-size: 1.125rem; font-weight: 600; color: var(--accent); }
.dc-desc {
  font-size: 0.98rem; line-height: 1.55; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.dc-date { color: var(--muted); font-size: 0.9rem; }

/* ============================================================
   核心能力（替代原定价区位置）
   ============================================================ */
.features-section { position: relative; z-index: 10; padding: 5rem 1.25rem 6rem; }
.fs-inner { max-width: 72rem; margin: 0 auto; }
.fs-title { text-align: center; font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 700; color: var(--ink); }
.fs-sub { text-align: center; color: var(--muted); margin: 0.9rem auto 3.2rem; font-size: 1rem; max-width: 40rem; line-height: 1.7; }
.fs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.6rem 1.4rem 1.5rem; transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 180px at 0% 0%, var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.feature-card:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.feature-card:hover::before { opacity: 1; }
.fc-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.fc-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.08rem; font-weight: 700; color: var(--ink); margin-bottom: 0.55rem; }
.feature-card p { font-size: 0.92rem; line-height: 1.75; color: var(--muted); }

/* ============================================================
   数据统计
   ============================================================ */
.stats-section {
  position: relative; z-index: 10; padding: 70px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
}
body.light .stats-section { background: var(--bg-soft); }
.ss-inner { max-width: 1100px; margin: 0 auto; }
.stats-section h2 { text-align: center; font-size: 28px; margin: 0 0 8px; color: var(--ink); }
.stats-section .ss-sub { text-align: center; color: var(--muted); margin: 0 0 44px; font-size: 15px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 980px; margin: 0 auto; }
.stat-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px 18px; text-align: center;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.stat-box:hover { border-color: var(--line-strong); transform: translateY(-3px); }
body.light .stat-box { box-shadow: 0 6px 24px rgba(6, 60, 46, 0.05); }
.stat-box .num { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-box .lbl { color: var(--muted); margin-top: 10px; font-size: 14px; }

/* ============================================================
   CTA
   ============================================================ */
.cta-section { position: relative; z-index: 10; padding: 3rem 1.25rem 5rem; }
.cta-box {
  max-width: 72rem; margin: 0 auto; text-align: center;
  border-radius: 26px; padding: 3.4rem 1.5rem;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 260px at 50% -20%, var(--accent-soft), transparent 70%),
    var(--card);
  box-shadow: var(--shadow-card);
}
body.light .cta-box {
  background:
    radial-gradient(700px 320px at 50% -30%, rgba(16, 185, 129, 0.16), transparent 70%),
    #ffffff;
}
.cta-box h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 700; color: var(--ink); }
.cta-box p { color: var(--muted); margin: 0.9rem auto 2rem; font-size: 1rem; line-height: 1.7; max-width: 36rem; }
.cta-actions { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }

.cta-note {
  margin-top: 1.1rem;
  font-size: 0.86rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.8rem 1.7rem; border-radius: 10px; text-decoration: none;
  font-size: 0.95rem; font-weight: 600; transition: all 0.25s ease;
  border: 1px solid var(--line-strong); color: var(--ink);
}
.cta-btn:hover { border-color: var(--accent); color: var(--accent); }
.cta-btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.cta-btn.primary:hover { background: var(--accent-2); color: var(--accent-ink); }

/* ============================================================
   页脚（阿里云风格两层）
   ============================================================ */
.page-footer { width: 100%; margin-top: 0 !important; position: relative; z-index: 10; }
.footer-nav-wrap { background-color: #f1f1f1; padding: 40px 0; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-nav-flex { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-cols { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.footer-brand { flex-shrink: 0; text-align: center; }
.footer-brand img { width: 52px; height: 52px; border-radius: 10px; display: block; margin: 0 auto 8px; object-fit: contain; }
.footer-brand span { font-size: 15px; font-weight: 600; color: #222; }
.footer-col h4 { font-size: 15px; color: #222; margin: 0 0 14px 0; font-weight: 600; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col li a { font-size: 14px; color: #555; text-decoration: none; }
.footer-col li a:hover { color: var(--accent-2); }
.footer-copyright-wrap { background-color: #ffffff; padding: 24px 0; border-top: 1px solid #e8e8e8; }
.copyright-links { margin-bottom: 12px; }
.copyright-links a { font-size: 13px; color: #666; text-decoration: none; margin-right: 18px; }
.copyright-links a:hover { color: var(--accent-2); }
.copyright-text { font-size: 13px; color: #777; }

body:not(.light) .footer-nav-wrap { background-color: #0b1110; }
body:not(.light) .footer-brand span,
body:not(.light) .footer-col h4 { color: #e6f7ef; }
body:not(.light) .footer-col li a { color: #94a3b8; }
body:not(.light) .footer-copyright-wrap { background-color: #070b0a; border-top-color: #1a2620; }
body:not(.light) .copyright-links a { color: #94a3b8; }
body:not(.light) .copyright-text { color: #64748b; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1320px) {
  .nav-inner { padding-right: 4.6rem; }
}
@media (max-width: 1024px) {
  .fs-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-login-btn { display: none; }
  .nav-user a { padding: 0.36rem 0.8rem; font-size: 0.82rem; }
  .nav-user a.nav-user-chip { padding: 0.18rem; gap: 0; }
  .nav-user-name { display: none; }
  .theme-toggle { top: 0.85rem; right: 0.85rem; width: 2.4rem; height: 2.4rem; }
  .title-first, .title-rest { font-size: clamp(1.5rem, 6vw, 2.5rem); }
  .media-date { font-size: 1.15rem; }
  .content-area { padding: 2rem 1rem; }
  .container-scroll { height: 40rem; padding: 1rem; }
  .cs-perspective { padding: 1.5rem 0; }
  .cs-card { height: 20rem; padding: 0.25rem; border-radius: 20px; }
  .cs-card-inner { border-radius: 12px; }
  .dc-card { width: min(18rem, 70vw); height: 7.5rem; }
  .dc-card::after { width: 12rem; }
  .dc-card-2 { transform: skewY(-8deg) translateX(18px) translateY(26px); }
  .dc-card-2:hover { transform: skewY(-8deg) translateX(18px) translateY(-5px); }
  .dc-card-3 { transform: skewY(-8deg) translateX(36px) translateY(52px); }
  .dc-card-3:hover { transform: skewY(-8deg) translateX(36px) translateY(25px); }
  .dc-card-1:hover { transform: skewY(-8deg) translateY(-30px); }
  .dc-heading { margin-bottom: 2rem; padding-left: 0.5rem; }
  .dc-desc { white-space: normal; font-size: 0.95rem; }
  .fs-grid { grid-template-columns: 1fr; }
  .features-section { padding: 3.5rem 1rem 4rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .cta-box { padding: 2.6rem 1.1rem; border-radius: 20px; }
  .footer-nav-flex { flex-direction: column; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .footer-brand { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dc-card, .theme-toggle, .feature-card, .stat-box { transition: none !important; }
}
