/* ============================================================
   Markdown Editor 官网样式
   深色代码风 · 蓝紫渐变 · 玻璃拟态 · 无外部依赖
   ============================================================ */

:root {
  --bg: #0a0d14;
  --bg-soft: #0e1220;
  --panel: rgba(20, 26, 45, 0.62);
  --panel-border: rgba(139, 148, 190, 0.16);
  --text: #e7eaf4;
  --text-dim: #9aa3c0;
  --text-faint: #6b7395;
  --indigo: #6366f1;
  --violet: #a855f7;
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(120deg, #6366f1 0%, #a855f7 50%, #22d3ee 100%);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "JetBrains Mono",
    "Courier New", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(99, 102, 241, 0.4);
}

/* ---------- 背景层：网格 + 光晕 + 粒子 ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
.bg-glow::before,
.bg-glow::after {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.34;
}
.bg-glow::before {
  top: -220px;
  left: -120px;
  background: radial-gradient(circle, #6366f1 0%, transparent 65%);
}
.bg-glow::after {
  top: 10%;
  right: -260px;
  background: radial-gradient(circle, #a855f7 0%, transparent 62%);
}

#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ---------- 布局容器 ---------- */
.wrap {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 13, 20, 0.72);
  border-bottom: 1px solid var(--panel-border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.55);
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  background: rgba(139, 148, 190, 0.1);
}
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 版本徽章 */
.badge-version {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.28);
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-version .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 40px;
  text-align: center;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 26px;
}
.hero-tag b {
  color: var(--cyan);
  font-family: var(--mono);
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -1.5px;
  margin-bottom: 22px;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 620px;
  margin: 0 auto 34px;
  font-size: 17px;
  color: var(--text-dim);
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 30px rgba(124, 87, 245, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 42px rgba(124, 87, 245, 0.55);
}
.btn-ghost {
  background: var(--panel);
  border-color: var(--panel-border);
  color: var(--text);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 148, 190, 0.4);
  background: rgba(139, 148, 190, 0.1);
}
.btn .meta {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.75;
  font-family: var(--mono);
}
.btn-arrow {
  transition: transform 0.2s;
}
.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.hero-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- 编辑器 Mockup（纯 CSS 绘制） ---------- */
.mockup {
  position: relative;
  margin: 72px auto 0;
  max-width: 920px;
  perspective: 1400px;
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotateX(0deg); }
  50% { transform: translateY(-10px) rotateX(0.6deg); }
}
.mockup-win {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: #0d1220;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(99, 102, 241, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: left;
}
.mockup-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--panel-border);
}
.dots { display: flex; gap: 7px; }
.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}
.dots i:nth-child(1) { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.mockup-tabs {
  display: flex;
  gap: 6px;
  margin-left: 10px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-dim);
}
.mockup-tabs .tab {
  padding: 3px 12px;
  border-radius: 6px 6px 0 0;
  background: rgba(139, 148, 190, 0.08);
}
.mockup-tabs .tab.active {
  color: var(--text);
  background: rgba(99, 102, 241, 0.18);
}
.mockup-body {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  min-height: 320px;
}
@media (max-width: 720px) {
  .mockup-body { grid-template-columns: 1fr; }
  .mockup-preview { display: none; }
}
.mockup-editor {
  padding: 18px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.9;
  overflow: hidden;
  border-right: 1px solid var(--panel-border);
}
.m-line { display: flex; }
.m-num {
  width: 30px;
  flex-shrink: 0;
  color: #3d4566;
  text-align: right;
  padding-right: 14px;
  user-select: none;
}
.m-c { color: #9aa3c0; }
.t-h1 { color: #f472b6; }
.t-h2 { color: #fb923c; }
.t-md { color: #c4b5fd; }
.t-b { color: #38bdf8; font-weight: 700; }
.t-g { color: #34d399; }
.t-y { color: #fbbf24; }
.t-r { color: #f87171; }
.t-dim { color: #6b7395; }
.m-caret {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--cyan);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.mockup-preview {
  padding: 20px 18px;
  background: #0b0f1b;
  font-size: 12.5px;
  overflow: hidden;
}
.pv-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.pv-sub {
  color: var(--text-dim);
  font-size: 11.5px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 10px;
}
.pv-p { color: var(--text-dim); margin-bottom: 10px; }
.pv-p b { color: var(--text); }
.pv-list { margin: 0 0 12px 18px; color: var(--text-dim); }
.pv-code {
  background: #131a2e;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: #c4b5fd;
}
.pv-code .k { color: #f472b6; }
.pv-code .f { color: #38bdf8; }
.pv-code .s { color: #34d399; }
.mockup-glow {
  position: absolute;
  inset: -14px;
  z-index: -1;
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.28), rgba(168, 85, 247, 0.22), rgba(34, 211, 238, 0.2));
  filter: blur(60px);
  border-radius: 24px;
}

/* ---------- 区块通用 ---------- */
.section {
  padding: 96px 0;
}
.sec-head {
  text-align: center;
  margin-bottom: 54px;
}
.sec-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 12px;
}
.sec-title {
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 14px;
}
.sec-desc {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 15.5px;
}

/* ---------- 特性卡片 ---------- */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .feat-grid { grid-template-columns: 1fr; }
}
.feat {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.feat:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.2);
}
.feat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.25s;
}
.feat:hover::before { opacity: 1; }
.feat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.14);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--violet);
}
.feat h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feat p {
  font-size: 13.5px;
  color: var(--text-dim);
}

/* ---------- 下载区 ---------- */
.dl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .dl-grid { grid-template-columns: 1fr; }
}
.dl-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px 26px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s, border-color 0.25s;
}
.dl-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.45);
}
.dl-card .os {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
}
.dl-card .os svg { color: var(--cyan); }
.dl-meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  background: rgba(139, 148, 190, 0.07);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 14px;
  word-break: break-all;
  line-height: 2;
}
.dl-meta b { color: var(--text); font-weight: 600; }
.dl-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.dl-note {
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 22px;
}

/* ---------- 版本 / 更新信息 ---------- */
.release {
  max-width: 720px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px 30px 26px;
}
.release-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 18px;
}
.release-ver {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.release-date {
  font-size: 13px;
  color: var(--text-faint);
  font-family: var(--mono);
}
.release ul {
  list-style: none;
}
.release ul li {
  padding: 9px 0 9px 28px;
  position: relative;
  color: var(--text-dim);
  font-size: 14px;
  border-bottom: 1px dashed rgba(139, 148, 190, 0.1);
}
.release ul li:last-child { border-bottom: none; }
.release ul li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--grad);
  transform: rotate(45deg);
}
.release ul li b { color: var(--text); }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--panel-border);
  padding: 40px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-faint);
}
.footer .brand { font-size: 14px; }
.footer a {
  color: var(--text-dim);
  text-decoration: none;
}
.footer a:hover { color: var(--cyan); }

/* ---------- 滚动渐显（渐进增强：默认可见，仅 JS 就绪后才隐藏做动画） ---------- */
/* 默认不加 .in 也可见 —— 即使外部脚本被预览沙箱拦截，内容也不会空白 */
.reveal {
  opacity: 1;
}
/* 仅当 <html> 带 js 类（由内联脚本注入）时才隐藏并准备动画，避免无脚本时永久空白 */
html.js .reveal:not(.in) {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
.reveal.d5 { transition-delay: 0.4s; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(139, 148, 190, 0.25);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(139, 148, 190, 0.4); }
::-webkit-scrollbar-track { background: transparent; }
