/* =========================================================
   BBIN官网 · 全站共享样式 /assets/site.css
   版本档案终端：深靛蓝底 + 三区强调色 + 粗边硬投影
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  /* 色彩 */
  --ink: #0A0F26;
  --panel: #151C3B;
  --panel-2: #1D2649;
  --line: #05070F;
  --rock: #3A4256;
  --bone: #F3EEE4;
  --signal: #FF6A2B;
  --cyan: #45D3C4;
  --clay: #C4694A;
  --moss: #8B9A5B;
  --sand: #6C7288;

  --bone-dim: rgba(243, 238, 228, 0.74);
  --bone-faint: rgba(243, 238, 228, 0.46);
  --hair: rgba(108, 114, 136, 0.34);

  /* 字体 */
  --font-display: "Barlow Condensed", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
    Menlo, Consolas, "Liberation Mono", monospace;

  /* 字号阶梯 */
  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-24: 1.5rem;
  --fs-32: 2rem;
  --fs-48: 3rem;
  --fs-72: 4.5rem;
  --fs-104: 6.5rem;

  /* 形状与节奏 */
  --border: 4px solid var(--line);
  --shadow: 8px 8px 0 var(--line);
  --radius: 2px;
  --gutter: clamp(16px, 4vw, 64px);
  --maxw: 1360px;
  --header-h: 88px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink);
  background-image: repeating-linear-gradient(
    0deg,
    rgba(108, 114, 136, 0.055) 0 1px,
    transparent 1px 4px
  );
  color: var(--bone);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

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

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

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

p {
  text-wrap: pretty;
}

h1, h2, h3 {
  text-wrap: balance;
}

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

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 220;
  padding: 10px 18px;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---------- 通用容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.surface {
  position: relative;
  padding: clamp(20px, 3vw, 36px);
  background: var(--panel);
  border: var(--border);
  box-shadow: var(--shadow);
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: var(--fs-13);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  white-space: nowrap;
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  transition: transform 0.16s ease, box-shadow 0.16s ease,
    background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--line);
}

.btn:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--line);
}

.btn--signal {
  background: var(--signal);
  color: var(--ink);
}

.btn--signal:hover {
  background: #FF8248;
}

.btn--cyan {
  background: var(--cyan);
  color: var(--ink);
}

.btn--clay {
  background: var(--clay);
  color: var(--bone);
}

.btn--bone {
  background: var(--bone);
  color: var(--ink);
}

.btn--quiet {
  background: transparent;
  color: var(--bone);
  border-color: var(--bone);
}

.btn--quiet:hover {
  background: var(--panel-2);
  border-color: var(--bone);
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 4px solid transparent;
  transition: background-color 0.28s ease, border-color 0.28s ease,
    box-shadow 0.28s ease;
}

.site-header[data-solid] {
  background: var(--ink);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 0 rgba(5, 7, 15, 0.62);
}

.header-shell {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 32px);
  min-height: var(--header-h);
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  transition: opacity 0.18s ease;
}

.brand:hover {
  opacity: 0.86;
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--signal);
  box-shadow: 4px 4px 0 var(--line);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover .brand-glyph {
  background: var(--cyan);
  box-shadow: 2px 2px 0 var(--line);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--bone);
}

.brand-text em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.04em;
  color: var(--cyan);
  white-space: nowrap;
}

/* 导航 */
.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(6px, 1.4vw, 22px);
}

.nav-list > li {
  display: flex;
}

.nav-list a {
  position: relative;
  display: inline-block;
  padding: 10px 3px;
  font-size: var(--fs-13);
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--bone-dim);
  transition: color 0.18s ease;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 2px;
  height: 3px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-list a:hover {
  color: var(--bone);
}

.nav-list a:hover::after {
  transform: scaleX(1);
}

.nav-list a[aria-current="page"] {
  color: var(--bone);
  font-weight: 700;
}

.nav-list a[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--signal);
}

/* 工具区 */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* 移动端目录按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.1em;
  border: 3px solid rgba(243, 238, 228, 0.34);
  transition: border-color 0.18s ease, color 0.18s ease,
    background-color 0.18s ease;
}

.nav-toggle:hover {
  border-color: var(--bone);
  background: var(--panel-2);
}

.nav-toggle-bars {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: background-color 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.site-header[data-open] .nav-toggle {
  color: var(--signal);
  border-color: var(--signal);
}

.site-header[data-open] .nav-toggle-bars {
  background: transparent;
}

.site-header[data-open] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.site-header[data-open] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--ink);
  border-top: 4px solid var(--line);
  color: var(--bone);
}

.footer-shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(32px, 5vw, 64px) var(--gutter) clamp(24px, 3vw, 36px);
}

.footer-panels {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.35fr;
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
}

.footer-panel {
  position: relative;
  padding: clamp(20px, 2.4vw, 30px);
  background: var(--panel);
  border: var(--border);
  box-shadow: var(--shadow);
}

.footer-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--panel-accent, var(--sand));
}

.footer-panel--brand {
  --panel-accent: var(--moss);
}

.footer-panel--index {
  --panel-accent: var(--cyan);
}

.footer-panel--contact {
  --panel-accent: var(--clay);
}

.panel-tag {
  display: inline-block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.18em;
  color: var(--sand);
}

.panel-title {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--bone);
}

.footer-wordmark {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--bone);
}

.footer-lede {
  margin-top: 12px;
  font-size: var(--fs-13);
  line-height: 1.8;
  color: var(--bone-dim);
}

.footer-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.05em;
  color: var(--moss);
  border: 2px solid var(--moss);
}

.footer-stamp .dot {
  width: 7px;
  height: 7px;
  background: var(--moss);
  border-radius: 50%;
}

.footer-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.footer-link-list a {
  display: block;
  padding: 7px 0;
  font-size: var(--fs-13);
  color: var(--bone-dim);
  border-bottom: 1px solid var(--hair);
  transition: color 0.16s ease, padding-left 0.16s ease,
    border-color 0.16s ease;
}

.footer-link-list a:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  padding-left: 5px;
}

.footer-contact > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  font-size: var(--fs-13);
  border-bottom: 1px solid var(--hair);
}

.footer-contact dt {
  color: var(--sand);
}

.footer-contact dd {
  color: var(--bone);
  word-break: break-word;
}

.footer-note {
  margin-top: 14px;
  padding-left: 12px;
  font-size: var(--fs-12);
  line-height: 1.75;
  color: var(--bone-faint);
  border-left: 3px solid var(--clay);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(24px, 3vw, 36px);
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.04em;
  color: var(--sand);
  border-top: 2px solid var(--hair);
}

.footer-icp {
  color: var(--bone-dim);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-legal a {
  color: var(--bone-dim);
  border-bottom: 1px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.footer-legal a:hover {
  color: var(--bone);
  border-bottom-color: var(--signal);
}

.footer-copy {
  color: var(--sand);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.08em;
  color: var(--sand);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.breadcrumb li:not(:first-child)::before {
  content: "/";
  color: var(--rock);
}

.breadcrumb a {
  color: var(--bone-dim);
  transition: color 0.16s ease;
}

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

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

/* ---------- 小标记 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.05em;
  color: var(--bone-dim);
  border: 2px solid var(--hair);
}

.tag--signal {
  color: var(--signal);
  border-color: var(--signal);
}

.tag--cyan {
  color: var(--cyan);
  border-color: var(--cyan);
}

.tag--clay {
  color: var(--clay);
  border-color: var(--clay);
}

.tag--moss {
  color: var(--moss);
  border-color: var(--moss);
}

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}

.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));
}

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

/* ---------- 图片容器基础规则 ---------- */
.figure {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  background: var(--panel);
  border: var(--border);
  box-shadow: var(--shadow);
}

.figure::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(69, 211, 196, 0.1) 0 1px,
    transparent 1px 6px
  );
}

.figure > img,
.figure > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.figure figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.05em;
  color: var(--bone-dim);
  background: var(--ink);
  border-top: 3px solid var(--line);
  border-right: 3px solid var(--line);
}

.figure--tall {
  aspect-ratio: 3 / 4;
}

.figure--square {
  aspect-ratio: 1 / 1;
}

.figure--wide {
  aspect-ratio: 21 / 9;
}

/* ---------- 入场与返回顶部 ---------- */
html[data-ready] [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

html[data-ready] [data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
}

.back-to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 130;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(80vw, 320px);
  padding: 12px 16px;
  color: var(--bone);
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease,
    visibility 0.22s ease, border-color 0.18s ease, color 0.18s ease;
}

.back-to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.back-to-top__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--ink);
  background: var(--signal);
  font-size: var(--fs-12);
  line-height: 1;
}

.back-to-top__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 平板 ---------- */
@media (max-width: 1080px) {
  .nav-list {
    gap: 4px;
  }

  .nav-list a {
    font-size: 0.75rem;
    padding: 10px 2px;
  }

  .header-tools .btn {
    padding: 9px 13px;
  }
}

/* ---------- 移动端导航 ---------- */
@media (max-width: 960px) {
  :root {
    --header-h: 74px;
    --fs-104: 4rem;
    --fs-72: 3rem;
    --fs-48: 2.25rem;
    --fs-32: 1.75rem;
    --fs-24: 1.375rem;
  }

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

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    padding: 10px var(--gutter) 26px;
    background: var(--panel);
    border-top: 3px solid var(--line);
    border-bottom: 4px solid var(--line);
    box-shadow: 0 12px 0 rgba(5, 7, 15, 0.6);
  }

  .site-header[data-open] .site-nav {
    display: flex;
  }

  .site-header[data-solid] .site-nav {
    background: var(--ink);
  }

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

  .nav-list a {
    display: block;
    padding: 15px 2px;
    font-size: var(--fs-16);
    color: var(--bone-dim);
    border-bottom: 1px solid var(--hair);
  }

  .nav-list > li:last-child a {
    border-bottom: 0;
  }

  .nav-list a::after {
    display: none;
  }

  .nav-list a[aria-current="page"] {
    color: var(--signal);
    padding-left: 12px;
    border-left: 3px solid var(--signal);
  }

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

  .footer-panel--contact {
    grid-column: 1 / -1;
  }

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

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  .header-bar {
    gap: 10px;
  }

  .brand-glyph {
    width: 40px;
    height: 40px;
    font-size: var(--fs-12);
  }

  .brand-text em {
    display: none;
  }

  .brand-text strong {
    font-size: var(--fs-16);
  }

  .header-tools {
    gap: 8px;
  }

  .header-tools .btn {
    padding: 8px 11px;
    font-size: var(--fs-12);
    letter-spacing: 0.02em;
    border-width: 2px;
    box-shadow: 4px 4px 0 var(--line);
  }

  .nav-toggle {
    padding: 8px 10px;
    border-width: 2px;
  }

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

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

  .footer-panel--contact {
    grid-column: auto;
  }

  .footer-base {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .back-to-top {
    right: 12px;
    bottom: 12px;
    padding: 10px 13px;
  }
}

@media (max-width: 400px) {
  .brand-text strong {
    max-width: 4.2em;
    overflow: hidden;
    white-space: nowrap;
  }

  .header-tools .btn--quiet {
    display: none;
  }
}

/* ---------- 减少动态 ---------- */
@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;
  }

  html[data-ready] [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover,
  .btn:active {
    transform: none;
  }

  .back-to-top {
    transform: none;
  }
}
