/* ============================================================
   Raybet新版 · 共享外壳样式 / assets/site.css
   技术蓝图网格 + 珠宝色分区 + 纸张叠层
   ============================================================ */

/* ---------- 0. reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body { margin: 0; }

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

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

p { margin: 0 0 1em; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

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

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

button { background: none; border: 0; }

input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---------- 1. 变量 ---------- */
:root {
  --deep-900: #071A2B;
  --deep-700: #0E2E4A;
  --indigo-600: #37296B;
  --cyan-400: #2FD8C6;
  --cyan-200: #9FF2E9;
  --coral-500: #FF6B4A;
  --coral-700: #B8381C;
  --paper-50: #F4F7F6;
  --mist-200: #D9E6EA;
  --grid-400: #7C9DB0;
  --ink-900: #08131A;

  --top-h: 56px;
  --rail-w: 236px;
  --shell-max: 1220px;

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

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. 基础排版 ---------- */
body {
  padding-top: var(--top-h);
  padding-left: var(--rail-w);
  min-height: 100vh;
  background-color: var(--paper-50);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 3. skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--coral-500);
  color: var(--ink-900);
  font-weight: 700;
  font-size: 14px;
  border-radius: 2px;
  transform: translateY(-180%);
  transition: transform 200ms var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- 4. 头部：固定框架 ---------- */
.site-header {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

/* 4.1 顶部薄条 */
.header-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(14px, 3vw, 28px);
  background-color: var(--deep-900);
  background-image: linear-gradient(90deg, rgba(124, 157, 176, 0.16) 1px, transparent 1px);
  background-size: 56px 100%;
  border-bottom: 1px solid rgba(47, 216, 198, 0.24);
  pointer-events: auto;
  z-index: 2;
}

.brand-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-name { color: #ffffff; }
.brand-dot { color: var(--cyan-400); font-weight: 700; }
.brand-sub {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cyan-200);
}

.lang-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--cyan-200);
  border: 1px solid rgba(159, 242, 233, 0.4);
  border-radius: 2px;
  padding: 3px 8px;
  white-space: nowrap;
}

.top-entry {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--coral-500);
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 700;
  border-radius: 2px;
  white-space: nowrap;
  transition: background 200ms ease, transform 200ms ease;
}
.top-entry:hover { background: #FF8A70; }

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--cyan-400), var(--coral-500));
  transition: width 100ms linear;
  z-index: 3;
}

/* 4.2 移动端展开按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(159, 242, 233, 0.45);
  border-radius: 2px;
  color: var(--cyan-200);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}
.nav-toggle:hover { background: rgba(47, 216, 198, 0.14); color: #ffffff; }
.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 14px;
  height: 10px;
}
.nav-toggle-bars span {
  display: block;
  height: 1.5px;
  background: currentColor;
}
.nav-toggle-text { white-space: nowrap; }

/* 4.3 左侧框架竖轨 */
.header-rail {
  position: absolute;
  top: var(--top-h);
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  padding: 22px 0 18px;
  overflow-y: auto;
  background-color: var(--deep-900);
  background-image:
    linear-gradient(180deg, rgba(47, 216, 198, 0.10) 0%, rgba(7, 26, 43, 0) 32%),
    linear-gradient(0deg, rgba(55, 41, 107, 0.55) 0%, rgba(7, 26, 43, 0) 46%);
  border-right: 1px solid rgba(47, 216, 198, 0.22);
  pointer-events: auto;
  z-index: 3;
}

.site-nav { flex: 0 0 auto; }

.rail-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--grid-400);
}
.rail-caption-line {
  flex: 1;
  height: 1px;
  background: rgba(124, 157, 176, 0.4);
}

.nav-list { display: flex; flex-direction: column; }
.nav-item { position: relative; }
.nav-item[hidden] { display: none; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px 11px 22px;
  color: #B9CDD8;
  font-size: 14.5px;
  font-weight: 600;
  transition: color 200ms ease, background 200ms ease;
}
.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: var(--coral-500);
  transform: translateY(-50%);
  transition: height 260ms var(--ease-out);
}
.nav-link:hover { color: #ffffff; background: rgba(47, 216, 198, 0.07); }
.nav-link[aria-current="page"] { color: #ffffff; background: rgba(47, 216, 198, 0.1); }
.nav-link[aria-current="page"]::before { height: 62%; }

.nav-index {
  flex: none;
  min-width: 30px;
  text-align: center;
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--grid-400);
  border: 1px solid rgba(124, 157, 176, 0.38);
  border-radius: 2px;
  transition: color 200ms ease, border-color 200ms ease;
}
.nav-link[aria-current="page"] .nav-index {
  color: var(--cyan-400);
  border-color: rgba(47, 216, 198, 0.6);
}
.nav-label { white-space: nowrap; }

/* 4.4 栏目定位筛选 */
.rail-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 20px 20px 0;
}
.rail-filter-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--grid-400);
}
.rail-filter-input {
  width: 100%;
  padding: 8px 10px;
  background: rgba(244, 247, 246, 0.06);
  border: 1px solid rgba(124, 157, 176, 0.38);
  border-radius: 2px;
  color: var(--paper-50);
  font-size: 13px;
  line-height: 1.4;
}
.rail-filter-input::placeholder { color: rgba(124, 157, 176, 0.9); }
.rail-filter-input:focus {
  outline: none;
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 2px rgba(47, 216, 198, 0.2);
}
.rail-filter-empty {
  margin: 8px 20px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--coral-500);
}
.rail-filter-empty[hidden] { display: none; }

/* 4.5 竖轨底部 */
.rail-foot {
  margin-top: auto;
  flex: 0 0 auto;
  padding: 22px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(124, 157, 176, 0.24);
}
.rail-coord {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--grid-400);
}
.coord-label { color: var(--cyan-400); margin-right: 6px; }
.rail-region {
  margin: 0;
  font-size: 12px;
  color: #9FB6C4;
}

/* 4.6 遮罩 */
.header-scrim {
  position: absolute;
  inset: 0;
  background: rgba(7, 26, 43, 0.62);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
  z-index: 1;
}
.site-header[data-open] .header-scrim {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---------- 5. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.btn-coral { background: var(--coral-500); color: var(--ink-900); }
.btn-coral:hover { background: #FF8A70; }
.btn-outline {
  background: transparent;
  color: var(--cyan-200);
  border-color: rgba(159, 242, 233, 0.5);
}
.btn-outline:hover { background: rgba(47, 216, 198, 0.14); color: #ffffff; }
.btn-block { width: 100%; }

/* ---------- 6. 页脚 ---------- */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  background-color: var(--deep-900);
  background-image: linear-gradient(90deg, rgba(124, 157, 176, 0.14) 1px, transparent 1px);
  background-size: 72px 100%;
  border-top: 1px solid rgba(47, 216, 198, 0.24);
  color: #B9CDD8;
}

.footer-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) clamp(20px, 5vw, 56px) 28px;
}

.footer-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 32px;
  padding-bottom: 22px;
}
.footer-brand {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.footer-summary {
  flex: 1 1 280px;
  margin: 0;
  max-width: 46ch;
  font-size: 14px;
  color: #9FB6C4;
}
.footer-meta {
  margin: 0 0 6px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(124, 157, 176, 0.28);
  font-size: 12.5px;
  color: #8EA7B5;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px 24px;
  padding: 32px 0;
}

.footer-col-title {
  margin: 0 0 14px;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--cyan-400);
  border-bottom: 1px solid rgba(47, 216, 198, 0.25);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-links a {
  font-size: 13.5px;
  color: #B9CDD8;
  transition: color 180ms ease;
}
.footer-links a::before {
  content: "—";
  margin-right: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(47, 216, 198, 0.6);
}
.footer-links a:hover { color: var(--cyan-200); }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(124, 157, 176, 0.28);
  font-size: 12.5px;
  color: #8EA7B5;
}
.footer-mono {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.footer-spacer { flex: 1 1 auto; }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0;
}
.footer-legal a { color: var(--cyan-200); }
.footer-legal a:hover { color: #ffffff; }

/* ---------- 7. 页面结构组件 ---------- */
.page-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
  background-image: linear-gradient(90deg, rgba(124, 157, 176, 0.16) 1px, transparent 1px);
  background-size: 96px 100%;
}

.section { padding: clamp(38px, 6vw, 76px) 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding-bottom: 14px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--mist-200);
}
.section-index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--coral-700);
}
.section-title { font-size: clamp(22px, 3vw, 32px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--coral-700);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--coral-500);
}

.lead {
  max-width: 62ch;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.7;
  color: #2C3F4C;
}

/* ---------- 8. 正文容器 ---------- */
.prose { max-width: 66ch; }
.prose h2 {
  margin: 2em 0 0.6em;
  font-size: clamp(20px, 2.4vw, 26px);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  margin: 1.6em 0 0.5em;
  font-size: 18px;
}
.prose p { margin: 0 0 1.15em; }
.prose ul,
.prose ol { margin: 0 0 1.2em; }
.prose li {
  position: relative;
  margin-bottom: 0.5em;
  padding-left: 18px;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 1px;
  background: var(--coral-500);
}

/* ---------- 9. 卡片 / 标签 / 面包屑 ---------- */
.card {
  position: relative;
  padding: clamp(18px, 2.4vw, 26px);
  background: #ffffff;
  border: 1px solid var(--mist-200);
  border-radius: 2px;
  box-shadow: 5px 5px 0 var(--mist-200);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--grid-400);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #3B5566;
}
.tag-coral {
  border-color: var(--coral-500);
  color: var(--coral-700);
  background: rgba(255, 107, 74, 0.08);
}
.tag-cyan {
  border-color: rgba(47, 216, 198, 0.7);
  color: #0D6B62;
  background: rgba(159, 242, 233, 0.2);
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--grid-400);
}
.crumb a { color: #476173; }
.crumb a:hover { color: var(--coral-700); }
.crumb-sep { color: #9FB6C4; }

/* ---------- 10. 网格 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 26px);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 11. 图片容器 ---------- */
.figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--mist-200);
  border-radius: 2px;
  background: linear-gradient(135deg, var(--deep-700) 0%, var(--indigo-600) 100%);
}
.figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(159, 242, 233, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(159, 242, 233, 0.14) 1px, transparent 1px);
  background-size: 36px 36px;
}
.figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure-16x9 { aspect-ratio: 16 / 9; }
.figure-4x3 { aspect-ratio: 4 / 3; }
.figure-1x1 { aspect-ratio: 1 / 1; }
.figure-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--grid-400);
}

/* ---------- 12. 可展开内容组 ---------- */
.expander {
  border: 1px solid var(--mist-200);
  border-radius: 2px;
  background: #ffffff;
}
.expander + .expander { margin-top: -1px; }

.expander-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-900);
  cursor: pointer;
  transition: background 200ms ease;
}
.expander-trigger:hover { background: rgba(47, 216, 198, 0.08); }

.expander-mark {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
}
.expander-mark::before,
.expander-mark::after {
  content: "";
  position: absolute;
  background: var(--coral-500);
  transition: transform 220ms var(--ease-out);
}
.expander-mark::before { left: 0; top: 6.5px; width: 14px; height: 1.5px; }
.expander-mark::after { left: 6.5px; top: 0; width: 1.5px; height: 14px; }
.expander[data-open] .expander-mark::after { transform: scaleY(0); }

.expander-panel {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid transparent;
}
.expander[data-open] .expander-panel {
  display: block;
  padding-top: 16px;
  border-top-color: var(--mist-200);
}

/* ---------- 13. 横向滑轨 ---------- */
.rail-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 320px);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
.rail-item { scroll-snap-align: start; }
.rail-track::-webkit-scrollbar { height: 6px; }
.rail-track::-webkit-scrollbar-track { background: var(--mist-200); }
.rail-track::-webkit-scrollbar-thumb { background: var(--grid-400); border-radius: 3px; }

/* ---------- 14. 显现动效 ---------- */
[data-js] [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 320ms ease, transform 320ms var(--ease-out);
}
[data-js] [data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
}

/* ---------- 15. 平板 ---------- */
@media (max-width: 1023px) {
  :root { --rail-w: 0px; }

  body { padding-left: 0; }

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

  .brand-sub { display: none; }

  .header-rail {
    width: min(86vw, 320px);
    transform: translateX(-103%);
    transition: transform 320ms var(--ease-out);
    box-shadow: 14px 0 42px rgba(7, 26, 43, 0.5);
  }
  .site-header[data-open] .header-rail { transform: translateX(0); }
  .site-header[data-open] .header-scrim { opacity: 1; visibility: visible; pointer-events: auto; }

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

/* ---------- 16. 手机 ---------- */
@media (max-width: 620px) {
  .header-top { gap: 10px; padding: 0 12px; }
  .brand-lockup { font-size: 15px; }
  .lang-tag { font-size: 10px; letter-spacing: 0.1em; padding: 2px 6px; }
  .top-entry { padding: 5px 10px; font-size: 12px; }

  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
  .footer-lead { align-items: flex-start; }
  .footer-lead .btn { width: 100%; }
  .footer-spacer { display: none; }
  .footer-base { gap: 6px 16px; }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .rail-track { grid-auto-columns: minmax(240px, 84%); }
  .figure-16x9,
  .figure-4x3 { aspect-ratio: 4 / 3; }
}

/* ---------- 17. 降低动效 ---------- */
@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;
  }

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