/* ============================================================
   华体汇国际 · CN PLUS — shared site kit
   /assets/site.css
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--lemon); color: var(--black); }

:focus-visible {
  outline: 2px solid var(--lemon);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- 2. Tokens ---------- */
:root {
  --ink: #04121E;
  --navy: #0E2E4A;
  --navy-2: #17456B;
  --teal: #1FD1B2;
  --teal-hi: #8CF2E0;
  --lemon: #F5E14B;
  --coral: #FF6B4A;
  --paper: #F4F1E9;
  --black: #101820;
  --slate: #7C97AB;

  --line: rgba(31, 209, 178, 0.24);
  --line-soft: rgba(124, 151, 171, 0.22);
  --line-paper: rgba(16, 24, 32, 0.14);

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system,
    "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Courier New", monospace;

  --w-max: 1440px;
  --gutter: clamp(16px, 4vw, 44px);
  --gap-x: clamp(16px, 2vw, 24px);
  --hdr-h: 68px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --cut: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));

  --z-header: 90;
  --z-scrim: 94;
  --z-drawer: 95;
  --z-progress: 120;
}

/* ---------- 3. Typography ---------- */
.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  font-feature-settings: "tnum" 1;
}

.display-xl {
  font-size: clamp(40px, 7vw, 120px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin: 0 0 0.28em;
}

.display-l {
  font-size: clamp(30px, 4.2vw, 64px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 0.4em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), transparent);
}

.lead {
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.72;
  color: rgba(244, 241, 233, 0.86);
}

.prose { max-width: 36em; }
.prose p + p { margin-top: 1.1em; }

.section--paper .lead,
.section--paper .prose { color: rgba(16, 24, 32, 0.82); }

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

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap-x);
}

.col-main { grid-column: 1 / span 8; }
.col-note { grid-column: 10 / span 3; }
.col-half { grid-column: span 6; }
.col-full { grid-column: 1 / -1; }

.section {
  position: relative;
  padding-block: clamp(48px, 7vw, 104px);
}

.section--ink { background: var(--ink); }
.section--navy { background: var(--navy); }

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

.section--paper .eyebrow { color: var(--navy-2); }
.section--paper .eyebrow::before { background: linear-gradient(90deg, var(--coral), transparent); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  transition: transform 0.24s var(--ease), background-color 0.24s var(--ease),
    color 0.24s var(--ease), border-color 0.24s var(--ease);
}

.btn:hover { transform: translateY(-4px); }

.btn--primary { background: var(--lemon); color: var(--black); }
.btn--primary:hover { background: var(--teal-hi); }

.btn--teal { background: var(--teal); color: var(--ink); }
.btn--teal:hover { background: var(--teal-hi); }

.btn--ghost {
  background: transparent;
  color: var(--teal-hi);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--teal); color: var(--paper); }

.section--paper .btn--ghost { color: var(--navy); border-color: var(--line-paper); }
.section--paper .btn--ghost:hover { color: var(--black); border-color: var(--navy-2); }

/* ---------- 6. Breadcrumbs ---------- */
.breadcrumbs {
  padding-block: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--slate);
}

.breadcrumb-item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: rgba(124, 151, 171, 0.55);
}

.breadcrumb-link {
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.breadcrumb-link:hover { color: var(--teal-hi); }

.breadcrumb-current { color: var(--teal); }

.section--paper .breadcrumbs { border-bottom-color: var(--line-paper); }
.section--paper .breadcrumb-list,
.section--paper .breadcrumb-link { color: rgba(16, 24, 32, 0.6); }
.section--paper .breadcrumb-current { color: var(--navy-2); }

/* ---------- 7. Index rail ---------- */
.index-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.index-link {
  display: block;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s var(--ease), transform 0.24s var(--ease);
}

.index-link:hover,
.index-link:focus-visible {
  color: var(--teal-hi);
  transform: translateX(3px);
}

.index-link[aria-current="true"] {
  color: var(--lemon);
}

.section--paper .index-rail { border-left-color: var(--line-paper); }
.section--paper .index-link { color: rgba(16, 24, 32, 0.55); }
.section--paper .index-link[aria-current="true"] { color: var(--coral); }

/* ---------- 8. Media frames ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: var(--navy);
  background-image:
    linear-gradient(135deg, rgba(31, 209, 178, 0.18) 0%, rgba(14, 46, 74, 0.9) 46%, rgba(4, 18, 30, 1) 100%),
    repeating-linear-gradient(90deg, rgba(140, 242, 224, 0.1) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(140, 242, 224, 0.1) 0 1px, transparent 1px 46px);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background: linear-gradient(0deg, rgba(4, 18, 30, 0.72), transparent);
  pointer-events: none;
}

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

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }

.media-frame--paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(135deg, rgba(23, 69, 107, 0.16) 0%, rgba(244, 241, 233, 0.9) 60%, rgba(244, 241, 233, 1) 100%),
    repeating-linear-gradient(90deg, rgba(23, 69, 107, 0.14) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(23, 69, 107, 0.14) 0 1px, transparent 1px 46px);
}

/* ---------- 9. Reveal + progress ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  z-index: var(--z-progress);
  pointer-events: none;
  background: linear-gradient(90deg, var(--teal), var(--teal-hi) 55%, var(--lemon));
  transition: width 0.1s linear;
}

/* ---------- 10. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--lemon);
  color: var(--black);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: 2px;
}

/* ---------- 11. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(4, 18, 30, 0.96);
  border-bottom: 1px solid var(--line);
  color: var(--paper);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 36px);
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding: 12px var(--gutter);
  min-height: var(--hdr-h);
}

.header-spacer { flex: 1 1 auto; }

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  background: var(--teal);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 58% 100%, 0 100%);
  transition: background-color 0.24s var(--ease);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.brand:hover .brand-mark { background: var(--lemon); }

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

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--slate);
  margin-top: 3px;
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  padding: 3px 8px;
  background: var(--lemon);
  color: var(--black);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 24px);
  flex: 0 1 auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 24px);
  flex-wrap: nowrap;
}

.nav-item { display: block; }

.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  color: rgba(244, 241, 233, 0.76);
  transition: color 0.2s var(--ease), transform 0.24s var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--paper);
  transform: translateY(-2px);
}

.nav-link[aria-current="page"] { color: var(--teal-hi); }

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--lemon);
}

.nav-utility { display: none; }

.header-utility {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  background: var(--lemon);
  color: var(--black);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  transition: background-color 0.24s var(--ease), transform 0.24s var(--ease);
}

.header-utility:hover,
.header-utility:focus-visible {
  background: var(--teal-hi);
  transform: translateY(-2px);
}

/* Toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--teal-hi);
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-toggle:hover { border-color: var(--teal); }

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 20px;
  background: currentColor;
  transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
}

.nav-toggle-label {
  font-size: 12px;
  letter-spacing: 0.14em;
}

.site-header[data-open] .nav-toggle-bar:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bar:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* Scrim */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: rgba(4, 18, 30, 0.68);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.site-header[data-open] .nav-scrim {
  opacity: 1;
  pointer-events: auto;
}

body.is-nav-open { overflow: hidden; }

/* ---------- 12. Header responsive (drawer) ---------- */
@media (max-width: 1159px) {
  .nav-toggle { display: inline-flex; }
  .header-utility { display: none; }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: min(80vh, 620px);
    overflow-y: auto;
    padding: 26px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px));
    background: var(--navy);
    border-top: 1px solid var(--teal);
    clip-path: polygon(0 22px, 22px 0, 100% 0, 100% 100%, 0 100%);
    transform: translateY(102%);
    transition: transform 0.3s var(--ease);
  }

  .site-header[data-open] .site-nav { transform: translateY(0); }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-item { border-bottom: 1px solid var(--line-soft); }

  .nav-link {
    display: block;
    padding: 14px 0;
    font-size: 17px;
    font-weight: 600;
    white-space: normal;
    color: rgba(244, 241, 233, 0.9);
  }

  .nav-link:hover,
  .nav-link:focus-visible { transform: translateX(4px); }

  .nav-link[aria-current="page"] { padding-left: 10px; }
  .nav-link[aria-current="page"]::after {
    left: 0;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 3px;
    height: 18px;
    margin-top: -9px;
    transform: translateX(-10px);
  }
  .nav-link[aria-current="page"] { padding-left: 0; }

  .nav-utility {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 22px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    background: var(--lemon);
    color: var(--black);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  }
}

@media (max-width: 520px) {
  .header-inner { gap: 10px; padding-block: 10px; }
  .brand-name { font-size: 14px; }
  .brand-sub { font-size: 9px; letter-spacing: 0.18em; }
  .brand-version { font-size: 11px; padding: 2px 6px; }
  .nav-toggle { padding: 9px 10px; }
  .nav-toggle-label { display: none; }
}

/* ---------- 13. Footer ---------- */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, var(--navy) 0%, var(--ink) 68%);
  color: var(--paper);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(46%, 620px);
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--lemon), transparent);
}

.footer-inner {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding: clamp(44px, 6vw, 88px) var(--gutter) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  padding-bottom: clamp(32px, 4vw, 56px);
}

.footer-brand { grid-column: 1 / span 4; }

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
}

.footer-brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.footer-statement {
  margin-top: 18px;
  max-width: 26em;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(244, 241, 233, 0.72);
}

.footer-batch {
  margin-top: 18px;
  display: inline-block;
  padding: 4px 10px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--teal-hi);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.footer-nav { grid-column: 6 / span 2; }
.footer-nav--legal { grid-column: 8 / span 2; }
.footer-contact { grid-column: 10 / span 3; }

.footer-heading {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--slate);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.footer-list { display: flex; flex-direction: column; gap: 2px; }

.footer-item { display: block; }

.footer-link {
  display: inline-block;
  padding: 5px 0;
  font-size: 14.5px;
  line-height: 1.5;
  text-decoration: none;
  color: rgba(244, 241, 233, 0.74);
  transition: color 0.2s var(--ease), transform 0.24s var(--ease);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--teal-hi);
  transform: translateX(3px);
}

.footer-meta {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--teal);
  margin-bottom: 14px;
}

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

.footer-contact-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--slate);
}

.footer-value {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(244, 241, 233, 0.86);
  word-break: break-word;
}

.footer-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 20px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--slate);
}

.footer-copy { margin: 0; }
.footer-icp { margin: 0; color: rgba(244, 241, 233, 0.6); }
.footer-batch-code { margin: 0; color: var(--coral); }

@media (max-width: 1024px) {
  .footer-brand { grid-column: 1 / -1; }
  .footer-nav { grid-column: 1 / span 4; }
  .footer-nav--legal { grid-column: 5 / span 4; }
  .footer-contact { grid-column: 1 / -1; }
  .footer-contact-list { flex-direction: row; flex-wrap: wrap; gap: 16px 32px; }
  .footer-contact-line { min-width: 160px; flex: 1 1 200px; }
}

@media (max-width: 640px) {
  .footer-nav,
  .footer-nav--legal { grid-column: 1 / -1; }
  .footer-contact-list { flex-direction: column; gap: 12px; }
  .footer-band {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ---------- 14. Generic responsive ---------- */
@media (max-width: 900px) {
  .col-main,
  .col-note,
  .col-half { grid-column: 1 / -1; }
}

/* ---------- 15. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

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

  .btn:hover,
  .nav-link:hover,
  .footer-link:hover,
  .index-link:hover,
  .header-utility:hover {
    transform: none;
  }
}
