/* ============================================================
   weide-insight.com.cn — shared site kit / assets/site.css
   reset · tokens · typography · header · footer · base components
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body { min-height: 100%; }

body {
  margin: 0;
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: clamp(15px, 0.5vw + 13.6px, 16.5px);
  line-height: 1.75;
  color: var(--white);
  background-color: var(--night-900);
}

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

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

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

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

a { color: inherit; }

strong, b { font-weight: 700; }

h1, h2, h3, h4, h5, h6 { font-weight: 800; line-height: 1.28; letter-spacing: 0.01em; }

::selection { background: var(--yellow); color: #1b1204; }

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

/* ---------- 2. Tokens ---------- */
:root {
  --night-950: #040b16;
  --night-900: #071325;
  --night-800: #0a1a2f;
  --night-700: #0f2540;
  --night-600: #153252;

  --paper: #f2eee4;
  --paper-dim: #e2dccd;

  --ink: #0a1524;
  --ink-soft: #3f4c5e;

  --white: #f7fafd;
  --muted: rgba(247, 250, 253, 0.66);
  --faint: rgba(247, 250, 253, 0.44);

  --blue: #2f7ff0;
  --green: #22a06b;
  --red: #d8412f;
  --yellow: #f0b429;
  --clay: #b4643c;

  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);

  --radius-sm: 3px;
  --radius: 8px;
  --radius-lg: 16px;

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

  --wrap: 1194px;
  --gutter: clamp(18px, 4.6vw, 56px);
}

/* ---------- 3. Page atmosphere ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(120% 88% at 50% 0%, #000 18%, transparent 82%);
  mask-image: radial-gradient(120% 88% at 50% 0%, #000 18%, transparent 82%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 560px at 82% -10%, rgba(47, 127, 240, 0.3), transparent 64%),
    radial-gradient(900px 520px at 2% 2%, rgba(34, 160, 107, 0.15), transparent 60%),
    radial-gradient(760px 460px at 50% 108%, rgba(240, 180, 41, 0.09), transparent 70%);
}

#main-content {
  position: relative;
  z-index: 1;
}

/* ---------- 4. Layout helpers ---------- */
.wrap {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

/* ---------- 5. Skip link ---------- */
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 300;
  transform: translate(-50%, -160%);
  padding: 0.7em 1.4em;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--yellow);
  color: #1b1204;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.18s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline-offset: -3px;
}

/* ---------- 6. Header ---------- */
.site-header {
  position: relative;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(6, 16, 31, 0.95) 0%,
    rgba(7, 19, 37, 0.87) 64%,
    rgba(7, 19, 37, 0.62) 100%
  );
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 46px -32px rgba(0, 0, 0, 0.9);
}

.site-header__bar {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(3, 9, 18, 0.5);
}

.site-header__bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px clamp(10px, 2vw, 28px);
  min-height: 34px;
  padding: 6px 0;
  font-size: 0.68rem;
  color: var(--faint);
}

.site-header__domain {
  color: rgba(96, 160, 250, 0.95);
}

.site-header__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.22);
}

.site-header__edition {
  color: var(--faint);
}

/* masthead */
.masthead {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 2.4vw, 32px);
  padding: clamp(16px, 2.4vw, 26px) 0 clamp(12px, 1.8vw, 18px);
}

.masthead::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(148px, 46%);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--blue) 0%,
    var(--green) 34%,
    var(--yellow) 66%,
    var(--red) 100%
  );
  opacity: 0.9;
}

.masthead__brand {
  grid-column: 2;
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--white);
}

.masthead__cn {
  display: block;
  font-size: clamp(1.8rem, 4.4vw, 2.9rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-shadow: 0 0 44px rgba(47, 127, 240, 0.38);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.masthead__brand:hover .masthead__cn,
.masthead__brand:focus-visible .masthead__cn {
  color: #ffffff;
  text-shadow: 0 0 56px rgba(240, 180, 41, 0.45);
}

.masthead__en {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.44em;
  text-indent: 0.44em;
  color: var(--faint);
}

.masthead__note {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  color: var(--faint);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding-block: 2px;
  white-space: nowrap;
}

.masthead__note--left { justify-self: start; }
.masthead__note--right { justify-self: end; }

/* nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 0.8em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--white);
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.nav-toggle:hover { background: var(--glass-strong); }

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.nav-toggle__text {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
}

/* nav */
.site-nav {
  border-top: 1px solid var(--line-soft);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.site-nav__list li + li {
  border-left: 1px solid var(--line-soft);
}

.site-nav__list a {
  position: relative;
  display: block;
  padding: 13px clamp(12px, 2.6vw, 30px);
  font-size: 0.94rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.site-nav__list a:hover,
.site-nav__list a:focus-visible {
  color: var(--white);
  background: var(--glass);
}

.site-nav__list a[aria-current="page"] {
  color: var(--white);
  font-weight: 700;
}

.site-nav__list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--yellow);
}

/* ---------- 7. Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(60px, 9vw, 120px);
  border-top: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    rgba(9, 24, 44, 0.6) 0%,
    rgba(4, 10, 20, 0.96) 62%
  );
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.55;
  background: linear-gradient(
    90deg,
    var(--blue) 0%,
    var(--green) 38%,
    var(--yellow) 68%,
    var(--red) 100%
  );
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.8fr 1.25fr;
  gap: clamp(26px, 4vw, 54px);
  padding: clamp(38px, 5.5vw, 68px) 0 clamp(30px, 4vw, 46px);
}

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

.site-footer__logo {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.2em;
}

.site-footer__en {
  margin-top: 0.5em;
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  color: var(--faint);
}

.site-footer__line {
  margin-top: 1em;
  max-width: 24em;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

.site-footer__cta {
  margin-top: 1.4em;
}

.site-footer__title {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--yellow);
}

.site-footer__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.site-footer__links {
  display: grid;
  gap: 0.7em;
  font-size: 0.92rem;
}

.site-footer__links--two {
  grid-template-columns: 1fr 1fr;
  column-gap: 1em;
}

.site-footer__links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.16s ease;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--yellow);
}

.site-footer__col--contact {
  min-width: 0;
  word-break: break-word;
}

.site-footer__contact {
  display: grid;
  gap: 0.75em;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer__contact li {
  display: flex;
  align-items: baseline;
  gap: 0.8em;
}

.site-footer__label {
  flex: none;
  width: 3.4em;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--faint);
}

.site-footer__note {
  margin-top: 1.1em;
  max-width: 26em;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--faint);
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6em 1.6em;
  padding: 16px 0 clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--line-soft);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* ---------- 8. Base components ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.78em 1.35em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease,
    color 0.16s ease, border-color 0.16s ease;
}

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

.btn--primary { background: var(--yellow); color: #1b1204; }
.btn--primary:hover { background: #ffc94a; }

.btn--blue { background: var(--blue); color: #ffffff; }
.btn--blue:hover { background: #4b93f6; }

.btn--ghost {
  background: var(--glass);
  border-color: var(--line);
  color: var(--white);
}
.btn--ghost:hover { background: var(--glass-strong); }

.btn--sm {
  padding: 0.55em 1em;
  font-size: 0.8rem;
}

.panel {
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
}

.panel--solid {
  background: var(--paper);
  border-color: rgba(10, 21, 36, 0.12);
  color: var(--ink);
}

.panel--accent { border-top: 3px solid var(--blue); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.2em 0.62em;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--glass-strong);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  line-height: 1.6;
}

.tag--blue {
  background: rgba(47, 127, 240, 0.18);
  border-color: rgba(47, 127, 240, 0.5);
  color: #a9caff;
}

.tag--green {
  background: rgba(34, 160, 107, 0.18);
  border-color: rgba(34, 160, 107, 0.5);
  color: #7fe0b4;
}

.tag--red {
  background: rgba(216, 65, 47, 0.18);
  border-color: rgba(216, 65, 47, 0.5);
  color: #ff9e8f;
}

.tag--yellow {
  background: rgba(240, 180, 41, 0.18);
  border-color: rgba(240, 180, 41, 0.5);
  color: #ffd77a;
}

.tag--white {
  background: rgba(247, 250, 253, 0.92);
  border-color: transparent;
  color: #0a1524;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--yellow);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
}

.breadcrumb {
  padding: clamp(16px, 2vw, 24px) 0 0;
  font-size: 0.78rem;
  color: var(--faint);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
}

.breadcrumb__list li + li::before {
  content: "/";
  margin-right: 0.4em;
  color: rgba(255, 255, 255, 0.22);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--white);
}

/* image containers for page stage */
.figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(47, 127, 240, 0.24) 0%,
    rgba(34, 160, 107, 0.12) 55%,
    rgba(240, 180, 41, 0.14) 100%
  );
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
}

.figure--16x9 { aspect-ratio: 16 / 9; }
.figure--4x3 { aspect-ratio: 4 / 3; }
.figure--1x1 { aspect-ratio: 1 / 1; }
.figure--tall { aspect-ratio: 3 / 4; }

.figure--16x9 img,
.figure--4x3 img,
.figure--1x1 img,
.figure--tall img {
  height: 100%;
  object-fit: cover;
}

.figure__caption {
  margin-top: 0.7em;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* scroll progress (injected by script) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 0;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    var(--blue) 0%,
    var(--green) 45%,
    var(--yellow) 78%,
    var(--red) 100%
  );
  box-shadow: 0 0 12px rgba(47, 127, 240, 0.5);
}

/* ---------- 9. Responsive ---------- */
@media (max-width: 1024px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    row-gap: clamp(30px, 5vw, 44px);
  }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; }

  .site-header__bar-inner {
    justify-content: center;
    gap: 6px 16px;
    font-size: 0.62rem;
  }

  .site-header__edition { display: none; }

  .masthead {
    grid-template-columns: 52px 1fr 52px;
    padding: 14px 0 12px;
  }

  .masthead__note { display: none; }

  .masthead__brand { grid-column: 2; }

  .masthead__cn {
    font-size: clamp(1.4rem, 6.2vw, 2rem);
    letter-spacing: 0.16em;
    text-indent: 0.16em;
  }

  .masthead__en {
    font-size: 0.54rem;
    letter-spacing: 0.34em;
    text-indent: 0.34em;
  }

  .nav-toggle {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .site-nav {
    max-height: 0;
    overflow: hidden;
    border-top: 1px solid transparent;
    transition: max-height 0.34s ease, border-color 0.2s ease;
  }

  .site-header[data-open] .site-nav {
    max-height: min(72vh, 470px);
    overflow-y: auto;
    border-top-color: var(--line-soft);
  }

  .site-nav__list {
    flex-direction: column;
    justify-content: stretch;
    padding: 6px 0 14px;
  }

  .site-nav__list li + li { border-left: 0; }

  .site-nav__list li { border-top: 1px solid var(--line-soft); }
  .site-nav__list li:first-child { border-top: 0; }

  .site-nav__list a {
    padding: 14px 14px;
    text-align: left;
    font-size: 1rem;
  }

  .site-nav__list a[aria-current="page"]::after {
    left: 0;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 2px;
  }
}

@media (max-width: 640px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
    padding-top: clamp(32px, 8vw, 44px);
  }

  .site-footer__base {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
  }
}

/* ---------- 10. Reduced motion ---------- */
@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;
    scroll-behavior: auto !important;
  }
}
