/* =========================================================
   WILLIAMHILL 中国站 · 共享样式 /assets/site.css
   框架式左栏导航 + 展览画册式内容节奏 + 数据面板质感
   ========================================================= */

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

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

body { margin: 0; }

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

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

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

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

ul, ol { list-style: none; }

table { border-collapse: collapse; width: 100%; }

main:focus { outline: none; }

/* ---------- 2. Tokens ---------- */
:root {
  --green: #0E3B2E;
  --green-deep: #08261E;
  --moss: #4F7A5C;
  --rock: #2B2F2E;
  --fog: #6E7674;
  --paper: #F4F1E8;
  --paper-card: #FBF9F3;
  --gold: #C9A227;
  --orange: #E07A3F;
  --blue: #3FA9C9;
  --blue-ink: #1F6E85;
  --line: #A9C3A6;

  --rail-w: 240px;
  --gap: 24px;
  --maxw: 1280px;

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

  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-1: 0 1px 0 rgba(8, 38, 30, .08), 0 18px 40px -26px rgba(8, 38, 30, .55);
}

/* ---------- 3. Base ---------- */
body {
  background: var(--paper);
  color: var(--rock);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .004em;
  word-break: break-word;
  text-rendering: optimizeLegibility;
}

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

.rail :focus-visible,
.topbar :focus-visible,
.panel-chip :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--gold);
}

@media (min-width: 960px) {
  body { padding-left: var(--rail-w); }
}

/* ---------- 4. Typography utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

.display-1 {
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.02em;
}

.h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.01em;
}

.h3 {
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1.3;
  font-weight: 700;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fog);
}

.lead {
  max-width: 62ch;
  font-size: 19px;
  line-height: 1.7;
}

.muted { color: var(--fog); }
.accent { color: var(--gold); }

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 1.6em; font-size: 28px; font-weight: 800; line-height: 1.25; }
.prose h3 { margin-top: 1.4em; font-size: 21px; font-weight: 700; }
.prose ul,
.prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .45em; }
.prose a { color: var(--blue-ink); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color .24s var(--ease), color .24s var(--ease),
              border-color .24s var(--ease), transform .24s var(--ease);
}

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-deep);
}
.btn--gold:hover { background: #DCB43A; border-color: #DCB43A; transform: translateY(-2px); }

.btn--outline {
  border-color: var(--green);
  color: var(--green);
}
.btn--outline:hover { background: var(--green); color: var(--paper); transform: translateY(-2px); }

.btn--ghost {
  border-color: rgba(244, 241, 232, .45);
  color: var(--paper);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

/* ---------- 6. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 72px 0; }
.section--tight { padding: 44px 0; }
.section--dark { background: var(--green); color: var(--paper); }

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

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--line), rgba(169, 195, 166, 0));
}

/* ---------- 7. Components ---------- */
.card {
  background: var(--paper-card);
  border: 1px solid rgba(169, 195, 166, .72);
  padding: 24px;
  box-shadow: var(--shadow-1);
  transition: transform .28s var(--ease), border-color .28s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--moss); }

.card--panel {
  background: linear-gradient(160deg, var(--green), var(--green-deep));
  border-color: rgba(201, 162, 39, .38);
  color: var(--paper);
  box-shadow: none;
}

.card__title {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}

.card__meta {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fog);
}

.card__body {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--fog);
}

.card--panel .card__meta { color: var(--line); }
.card--panel .card__body { color: rgba(244, 241, 232, .78); }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line);
  background: rgba(169, 195, 166, .16);
  color: var(--moss);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  line-height: 1.6;
  text-transform: uppercase;
}
.tag--new { border-color: var(--orange); background: rgba(224, 122, 63, .18); color: #7A3D16; }
.tag--gold { border-color: var(--gold); background: rgba(201, 162, 39, .2); color: #6D570F; }
.tag--blue { border-color: var(--blue); background: rgba(63, 169, 201, .16); color: var(--blue-ink); }

.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(169, 195, 166, .6);
  background: linear-gradient(150deg, var(--green), var(--green-deep));
}
.media-frame img,
.media-frame svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--16x9 { aspect-ratio: 16 / 9; }
.media-frame--4x3 { aspect-ratio: 4 / 3; }
.media-frame--1x1 { aspect-ratio: 1 / 1; }
.media-frame--tall { aspect-ratio: 3 / 4; }

.media-frame__caption {
  margin-top: 10px;
  color: var(--fog);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
}

.texture-grid { position: relative; }
.texture-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(244, 241, 232, .06) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(244, 241, 232, .06) 0 1px, transparent 1px 26px);
}

.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--fog);
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumbs a {
  color: var(--fog);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.breadcrumbs a:hover { color: var(--blue-ink); border-bottom-color: currentColor; }
.breadcrumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--line);
}

/* ---------- 8. Header : skip link ---------- */
.skip-link {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 99;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }

@media (min-width: 960px) {
  .skip-link { left: calc(var(--rail-w) + 12px); }
}

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

.brand__mark {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: var(--gold);
  color: var(--green-deep);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}

.brand__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .01em;
}

.brand__ver {
  padding: 1px 5px;
  border: 1px solid rgba(201, 162, 39, .55);
  color: var(--gold);
  font-size: 11px;
  line-height: 1.5;
}

.brand--topbar .brand__mark { flex-basis: 30px; width: 30px; height: 30px; font-size: 12px; }
.brand--topbar .brand__name { font-size: 14px; }
.brand--footer .brand__name { font-size: 16px; }

/* ---------- 10. Header : mobile topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--green);
  border-bottom: 1px solid rgba(201, 162, 39, .45);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(201, 162, 39, .55);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .1em;
  transition: border-color .24s var(--ease), color .24s var(--ease);
}
.nav-toggle:hover { border-color: var(--gold); color: var(--gold); }
.nav-toggle__text { line-height: 1; }

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}
.nav-toggle__bars i {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform .24s var(--ease), opacity .24s var(--ease);
}
.site-header[data-open] .nav-toggle__bars i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle__bars i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- 11. Header : panel chip ---------- */
.panel-chip {
  display: none;
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 65;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(8, 38, 30, .94);
  border: 1px solid rgba(201, 162, 39, .5);
  color: var(--paper);
}
.panel-chip__label {
  color: var(--line);
  font-size: 10px;
  letter-spacing: .22em;
}
.panel-chip__link {
  color: var(--gold);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .24s var(--ease);
}
.panel-chip__link:hover { border-bottom-color: currentColor; }

/* ---------- 12. Header : left rail ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 240px;
  padding: 26px 20px 26px;
  overflow-y: auto;
  background: var(--green);
  color: var(--paper);
  border-right: 1px solid rgba(201, 162, 39, .35);
}

.rail::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(244, 241, 232, .05) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(244, 241, 232, .05) 0 1px, transparent 1px 28px);
}

.rail > * { position: relative; z-index: 1; }

.rail__head { display: flex; flex-direction: column; gap: 10px; }

.rail__tag {
  color: var(--line);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.version-block {
  padding: 14px 14px 14px 16px;
  border: 1px solid rgba(169, 195, 166, .28);
  border-left: 3px solid var(--gold);
  background: rgba(8, 38, 30, .55);
}
.version-block__label {
  color: var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.version-block__value {
  margin-top: 2px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.copy-btn {
  width: 100%;
  margin-top: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(201, 162, 39, .55);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  transition: background-color .24s var(--ease), color .24s var(--ease), border-color .24s var(--ease);
}
.copy-btn:hover { background: rgba(201, 162, 39, .16); }
.copy-btn.is-copied {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-deep);
}

.rail-nav__list { display: flex; flex-direction: column; gap: 2px; }
.rail-nav__item { display: block; }

.rail-link {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-left: 2px solid transparent;
  color: rgba(244, 241, 232, .82);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color .24s var(--ease), color .24s var(--ease), border-color .24s var(--ease);
}
.rail-link:hover { background: rgba(244, 241, 232, .08); color: var(--paper); }

.rail-link[aria-current="page"] {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(201, 162, 39, .22), rgba(201, 162, 39, 0));
  color: var(--paper);
  font-weight: 700;
}

.rail-link__idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--gold);
  opacity: .9;
}

.rail-link__label { display: inline-block; }

.rail-link.is-current { background: rgba(244, 241, 232, .07); color: var(--paper); }
.rail-link.is-current .rail-link__label::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  background: var(--blue);
  border-radius: 50%;
  vertical-align: middle;
}

.rail__foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(169, 195, 166, .25);
}

.quick-list { display: flex; flex-direction: column; gap: 6px; }
.quick-list__item { display: block; }

.quick-link {
  display: block;
  padding: 8px 10px;
  border: 1px solid rgba(169, 195, 166, .35);
  background: rgba(8, 38, 30, .5);
  color: var(--paper);
  font-size: 13px;
  text-decoration: none;
  transition: border-color .24s var(--ease), color .24s var(--ease), background-color .24s var(--ease);
}
.quick-link:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, .14);
  color: var(--gold);
}

.rail__note {
  margin-top: 12px;
  color: rgba(244, 241, 232, .45);
  font-size: 10.5px;
  letter-spacing: .1em;
}

.rail-backdrop { display: none; }

/* ---------- 13. Footer ---------- */
.site-footer {
  margin-top: 72px;
  background: var(--green-deep);
  border-top: 3px solid var(--gold);
  color: rgba(244, 241, 232, .86);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px 32px;
  padding-top: 56px;
  padding-bottom: 40px;
}

.footer__intro {
  max-width: 34ch;
  margin-top: 16px;
  color: rgba(244, 241, 232, .72);
  font-size: 14.5px;
  line-height: 1.75;
}

.footer__version {
  margin-top: 14px;
  color: var(--gold);
  font-size: 11.5px;
  letter-spacing: .08em;
}

.footer__title {
  margin-bottom: 14px;
  color: var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.footer__list { display: flex; flex-direction: column; gap: 10px; }
.footer__item { display: block; }

.footer__link {
  color: rgba(244, 241, 232, .86);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .24s var(--ease), border-color .24s var(--ease);
}
.footer__link:hover { color: var(--gold); border-bottom-color: var(--gold); }

.footer__meta {
  display: grid;
  gap: 6px;
  padding-top: 20px;
  padding-bottom: 36px;
  border-top: 1px solid rgba(169, 195, 166, .28);
}

.footer__meta-line {
  color: rgba(244, 241, 232, .66);
  font-size: 13.5px;
  letter-spacing: .01em;
}

.footer__year {
  color: rgba(244, 241, 232, .45);
  font-size: 12px;
  letter-spacing: .08em;
}

/* ---------- 14. Motion protocol ---------- */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.has-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 15. Responsive ---------- */
@media (max-width: 959px) {
  .rail {
    width: min(320px, 86vw);
    padding: 22px 18px 28px;
    transform: translateX(-102%);
    transition: transform .30s var(--ease);
    box-shadow: 24px 0 60px -30px rgba(8, 38, 30, .95);
  }
  .site-header[data-open] .rail { transform: translateX(0); }

  .rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(8, 38, 30, .66);
    opacity: 0;
    pointer-events: none;
    transition: opacity .30s var(--ease);
  }
  .site-header[data-open] .rail-backdrop { opacity: 1; pointer-events: auto; }

  body.nav-open { overflow: hidden; }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 24px; }
}

@media (min-width: 960px) {
  .topbar { display: none; }
  .panel-chip { display: inline-flex; }
}

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

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .container { padding: 0 18px; }
  .section { padding: 52px 0; }
  .section--tight { padding: 34px 0; }
  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 30px; padding-top: 40px; }
  .site-footer { margin-top: 48px; }
  .footer__meta { padding-bottom: 28px; }
}

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

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

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