/* ============================================================
   博盈服务 · V4 中文导航
   共享样式 /assets/site.css
   侧轨外壳 + 奶油纸面 + 复古出版配色
   ============================================================ */

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

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

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

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

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

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

/* ---------- 变量 ---------- */
:root{
  --ink: #0B2545;
  --ink-deep: #071A33;
  --ink-soft: #4A3F36;
  --paper: #F6F0E4;
  --paper-bright: #FFFDF8;
  --orange: #FF6B35;
  --orange-deep: #D94E1F;
  --teal: #1B998B;
  --teal-deep: #12786D;
  --brown: #2B2118;
  --slate: #5B6B7C;
  --sand: #D8CBB8;

  --rail-w: 264px;
  --rail-w-collapsed: 88px;
  --topbar-h: 60px;

  --radius-card: 22px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px -28px rgba(11, 37, 69, .55);

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

  --ease-out: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-reduced-motion: no-preference){
  html{ scroll-behavior: smooth; }
}

/* ---------- 中文排版基线 ---------- */
body{
  padding-top: var(--topbar-h);
  background: var(--paper);
  color: var(--brown);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: .012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6{
  color: var(--ink);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.012em;
}

h1{ font-size: clamp(2.125rem, 6.2vw, 3.5rem); line-height: 1.14; }
h2{ font-size: clamp(1.6rem, 4vw, 2.25rem); line-height: 1.18; }
h3{ font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.3; }
h4{ font-size: 1.0625rem; line-height: 1.35; }

p{ margin: 0; }

small{ font-size: .8125rem; line-height: 1.7; }

a{
  color: var(--orange-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

strong, b{ font-weight: 700; color: var(--ink); }

::selection{ background: rgba(255, 107, 53, .28); color: var(--ink); }

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

/* ---------- 跳转链 ---------- */
.skip-link{
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  background: var(--orange);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .18s var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible{
  transform: translateY(0);
  color: var(--ink);
}

/* ============================================================
   头部外壳 / 侧边轨道
   ============================================================ */
.site-header{
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 100%;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper-bright);
  box-shadow: 0 1px 0 rgba(216, 203, 184, .16);
}

/* 滚动进度 */
.scroll-progress{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 3px;
  pointer-events: none;
}
.scroll-progress__bar{
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange) 55%, var(--teal) 100%);
  transition: width .12s linear;
}

/* 品牌锁定 */
.brand-mark{
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand-mark__sign{
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--orange) 0%, var(--orange-deep) 100%);
  box-shadow: 0 8px 18px -12px rgba(255, 107, 53, .9);
}
.brand-mark__dot{
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--ink);
  transform: rotate(45deg);
}
.brand-mark__text{
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-mark__name{
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--paper-bright);
  white-space: nowrap;
}
.brand-mark__sub{
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2em;
  line-height: 1.5;
  color: rgba(216, 203, 184, .62);
  white-space: nowrap;
}

/* 移动端抽屉开关 */
.nav-toggle{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid rgba(216, 203, 184, .28);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, .06);
  color: var(--paper-bright);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out);
}
.nav-toggle:hover{
  background: rgba(255, 107, 53, .16);
  border-color: rgba(255, 107, 53, .55);
}
.nav-toggle__bars{
  display: grid;
  gap: 4px;
  width: 18px;
}
.nav-toggle__bars span{
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s var(--ease-out), opacity .2s var(--ease-out);
}
.site-header[data-open="true"] .nav-toggle__bars span:nth-child(1){
  transform: translateY(6px) rotate(45deg);
}
.site-header[data-open="true"] .nav-toggle__bars span:nth-child(2){
  opacity: 0;
}
.site-header[data-open="true"] .nav-toggle__bars span:nth-child(3){
  transform: translateY(-6px) rotate(-45deg);
}

/* 导航轨道：移动端为抽屉 */
.nav-rail{
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  z-index: 66;
  width: min(84vw, 336px);
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 20px 30px;
  background: var(--ink-deep);
  color: var(--paper-bright);
  border-right: 1px solid rgba(216, 203, 184, .14);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform .24s var(--ease-out), visibility .24s linear;
}
.site-header[data-open="true"] .nav-rail{
  transform: translateX(0);
  visibility: visible;
}

.nav-rail__caption{
  padding-left: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .26em;
  color: rgba(216, 203, 184, .55);
}

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

.nav-rail__item{ display: block; }

.nav-rail__link{
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 12px 11px 16px;
  border-radius: 14px;
  color: rgba(246, 240, 228, .74);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  transition: color .18s var(--ease-out), background .18s var(--ease-out);
}
.nav-rail__link::before{
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 3px;
  background: var(--orange);
  transform: translateY(-50%);
  transition: height .2s var(--ease-out);
}
.nav-rail__link:hover{
  color: var(--paper-bright);
  background: rgba(255, 253, 248, .07);
}
.nav-rail__link:hover::before{ height: 16px; }

.nav-rail__link[aria-current="page"]{
  color: var(--paper-bright);
  background: rgba(255, 107, 53, .16);
}
.nav-rail__link[aria-current="page"]::before{ height: 22px; }

.nav-rail__index{
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: rgba(216, 203, 184, .58);
  transition: color .18s var(--ease-out);
}
.nav-rail__link[aria-current="page"] .nav-rail__index{ color: var(--orange); }

.nav-rail__label{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 轨道底部 */
.rail-actions{
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-collapse{
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid rgba(216, 203, 184, .24);
  border-radius: var(--radius-pill);
  color: rgba(246, 240, 228, .78);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: border-color .18s var(--ease-out), color .18s var(--ease-out);
}
.rail-collapse:hover{
  border-color: var(--orange);
  color: var(--paper-bright);
}
.rail-collapse__icon{
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s var(--ease-out);
}
body[data-rail="collapsed"] .rail-collapse__icon{ transform: rotate(225deg); }

.rail-note{
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(216, 203, 184, .5);
}

/* 移动端遮罩 */
.nav-scrim{
  position: fixed;
  inset: 0;
  z-index: 64;
  background: rgba(7, 26, 51, .66);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s var(--ease-out);
}
.site-header[data-open="true"] .nav-scrim{
  opacity: 1;
  pointer-events: auto;
}

/* 返回顶部 */
.to-top{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 75;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 203, 184, .34);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper-bright);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  box-shadow: var(--shadow-soft);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out),
              background .2s var(--ease-out);
}
.to-top::before{
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}
.to-top[data-visible="true"]{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.to-top:hover{ background: var(--orange); color: var(--ink); }

body[data-nav-lock="true"]{ overflow: hidden; }

/* ============================================================
   桌面端：侧边固定轨道
   ============================================================ */
@media (min-width: 1024px){
  body{
    padding-top: 0;
    padding-left: var(--rail-w);
    transition: padding-left .24s var(--ease-out);
  }
  body[data-rail="collapsed"]{ padding-left: var(--rail-w-collapsed); }

  .site-header{
    width: var(--rail-w);
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 26px 18px 22px;
    transition: width .24s var(--ease-out), padding .24s var(--ease-out);
  }
  body[data-rail="collapsed"] .site-header{
    width: var(--rail-w-collapsed);
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-toggle{ display: none; }
  .nav-scrim{ display: none; }

  .nav-rail{
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    width: auto;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 30px;
    padding: 0;
    background: transparent;
    border-right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .rail-collapse{ display: inline-flex; }

  .brand-mark{ width: 100%; }

  .to-top{ right: 24px; bottom: 24px; }

  /* 收起态 */
  body[data-rail="collapsed"] .brand-mark{ justify-content: center; }
  body[data-rail="collapsed"] .brand-mark__text,
  body[data-rail="collapsed"] .nav-rail__caption,
  body[data-rail="collapsed"] .nav-rail__label,
  body[data-rail="collapsed"] .rail-note,
  body[data-rail="collapsed"] .rail-actions .btn--primary,
  body[data-rail="collapsed"] .rail-collapse__text{
    display: none;
  }
  body[data-rail="collapsed"] .nav-rail__link{
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
  }
  body[data-rail="collapsed"] .nav-rail__index{ font-size: 13px; }
  body[data-rail="collapsed"] .rail-collapse{ padding: 10px; }
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer{
  background: var(--ink-deep);
  color: rgba(246, 240, 228, .78);
  margin-top: 0;
}

.site-footer__inner{
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 20px 38px;
  display: grid;
  gap: 34px;
}

.site-footer__brand{ min-width: 0; }

.site-footer__mark{
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--orange) 0%, var(--orange-deep) 100%);
}
.site-footer__mark::after{
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--ink-deep);
  transform: rotate(45deg);
}

.site-footer__name{
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -.005em;
  color: var(--paper-bright);
  margin-bottom: 10px;
}

.site-footer__meta{
  font-size: 13px;
  line-height: 1.9;
  color: rgba(246, 240, 228, .55);
}

.site-footer__cols{
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.site-footer__col{ min-width: 0; }

.site-footer__title{
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--orange);
}

.site-footer__list{
  display: grid;
  gap: 7px;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(246, 240, 228, .74);
}
.site-footer__list a{
  color: rgba(246, 240, 228, .82);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color .18s var(--ease-out), border-color .18s var(--ease-out);
}
.site-footer__list a:hover{
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.site-footer__base{
  border-top: 1px solid rgba(216, 203, 184, .16);
}
.site-footer__base-inner{
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  justify-content: space-between;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(246, 240, 228, .5);
}

@media (min-width: 768px){
  .site-footer__inner{
    grid-template-columns: 1.05fr 1fr;
    gap: 48px;
    padding: 60px 32px 44px;
  }
  .site-footer__base-inner{ padding: 20px 32px 30px; }
}

/* ============================================================
   页面级可复用组件
   ============================================================ */
.wrap{
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 768px){
  .wrap{ padding: 0 32px; }
}

.lede{
  max-width: 62ch;
  font-size: clamp(1rem, 1.6vw, 1.0625rem);
  line-height: 1.85;
  color: var(--ink-soft);
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--orange-deep);
}
.eyebrow::before{
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--orange);
}

/* 网格 */
.grid{
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}
.col-3{ grid-column: span 3; }
.col-4{ grid-column: span 4; }
.col-5{ grid-column: span 5; }
.col-6{ grid-column: span 6; }
.col-7{ grid-column: span 7; }
.col-8{ grid-column: span 8; }
.col-12{ grid-column: span 12; }

@media (max-width: 767px){
  .grid{ grid-template-columns: 1fr; gap: 18px; }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-12{ grid-column: auto; }
}

/* 图片容器基础 */
.media-frame{
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--ink);
  aspect-ratio: 16 / 10;
  isolation: isolate;
}
.media-frame img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame__placeholder{
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--ink) 0%, #123A63 58%, #0D2C4F 100%);
}
.media-frame__placeholder::after{
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(27, 153, 139, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 153, 139, .22) 1px, transparent 1px);
  background-size: 34px 34px;
}
.media-frame--wide{ aspect-ratio: 21 / 9; }
.media-frame--tall{ aspect-ratio: 4 / 5; }

/* 信息块 */
.callout{
  padding: 22px 24px;
  border: 1px solid var(--teal);
  border-left-width: 4px;
  border-radius: 18px;
  background: rgba(27, 153, 139, .1);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}
.callout__label{
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--teal-deep);
}

/* 面包屑 */
.breadcrumb{ font-size: 13px; line-height: 1.7; color: var(--slate); }
.breadcrumb__list{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.breadcrumb__item{
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb__item + .breadcrumb__item::before{
  content: "/";
  color: var(--sand);
}
.breadcrumb__link{
  color: var(--slate);
  text-decoration: none;
  border-bottom: 1px solid var(--sand);
  transition: color .18s var(--ease-out), border-color .18s var(--ease-out);
}
.breadcrumb__link:hover{
  color: var(--orange-deep);
  border-bottom-color: var(--orange);
}

/* 按钮 */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s var(--ease-out), color .18s var(--ease-out),
              border-color .18s var(--ease-out), transform .18s var(--ease-out);
}
.btn--primary{
  background: var(--orange);
  color: var(--ink);
}
.btn--primary:hover{
  background: var(--orange-deep);
  color: var(--paper-bright);
  transform: translateY(-2px);
}
.btn--ghost{
  background: transparent;
  border-color: var(--sand);
  color: var(--ink);
}
.btn--ghost:hover{
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-2px);
}
.btn--block{ width: 100%; }

/* ============================================================
   动效偏好
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
