/* DeviceFree 官网 / 在线文档 · 零依赖静态站 */
:root {
  --brand: #2b7fff;
  --brand-2: #17c0eb;
  --brand-dark: #1b5fd8;
  --ink: #1f2d3d;
  --text: #4b5b70;
  --muted: #8497ad;
  --line: #e6ecf5;
  --bg: #ffffff;
  --bg-soft: #f7fafe;
  --radius: 12px;
  --nav-h: 62px;
  --sidebar-w: 320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.nav-brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-brand b { font-size: 18px; color: var(--ink); letter-spacing: .5px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  display: inline-block; padding: 7px 13px; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.nav-links a:hover { color: var(--brand); background: #eef5ff; }
.nav-links a.active { color: var(--brand); background: #eef5ff; font-weight: 600; }
.nav-search {
  display: flex; align-items: center; gap: 7px;
  width: 190px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--bg-soft);
}
.nav-search input {
  width: 100%; border: 0; outline: 0; background: transparent;
  font-size: 13px; color: var(--ink);
}
.nav-search svg { flex: 0 0 14px; width: 14px; height: 14px; color: var(--muted); }
.nav-toggle { display: none; border: 0; background: transparent; font-size: 22px; color: var(--ink); cursor: pointer; }

/* ---------- 首页 Hero ---------- */
.hero {
  text-align: center;
  padding: 86px 24px 62px;
  background: linear-gradient(180deg, #fff 0%, #f7fafe 100%);
  border-bottom: 1px solid var(--line);
}
.hero-logo { width: 106px; height: 106px; border-radius: 24px; box-shadow: 0 14px 34px rgba(43,127,255,.24); }
.hero h1 { margin: 26px 0 0; font-size: 48px; font-weight: 700; color: var(--ink); letter-spacing: 2px; }
.hero .tagline { margin: 16px auto 0; max-width: 700px; font-size: 18px; color: #5c6b81; line-height: 1.9; }
.hero .tagline b { color: var(--brand); }
.hero-actions { margin-top: 32px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 26px; border-radius: 9px;
  font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff; background: linear-gradient(92deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 22px rgba(43,127,255,.3); }
.btn-primary:hover { color: #fff; box-shadow: 0 12px 30px rgba(43,127,255,.42); }
.btn-ghost { color: var(--brand); background: #fff; border-color: #bcd6f5; }
.btn-ghost:hover { color: var(--brand-dark); border-color: var(--brand); }
.hero-meta { margin-top: 22px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.hero-meta span { padding: 5px 13px; border-radius: 20px; font-size: 12.5px; color: #3f7fd6; background: #fff; border: 1px solid #dbe6f5; }

/* ---------- 通用区块 ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 66px 24px; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-tag { font-size: 12px; letter-spacing: 4px; color: var(--brand); font-weight: 600; }
.section-head h2 { margin: 10px 0 0; font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.section-head p { margin: 12px auto 0; max-width: 660px; font-size: 14.5px; color: var(--muted); }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  padding: 26px 24px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(43,127,255,.06);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-5px); border-color: rgba(43,127,255,.45); box-shadow: 0 16px 36px rgba(43,127,255,.16); }
.card-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); background: #eef5ff; border: 1px solid #d6e7ff;
  font-size: 22px; font-weight: 700;
}
.card h3 { margin: 18px 0 8px; font-size: 17px; color: var(--ink); font-weight: 600; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.85; }

/* ---------- 系统一览 ---------- */
.showcase { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.shot {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(43,127,255,.06);
}
.shot img { display: block; width: 100%; height: auto; }
.shot .cap { padding: 11px 14px; font-size: 13px; color: var(--text); border-top: 1px solid var(--line); }

/* ---------- 页脚 ---------- */
.footer {
  padding: 14px 24px; text-align: center; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer .links { margin-bottom: 10px; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.footer b { color: var(--ink); }

/* ---------- 文档页 ---------- */
.doc-layout { display: flex; align-items: flex-start; min-height: calc(100vh - var(--nav-h)); }
.sidebar {
  position: sticky; top: var(--nav-h);
  flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h)); overflow-y: auto;
  padding: 26px 16px 40px 24px;
  border-right: 1px solid var(--line); background: #fff;
}
.sidebar .group { margin-bottom: 22px; }
.sidebar .group-title { padding: 0 10px 8px; font-size: 12.5px; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
.sidebar a {
  display: block; padding: 6px 12px; margin: 2px 0; border-radius: 7px;
  font-size: 13.8px; color: var(--text); border-left: 3px solid transparent;
}
.sidebar a:hover { background: #eef5ff; color: var(--brand); }
.sidebar a.active { color: var(--brand); background: #eef5ff; border-left-color: var(--brand); font-weight: 600; }
.sidebar a.hit { outline: 1px solid rgba(43,127,255,.35); }

.doc-main { flex: 1 1 auto; min-width: 0; max-width: 920px; margin: 0 auto; padding: 38px 48px 90px; }
.doc-content h1 { margin: 0 0 8px; font-size: 32px; color: var(--ink); letter-spacing: .5px; }
.doc-content .lead { margin: 0 0 30px; font-size: 15px; color: var(--muted); }
.doc-content h2 {
  margin: 40px 0 16px; padding-bottom: 10px; font-size: 22px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.doc-content h3 { margin: 28px 0 12px; font-size: 17px; color: var(--ink); }
.doc-content p { margin: 12px 0; }
.doc-content ul, .doc-content ol { padding-left: 22px; }
.doc-content li { margin: 6px 0; }
.doc-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.doc-content th, .doc-content td { padding: 10px 13px; border: 1px solid var(--line); text-align: left; }
.doc-content th { background: var(--bg-soft); color: var(--ink); font-weight: 600; }
.doc-content code {
  padding: 2px 6px; border-radius: 4px; background: #eef5ff; color: var(--brand-dark);
  font-size: 13px; font-family: Consolas, Monaco, monospace;
  overflow-wrap: anywhere; word-break: break-word;
}
.doc-content pre {
  margin: 16px 0; padding: 16px 18px; border-radius: 9px; overflow-x: auto;
  background: #1e2a3a; color: #dce7f5; font-size: 13px; line-height: 1.7;
}
.doc-content pre code { padding: 0; background: transparent; color: inherit; }
.doc-content blockquote {
  margin: 18px 0; padding: 13px 18px; border-left: 4px solid var(--brand);
  background: #f2f8ff; border-radius: 0 8px 8px 0; color: #3d5675;
}
.doc-content blockquote p { margin: 0; }
.doc-content img.shot { margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(43,127,255,.1); }
.doc-content hr { margin: 34px 0; border: 0; border-top: 1px solid var(--line); }
.doc-content .tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px;
  background: #eef5ff; color: var(--brand); margin-right: 6px;
}
.doc-pager { margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.doc-pager a { font-size: 14px; }
.doc-pager .disabled { color: #c3cfdd; }

/* 搜索结果浮层 */
.search-pop {
  position: absolute; top: calc(var(--nav-h) - 6px); right: 28px; z-index: 80;
  width: 340px; max-height: 380px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(31,45,61,.16); padding: 8px; display: none;
}
.search-pop.show { display: block; }
.search-pop a { display: block; padding: 9px 11px; border-radius: 7px; font-size: 13.5px; color: var(--text); }
.search-pop a:hover { background: #eef5ff; color: var(--brand); }
.search-pop .empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.search-pop b { color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 26px rgba(31,45,61,.1);
  }
  .nav-toggle { display: block; margin-left: 0; }
  .nav-search { display: flex; width: 150px; margin-left: auto; }
  .search-pop {
    position: fixed; top: var(--nav-h); left: 12px; right: 12px;
    width: auto; max-height: 60vh;
  }
  .card-grid, .shot-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar {
    position: fixed; top: var(--nav-h); left: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .25s;
    box-shadow: 8px 0 24px rgba(31,45,61,.12);
  }
  .sidebar.open { transform: translateX(0); }
  .doc-main { padding: 28px 22px 70px; }
}
@media (max-width: 640px) {
  .hero { padding: 58px 20px 44px; }
  .hero h1 { font-size: 34px; }
  .hero .tagline { font-size: 15.5px; }
  .card-grid, .shot-grid { grid-template-columns: 1fr; }
  .section { padding: 46px 20px; }
  .section-head h2 { font-size: 24px; }
  .doc-main { padding: 22px 16px 60px; }
  .doc-content h1 { font-size: 26px; }
}
