/* ==========================================================================
   MqtOS 官网 - 设计系统
   --------------------------------------------------------------------------
   设计方向：纯黑基底 / 通透渐变冷调电光蓝流体光带 / 同系渐变文字
             简约暗黑电竞科技配色
   性能原则：零外部资源引用（字体走系统栈、图标内联 SVG），动画仅用
             transform / opacity，支持 prefers-reduced-motion
   ========================================================================== */

/* ==========================================================================
   1. 设计令牌 (Design Tokens)
   ========================================================================== */
:root {
  /* 基底 */
  --bg-0: #000000;
  --bg-1: #05070d;
  --bg-2: #0a0f1c;
  --surface: rgba(13, 20, 38, 0.55);
  --surface-strong: rgba(15, 24, 46, 0.85);

  /* 电光蓝体系（冷调） */
  --cyan: #67e8f9;      /* 浅青 - 高光 */
  --e-blue: #38bdf8;    /* 电光青蓝 */
  --e-blue-2: #3b82f6;  /* 电光蓝 */
  --violet: #818cf8;    /* 蓝紫 - 少量点缀 */
  --glow: rgba(56, 189, 248, 0.6);

  /* 文字 */
  --txt-1: #f2f6ff;
  --txt-2: #9aa8c0;
  --txt-3: #64748b;

  /* 线条 */
  --line: rgba(120, 165, 255, 0.16);
  --line-2: rgba(120, 165, 255, 0.08);

  /* 渐变 */
  --grad-main: linear-gradient(100deg, #7dd3fc 0%, #38bdf8 32%, #3b82f6 66%, #818cf8 100%);
  --grad-cta: linear-gradient(120deg, #22d3ee 0%, #3b82f6 55%, #6366f1 100%);
  --grad-band: linear-gradient(90deg,
      transparent 0%,
      rgba(56, 189, 248, 0) 16%,
      rgba(56, 189, 248, 0.72) 36%,
      rgba(59, 130, 246, 0.5) 54%,
      rgba(129, 140, 248, 0.32) 68%,
      rgba(56, 189, 248, 0) 84%,
      transparent 100%);

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas,
               "Courier New", monospace;

  /* 布局 */
  --container: 1120px;
  --radius: 18px;
  --nav-h: 64px;
}

/* ==========================================================================
   2. 基础 / 重置
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--txt-1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }

::selection { background: rgba(56, 189, 248, 0.35); color: #fff; }

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

/* 无障碍：跳过导航 */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  padding: 10px 16px; background: var(--bg-2); color: #fff; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   3. 通用组件
   ========================================================================== */
.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(72px, 9vw, 120px) 0;
  scroll-margin-top: calc(var(--nav-h) + 8px);
}

.section-head {
  max-width: 640px;
  margin: 0 auto clamp(40px, 6vw, 64px);
  text-align: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px;
  background: var(--grad-main);
}

.section-title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-desc {
  margin-top: 14px;
  color: var(--txt-2);
  font-size: clamp(15px, 2vw, 17px);
}

.grad-text {
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px;
  border-radius: 999px;
  font-size: 16px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
              border-color 0.18s ease, background-color 0.18s ease;
}
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  color: #050810;
  background: linear-gradient(135deg, #22d3ee 0%, #38bdf8 45%, #3b82f6 100%);
  box-shadow: 0 8px 26px -10px rgba(56, 189, 248, 0.6);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px -12px rgba(56, 189, 248, 0.78);
}

.btn-ghost {
  color: var(--txt-1);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: rgba(103, 232, 249, 0.5);
  background: rgba(56, 189, 248, 0.09);
  transform: translateY(-2px);
}

.btn .btn-arrow { transition: transform 0.18s ease; }
.btn:hover .btn-arrow { transform: translateY(2px); }

.btn.is-disabled {
  opacity: 0.5;
  filter: saturate(0.4);
  cursor: not-allowed;
  box-shadow: none;
}

/* Toast 轻提示 */
.toast {
  position: fixed;
  left: 50%; bottom: 32px;
  transform: translateX(-50%) translateY(14px);
  z-index: 200;
  padding: 11px 22px;
  border-radius: 999px;
  background: rgba(10, 16, 30, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--txt-1);
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px -10px rgba(56, 189, 248, 0.4);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  visibility: visible;
}

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(56, 189, 248, 0.06);
  color: var(--cyan);
  font-size: 13px; font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2.4s ease-in-out infinite;
}

/* 滚动渐入 */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   4. 流体光带背景 (Fluid Light Bands)
   ========================================================================== */
/* 全页背景：固定于视口，光带随滚动持续可见，页面不再有区块切边 */
.fx-bg {
  position: fixed; inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* 光栅网格（仅首屏） */
.fx-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(120, 165, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 165, 255, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
}

/* 柔光球体 */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.7;
  animation: drift 18s ease-in-out infinite alternate;
  will-change: transform;
}
.orb-a {
  width: 540px; height: 540px;
  top: -160px; right: 4%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.6), transparent 66%);
}
.orb-b {
  width: 440px; height: 440px;
  top: 40%; left: -160px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.45), transparent 66%);
  animation-delay: -7s;
}
.orb-c {
  width: 360px; height: 360px;
  bottom: -120px; right: 22%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.42), transparent 66%);
  animation-delay: -12s;
}

/* 流体光带 */
.ribbon {
  position: absolute;
  left: -40%;
  width: 180%;
  height: 34vh;
  border-radius: 50%;
  background: var(--grad-band);
  filter: blur(34px);
  will-change: transform;
}
.ribbon-1 { top: -8%;  animation: flow 11s ease-in-out infinite; }
.ribbon-2 { top: 14%;  opacity: 0.95; animation: flow 15s ease-in-out infinite reverse; }
.ribbon-3 { top: 36%;  opacity: 0.75; animation: flow 9s ease-in-out infinite; }

/* 扫描高光 */
.scanline {
  position: absolute;
  left: 0; right: 0; height: 2px;
  top: 0;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.5), transparent);
  opacity: 0.6;
  animation: scan 7s linear infinite;
  will-change: transform;
}

@keyframes flow {
  0%   { transform: rotate(-7deg) translateX(-7%); }
  100% { transform: rotate(-7deg) translateX(7%); }
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(42px, 28px, 0) scale(1.14); }
}
@keyframes scan {
  0%   { transform: translateY(0); }
  100% { transform: translateY(88vh); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.8); }
}

/* 静态渐变带（下载等区块底衬，不参与动画，性能友好） */
.band-static {
  position: absolute; left: 50%; top: -12%;
  width: min(1200px, 140%); height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 50% at 50% 50%,
              rgba(56, 189, 248, 0.12), transparent 70%);
  pointer-events: none;
}

/* ==========================================================================
   5. 导航
   ========================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex; align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease,
              backdrop-filter 0.3s ease;
}
.nav-inner {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; /* 供居中胶囊导航定位 */
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 20px; letter-spacing: 0.01em;
}
.brand-logo {
  width: 30px; height: 30px;
  object-fit: contain;
  border-radius: 8px;
  flex: 0 0 auto;
}
.brand-name .grad-text { font-weight: 800; }

/* 导航：居中胶囊 */
.nav-links {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.045);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.nav-links a {
  display: block;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14.5px; font-weight: 500;
  color: var(--txt-2);
  white-space: nowrap;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.nav-links a:hover { color: var(--txt-1); background: rgba(56, 189, 248, 0.14); }

.nav-cta {
  height: 38px; padding: 0 18px; font-size: 14px;
}

/* 移动端汉堡 */
.nav-burger {
  display: none;
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-burger span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: var(--txt-1);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav.open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   6. Hero 首屏
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding-top: 8px;
}

.hero h1 {
  margin-top: 26px;
  font-size: clamp(40px, 7.5vw, 74px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.hero-sub {
  margin-top: 22px;
  max-width: 560px;
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--txt-2);
}

.hero-cta {
  margin-top: 38px;
  display: flex; flex-wrap: wrap; gap: 14px;
}

.hero-chips {
  margin-top: 34px;
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  align-items: center;
  color: var(--txt-3);
  font-size: 14px;
}
.hero-chips .chip {
  display: inline-flex; align-items: center; gap: 7px;
}
.hero-chips svg { width: 16px; height: 16px; color: var(--e-blue); }

/* ==========================================================================
   7. 特性卡片
   ========================================================================== */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feat-card {
  position: relative;
  padding: 30px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feat-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-main);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.feat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 18px 44px -18px rgba(56, 189, 248, 0.4);
}
.feat-card:hover::before { opacity: 1; }

.feat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  margin-bottom: 20px;
}
.feat-icon svg { width: 22px; height: 22px; }

.feat-card h3 { font-size: 18px; font-weight: 700; }
.feat-card p {
  margin-top: 9px;
  font-size: 14.5px;
  color: var(--txt-2);
}

/* ==========================================================================
   8. 界面预览
   ========================================================================== */
/* 界面预览：单图通栏，无边框、无浏览器框架，原比例完整呈现 */
.shot-clean {
  position: relative;
  max-width: 640px;
  margin-inline: auto;
}
.shot-clean::before {
  content: "";
  position: absolute;
  inset: -10% -6%;
  background: radial-gradient(ellipse 55% 50% at 50% 45%,
              rgba(56, 189, 248, 0.13), transparent 70%);
  pointer-events: none;
}
.shot-clean img {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 680 / 520;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.95);
}

/* ==========================================================================
   9. 下载
   ========================================================================== */
.dl-main {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 22, 42, 0.9), rgba(6, 9, 18, 0.9));
  padding: clamp(26px, 5vw, 44px);
  overflow: hidden;
}
.dl-main::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad-band);
  opacity: 0.14;
  pointer-events: none;
}

.dl-latest {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px;
  justify-content: space-between;
}

.dl-ver {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.dl-ver h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; }
.dl-ver .ver-tag {
  font-family: var(--font-mono);
  font-size: 15px; color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
  padding: 4px 12px; border-radius: 999px;
}
.dl-meta {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  color: var(--txt-3); font-size: 13.5px;
  margin-top: 8px;
}
.dl-meta span { display: inline-flex; align-items: center; gap: 6px; }
.dl-meta svg { width: 15px; height: 15px; color: var(--e-blue); }

.dl-btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* 复制链接小按钮 */
.icon-btn {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent; color: var(--txt-2);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.icon-btn:hover { color: var(--cyan); border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.08); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.copied { color: #4ade80; border-color: rgba(74, 222, 128, 0.5); }

.dl-hash {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--txt-3);
}
.dl-hash code {
  font-family: var(--font-mono);
  color: var(--txt-2);
  font-size: 12px;
  word-break: break-all;
}

/* 更新日志 */
.changelog {
  margin-top: 26px;
  max-height: 340px; overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(8, 13, 26, 0.4);
}
.changelog-list { margin: 0; padding: 8px 0; }
.cl-item {
  display: grid; grid-template-columns: 84px 1fr;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}
.cl-item:last-child { border-bottom: 0; }
.cl-ver {
  font-family: var(--font-mono); font-weight: 600; color: var(--cyan);
  font-size: 13px;
}
.cl-tag {
  display: inline-block; margin-right: 8px;
  padding: 1px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.cl-tag.fix { background: rgba(129, 140, 248, 0.16); color: #a5b4fc; }
.cl-tag.new { background: rgba(56, 189, 248, 0.14); color: #67e8f9; }
.cl-tag.opt { background: rgba(74, 222, 128, 0.14); color: #86efac; }
.cl-desc { color: var(--txt-2); }

/* ==========================================================================
   10. 页脚
   ========================================================================== */
.footer {
  border-top: 1px solid var(--line-2);
  padding: 44px 0 56px;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 20px;
  justify-content: space-between; align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.footer-meta { color: var(--txt-3); font-size: 13px; max-width: 480px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--txt-2); font-size: 14px; transition: color 0.18s ease; }
.footer-links a:hover { color: var(--cyan); }

/* ==========================================================================
   11. 响应式
   ========================================================================== */
@media (max-width: 960px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    transform: translateY(-12px);
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 14px 20px 20px;
    border-radius: 0 0 18px 18px;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    background: rgba(2, 4, 10, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  }
  .nav.open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links a { padding: 13px 16px; font-size: 16px; text-align: center; }
  .nav-cta { display: none; }
  .nav-burger { display: inline-flex; }
}

@media (max-width: 640px) {
  .feat-grid { grid-template-columns: 1fr; }
  .cl-item { grid-template-columns: 1fr; gap: 4px; }
  .dl-btn-group { width: 100%; }
  .dl-btn-group .btn { flex: 1; min-width: 0; }
}

/* ==========================================================================
   12. 减少动效 (Reduced Motion)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  /* 光带/光球保留可见（只是冻结动画），避免系统减少动效时首屏变纯黑 */
}
