/* ==========================================================================
   InfiStudio Components — V2 共享组件样式
   依赖 tokens.css。官网与教程共用。
   ========================================================================== */

/* ---- 按钮系统 -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #130d08;
  box-shadow: var(--glow-gold);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-gold-strong);
}
/* 主按钮 sheen 流光 */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease-out);
}
.btn-primary:hover::after {
  left: 130%;
}
.btn-ghost {
  border-color: var(--line);
  color: var(--ink-soft);
  background: var(--surface-1);
}
.btn-ghost:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-2px);
}
.btn-text {
  min-height: auto;
  padding: 4px 0;
  color: var(--ink-soft);
}
.btn-text:hover {
  color: var(--gold-bright);
}
.btn-icon {
  min-height: 44px;
  width: 44px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface-1);
}
.btn-icon:hover {
  border-color: var(--line-strong);
  color: var(--gold-bright);
}
.btn-lg {
  min-height: 52px;
  padding: 0 28px;
  font-size: var(--text-md);
}

/* ---- 顶栏 ----------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 232, 201, 0.08);
  background: rgba(8, 6, 4, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}
.site-header.scrolled {
  background: rgba(6, 4, 3, 0.86);
  box-shadow: var(--elev-1);
}
.site-header .container,
.site-header .container-wide {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.brand-mark {
  width: 36px;
  height: 22px;
  display: block;
  object-fit: contain;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.brand-name em {
  color: var(--gold);
  font-style: italic;
}
.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}
.nav a {
  position: relative;
  padding: 4px 0;
  transition: color var(--dur-fast) ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--gold-bright);
  transition: width var(--dur-base) var(--ease-out);
}
.nav a:hover {
  color: var(--ink);
}
.nav a:hover::after {
  width: 100%;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.version {
  color: var(--ink-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
}
.header-actions .btn {
  min-height: 40px;
  padding: 0 18px;
  font-size: var(--text-sm);
}

/* 移动端汉堡 */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-1);
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 1.6px;
  background: var(--ink);
  transform: translateX(-50%);
  transition: transform var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out);
}
.nav-toggle span {
  top: 50%;
  transform: translate(-50%, -50%);
}
.nav-toggle span::before {
  top: -6px;
}
.nav-toggle span::after {
  top: 6px;
}
body.nav-open .nav-toggle span {
  background: transparent;
}
body.nav-open .nav-toggle span::before {
  transform: translateX(-50%) translateY(6px) rotate(45deg);
}
body.nav-open .nav-toggle span::after {
  transform: translateX(-50%) translateY(-6px) rotate(-45deg);
}

/* 移动端抽屉 */
.mobile-drawer {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 49;
  background: rgba(6, 4, 3, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateX(100%);
  transition: transform var(--dur-base) var(--ease-out);
  overflow-y: auto;
}
body.nav-open .mobile-drawer {
  transform: translateX(0);
}
.mobile-drawer a {
  padding: 16px 8px;
  font-size: var(--text-lg);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.mobile-drawer a:hover {
  color: var(--gold-bright);
}
.mobile-drawer .btn {
  margin-top: 20px;
}

/* ---- 区块标题系统 --------------------------------------------------- */
section {
  padding: var(--section-y) 0;
  position: relative;
}
.section-head {
  max-width: 820px;
  margin-bottom: 46px;
}
.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-kicker {
  color: var(--gold);
  font-size: var(--text-sm);
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.section-title {
  font-family: var(--font-serif-cn);
  font-size: var(--text-4xl);
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.section-lead {
  margin-top: 18px;
  max-width: 680px;
  color: var(--ink-soft);
  font-size: var(--text-lg);
  font-weight: 300;
}
.section-head.center .section-lead {
  margin-left: auto;
  margin-right: auto;
}

/* ---- 卡片系统 ------------------------------------------------------- */
.card {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
  transition: transform var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 168, 92, 0.32);
  background: var(--surface-3);
}
.card-glass {
  background:
    radial-gradient(circle at 86% 14%, rgba(255, 196, 114, 0.16), transparent 18rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 34%),
    var(--glass);
  box-shadow: var(--elev-3), inset 0 1px rgba(255, 255, 255, 0.08);
}

/* ---- 徽章 / chip --------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(232, 168, 92, 0.2);
  background: rgba(232, 168, 92, 0.08);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: 1.35;
  letter-spacing: 0.02em;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid rgba(232, 168, 92, 0.18);
  border-radius: var(--radius-pill);
  background: rgba(232, 168, 92, 0.07);
  color: var(--gold-bright);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold);
}
.tag {
  display: inline-flex;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-gold {
  color: #130d08;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
}
.tag-soft {
  color: var(--ink-soft);
  background: var(--surface-3);
}

/* ---- 截图占位 / 展示框 --------------------------------------------- */
.shot {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(232, 168, 92, 0.2);
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
  box-shadow: var(--elev-2);
}
.shot img {
  width: 100%;
  height: auto;
  display: block;
}
.shot figcaption {
  padding: 12px 16px;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.3);
}
.shot-placeholder {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  color: var(--ink-muted);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(232, 168, 92, 0.05) 0,
      rgba(232, 168, 92, 0.05) 12px,
      transparent 12px,
      transparent 24px
    ),
    rgba(0, 0, 0, 0.28);
}
.shot-placeholder::before {
  content: "待截图";
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: rgba(232, 168, 92, 0.55);
  letter-spacing: 0.1em;
}
.shot-placeholder .shot-id {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: rgba(232, 168, 92, 0.6);
  border: 1px solid rgba(232, 168, 92, 0.28);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.shot-placeholder .shot-desc {
  max-width: 80%;
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ---- 数据指标 metric ----------------------------------------------- */
.metric {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(232, 168, 92, 0.18);
  background: rgba(232, 168, 92, 0.07);
}
.metric strong {
  display: block;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}
.metric span {
  display: block;
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

/* ---- 要点列表 ------------------------------------------------------- */
.dot-list {
  display: grid;
  gap: 12px;
  color: var(--ink-soft);
  list-style: none;
}
.dot-list li {
  position: relative;
  padding-left: 20px;
}
.dot-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(232, 168, 92, 0.72);
}

/* ---- FAQ 手风琴 ----------------------------------------------------- */
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out);
}
.faq-item[open] {
  border-color: var(--line-strong);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--gold);
  transition: transform var(--dur-base) var(--ease-out);
  flex-shrink: 0;
  margin-left: auto;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item .faq-body {
  padding: 0 24px 22px;
  color: var(--ink-soft);
  font-size: var(--text-base);
  line-height: 1.75;
}

/* ---- 页脚 ----------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 40px;
  color: var(--ink-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}
.footer-brand p {
  margin-top: 16px;
  max-width: 280px;
  font-size: var(--text-sm);
  line-height: 1.7;
}
.footer-col h4 {
  color: var(--ink);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  padding: 6px 0;
  font-size: var(--text-base);
  color: var(--ink-muted);
  transition: color var(--dur-fast) ease;
}
.footer-col a:hover {
  color: var(--gold-bright);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--text-sm);
  flex-wrap: wrap;
}
.footer-bottom .footer-legal {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* ---- 回到顶部 ------------------------------------------------------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.to-top:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* ---- 响应式：顶栏与页脚 -------------------------------------------- */
@media (max-width: 1040px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .nav,
  .header-actions .btn-tutorial,
  .header-actions .version {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .section-head {
    margin-bottom: 32px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
