/* ==========================================================================
   VueIC · 组件层
   按钮 / 链接 / 标签 / 卡片 / 图标 / 骨架屏 / 折叠区 / 代码块 / 架构图 /
   站点头部 / 自定义光标 / 章节导轨
   ========================================================================== */

/* ------------------------------------------------------------------ 按钮 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color var(--dur-hover) var(--ease-out),
              border-color var(--dur-hover) var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out),
              color var(--dur-hover) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 3px; }
.btn--primary:focus-visible { box-shadow: 0 2px 12px rgba(59, 125, 216, 0.18); }

.btn .ico { width: 18px; height: 18px; flex: none; }
.btn .ico--arrow { transition: transform var(--dur-hover) var(--ease-out); }
.btn:hover .ico--arrow { transform: translateX(3px); }

.btn--primary {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(59, 125, 216, 0.18);
}
.btn--primary:hover {
  background: var(--brand-bright);
  box-shadow: 0 6px 24px rgba(59, 125, 216, 0.34);
}

.btn--outline {
  border: 1px solid var(--border);
  background: rgba(22, 26, 36, 0.5);
  color: var(--text-2);
}
.btn--outline:hover {
  border-color: var(--brand-40);
  background: var(--brand-08);
  color: var(--text);
}

.btn--ghost {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-2);
}
.btn--ghost:hover {
  border-color: var(--brand-40);
  color: var(--text);
  background: var(--brand-04);
}
.btn--sm { min-height: 38px; font-size: 13.5px; }

.ico-ext {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.92em;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform var(--dur-hover) var(--ease-out);
}
.btn:hover .ico-ext { transform: translate(2px, -3px); }

/* 实验室平台主按钮（方案 4.5 按钮设计规范） */
.btn-lab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 280px;
  max-width: min(100%, 320px);
  height: 56px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #3B7DD8 0%, #2A5FA8 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-btn);
  transition: background var(--dur-hover) var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out),
              transform var(--dur-hover) var(--ease-out);
}
.btn-lab .ico--ne {
  width: 20px; height: 20px;
  transition: transform var(--dur-hover) var(--ease-out);
}
.btn-lab:hover {
  background: linear-gradient(135deg, #5A9AF0 0%, #3B7DD8 100%);
  box-shadow: var(--shadow-btn-hover);
  transform: scale(1.02);
}
.btn-lab:hover .ico--ne { transform: translate(2px, -2px); }
.btn-lab:active {
  transform: scale(0.98);
  box-shadow: 0 2px 12px rgba(59, 125, 216, 0.22);
}
.btn-lab:focus-visible {
  outline: none;
  /* 方案 4.5：Focus 状态外发光，同时保留按钮本身的主品牌阴影 */
  box-shadow: var(--shadow-btn), 0 0 0 4px rgba(59, 125, 216, 0.2);
}

/* ------------------------------------------------------------------ 链接 */
.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--brand-bright);
  transition: color var(--dur-hover) var(--ease-out);
}
.link-cta .ico { width: 18px; height: 18px; transition: transform var(--dur-hover) var(--ease-out); }
.link-cta:hover { color: var(--text); }
.link-cta:hover .ico { transform: translateX(4px); }

.link-underline {
  color: var(--text-2);
  border-bottom: 1px solid transparent;
  transition: color var(--dur-hover) var(--ease-out), border-color var(--dur-hover) var(--ease-out);
}
.link-underline:hover { color: var(--text); border-bottom-color: var(--brand); }

/* ------------------------------------------------------------------ 标签 */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-list li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--text-04);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  transition: border-color var(--dur-hover) var(--ease-out),
              color var(--dur-hover) var(--ease-out),
              background-color var(--dur-hover) var(--ease-out);
}

/* ------------------------------------------------------------------ 图标 */
.ico { width: 20px; height: 20px; }

/* 线性图标的描边绘制动画（方案 4.4 社会痛点卡片） */
[data-draw-icon] svg { width: 40px; height: 40px; overflow: visible; }
[data-draw-icon] .draw {
  stroke: var(--brand);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: var(--draw-len, 120);
  stroke-dashoffset: 0;
}
.js [data-draw-icon]:not(.is-drawn) .draw { stroke-dashoffset: var(--draw-len, 120); }
.js [data-draw-icon] .draw {
  transition: stroke-dashoffset var(--dur-reveal) var(--ease-out-quart);
}

/* ------------------------------------------------------------------ 卡片共性 */
.card-surface {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(22, 26, 36, 0.72) 0%, rgba(15, 17, 24, 0.72) 100%);
}

/* ------------------------------------------------------------------ 骨架屏 */
.sk {
  display: block;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--surface) 0%, #1D2230 40%, var(--surface) 80%);
  background-size: 220% 100%;
  animation: sk-shimmer 1.5s linear infinite;
}
.sk--icon { width: 22px; height: 22px; border-radius: 6px; }
.sk--label { width: 72px; height: 12px; }
.sk--value { width: 132px; height: 16px; }

/* ------------------------------------------------------------------ 折叠区 */
.tech {
  margin-top: var(--block-y);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(15, 17, 24, 0.7) 0%, rgba(8, 9, 13, 0.7) 100%);
  overflow: hidden;
}
.tech__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: 22px var(--card-pad);
  text-align: left;
  transition: background-color var(--dur-hover) var(--ease-out);
}
.tech__toggle:hover { background: var(--brand-04); }
.tech__toggle-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 20px;
}
.tech__toggle-mark {
  width: 18px;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--brand);
  transition: transform var(--dur-hover) var(--ease-out);
}
.tech__toggle-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-2);
}
.tech__toggle-icon {
  flex: none;
  color: var(--text-2);
  transition: transform var(--dur-panel) var(--ease-out-quart), color var(--dur-hover) var(--ease-out);
}
.tech__toggle-icon svg { width: 20px; height: 20px; }
.tech__toggle:hover .tech__toggle-icon { color: var(--brand-bright); }
.tech__toggle[aria-expanded="true"] .tech__toggle-icon { transform: rotate(180deg); }

.tech__panel {
  padding: 0 var(--card-pad) var(--card-pad);
  overflow: hidden;
}
.tech__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.tech-card {
  padding: var(--space-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(8, 9, 13, 0.6);
}
.tech-card--wide { grid-column: 1 / -1; }
.tech-card__title {
  margin-bottom: 8px;
  font-family: var(--font-heading);
  font-size: 18px;
}
.tech-card__desc {
  margin-bottom: var(--space-3);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}

/* ------------------------------------------------------------------ 代码块 */
.code-block {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8, 9, 13, 0.85);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text-2);
  tab-size: 2;
}

/* ------------------------------------------------------------------ 架构图 */
.diagram svg { width: 100%; height: auto; }
.diagram__nodes rect {
  fill: rgba(22, 26, 36, 0.85);
  stroke: var(--border);
  stroke-width: 1;
}
.diagram__nodes .diagram__accent {
  fill: var(--warm-08);
  stroke: var(--warm-32);
}
.diagram__edges path {
  stroke: var(--border);
  stroke-width: 1;
  fill: none;
}
.diagram__arrows path { fill: var(--text-3); }
.diagram__text text {
  fill: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
}
.diagram__text text.diagram__text-sub { fill: var(--text-3); font-size: 10.5px; }

/* ------------------------------------------------------------------ 站点头部 */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  height: var(--header-h);
  transition: background-color var(--dur-card) var(--ease-out),
              border-color var(--dur-card) var(--ease-out),
              backdrop-filter var(--dur-card) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
}
.site-header.is-stuck {
  background: rgba(8, 9, 13, 0.76);
  border-bottom-color: var(--border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  color: var(--brand);
  transition: color var(--dur-hover) var(--ease-out), transform var(--dur-card) var(--ease-out);
}
.brand__mark svg { width: 30px; height: 30px; }
.brand:hover .brand__mark { color: var(--brand-bright); transform: translateY(-1px); }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name {
  font-family: var(--font-heading);
  font-size: 21px;
  letter-spacing: 0.02em;
}
.brand__sub {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  position: relative;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-2);
  transition: color var(--dur-hover) var(--ease-out);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 6px;
  height: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-card) var(--ease-out-quart);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }
.site-nav a.is-active { color: var(--text); }
.site-header__cta { margin-left: var(--space-2); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.nav-toggle__bars { display: grid; gap: 5px; width: 18px; }
.nav-toggle__bars i {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur-card) var(--ease-out), opacity var(--dur-card) var(--ease-out);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* 移动端导航面板 */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: grid;
  align-content: center;
  padding: var(--space-8) var(--pad-x);
  background: rgba(8, 9, 13, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.mobile-nav[hidden] { display: none; }
.mobile-nav nav { display: grid; gap: 4px; }
.mobile-nav a {
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 26px;
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav__ext {
  margin-top: var(--space-3);
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  color: var(--brand-bright);
}

/* ------------------------------------------------------------------ 章节导轨 */
.chapter-rail {
  position: fixed;
  top: 50%;
  right: clamp(20px, 3vw, 40px);
  z-index: var(--z-rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}
.chapter-rail__line {
  position: relative;
  display: block;
  width: 1px;
  height: 160px;
  background: var(--border);
  overflow: hidden;
}
.chapter-rail__line i {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 1px;
  height: 0%;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-bright) 100%);
  transition: height 120ms linear;
}
.chapter-rail__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-3);
}
.chapter-rail__label b { font-weight: 500; color: var(--brand); }
.chapter-rail__label em {
  writing-mode: vertical-rl;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--text-3);
}
@media (max-width: 1279px) { .chapter-rail { display: none; } }

/* ------------------------------------------------------------------ 自定义光标 */
#cursor-canvas {
  position: fixed;
  inset: 0;
  z-index: var(--z-cursor);
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-card) var(--ease-out);
  mix-blend-mode: screen;
}
#cursor-canvas.is-on { opacity: 1; }

/* ------------------------------------------------------------------ 复制提示 */
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 210;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity var(--dur-hover) var(--ease-out), transform var(--dur-hover) var(--ease-out);
  pointer-events: none;
}
.copy-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
