/* ==========================================================================
   九耀投资 · 设计系统基础层
   main.css — tokens / reset / typography / layout / header / footer / 通用组件
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* 深色系 */
  --ink-950: #05080F;
  --ink-900: #080C16;
  --ink-850: #0A1020;
  --ink-800: #0E1728;
  --ink-700: #16213A;
  --ink-600: #1E2C48;

  /* 浅色系 */
  --paper: #F7F4ED;
  --paper-2: #EFEAE0;
  --paper-3: #E4DDCE;

  /* 金色系 */
  --gold: #C6A15B;
  --gold-2: #E2C68F;
  --gold-3: #8E7034;

  /* 文本 */
  --text: #E9EDF4;
  --text-dim: #B9C2D2;
  --muted: #8C99AE;
  --ink-text: #0C1220;
  --ink-text-dim: #3D4759;
  --ink-muted: #66707F;

  /* 线条 */
  --line: rgba(233, 237, 244, 0.12);
  --line-strong: rgba(233, 237, 244, 0.24);
  --line-ink: rgba(12, 18, 32, 0.12);
  --line-ink-strong: rgba(12, 18, 32, 0.22);

  /* 字体 */
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", "宋体", serif;
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-latin: "Optima", "Palatino Linotype", "Georgia", "Times New Roman", serif;

  /* 字号 */
  --fs-hero: clamp(2.4rem, 6vw, 5.1rem);
  --fs-display: clamp(1.8rem, 3.5vw, 3rem);
  --fs-h3: clamp(1.15rem, 1.9vw, 1.5rem);
  --fs-h4: 1.0625rem;
  --fs-lede: clamp(1rem, 1.3vw, 1.1875rem);
  --fs-body: 1rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;
  --fs-micro: 0.6875rem;

  /* 布局 */
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 56px);
  --section-y: clamp(84px, 10.5vw, 156px);
  --header-h: 76px;
  --radius: 2px;
  --radius-lg: 4px;

  /* 动效 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.9s;

  /* 阴影 */
  --shadow-lg: 0 40px 90px -48px rgba(0, 0, 0, 0.75);
  --shadow-md: 0 18px 44px -26px rgba(0, 0, 0, 0.55);
}

/* ---------- 2. Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

::selection {
  background: var(--gold);
  color: var(--ink-950);
}

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

/* 中文字距与节奏 */
p {
  letter-spacing: 0.01em;
}

/* ---------- 3. Typography ---------- */
.display,
.hero__title,
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0.02em;
}

.display {
  font-size: var(--fs-display);
  color: inherit;
}

.display em,
.title-accent {
  font-style: normal;
  color: var(--gold);
}

.section--paper .display em,
.section--paper .title-accent {
  color: var(--gold-3);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(18px, 2.4vw, 30px);
  font-family: var(--font-body);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section--paper .eyebrow {
  color: var(--gold-3);
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.95;
  color: var(--text-dim);
  max-width: 46em;
}

.section--paper .lede {
  color: var(--ink-text-dim);
}

.muted {
  color: var(--muted);
}

.section--paper .muted {
  color: var(--ink-muted);
}

.latin {
  font-family: var(--font-latin);
  letter-spacing: 0.08em;
}

/* ---------- 4. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--ink {
  background: var(--ink-900);
  color: var(--text);
}

.section--ink-alt {
  background: var(--ink-850);
  color: var(--text);
}

.section--paper {
  background: var(--paper);
  color: var(--ink-text);
}

.section--paper-alt {
  background: var(--paper-2);
  color: var(--ink-text);
}

.section--tight {
  padding-block: clamp(56px, 7vw, 96px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 56px);
  margin-bottom: clamp(40px, 5.5vw, 76px);
}

.section-head__main {
  flex: 1 1 30em;
  min-width: 0;
  max-width: 42em;
}

.section-head__aside {
  flex: 0 1 24em;
  min-width: 0;
  max-width: 24em;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.section--paper .section-head__aside {
  color: var(--ink-muted);
}

/* 分割线 */
.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}

.section--paper .rule {
  background: var(--line-ink);
}

/* ---------- 5. Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: inherit;
  --btn-bd: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

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

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

.btn:active {
  transform: translateY(1px);
}

.btn--solid {
  --btn-bg: var(--gold);
  --btn-fg: var(--ink-950);
}

.btn--solid:hover {
  --btn-bg: var(--gold-2);
}

.btn--outline {
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
}

.btn--outline:hover {
  --btn-fg: var(--gold-2);
  --btn-bd: var(--gold);
}

.section--paper .btn--outline {
  --btn-fg: var(--ink-text);
  --btn-bd: var(--line-ink-strong);
}

.section--paper .btn--outline:hover {
  --btn-fg: var(--ink-text);
  --btn-bd: var(--gold-3);
}

.btn--link {
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.btn--link:hover {
  color: var(--gold-2);
  border-color: var(--gold);
}

.btn--block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
}

/* ---------- 6. Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-3), var(--gold-2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
  will-change: transform;
}

/* ---------- 7. Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  transition: background-color 0.5s var(--ease-out), border-color 0.5s var(--ease-out),
    backdrop-filter 0.5s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(5, 8, 15, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1420px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: var(--header-h);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}

.brand__mark {
  width: 34px;
  height: 34px;
  color: var(--gold);
  transition: transform 0.9s var(--ease-out);
}

.brand:hover .brand__mark {
  transform: rotate(45deg);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text);
}

.brand__en {
  font-family: var(--font-latin);
  font-size: 0.5625rem;
  letter-spacing: 0.26em;
  color: var(--muted);
  text-transform: uppercase;
}

/* 导航 */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
}

.nav__link {
  position: relative;
  padding: 6px 0;
  font-size: var(--fs-sm);
  letter-spacing: 0.12em;
  color: var(--text-dim);
  transition: color 0.35s var(--ease-out);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.5s var(--ease-out);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--text);
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-header__cta {
  padding: 11px 22px;
  font-size: var(--fs-xs);
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  place-items: center;
  color: var(--text);
}

.nav-toggle__box {
  position: relative;
  display: block;
  width: 22px;
  height: 12px;
}

.nav-toggle__box span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition: transform 0.45s var(--ease-out), opacity 0.3s linear, top 0.45s var(--ease-out);
}

.nav-toggle__box span:nth-child(1) {
  top: 0;
}

.nav-toggle__box span:nth-child(2) {
  top: 100%;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(1) {
  top: 50%;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(2) {
  top: 50%;
  transform: rotate(-45deg);
}

/* ---------- 8. 移动端导航面板 ---------- */
@media (max-width: 900px) {
  :root {
    --header-h: 66px;
  }

  .nav-toggle {
    display: grid;
  }

  .site-header__cta {
    display: none;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(18px, 4vh, 34px);
    padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
    background: rgba(5, 8, 15, 0.97);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.45s var(--ease-out), transform 0.55s var(--ease-out),
      visibility 0s linear 0.45s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.45s var(--ease-out), transform 0.55s var(--ease-out),
      visibility 0s linear 0s;
  }

  .nav__link {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 7vw, 2.75rem);
    letter-spacing: 0.06em;
    color: var(--text);
  }

  .nav__link::after {
    display: none;
  }

  .nav__link[aria-current="page"] {
    color: var(--gold);
  }
}

@media (max-width: 560px) {
  :root {
    --fs-display: clamp(1.55rem, 6.2vw, 2rem);
    --fs-hero: clamp(2.15rem, 9.2vw, 3rem);
  }

  .eyebrow {
    letter-spacing: 0.22em;
  }
}

/* ---------- 9. Footer ---------- */
.site-footer {
  position: relative;
  padding-top: clamp(56px, 7vw, 92px);
  background: var(--ink-950);
  color: var(--text-dim);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.site-footer__glow {
  position: absolute;
  top: -160px;
  right: -80px;
  width: 520px;
  height: 420px;
  background: radial-gradient(circle, rgba(198, 161, 91, 0.16), transparent 62%);
  pointer-events: none;
  filter: blur(10px);
}

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.site-footer__brand .brand {
  margin-bottom: 20px;
}

.site-footer__desc {
  max-width: 24em;
  font-size: var(--fs-sm);
  line-height: 1.9;
  color: var(--muted);
}

.site-footer__col-title {
  margin-bottom: 18px;
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.site-footer__col {
  min-width: 0;
}

.contact-item {
  min-width: 0;
}

.site-footer__list {
  display: grid;
  gap: 12px;
  font-size: var(--fs-sm);
}

.site-footer__list a,
.site-footer__list span {
  color: var(--muted);
  transition: color 0.3s var(--ease-out);
}

.site-footer__list a:hover {
  color: var(--text);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  padding-block: 26px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--muted);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.site-footer__note {
  font-size: var(--fs-xs);
  line-height: 1.8;
  color: rgba(140, 153, 174, 0.72);
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  color: var(--muted);
  transition: color 0.3s var(--ease-out);
}

.to-top:hover {
  color: var(--gold-2);
}

.to-top svg {
  width: 14px;
  height: 14px;
  transition: transform 0.4s var(--ease-out);
}

.to-top:hover svg {
  transform: translateY(-3px);
}

@media (max-width: 900px) {
  .site-footer__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .site-footer__main {
    grid-template-columns: 1fr;
  }
}

/* ---------- 10. 滚动揭示动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

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

.reveal--left {
  transform: translateX(-36px);
}

.reveal--left.is-visible {
  transform: translateX(0);
}

.reveal--right {
  transform: translateX(36px);
}

.reveal--right.is-visible {
  transform: translateX(0);
}

.reveal--scale {
  transform: translateY(24px) scale(0.97);
}

.reveal--scale.is-visible {
  transform: none;
}

/* 分割揭幕（用于标题行） */
.reveal-line {
  display: block;
  overflow: hidden;
}

.reveal-line__inner {
  display: block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.is-inview .reveal-line__inner {
  transform: translateY(0);
}

/* ---------- 11. 通用小组件 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.section--paper .tag {
  border-color: var(--line-ink-strong);
  color: var(--ink-text-dim);
}

.tag__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

/* 序号 */
.index-num {
  font-family: var(--font-latin);
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  color: var(--gold);
}

.section--paper .index-num {
  color: var(--gold-3);
}

/* 滚动跑马灯 */
.marquee {
  position: relative;
  display: flex;
  overflow: hidden;
  padding-block: clamp(22px, 3vw, 34px);
  border-block: 1px solid var(--line);
  user-select: none;
}

.section--paper .marquee {
  border-color: var(--line-ink);
}

.marquee__track {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding-right: clamp(28px, 4vw, 56px);
  animation: marquee-scroll 34s linear infinite;
  will-change: transform;
}

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.6vw, 1.375rem);
  letter-spacing: 0.18em;
  color: var(--text-dim);
  white-space: nowrap;
}

.marquee__item::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-100%, 0, 0); }
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

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

  .reveal,
  .reveal-line__inner {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .marquee__track {
    animation: none;
  }

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

.placeholder {
  color: var(--gold-2);
  border-bottom: 1px dashed rgba(226, 198, 143, 0.55);
  font-style: normal;
}

.section--paper .placeholder {
  color: var(--gold-3);
  border-bottom-color: rgba(142, 112, 52, 0.5);
}

/* ---------- 14. Skip link 之外的可访问性兜底 ---------- */

/* ---------- 12. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--gold);
  color: var(--ink-950);
  font-size: var(--fs-sm);
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 13. 工具类 ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-gold {
  color: var(--gold);
}

.section--paper .text-gold {
  color: var(--gold-3);
}

.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.stack-32 > * + * { margin-top: 32px; }

.no-wrap {
  white-space: nowrap;
}
