/* ============================================================
   乐投 · LETOU — 全站共享样式 /assets/site.css
   头部侧边轨道 + 页脚控制台色块 + 通用组件
   ============================================================ */

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

* { margin: 0; }

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

body {
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

a { color: inherit; }

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

/* ---------- 2. Tokens ---------- */
:root {
  --ink: #0B1220;
  --blue: #1B5CFF;
  --blue-tint: #E8EFFF;
  --paper: #FBFCFE;
  --orange: #FF6A1F;
  --warm: #FFF3E9;
  --violet: #7A5BFF;
  --green: #39E08E;
  --gray: #6B7688;
  --line: #D8E0EE;
  --console: #0A1730;
  --console-soft: #13264E;

  --rail-collapsed: 104px;
  --rail-open: 296px;
  --bar-h: 64px;
  --shell-max: 1240px;
  --shell-pad: 56px;

  --font-display: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --font-body: "Inter", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-num: "Space Grotesk", "Archivo", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-card: 0 24px 48px -34px rgba(11, 18, 32, .55);
}

/* ---------- 3. Base typography ---------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; }

.num,
.tabular {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* ---------- 4. Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 300;
  padding: 12px 20px;
  background: var(--orange);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 10px 10px;
  transition: top .2s var(--ease);
}

.skip-link:focus {
  top: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding-left: var(--shell-pad);
  padding-right: var(--shell-pad);
}

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

body.nav-locked {
  overflow: hidden;
}

/* ---------- 5. Main content offset ---------- */
.site-main {
  margin-left: var(--rail-collapsed);
  min-height: 100vh;
  transition: margin-left .36s var(--ease);
}

body[data-rail-open] .site-main {
  margin-left: var(--rail-open);
}

/* ---------- 6. Header: side rail ---------- */
.site-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  width: var(--rail-collapsed);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 16px 22px;
  background: var(--console);
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
  transition: width .36s var(--ease);
}

.site-rail::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--blue), var(--violet) 42%, var(--orange) 74%, var(--green));
  pointer-events: none;
}

.site-rail::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 280px;
  height: 340px;
  background: radial-gradient(circle at 50% 50%, rgba(27, 92, 255, .5), rgba(122, 91, 255, .16) 46%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

body[data-rail-open] .site-rail {
  width: var(--rail-open);
}

/* --- rail head --- */
.rail__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

body[data-rail-open] .rail__head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.rail__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

.rail__brand-mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}

.rail__brand-latin {
  font-family: var(--font-num);
  font-size: .68rem;
  letter-spacing: .3em;
  color: var(--green);
  opacity: 0;
  transition: opacity .22s var(--ease);
}

body[data-rail-open] .rail__brand-latin {
  opacity: 1;
}

.rail__toggle {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(251, 252, 254, .06);
  border: 1px solid rgba(251, 252, 254, .16);
  border-radius: 10px;
  color: var(--paper);
  cursor: pointer;
  transition: background .22s, border-color .22s, transform .22s var(--ease);
}

.rail__toggle:hover {
  background: rgba(57, 224, 142, .14);
  border-color: rgba(57, 224, 142, .55);
  transform: translateY(-2px);
}

.rail__bars {
  display: grid;
  gap: 5px;
  width: 16px;
}

.rail__bars i {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s;
}

[data-nav-toggle][aria-expanded="true"] .rail__bars i:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

[data-nav-toggle][aria-expanded="true"] .rail__bars i:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* --- rail nav --- */
.rail__nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.rail__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px 11px 22px;
  border-radius: 10px;
  color: rgba(251, 252, 254, .7);
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.3;
  white-space: nowrap;
  transition: background .22s, color .22s, transform .22s var(--ease);
}

.rail__link:hover {
  background: rgba(251, 252, 254, .07);
  color: var(--paper);
  transform: translateX(3px);
}

.rail__link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(27, 92, 255, .46), rgba(122, 91, 255, .12) 82%, transparent);
  color: var(--paper);
}

.rail__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 224, 142, .16);
}

.rail__link-idx {
  flex: 0 0 auto;
  width: 20px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: .68rem;
  letter-spacing: .1em;
  color: rgba(251, 252, 254, .33);
  transition: color .22s;
}

.rail__link:hover .rail__link-idx,
.rail__link[aria-current="page"] .rail__link-idx {
  color: var(--green);
}

.rail__link-label {
  opacity: 0;
  transition: opacity .26s var(--ease);
}

body[data-rail-open] .rail__link-label {
  opacity: 1;
}

/* --- rail quick actions --- */
.rail__quick {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 16px;
  border-top: 1px solid rgba(251, 252, 254, .1);
  opacity: 0;
  transition: opacity .26s var(--ease);
}

body[data-rail-open] .rail__quick {
  opacity: 1;
}

.rail__quick-label {
  margin: 0 0 6px;
  padding-left: 10px;
  font-family: var(--font-num);
  font-size: .64rem;
  letter-spacing: .26em;
  color: rgba(57, 224, 142, .8);
  white-space: nowrap;
}

.rail__quick-link {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: .84rem;
  color: rgba(251, 252, 254, .58);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s, background .2s, transform .2s var(--ease);
}

.rail__quick-link:hover {
  color: var(--green);
  background: rgba(57, 224, 142, .1);
  transform: translateX(3px);
}

/* --- rail foot --- */
.rail__foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
}

.rail__spine {
  writing-mode: vertical-rl;
  font-family: var(--font-num);
  font-size: .64rem;
  letter-spacing: .44em;
  color: rgba(251, 252, 254, .26);
  text-align: center;
  transition: opacity .24s var(--ease);
}

body[data-rail-open] .rail__spine {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

body[data-rail-open] .rail__foot {
  justify-content: flex-start;
}

.rail__note {
  margin: 0;
  font-size: .72rem;
  line-height: 1.6;
  color: rgba(251, 252, 254, .42);
  opacity: 0;
  transition: opacity .26s var(--ease);
}

body[data-rail-open] .rail__note {
  opacity: 1;
}

.site-rail :focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -2px;
}

/* ---------- 7. Footer ---------- */
.site-foot {
  position: relative;
  margin-left: var(--rail-collapsed);
  background: var(--console);
  color: rgba(251, 252, 254, .76);
  overflow: hidden;
  isolation: isolate;
  transition: margin-left .36s var(--ease);
}

body[data-rail-open] .site-foot {
  margin-left: var(--rail-open);
}

.site-foot::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--violet) 36%, var(--orange) 72%, var(--green));
  z-index: 2;
}

.site-foot__glow {
  position: absolute;
  top: -200px;
  right: -120px;
  width: 560px;
  height: 460px;
  background: radial-gradient(circle at 50% 50%, rgba(27, 92, 255, .38), rgba(122, 91, 255, .14) 46%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.site-foot__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 52px 48px;
  padding-top: 76px;
  padding-bottom: 56px;
}

.site-foot__logo {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--paper);
}

.site-foot__intro {
  margin: 0 0 20px;
  font-size: .95rem;
  line-height: 1.85;
  color: rgba(251, 252, 254, .66);
  max-width: 34ch;
}

.site-foot__stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-num);
  font-size: .72rem;
  letter-spacing: .12em;
  color: rgba(251, 252, 254, .5);
}

.site-foot__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 224, 142, .16);
  animation: foot-pulse 2.4s ease-in-out infinite;
}

@keyframes foot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.site-foot__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}

.site-foot__title {
  margin: 0 0 18px;
  font-family: var(--font-num);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .24em;
  color: var(--green);
  text-transform: uppercase;
}

.site-foot__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-foot__link {
  display: inline-block;
  padding: 5px 0;
  font-size: .93rem;
  color: rgba(251, 252, 254, .7);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s, transform .2s var(--ease);
}

.site-foot__link:hover {
  color: var(--paper);
  border-color: var(--green);
  transform: translateX(4px);
}

.site-foot__contact {
  display: flex;
  flex-direction: column;
}

.site-foot__contact-line {
  margin: 0 0 8px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: .87rem;
  letter-spacing: .04em;
  color: rgba(251, 252, 254, .82);
  word-break: break-all;
}

.site-foot__contact-note {
  margin: 12px 0 0;
  font-size: .8rem;
  line-height: 1.8;
  color: rgba(251, 252, 254, .48);
}

.site-foot__legal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 22px;
  padding-bottom: 26px;
  border-top: 1px solid rgba(251, 252, 254, .1);
  font-family: var(--font-num);
  font-size: .76rem;
  letter-spacing: .08em;
  color: rgba(251, 252, 254, .44);
}

.site-foot__legal p { margin: 0; }

/* ---------- 8. Generic components ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .22s var(--ease), background .22s, color .22s, border-color .22s, box-shadow .22s;
}

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

.btn--primary {
  background: linear-gradient(96deg, var(--blue), var(--violet) 60%, var(--orange));
  color: #fff;
  box-shadow: 0 18px 34px -24px rgba(27, 92, 255, .95);
}

.btn--primary:hover {
  box-shadow: 0 24px 44px -22px rgba(27, 92, 255, 1);
}

.btn--orange {
  background: var(--orange);
  color: var(--ink);
  box-shadow: 0 16px 30px -22px rgba(255, 106, 31, .95);
}

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

.btn--ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  font-family: var(--font-num);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--gray);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  color: var(--line);
}

.breadcrumb a {
  color: var(--gray);
  text-decoration: none;
  transition: color .2s;
}

.breadcrumb a:hover { color: var(--blue); }

.breadcrumb [aria-current="page"] { color: var(--ink); }

.prose {
  max-width: 68ch;
}

.prose p { margin-bottom: 1.15em; }

.prose h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  margin: 1.9em 0 .55em;
}

.prose h3 {
  font-size: 1.2rem;
  margin: 1.6em 0 .5em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
}

.prose ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: .55em;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: 9px;
  height: 2px;
  background: var(--orange);
}

.panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  transition: transform .24s var(--ease), border-color .24s, box-shadow .24s;
}

.panel:hover {
  transform: translateY(-4px);
  border-color: var(--blue);
  box-shadow: var(--shadow-card);
}

.panel--cut {
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.panel--cut:hover {
  box-shadow: none;
}

.img-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg,
      rgba(27, 92, 255, .16),
      rgba(122, 91, 255, .12) 44%,
      rgba(255, 106, 31, .13));
}

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

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

/* ---------- 9. JS-injected chrome ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 120;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--blue), var(--violet) 34%, var(--orange) 68%, var(--green));
  pointer-events: none;
}

.to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 110;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-num);
  font-size: .78rem;
  letter-spacing: .14em;
  cursor: pointer;
  box-shadow: 0 18px 36px -22px rgba(11, 18, 32, .6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .26s var(--ease), transform .26s var(--ease), visibility .26s, border-color .2s, color .2s;
}

.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* ---------- 10. Responsive ---------- */
@media (max-width: 1100px) {
  :root { --shell-pad: 40px; }

  .site-foot__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }

  .site-foot__contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 899px) {
  :root {
    --shell-pad: 20px;
    --rail-open: 296px;
  }

  .site-main {
    margin-left: 0;
    padding-top: var(--bar-h);
  }

  body[data-rail-open] .site-main { margin-left: 0; }

  /* rail becomes a top bar */
  .site-rail {
    inset: 0 0 auto 0;
    width: 100%;
    height: var(--bar-h);
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 0 16px;
    overflow: visible;
    transition: none;
  }

  body[data-rail-open] .site-rail { width: 100%; }

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

  .rail__head {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  body[data-rail-open] .rail__head {
    flex-direction: row;
    justify-content: space-between;
  }

  .rail__brand-mark { font-size: 1.3rem; }

  .rail__brand-latin { opacity: 1; }

  .rail__nav {
    position: fixed;
    top: var(--bar-h);
    right: 0;
    bottom: 0;
    width: min(84vw, 340px);
    z-index: 88;
    flex: 0 0 auto;
    padding: 24px 20px 44px;
    background: var(--console);
    border-left: 1px solid rgba(251, 252, 254, .08);
    box-shadow: -30px 0 70px -34px rgba(0, 0, 0, .85);
    transform: translateX(102%);
    transition: transform .34s var(--ease);
    overflow-y: auto;
  }

  .rail__nav[data-open] {
    transform: translateX(0);
  }

  .rail__link {
    padding: 13px 12px 13px 22px;
  }

  .rail__link-label {
    opacity: 1;
  }

  body[data-rail-open] .rail__link-label { opacity: 1; }

  .rail__quick {
    opacity: 1;
  }

  body[data-rail-open] .rail__quick { opacity: 1; }

  .rail__foot {
    display: none;
  }

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

  body[data-rail-open] .site-foot { margin-left: 0; }

  .site-foot__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 56px;
    padding-bottom: 40px;
  }

  .site-foot__contact { grid-column: auto; }

  .site-foot__nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 16px;
  }

  .site-foot__intro { max-width: none; }

  .to-top {
    right: 16px;
    bottom: 16px;
    padding: 11px 16px;
  }
}

@media (max-width: 560px) {
  .site-foot__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-foot__legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .panel { padding: 22px; }
}

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

  .site-foot__dot { animation: none; opacity: 1; }
}
