/* ============================================================
   GRAILA Visual Engine | Footer Stylesheet
   ----------------------------------------------------------------
   v0.4.0 - Full DeciDao aesthetic, ported from v4 footer code.
   Class naming: .gve-footer__*
   CSS variables inherited from header (:root scope)
   ----------------------------------------------------------------
   Layout:
     [Manifesto - top promise band]
     [Main: subscribe + 4 columns]
     [Brand row: logo + tagline + social]
     [Bottom: copyright + legal links]
     [Signature seal - bottom-right floating]
   ============================================================ */

/* ============================================================
   Footer 容器
   ============================================================ */

.gve-footer {
  position: relative;
  background: var(--gve-ink);
  color: var(--gve-paper);
  font-family: var(--gve-font-body-cn);
  overflow: hidden;
  isolation: isolate;
}

/* 顶部一道极细的朱砂线 */
.gve-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: var(--gve-cinnabar);
  opacity: 0.6;
  z-index: 2;
}

/* 背景纹理 - 极淡的同心圆,暗示"道"的运转 */
.gve-footer::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -200px;
  transform: translateY(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at center,
      transparent 50%,
      rgba(247, 244, 237, 0.015) 50.5%,
      rgba(247, 244, 237, 0.015) 51%,
      transparent 51.5%,
      transparent 65%,
      rgba(247, 244, 237, 0.01) 65.5%,
      rgba(247, 244, 237, 0.01) 66%,
      transparent 66.5%
    );
  pointer-events: none;
  animation: gve-footer-rotate 60s linear infinite;
}

@keyframes gve-footer-rotate {
  from { transform: translateY(-50%) rotate(0deg); }
  to   { transform: translateY(-50%) rotate(360deg); }
}

.gve-footer * {
  box-sizing: border-box;
}

.gve-footer__inner {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gve-space-6);
}

/* ============================================================
   品牌主张(顶部区,在玄黑底上)
   ----------------------------------------------------------------
   注意:背景是 footer 自身的玄黑(透明继承),不是宣纸白
   ============================================================ */

.gve-footer__manifesto {
  background: transparent;
  color: var(--gve-paper);
  padding: var(--gve-space-12) 0 0;
  position: relative;
}

.gve-footer__manifesto-mark {
  display: inline-block;
  font-family: var(--gve-font-display-en);
  font-style: italic;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--gve-cinnabar);
  text-transform: uppercase;
  margin-bottom: var(--gve-space-3);
  opacity: 0.9;
}

.gve-footer__manifesto-cn {
  font-family: var(--gve-font-display-cn);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--gve-paper);
  margin: 0 0 var(--gve-space-3);
}

.gve-footer__manifesto-en {
  font-family: var(--gve-font-display-en);
  font-style: italic;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: 300;
  line-height: 1.6;
  margin: 0;
  color: rgba(247, 244, 237, 0.55);
  letter-spacing: 0.01em;
}

/* ============================================================
   主体区(订阅 + 4 列)
   ============================================================ */

.gve-footer__main {
  padding: var(--gve-space-12) 0 var(--gve-space-8);
  border-bottom: 1px solid rgba(247, 244, 237, 0.08);
}

.gve-footer__main .gve-footer__inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--gve-space-12);
  align-items: start;
}

/* ============================================================
   订阅区
   ============================================================ */

.gve-footer__subscribe {
  /* 在 grid 第一列 */
}

.gve-footer__subscribe-label {
  display: block;
  font-family: var(--gve-font-display-en);
  font-style: italic;
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gve-cinnabar);
  opacity: 0.9;
  margin-bottom: var(--gve-space-2);
}

.gve-footer__subscribe-title {
  font-family: var(--gve-font-display-cn);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 var(--gve-space-2);
  color: var(--gve-paper);
  letter-spacing: 0.1em;
}

.gve-footer__subscribe-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--gve-mist-soft);
  margin: 0 0 var(--gve-space-3);
}

.gve-footer__subscribe-form {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: rgba(247, 244, 237, 0.04);
  border: 1px solid rgba(247, 244, 237, 0.12);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color var(--gve-duration-quick) var(--gve-ease-still);
}

.gve-footer__subscribe-form:focus-within {
  border-color: var(--gve-cinnabar);
}

.gve-footer__subscribe-input {
  flex: 1;
  background: none;
  border: none;
  padding: 0.7em 1em;
  color: var(--gve-paper);
  font-family: var(--gve-font-body-en);
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  outline: none;
}

.gve-footer__subscribe-input::placeholder {
  color: var(--gve-mist-soft);
  opacity: 0.6;
}

.gve-footer__subscribe-submit {
  background: var(--gve-cinnabar);
  color: var(--gve-paper);
  border: none;
  padding: 0 var(--gve-space-3);
  font-family: var(--gve-font-body-cn);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition:
    background var(--gve-duration-quick) var(--gve-ease-still),
    color var(--gve-duration-quick) var(--gve-ease-still);
}

.gve-footer__subscribe-submit:hover {
  background: var(--gve-cinnabar-soft);
}

.gve-footer__subscribe-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gve-footer__subscribe-feedback {
  margin: var(--gve-space-2) 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  min-height: 1.2em;
  transition: color var(--gve-duration-quick) var(--gve-ease-still);
}

.gve-footer__subscribe-feedback.is-success {
  color: #6FCF97;
}

.gve-footer__subscribe-feedback.is-error {
  color: var(--gve-cinnabar);
}

/* ============================================================
   链接 4 列
   ============================================================ */

.gve-footer__columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gve-space-4);
}

.gve-footer__column-title {
  font-family: var(--gve-font-display-en);
  font-style: italic;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gve-cinnabar);
  opacity: 0.85;
  margin: 0 0 var(--gve-space-3);
}

.gve-footer__column-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gve-space-1);
}

.gve-footer__column-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: rgba(247, 244, 237, 0.75);
  padding: 0.3em 0;
  transition:
    color var(--gve-duration-quick) var(--gve-ease-still),
    transform var(--gve-duration-quick) var(--gve-ease-still);
}

.gve-footer__column-link:hover {
  color: var(--gve-paper);
  transform: translateX(3px);
}

.gve-footer__column-link-main {
  font-family: var(--gve-font-display-cn);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.gve-footer__column-link-sub {
  font-family: var(--gve-font-display-en);
  font-style: italic;
  font-size: 0.8125rem;
  font-weight: 300;
  color: rgba(247, 244, 237, 0.35);
  letter-spacing: 0.01em;
  transition: color var(--gve-duration-quick) var(--gve-ease-still);
}

.gve-footer__column-link:hover .gve-footer__column-link-sub {
  color: var(--gve-cinnabar);
  opacity: 0.7;
}

/* ============================================================
   品牌行(logo + 品牌名 + tagline + 社交)
   ============================================================ */

.gve-footer__brand-row {
  padding: var(--gve-space-6) 0;
  border-bottom: 1px solid rgba(247, 244, 237, 0.08);
}

.gve-footer__brand-row .gve-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gve-space-4);
  flex-wrap: wrap;
}

.gve-footer__brand-block {
  display: flex;
  align-items: center;
  gap: var(--gve-space-4);
  flex-wrap: wrap;
}

.gve-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--gve-space-2);
  text-decoration: none;
  color: inherit;
  transition: opacity var(--gve-duration-quick) var(--gve-ease-still);
}

.gve-footer__brand:hover {
  opacity: 0.7;
}

.gve-footer__brand-logo {
  width: var(--gve-logo-nav, 44px);
  height: var(--gve-logo-nav, 44px);
  object-fit: contain;
  flex-shrink: 0;
  transform: rotate(-3deg);
  transition: transform var(--gve-duration-slow) var(--gve-ease-flow);
}

.gve-footer__brand:hover .gve-footer__brand-logo {
  transform: rotate(3deg);
}

.gve-footer__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.gve-footer__brand-en {
  font-family: var(--gve-font-display-en);
  font-weight: 500;
  font-size: 1.625rem;
  letter-spacing: -0.01em;
  line-height: 1;
}

.gve-footer__brand-cn {
  font-family: var(--gve-font-display-cn);
  font-weight: 400;
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  color: rgba(247, 244, 237, 0.55);
  margin-top: 6px;
}

.gve-footer__tagline {
  font-family: var(--gve-font-display-en);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--gve-mist-soft);
  margin: 0;
  letter-spacing: 0.02em;
  flex: 1;
  min-width: 240px;
}

/* ============================================================
   品牌行的社交图标
   ============================================================ */

.gve-footer__social {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gve-space-2);
  max-width: 100%;
}

.gve-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--gve-mist-soft);
  text-decoration: none;
  border-radius: 50%;
  transition:
    color var(--gve-duration-quick) var(--gve-ease-still),
    background var(--gve-duration-quick) var(--gve-ease-still),
    transform var(--gve-duration-quick) var(--gve-ease-still);
}

.gve-footer__social-link:hover {
  color: var(--gve-cinnabar);
  background: rgba(200, 52, 31, 0.1);
  transform: translateY(-2px);
}

.gve-footer__social-link svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gve-footer__social-link--x svg {
  width: 16px;
  height: 16px;
}

/* 窄屏:图标缩小 + 间距收紧,确保 7 个图标能完整显示 */
@media (max-width: 640px) {
  .gve-footer__social {
    gap: var(--gve-space-1);
  }
  .gve-footer__social-link {
    width: 32px;
    height: 32px;
  }
  .gve-footer__social-link svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 420px) {
  .gve-footer__social-link {
    width: 28px;
    height: 28px;
  }
  .gve-footer__social-link svg {
    width: 14px;
    height: 14px;
  }
  .gve-footer__social-link--x svg {
    width: 13px;
    height: 13px;
  }
}

/* ============================================================
   底部条(版权 + 法律)
   ============================================================ */

.gve-footer__bottom {
  padding: var(--gve-space-3) 0;
}

.gve-footer__bottom .gve-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gve-space-3);
  flex-wrap: wrap;
}

.gve-footer__copyright {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gve-space-1);
  font-size: 0.8125rem;
  color: rgba(247, 244, 237, 0.4);
  letter-spacing: 0.05em;
  margin: 0;
  line-height: 1.6;
}

.gve-footer__copyright-primary {
  font-family: var(--gve-font-body-en);
}

.gve-footer__copyright-secondary {
  font-family: var(--gve-font-body-cn);
  letter-spacing: 0.05em;
}

/* 运营主体声明 - 克制的法律合规小字 */
.gve-footer__copyright-entity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  color: rgba(247, 244, 237, 0.32);
  letter-spacing: 0.04em;
  margin-top: var(--gve-space-1);
}

.gve-footer__copyright-entity-cn {
  font-family: var(--gve-font-body-cn);
  letter-spacing: 0.08em;
}

.gve-footer__copyright-entity-en {
  font-family: var(--gve-font-body-en);
  font-style: italic;
}

.gve-footer__legal {
  display: flex;
  gap: var(--gve-space-3);
  flex-wrap: wrap;
}

.gve-footer__legal-link {
  font-size: 0.75rem;
  color: var(--gve-mist-soft);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--gve-duration-quick) var(--gve-ease-still);
}

.gve-footer__legal-link:hover {
  color: var(--gve-paper);
}

/* ============================================================
   右下签名印章(浮动,半透明)
   ----------------------------------------------------------------
   悬停 footer 任何位置时透明度提高 + 旋转
   位置:right 距离加大,避开常见的"回到顶部"按钮(通常在 right:24-32px)
   颜色:保持原图(用户应提供朱砂红的 logo SVG/PNG)
   ============================================================ */

.gve-footer__signature {
  position: absolute;
  right: 120px;          /* 加大右边距 - 避开回到顶部按钮 */
  bottom: var(--gve-space-4);
  width: 56px;
  height: 56px;
  opacity: 0.35;
  pointer-events: none;
  transition:
    opacity var(--gve-duration-slow) var(--gve-ease-flow),
    transform var(--gve-duration-slow) var(--gve-ease-flow);
  transform: rotate(-4deg);
  z-index: 1;
}

.gve-footer__signature img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* 不用 filter - 保持图片原色(朱砂红 logo 在玄黑底上自然显示) */
}

.gve-footer:hover .gve-footer__signature {
  opacity: 0.7;
  transform: rotate(2deg);
}

/* ============================================================
   入场动画(滚到 footer 时各区块依次淡入)
   ----------------------------------------------------------------
   由 footer.js 的 IntersectionObserver 添加 .is-visible 类触发
   ============================================================ */

.gve-footer--with-intro .gve-footer__manifesto-mark,
.gve-footer--with-intro .gve-footer__manifesto-cn,
.gve-footer--with-intro .gve-footer__manifesto-en,
.gve-footer--with-intro .gve-footer__subscribe,
.gve-footer--with-intro .gve-footer__column,
.gve-footer--with-intro .gve-footer__brand-block,
.gve-footer--with-intro .gve-footer__bottom {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--gve-duration-slow) var(--gve-ease-flow),
    transform var(--gve-duration-slow) var(--gve-ease-flow);
}

.gve-footer--with-intro.is-visible .gve-footer__manifesto-mark { transition-delay: 0ms; }
.gve-footer--with-intro.is-visible .gve-footer__manifesto-cn   { transition-delay: 100ms; }
.gve-footer--with-intro.is-visible .gve-footer__manifesto-en   { transition-delay: 200ms; }
.gve-footer--with-intro.is-visible .gve-footer__subscribe      { transition-delay: 300ms; }
.gve-footer--with-intro.is-visible .gve-footer__column:nth-child(1) { transition-delay: 400ms; }
.gve-footer--with-intro.is-visible .gve-footer__column:nth-child(2) { transition-delay: 450ms; }
.gve-footer--with-intro.is-visible .gve-footer__column:nth-child(3) { transition-delay: 500ms; }
.gve-footer--with-intro.is-visible .gve-footer__column:nth-child(4) { transition-delay: 550ms; }
.gve-footer--with-intro.is-visible .gve-footer__brand-block    { transition-delay: 600ms; }
.gve-footer--with-intro.is-visible .gve-footer__bottom         { transition-delay: 700ms; }

.gve-footer--with-intro.is-visible .gve-footer__manifesto-mark,
.gve-footer--with-intro.is-visible .gve-footer__manifesto-cn,
.gve-footer--with-intro.is-visible .gve-footer__manifesto-en,
.gve-footer--with-intro.is-visible .gve-footer__subscribe,
.gve-footer--with-intro.is-visible .gve-footer__column,
.gve-footer--with-intro.is-visible .gve-footer__brand-block,
.gve-footer--with-intro.is-visible .gve-footer__bottom {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1200px) {
  .gve-footer__main .gve-footer__inner {
    grid-template-columns: 280px 1fr;
    gap: var(--gve-space-6);
  }

  .gve-footer__columns {
    gap: var(--gve-space-3);
  }
}

@media (max-width: 1024px) {
  .gve-footer__main .gve-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--gve-space-8);
  }

  .gve-footer__subscribe {
    max-width: 480px;
  }

  .gve-footer__columns {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 880px) {
  .gve-footer__inner {
    padding: 0 var(--gve-space-3);
  }

  .gve-footer__manifesto {
    padding: var(--gve-space-8) 0 0;
  }

  .gve-footer__main {
    padding: var(--gve-space-8) 0 var(--gve-space-6);
  }

  .gve-footer__columns {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gve-space-4);
  }

  .gve-footer__brand-row .gve-footer__inner,
  .gve-footer__bottom .gve-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gve-space-2);
  }

  .gve-footer__signature {
    width: 44px;
    height: 44px;
    right: 90px;             /* 移动端也避开回到顶部按钮 */
    bottom: var(--gve-space-3);
  }
}

@media (max-width: 540px) {
  .gve-footer__columns {
    grid-template-columns: 1fr;
  }

  .gve-footer__manifesto-cn {
    font-size: 1.375rem;
  }

  .gve-footer__brand-en {
    font-size: 1.25rem;
  }
}

/* ============================================================
   降低动效偏好
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .gve-footer,
  .gve-footer *,
  .gve-footer *::before,
  .gve-footer *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
