/* ============================================================
   best365官网 · /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 头部 / 页脚 / 通用组件
   ============================================================ */

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

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

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

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

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

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

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

a { color: inherit; }

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

/* ---------- 2. 设计变量 ---------- */
:root {
  /* 色彩 */
  --ink-900: #060B18;
  --ink-800: #0C1726;
  --ink-700: #13253C;
  --line-500: #26445F;
  --cyan-400: #2FE3D0;
  --cyan-200: #9BF5EC;
  --amber-500: #FFA51F;
  --amber-600: #B45A00;
  --paper-050: #F2F6FA;
  --text-100: #E9EFF8;
  --text-400: #93A6BF;
  --teal-600: #0E7C8A;
  --ink-on-paper: #0B1421;

  /* 结构 */
  --rail-w: 56px;
  --cmd-h: 44px;
  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 56px);
  --radius: 3px;

  /* 字体 */
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
                "SimSun", Georgia, serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Consolas,
               "Liberation Mono", Menlo, monospace;

  /* 质感 */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 6px 18px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .6, .2, 1);
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  padding-top: var(--cmd-h);
  overflow-x: hidden;
  background: var(--ink-900);
  color: var(--text-100);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--text-100);
}

h1 { font-size: clamp(32px, 5.4vw, 60px); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 3vw, 36px); }
h3 { font-size: clamp(18px, 2vw, 23px); font-weight: 700; }

p { max-width: 72ch; }

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

small { font-size: 12px; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

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

.section { padding-block: clamp(40px, 6vw, 88px); }
.section--tight { padding-block: clamp(28px, 4vw, 56px); }

.section--paper {
  background: var(--paper-050);
  color: var(--ink-on-paper);
}
.section--paper h1,
.section--paper h2,
.section--paper h3,
.section--paper h4 { color: #060B18; }
.section--paper .btn--accent {
  background: var(--amber-600);
  border-color: var(--amber-600);
  color: #FFF8EC;
}
.section--paper .prose a { color: #0E6F7A; }
.section--paper .lead { color: #46586D; }

.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.stack > * + * { margin-top: var(--stack-gap, 16px); }

/* ---------- 5. 通用文本组件 ---------- */
.lead {
  font-family: var(--font-serif);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.85;
  color: var(--text-400);
  max-width: 68ch;
}

.prose {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-100);
  max-width: 68ch;
}
.prose p + p,
.prose ul + p,
.prose p + ul { margin-top: 1em; }
.prose ul { list-style: none; }
.prose ul li {
  position: relative;
  padding-left: 18px;
  margin-top: 0.5em;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 8px;
  height: 1px;
  background: var(--cyan-400);
}
.prose a {
  color: var(--cyan-400);
  text-decoration: underline;
  text-decoration-color: var(--line-500);
  text-underline-offset: 3px;
  transition: text-decoration-color .16s var(--ease);
}
.prose a:hover { text-decoration-color: var(--cyan-400); }
.prose h2, .prose h3 { margin-top: 1.6em; margin-bottom: 0.6em; }

.rule {
  height: 1px;
  border: 0;
  background: var(--line-500);
}

/* ---------- 6. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-400);
}
.breadcrumb a {
  color: var(--text-400);
  text-decoration: none;
  transition: color .16s var(--ease);
}
.breadcrumb a:hover { color: var(--cyan-400); }
.breadcrumb__sep { color: var(--line-500); }
.breadcrumb [aria-current="page"] { color: var(--text-100); }

/* ---------- 7. 按钮与标签 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--line-500);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-100);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: color .16s var(--ease),
              border-color .16s var(--ease),
              background-color .16s var(--ease),
              transform .16s var(--ease);
}
.btn:hover { border-color: var(--cyan-400); color: var(--cyan-400); }

.btn--accent {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: #060B18;
  font-weight: 700;
}
.btn--accent:hover {
  background: #FFB84D;
  border-color: #FFB84D;
  color: #060B18;
  transform: translateY(-2px);
}

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--ink-700); color: var(--text-100); border-color: var(--line-500); }

.btn--cyan {
  border-color: var(--cyan-400);
  color: var(--cyan-400);
  background: transparent;
}
.btn--cyan:hover {
  background: rgba(47, 227, 208, .1);
  color: var(--cyan-200);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line-500);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan-200);
  white-space: nowrap;
}
.tag--accent {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: #060B18;
  font-weight: 700;
}

/* ---------- 8. 面板 ---------- */
.panel {
  position: relative;
  background: var(--ink-800);
  border: 1px solid var(--line-500);
  border-radius: var(--radius);
  padding: clamp(16px, 2vw, 24px);
  box-shadow: var(--shadow-1);
}
.panel__head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan-200);
  margin-bottom: 12px;
}

/* ---------- 9. 图片容器基础规则 ---------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-500);
  background: var(--ink-700);
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow-1);
}
.media > img,
.media > svg,
.media > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }

.media__caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-400);
}

/* ---------- 10. 头部 · 外层 ---------- */
.site-header {
  position: relative;
  z-index: 300;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 700;
  transform: translate(-50%, -180%);
  padding: 10px 18px;
  border-radius: 2px;
  background: var(--amber-500);
  color: #060B18;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-2);
  transition: transform .16s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { transform: translate(-50%, 0); }

.scrollrail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 600;
  pointer-events: none;
  background: transparent;
}
.scrollrail__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--cyan-400);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* ---------- 11. 头部 · 左侧命令栏 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: var(--rail-w);
  padding: 10px 0 12px;
  background: var(--ink-800);
  border-right: 1px solid var(--line-500);
}

.rail__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--cyan-200);
  text-decoration: none;
  border-radius: 2px;
  transition: color .16s var(--ease);
}
.rail__brand:hover { color: #FFFFFF; }

.rail__nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid var(--line-500);
  border-bottom: 1px solid var(--line-500);
  scrollbar-width: none;
  background: transparent;
}
.rail__nav::-webkit-scrollbar { width: 0; height: 0; }

.rail__list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
}

.rail__item { display: block; width: 100%; }

.rail__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 0;
  writing-mode: vertical-rl;
  border-left: 2px solid transparent;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.12em;
  color: var(--text-400);
  text-decoration: none;
  transition: color .16s var(--ease),
              background-color .16s var(--ease),
              border-color .16s var(--ease);
}
.rail__link:hover {
  color: var(--text-100);
  background: var(--ink-700);
}
.rail__link[aria-current="page"] {
  color: var(--cyan-400);
  border-left-color: var(--cyan-400);
  background: rgba(47, 227, 208, .09);
  font-weight: 700;
}

.rail__cta { display: none; }

.rail__version {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-400);
  padding-bottom: 2px;
  white-space: nowrap;
}

/* ---------- 12. 头部 · 顶部快捷命令条 ---------- */
.cmdbar {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--cmd-h);
  padding-inline: clamp(12px, 2vw, 24px);
  background: rgba(6, 11, 24, .9);
  border-bottom: 1px solid var(--line-500);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cmdbar__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  max-width: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.statusdot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 0 3px rgba(47, 227, 208, .16);
}

.cmdbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.cmdbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line-500);
  border-radius: 2px;
  background: transparent;
  color: var(--text-400);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s var(--ease),
              border-color .16s var(--ease),
              background-color .16s var(--ease),
              transform .16s var(--ease);
}
.cmdbtn:hover {
  color: var(--text-100);
  border-color: var(--cyan-400);
}

.cmdbtn--accent {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: #060B18;
  font-weight: 700;
}
.cmdbtn--accent:hover {
  background: #FFB84D;
  border-color: #FFB84D;
  color: #060B18;
  transform: translateY(-2px);
}

/* ---------- 13. 移动导航按钮 ---------- */
.navtoggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-500);
  border-radius: 2px;
  background: transparent;
  color: var(--text-100);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.navtoggle:hover { border-color: var(--cyan-400); color: var(--cyan-400); }

.navtoggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: background-color .16s var(--ease);
}
.navtoggle__bars::before,
.navtoggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform .16s var(--ease);
}
.navtoggle__bars::before { top: -5px; }
.navtoggle__bars::after { top: 5px; }

.navtoggle[aria-expanded="true"] .navtoggle__bars { background: transparent; }
.navtoggle[aria-expanded="true"] .navtoggle__bars::before { transform: translateY(5px) rotate(45deg); }
.navtoggle[aria-expanded="true"] .navtoggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* ---------- 14. 页脚 ---------- */
.site-footer {
  margin-top: clamp(56px, 9vw, 120px);
  background: var(--ink-800);
  border-top: 1px solid var(--line-500);
  color: var(--text-400);
  font-size: 14px;
}

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

.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: clamp(22px, 3vw, 36px);
  border-bottom: 1px solid var(--line-500);
}

.footer__identity { min-width: 0; }

.footer__wordmark {
  font-family: var(--font-sans);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-100);
  max-width: none;
}

.footer__tagline {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-400);
  max-width: none;
}

.footer__version {
  padding: 6px 10px;
  border: 1px solid var(--line-500);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--cyan-200);
  white-space: nowrap;
  max-width: none;
}

.footer__body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(24px, 3vw, 40px) 0;
}

.footer__head {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan-200);
  max-width: none;
}

.footer__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
}

.footer__link {
  display: inline-block;
  color: var(--text-400);
  font-size: 14px;
  text-decoration: none;
  transition: color .16s var(--ease);
}
.footer__link:hover,
.footer__link:focus-visible { color: var(--cyan-400); }
.footer__link[aria-current="page"] { color: var(--text-100); font-weight: 500; }

.footer__deflist { display: grid; gap: 10px; }

.footer__defrow {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.footer__defrow dt {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-400);
}
.footer__defrow dd {
  margin: 0;
  color: var(--text-100);
  font-size: 14px;
  word-break: break-word;
}

.footer__note {
  margin-top: 14px;
  max-width: 46ch;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-400);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: clamp(18px, 2.5vw, 28px);
  border-top: 1px solid var(--line-500);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-400);
}
.footer__copy,
.footer__icp { max-width: none; }

/* ---------- 15. 显现动效 ---------- */
[data-reveal] {
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
html.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
}
html.reveal-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 16. 响应式 · 移动与平板 ---------- */
@media (max-width: 899px) {
  :root {
    --rail-w: 0px;
    --cmd-h: 56px;
  }

  body {
    padding-left: 0;
    padding-top: 56px;
  }

  .cmdbar { display: none; }

  .rail {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: auto;
    height: 56px;
    padding: 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line-500);
  }

  .rail__brand {
    writing-mode: horizontal-tb;
    margin-right: auto;
    padding: 0;
    font-size: 14px;
    letter-spacing: 0.1em;
  }

  .rail__version { display: none; }

  .navtoggle { display: inline-flex; }

  .rail__nav {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    flex: 0 0 auto;
    display: block;
    padding: 14px 12px 24px;
    background: var(--ink-800);
    border-top: 0;
    border-bottom: 0;
    border-right: 1px solid var(--line-500);
    box-shadow: var(--shadow-2);
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform .18s var(--ease);
  }
  .rail__nav[data-open="true"] { transform: translateX(0); }

  .rail__list { gap: 4px; }

  .rail__link {
    writing-mode: horizontal-tb;
    justify-content: flex-start;
    padding: 12px 10px;
    font-size: 15px;
    letter-spacing: 0.06em;
    border-left-width: 2px;
  }

  .rail__cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line-500);
  }
  .rail__cta .cmdbtn {
    width: 100%;
    height: 38px;
    font-size: 13px;
  }

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

@media (max-width: 860px) {
  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .footer__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .footer__defrow { grid-template-columns: 44px minmax(0, 1fr); }
  .footer__list { gap: 10px 16px; }
}

@media (max-width: 420px) {
  .footer__list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 17. 降低动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html.reveal-ready [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .skip-link { transition: none; }
}

/* ---------- 18. 打印 ---------- */
@media print {
  .skip-link,
  .scrollrail,
  .rail,
  .cmdbar { display: none !important; }
  body {
    padding: 0;
    background: #FFFFFF;
    color: #000000;
  }
  .site-footer { border-top: 1px solid #999; background: #FFFFFF; color: #000000; }
}
