/* ============================================================
   开心娱乐CN · /assets/site.css
   展览画册式网格 / 矿物色体系 / 数字游乐场
   ============================================================ */

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

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

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

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

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

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

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

/* ---------- 2. Tokens ---------- */
:root {
  --paper: #F7F1E6;
  --paper-2: #EFE5D3;
  --ink: #16171B;
  --night: #1B1B34;
  --night-2: #2C2A66;
  --violet: #5B3FA0;
  --orange: #F26B38;
  --orange-deep: #D4501F;
  --yellow: #FFC93C;
  --mint: #1FC7A9;
  --rock: #6D7078;
  --moss: #6C8A63;
  --clay: #B86B4B;

  --line: rgba(22, 23, 27, 0.14);
  --line-2: rgba(22, 23, 27, 0.30);
  --line-inv: rgba(247, 241, 230, 0.16);
  --line-inv-2: rgba(247, 241, 230, 0.34);

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

  --shell: 1220px;
  --gutter: 24px;
  --header-h: 100px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 200ms;
}

/* ---------- 3. Base typography ---------- */
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 88% -6%, rgba(31, 199, 169, 0.10), transparent 42%),
    radial-gradient(circle at 4% 32%, rgba(242, 107, 56, 0.09), transparent 38%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-weight: 800; line-height: 1.22; letter-spacing: -0.005em; }
h1 { font-size: clamp(34px, 5.2vw, 58px); }
h2 { font-size: clamp(26px, 3.4vw, 38px); }
h3 { font-size: clamp(20px, 2.2vw, 26px); }
h4 { font-size: 18px; }

p { text-wrap: pretty; }

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

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

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

.page-main {
  display: block;
  padding-top: var(--header-h);
}

.divider {
  height: 1px;
  border: 0;
  background: var(--line);
  margin-block: clamp(32px, 5vw, 64px);
}

.grid { display: grid; gap: clamp(18px, 2.4vw, 32px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 5. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  padding: 12px 22px;
  background: var(--night);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--yellow);
  transform: translateY(-180%);
  transition: transform 180ms var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 6. Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  color: var(--ink);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background-color 220ms var(--ease),
    color 220ms var(--ease),
    border-color 220ms var(--ease),
    box-shadow 220ms var(--ease);
}

.site-header[data-state="solid"] {
  background: var(--night);
  color: var(--paper);
  border-bottom-color: var(--line-inv);
  box-shadow: 0 26px 48px -38px rgba(0, 0, 0, 0.95);
}

/* 6.1 坐标条 */
.header-rail {
  border-bottom: 1px solid var(--line);
  transition: border-color 220ms var(--ease);
}
.site-header[data-state="solid"] .header-rail { border-bottom-color: var(--line-inv); }

.rail-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 34px;
}

.rail-coord {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  white-space: nowrap;
  opacity: 0.72;
}

.rail-dot {
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(31, 199, 169, 0.20);
}

.quick-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  min-width: 0;
}

.quick-link {
  padding: 2px 14px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  opacity: 0.74;
  border-left: 1px solid var(--line);
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}
.quick-link:hover,
.quick-link:focus-visible { opacity: 1; color: var(--orange); }
.site-header[data-state="solid"] .quick-link { border-left-color: var(--line-inv); }
.site-header[data-state="solid"] .quick-link:hover,
.site-header[data-state="solid"] .quick-link:focus-visible { color: var(--yellow); }

/* 6.2 主栏 */
.header-bar { position: relative; }

.bar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding-block: 8px;
}

.brand-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1.5px solid currentColor;
  transition: transform 240ms var(--ease);
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  background: linear-gradient(140deg, var(--yellow) 0%, var(--orange) 52%, var(--violet) 100%);
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: var(--mint);
}
.brand:hover .brand-mark { transform: translate(-1px, -1px); }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand-tag {
  margin-top: 5px;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  opacity: 0.62;
}

/* 6.3 导航 */
.primary-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item { display: block; }

.nav-link {
  position: relative;
  display: block;
  padding: 10px 15px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--dur) var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 4px;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease);
}
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }

.nav-link::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  background: var(--orange);
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.nav-link[aria-current="page"] { font-weight: 700; }
.nav-link[aria-current="page"]::after { transform: scaleX(1); background: var(--yellow); }
.nav-link[aria-current="page"]::before { opacity: 1; }

.header-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  background: var(--orange);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--orange);
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.header-cta:hover,
.header-cta:focus-visible {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--night);
}

.nav-cta { display: none; }

/* 6.4 移动按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 9px 13px;
  border: 1px solid var(--line-2);
  font-size: 12px;
  letter-spacing: 0.16em;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.site-header[data-state="solid"] .nav-toggle { border-color: var(--line-inv-2); }
.nav-toggle:hover,
.nav-toggle:focus-visible { border-color: var(--orange); color: var(--orange); }

.nav-toggle-text { line-height: 1; }

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: background-color 180ms var(--ease);
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 200ms var(--ease);
}
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }

.site-header[data-open="true"] .nav-toggle-icon { background: transparent; }
.site-header[data-open="true"] .nav-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
.site-header[data-open="true"] .nav-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }

/* 6.5 阅读进度 */
.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}
.scroll-meter-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--yellow) 0%, var(--orange) 46%, var(--mint) 100%);
  transition: transform 90ms linear;
}

/* ---------- 7. Footer ---------- */
.site-footer {
  position: relative;
  background: var(--night);
  color: var(--paper);
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(247, 241, 230, 0.055) 1px, transparent 1px);
  background-size: 96px 100%;
}

.footer-rule {
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--orange) 0%, var(--yellow) 34%, var(--mint) 64%, var(--violet) 100%);
}

.footer-inner {
  position: relative;
  padding-block: clamp(44px, 6vw, 72px) 28px;
}

.footer-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.footer-coord {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--mint);
}

.coord-dot {
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--yellow);
}

.footer-brandname {
  margin-top: 14px;
  font-family: var(--font-round);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--paper);
}

.footer-line {
  margin-top: 12px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(247, 241, 230, 0.72);
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 11px 22px;
  border: 1px solid var(--line-inv-2);
  color: var(--yellow);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.footer-cta:hover,
.footer-cta:focus-visible {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--night);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(247, 241, 230, 0.56);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-inv);
}

.footer-list { margin-top: 14px; }

.footer-link {
  display: inline-block;
  padding: 6px 0;
  font-size: 14.5px;
  color: rgba(247, 241, 230, 0.78);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--yellow);
  transform: translateX(3px);
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 34px;
  margin-top: clamp(32px, 4vw, 48px);
  padding-top: 24px;
  border-top: 1px solid var(--line-inv);
}

.footer-contact-item {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  color: rgba(247, 241, 230, 0.80);
}

.footer-contact-key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 26px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-inv);
}

.footer-copy,
.footer-record {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(247, 241, 230, 0.58);
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid var(--line-inv-2);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(247, 241, 230, 0.82);
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.to-top:hover,
.to-top:focus-visible {
  background: var(--orange);
  border-color: var(--orange);
  color: #FFFFFF;
}

.to-top-arrow { font-size: 13px; line-height: 1; }

/* ---------- 8. Common components ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--clay);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
}

.section-title {
  font-family: var(--font-round);
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--night);
}

.coord-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--rock);
}

/* 面包屑 */
.breadcrumb { padding-block: 18px 0; }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--rock);
}

.breadcrumb-item { display: inline-flex; align-items: center; }
.breadcrumb-item + .breadcrumb-item::before {
  content: "／";
  margin-inline: 8px;
  color: rgba(22, 23, 27, 0.26);
}

.breadcrumb-link {
  color: var(--rock);
  transition: color var(--dur) var(--ease);
}
.breadcrumb-link:hover,
.breadcrumb-link:focus-visible { color: var(--orange); }

.breadcrumb-current { color: var(--ink); font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: 2px;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--orange); border-color: var(--orange); color: #FFFFFF; }
.btn--primary:hover,
.btn--primary:focus-visible { background: var(--orange-deep); border-color: var(--orange-deep); color: #FFFFFF; }

.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover,
.btn--ghost:focus-visible { border-color: var(--orange); color: var(--orange); }

.btn--dark { background: var(--night); border-color: var(--night); color: var(--paper); }
.btn--dark:hover,
.btn--dark:focus-visible { background: var(--violet); border-color: var(--violet); color: #FFFFFF; }

/* 卡片 */
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line-2);
  padding: clamp(20px, 2.4vw, 30px);
  transition:
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 16px;
  height: 16px;
  border-top: 2px solid var(--orange);
  border-left: 2px solid var(--orange);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.card:hover,
.card:focus-within {
  border-color: var(--night);
  transform: translateY(-3px);
  box-shadow: 0 24px 44px -34px rgba(27, 27, 52, 0.65);
}
.card:hover::before,
.card:focus-within::before { opacity: 1; }

.card-title {
  font-family: var(--font-round);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--night);
}

.card-text {
  margin-top: 9px;
  font-size: 15px;
  line-height: 1.78;
  color: var(--rock);
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--rock);
}
.tag--accent { border-color: var(--orange); color: var(--orange); }

/* 图片容器 */
.figure-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
}
.figure-frame > img,
.figure-frame > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange) 0%, var(--yellow) 100%);
}
.figure-frame--wide { aspect-ratio: 21 / 9; }
.figure-frame--tall { aspect-ratio: 4 / 5; }

/* 图例 */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: rgba(247, 241, 230, 0.6);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--rock);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  flex: none;
  background: var(--rock);
}

/* 入场动画 */
[data-reveal].is-visible {
  animation: reveal-in 520ms var(--ease) both;
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 9. Responsive ---------- */
@media (max-width: 1020px) {
  :root { --header-h: 64px; }

  .header-rail { display: none; }

  .bar-inner { min-height: 64px; gap: 14px; }

  .header-cta { margin-left: auto; }
  .primary-nav { margin-left: 0; }

  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 26px;
    background: var(--night);
    color: var(--paper);
    border-top: 1px solid var(--line-inv);
    box-shadow: 0 34px 64px -34px rgba(0, 0, 0, 0.9);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-header[data-open="true"] .primary-nav { display: flex; }

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

  .nav-link {
    padding: 15px 4px;
    font-size: 16px;
    border-bottom: 1px solid var(--line-inv);
  }
  .nav-link::after { display: none; }
  .nav-link::before { left: -12px; }
  .nav-link[aria-current="page"] { color: var(--yellow); }

  .nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 15px 22px;
    background: var(--orange);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: background-color var(--dur) var(--ease);
  }
  .nav-cta:hover,
  .nav-cta:focus-visible { background: var(--orange-deep); }

  .footer-masthead { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .quick-links { display: none; }

  .header-cta { display: none; }

  .grid-2,
  .grid-3 { grid-template-columns: minmax(0, 1fr); }

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

  .footer-bottom { justify-content: flex-start; }
}

@media (max-width: 520px) {
  :root { --gutter: 18px; }

  body { font-size: 16px; }

  .brand-tag { display: none; }

  .brand-name { font-size: 16.5px; }

  .footer-nav { grid-template-columns: minmax(0, 1fr); gap: 26px; }

  .footer-contact { flex-direction: column; gap: 10px; }
}

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

  [data-reveal].is-visible { animation: none; }
}
