/* ============================================
   KAIYUN CN 共享 Site Kit CSS
   ============================================ */

/* ---------- 1. Reset & Tokens ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --paper: #F5F0E6;
  --ink: #0B1D3A;
  --ink-deep: #1B2A4A;
  --gold: #C9A961;
  --gold-light: #E6C87A;
  --red: #E63946;
  --gray-light: #E5E0D8;
  --gray: #6E6A64;
  --white: #FFFFFF;

  --font-serif: "Noto Serif SC", "Source Han Serif", "Songti SC", "STSong", Georgia, serif;
  --font-sans: "Noto Sans SC", "Source Han Sans", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;

  --sidebar-width: 280px;
  --header-h: 64px;
  --container-max: 1320px;
  --ease: 0.25s ease;
}

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

body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color var(--ease);
}

a:hover {
  color: var(--gold);
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

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

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

/* ---------- 2. Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1rem;
}

.display {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
}

.note {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray);
}

.kicker {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.stat {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--gold);
}

/* ---------- 3. Skip Link ---------- */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 500;
  padding: 0.75rem 1.25rem;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: top var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- 4. Scroll Progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  z-index: 400;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

/* ---------- 5. Site Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--ink);
  color: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
  border-right: 1px solid rgba(201, 169, 97, 0.18);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: repeating-linear-gradient(135deg, var(--gold) 0, var(--gold) 8px, transparent 8px, transparent 16px);
  opacity: 0.45;
  pointer-events: none;
}

.site-header__bar {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(201, 169, 97, 0.25);
}

/* ---------- 6. Brand ---------- */
.site-brand {
  display: block;
  text-align: center;
  color: var(--paper);
}

.site-brand__mark {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--gold);
  transition: color var(--ease);
}

.site-brand__suffix {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--gold-light);
  vertical-align: super;
  margin-left: 0.12rem;
}

.site-brand__tagline {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.66rem;
  line-height: 1.6;
  letter-spacing: 0.1em;
  color: rgba(245, 240, 230, 0.55);
}

.site-brand:hover .site-brand__mark {
  color: var(--gold-light);
}

/* ---------- 7. Nav Toggle ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 48px;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  border: 1px solid rgba(201, 169, 97, 0.45);
  border-radius: 2px;
  transition: border-color var(--ease), background var(--ease);
}

.nav-toggle:hover {
  border-color: var(--gold);
  background: var(--ink-deep);
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 8. Primary Nav ---------- */
.primary-nav {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.primary-nav__list {
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.primary-nav__link {
  display: block;
  padding: 0.72rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(245, 240, 230, 0.82);
  border-left: 3px solid transparent;
  border-radius: 2px;
  transition: background var(--ease), color var(--ease), padding-left var(--ease);
}

.primary-nav__link:hover {
  color: var(--gold-light);
  background: rgba(201, 169, 97, 0.1);
  padding-left: 1.25rem;
}

.primary-nav__link[aria-current="page"] {
  color: var(--ink);
  background: var(--gold);
  font-weight: 700;
  border-left-color: var(--gold-light);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.primary-nav__link[aria-current="page"]:hover {
  color: var(--ink);
  background: var(--gold-light);
}

.primary-nav__aside {
  margin-top: auto;
  padding: 1.75rem 1.5rem 2.5rem;
  border-top: 1px solid rgba(201, 169, 97, 0.18);
}

.primary-nav__meta {
  margin-bottom: 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  line-height: 1.5;
  color: rgba(245, 240, 230, 0.55);
}

.primary-nav__cta {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--gold);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background var(--ease), color var(--ease);
}

.primary-nav__cta:hover {
  background: var(--gold-light);
  color: var(--ink);
}

/* ---------- 9. Main & Container ---------- */
.site-main {
  display: block;
  margin-left: var(--sidebar-width);
  min-height: 65vh;
  scroll-margin-top: var(--header-h);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- 10. Sections ---------- */
.section {
  padding: 3rem 0;
}

.section--wide {
  padding: 4.5rem 0;
}

.section--narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem 0;
}

/* ---------- 11. Grid ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ---------- 12. Card ---------- */
.card {
  background: var(--white);
  padding: 1.5rem;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  filter: drop-shadow(0 2px 8px rgba(11, 29, 58, 0.08));
  transition: transform var(--ease), filter var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  filter: drop-shadow(0 10px 24px rgba(11, 29, 58, 0.14));
}

.card--dark {
  background: var(--ink-deep);
  color: rgba(245, 240, 230, 0.85);
}

.card--dark h3 {
  color: var(--paper);
}

.card__title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

/* ---------- 13. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform 0.1s ease;
}

.btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  text-decoration: none;
}

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

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn--gold:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* ---------- 14. Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  color: var(--gray);
  transition: color var(--ease);
}

.breadcrumbs a:hover {
  color: var(--gold);
}

.breadcrumbs__sep {
  color: rgba(110, 106, 100, 0.45);
}

/* ---------- 15. Media ---------- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--ink-deep);
  aspect-ratio: 16 / 9;
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.media:hover img {
  transform: scale(1.04);
}

/* ---------- 16. Table & Tag ---------- */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}

.table thead th {
  font-weight: 700;
  color: var(--ink);
  background: var(--gray-light);
  letter-spacing: 0.05em;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.6;
  background: var(--red);
  color: var(--white);
  border-radius: 2px;
}

/* ---------- 17. Footer ---------- */
.site-footer {
  position: relative;
  margin-left: var(--sidebar-width);
  background: var(--ink);
  color: rgba(245, 240, 230, 0.75);
  font-family: var(--font-sans);
}

.site-footer::before {
  content: "";
  display: block;
  height: 4px;
  background: repeating-linear-gradient(135deg, var(--gold) 0, var(--gold) 10px, transparent 10px, transparent 20px);
  opacity: 0.75;
}

.site-footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 3.5rem 2rem 2.5rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: 2.5rem;
}

.site-footer__col--brand {
  padding-right: 1rem;
}

.site-footer__logo {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold);
  transition: color var(--ease);
}

.site-footer__logo:hover {
  color: var(--gold-light);
}

.site-footer__trust {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  line-height: 1.8;
  color: rgba(245, 240, 230, 0.55);
}

.site-footer__heading {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid rgba(201, 169, 97, 0.22);
}

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.site-footer__list a {
  display: inline-block;
  color: rgba(245, 240, 230, 0.75);
  transition: color var(--ease), padding-left var(--ease);
}

.site-footer__list a:hover {
  color: var(--gold-light);
  padding-left: 0.4rem;
}

.site-footer__contact p {
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(245, 240, 230, 0.7);
}

.site-footer__bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: rgba(245, 240, 230, 0.45);
  border-top: 1px solid rgba(201, 169, 97, 0.16);
}

/* ---------- 18. Reveal ---------- */
.js-enabled [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-enabled [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 19. Responsive ---------- */
@media (max-width: 1023px) {
  .site-header {
    width: 100%;
    height: auto;
    background: transparent;
    border-right: none;
    clip-path: none;
  }

  .site-header::after {
    display: none;
  }

  .site-header__bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    padding: 0.6rem 1.25rem;
    background: var(--ink);
    border-bottom: 2px solid var(--gold);
  }

  .site-brand {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    text-align: left;
  }

  .site-brand__mark {
    font-size: 1.4rem;
  }

  .site-brand__suffix {
    font-size: 0.6rem;
  }

  .site-brand__tagline {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    padding: calc(var(--header-h) + 1.5rem) 2rem 2rem;
    background: var(--ink);
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s ease, opacity 0.35s ease, visibility 0.35s ease;
    pointer-events: none;
  }

  .primary-nav[data-open="true"] {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .primary-nav__list {
    padding: 0;
    gap: 0.5rem;
  }

  .primary-nav__link {
    padding: 0.85rem 1.1rem;
    font-size: 1.05rem;
  }

  .primary-nav__link:hover {
    padding-left: 1.3rem;
  }

  .primary-nav__aside {
    padding: 1.5rem 0 1rem;
  }

  .scroll-progress {
    left: 0;
  }

  .site-main {
    margin-left: 0;
    padding-top: calc(var(--header-h) + 2px);
  }

  .site-footer {
    margin-left: 0;
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    padding: 2.5rem 1.5rem 1.5rem;
  }

  .site-footer__col--brand {
    grid-column: 1 / -1;
    padding-right: 0;
  }

  [id] {
    scroll-margin-top: calc(var(--header-h) + 1rem);
  }
}

@media (max-width: 991px) and (min-width: 768px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .site-footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .container {
    padding: 0 1.25rem;
  }

  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }
}

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

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

  .js-enabled [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
