/* ============================================
   版本APP官方主站 — Site CSS
   文件路径 /assets/site.css
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --navy: #0A1F44;
  --navy-deep: #081730;
  --gold: #D4AF37;
  --orange: #FF6B35;
  --cream: #F5F3EB;
  --mist: #9AAEBB;
  --green: #35C48D;
  --red: #FF4D6D;
  --cyan: #1FB6C8;
  --steel: #2B3E5C;
  --font-heading: Oswald, 'Arial Narrow', sans-serif;
  --font-body: Source Serif, 'Songti SC', 'Noto Sans CJK SC', serif;
  --font-mono: JetBrains Mono, 'SFMono-Regular', monospace;
  --sidebar-w: 260px;
  --header-h-mobile: 64px;
  --gutter: clamp(1rem, 4vw, 4rem);
  --max-w: 1440px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --speed: 0.3s;
}

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

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

body {
  background: var(--navy-deep);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.nav-lock {
  overflow: hidden;
}

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

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

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

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--gold);
  color: var(--navy-deep);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 焦点可见性 ---------- */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 3000;
  background: var(--orange);
  color: var(--navy-deep);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.25rem;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- 布局容器 ---------- */
#main-content,
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem 1.5rem;
  border: 0;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: background var(--speed) var(--ease),
    color var(--speed) var(--ease),
    transform var(--speed) var(--ease);
}

.btn-primary {
  background: var(--orange);
  color: var(--navy-deep);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn-primary:hover {
  background: var(--gold);
  color: var(--navy-deep);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.45);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn-ghost:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold);
  border-color: var(--gold);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mist);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(154, 174, 187, 0.15);
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--mist);
  transition: color 0.2s;
}

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

.breadcrumb-sep {
  color: var(--gold);
  opacity: 0.5;
}

.breadcrumb-current {
  color: var(--cream);
}

/* ---------- 章节标题与索引 ---------- */
.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(212, 175, 55, 0.4), transparent);
  transform: skewX(-15deg);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 0.2rem 0.625rem;
  flex-shrink: 0;
}

/* ---------- 切角面板 ---------- */
.panel-chamfer {
  background: var(--navy);
  border: 1px solid rgba(154, 174, 187, 0.1);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  padding: 1.5rem;
}

/* ---------- 数据卡片 ---------- */
.data-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-left: 3px solid var(--gold);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.data-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 6px,
    rgba(212, 175, 55, 0.06) 6px,
    rgba(212, 175, 55, 0.06) 7px
  );
  pointer-events: none;
}

.data-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mist);
}

.data-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.2;
}

.data-value[data-accent="gold"] {
  color: var(--gold);
}

.data-value[data-accent="orange"] {
  color: var(--orange);
}

.data-value[data-accent="green"] {
  color: var(--green);
}

/* ---------- 标签 Chip ---------- */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  padding: 0.2rem 0.75rem;
}

.chip[data-tone="orange"] {
  color: var(--orange);
  background: rgba(255, 107, 53, 0.08);
  border-color: rgba(255, 107, 53, 0.25);
}

.chip[data-tone="green"] {
  color: var(--green);
  background: rgba(53, 196, 141, 0.08);
  border-color: rgba(53, 196, 141, 0.25);
}

/* ---------- 状态行 ---------- */
.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--mist);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}

/* ---------- 图片容器占位 ---------- */
.img-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--navy);
  border: 1px solid rgba(154, 174, 187, 0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-frame[data-ratio="4/3"] {
  aspect-ratio: 4 / 3;
}

.img-frame[data-ratio="1/1"] {
  aspect-ratio: 1 / 1;
}

.img-frame[data-ratio="21/9"] {
  aspect-ratio: 21 / 9;
}

.img-frame::before {
  content: attr(data-caption);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mist);
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(154, 174, 187, 0.06) 10px,
    rgba(154, 174, 187, 0.06) 12px
  );
  padding: 0.5rem 1rem;
  border: 1px dashed rgba(154, 174, 187, 0.3);
  position: relative;
  z-index: 1;
}

.img-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.img-frame.has-img::before,
.img-frame:has(img)::before {
  display: none;
}

/* ---------- 简单占位块 ---------- */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 2rem;
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(154, 174, 187, 0.06) 10px, rgba(154, 174, 187, 0.06) 12px),
    var(--navy);
  border: 1px dashed rgba(154, 174, 187, 0.3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mist);
  text-align: center;
}

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  z-index: 4000;
  pointer-events: none;
}

/* ============================================
   头部 — 桌面端侧边轨道导航
   ============================================ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: var(--navy);
  border-right: 1px solid rgba(154, 174, 187, 0.12);
  z-index: 1000;
}

.header-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.75rem 1.25rem;
}

/* 品牌 */
.brand {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(154, 174, 187, 0.12);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  color: var(--navy-deep);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--gold);
  font-style: normal;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* 移动端汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

.toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transition: transform var(--speed) var(--ease),
    opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 导航 */
.site-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  color: var(--mist);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  transition: color var(--speed) var(--ease),
    background var(--speed) var(--ease);
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: var(--orange);
  transform: translateY(-50%) skewX(-25deg);
  transition: height var(--speed) var(--ease);
}

.nav-link:hover {
  color: var(--cream);
  background: rgba(212, 175, 55, 0.06);
}

.nav-link:hover::before {
  height: 55%;
}

.nav-link[aria-current="page"] {
  color: var(--cream);
  background: rgba(212, 175, 55, 0.1);
}

.nav-link[aria-current="page"]::before {
  height: 55%;
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--gold);
  opacity: 0.65;
  min-width: 1.5em;
  letter-spacing: 0.05em;
}

.nav-label {
  flex: 1;
}

/* 导航底部 CTA 与状态 */
.header-footer {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(154, 174, 187, 0.12);
}

.header-cta {
  display: block;
  text-align: center;
}

.header-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--mist);
  letter-spacing: 0.08em;
}

/* ============================================
   头部 — 移动端抽屉
   ============================================ */
@media (max-width: 860px) {
  .app-header {
    width: 100%;
    height: var(--header-h-mobile);
    border-right: none;
    border-bottom: 1px solid rgba(154, 174, 187, 0.12);
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1rem;
  }

  .brand {
    margin: 0;
    padding: 0;
    border: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 0.8125rem;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  }

  .brand-name {
    font-size: 0.8rem;
  }

  .brand-sub {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h-mobile);
    bottom: 0;
    left: 0;
    width: min(320px, 86vw);
    background: var(--navy);
    padding: 1.5rem 1.25rem;
    border-right: 1px solid rgba(154, 174, 187, 0.12);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.4);
    z-index: 900;
    overflow-y: auto;
    visibility: hidden;
    transform: translateX(-103%);
    transition: transform 0.35s var(--ease),
      visibility 0s linear 0.35s;
  }

  .site-nav[data-open="true"] {
    visibility: visible;
    transform: translateX(0);
    transition: transform 0.35s var(--ease),
      visibility 0s linear 0s;
  }

  .nav-list {
    flex: 1;
  }

  .header-footer {
    border-top: 1px solid rgba(154, 174, 187, 0.12);
    padding-top: 1rem;
    margin-top: 1rem;
  }

  #main-content,
  .main-content {
    margin-left: 0;
    padding-top: var(--header-h-mobile);
  }
}

/* ============================================
   页脚
   ============================================ */
.app-footer {
  background: var(--navy);
  border-top: 1px solid rgba(154, 174, 187, 0.12);
  margin-left: var(--sidebar-w);
  padding: 3.5rem 0 2rem;
}

.footer-inner {
  max-width: calc(var(--max-w) - var(--sidebar-w));
  padding-inline: var(--gutter);
  margin-inline: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(154, 174, 187, 0.12);
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cream);
}

.footer-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 0.25rem;
}

.footer-about {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--mist);
  line-height: 1.7;
  max-width: 32ch;
}

.footer-heading {
  font-size: 0.8125rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  position: relative;
}

.footer-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 24px;
  height: 2px;
  background: linear-gradient(to right, var(--orange), transparent);
  transform: skewX(-30deg);
}

.footer-column .footer-links li + li {
  margin-top: 0.375rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--mist);
  transition: color 0.2s;
}

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

.footer-contact {
  font-size: 0.8125rem;
  color: var(--mist);
  line-height: 1.7;
}

.footer-contact + .footer-contact {
  margin-top: 0.625rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-trust {
  font-size: 0.75rem;
  color: var(--mist);
  max-width: 70ch;
  line-height: 1.6;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--mist);
  white-space: nowrap;
}

.footer-icp a {
  color: var(--mist);
  font-size: 0.6875rem;
  transition: color 0.2s;
}

.footer-icp a:hover {
  color: var(--gold);
}

/* ---------- 页脚响应式 ---------- */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1.5fr 1fr 1fr;
  }

  .footer-column:nth-child(4) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .app-footer {
    margin-left: 0;
    padding: 2.5rem 0 1.5rem;
  }

  .footer-inner {
    max-width: 100%;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-column:nth-child(4) {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-column:nth-child(4) {
    grid-column: auto;
  }
}

/* ============================================
   无障碍 — 减少动态
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .status-dot {
    animation: none;
    opacity: 1;
  }

  .site-nav,
  .site-nav[data-open="true"],
  .nav-toggle .toggle-bar,
  .btn {
    transition: none !important;
  }
}
