/* 智慧監控系統 — 使用說明書樣式 (深色主題，沿用主系統視覺) */
:root {
  --bg: #0c131d;
  --bg-2: #0f1722;
  --card: #18222f;
  --card-2: #1d2937;
  --border: #2a3a4d;
  --text: #e6edf5;
  --muted: #93a4b8;
  --accent: #22d3ee;
  --accent-2: #38bdf8;
  --gold: #f4b400;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --radius: 14px;
  --maxw: 920px;
  --nav-w: 268px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #15314033, transparent),
              var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

/* ---------- Inline icons (replace emoji everywhere except mode names) ---------- */
.ic {
  width: 1.05em; height: 1.05em;
  vertical-align: -0.16em;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.ic-fill { fill: currentColor; stroke: none; }
h2 > .ic, h3 > .ic { stroke-width: 1.8; }

/* ---------- Layout ---------- */
.layout { display: flex; align-items: flex-start; }

/* TOC sidebar */
.toc {
  position: sticky;
  top: 0;
  width: var(--nav-w);
  height: 100vh;
  flex: 0 0 var(--nav-w);
  overflow-y: auto;
  padding: 26px 18px;
  background: linear-gradient(180deg, var(--bg-2), #0b1119);
  border-right: 1px solid var(--border);
}
.toc .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.toc .brand .logo { font-size: 26px; }
.toc .brand .name { font-weight: 800; font-size: 17px; letter-spacing: .3px; }
.toc .ver { font-size: 12px; color: var(--muted); margin: -10px 0 18px 36px; }
.toc nav a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 14.5px;
  border-left: 2px solid transparent;
  transition: all .15s ease;
}
.toc nav a:hover { color: var(--text); background: #ffffff0a; }
.toc nav a.active { color: var(--accent); background: #22d3ee14; border-left-color: var(--accent); }
.toc nav a.sub { margin-left: 14px; font-size: 13.5px; padding-top: 5px; padding-bottom: 5px; }

/* main content */
main { flex: 1 1 auto; min-width: 0; padding: 0 28px 120px; }
.content { max-width: var(--maxw); margin: 0 auto; }

/* ---------- Cover ---------- */
.cover {
  text-align: center;
  padding: 76px 20px 54px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}
.cover h1 { font-size: 38px; margin: 0 0 10px; letter-spacing: .5px; }
.cover .tagline { color: var(--muted); font-size: 17px; margin: 0 auto 24px; max-width: 620px; }
.cover .meta { display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cover .chip {
  background: var(--card); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px; color: var(--muted);
}
.cover .chip a { color: var(--accent); text-decoration: none; }
.cover .chip b { color: var(--text); }

/* ---------- Sections ---------- */
section { padding-top: 28px; margin-top: 14px; scroll-margin-top: 16px; }
section > h2 {
  font-size: 26px; margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
section > h2 .num {
  font-size: 14px; color: #06121b; background: var(--accent);
  border-radius: 8px; padding: 2px 9px; font-weight: 800;
}
section > .lead { color: var(--muted); margin: 2px 0 18px; }
h3 { font-size: 18.5px; margin: 26px 0 10px; color: var(--accent-2); }
p { margin: 10px 0; }
a { color: var(--accent); }

/* steps */
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 14px 0; }
ol.steps > li {
  position: relative; padding: 10px 12px 10px 46px; margin: 8px 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
}
ol.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #06121b; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
ul.bullets { padding-left: 20px; }
ul.bullets li { margin: 6px 0; }

/* feature grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.grid .item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.grid .item .t { font-weight: 700; margin-bottom: 4px; }
.grid .item .d { color: var(--muted); font-size: 14px; }

/* callouts */
.callout { border-radius: 12px; padding: 12px 16px; margin: 14px 0; border: 1px solid; font-size: 14.5px; }
.callout.tip  { background: #22d3ee10; border-color: #22d3ee44; }
.callout.warn { background: #f59e0b14; border-color: #f59e0b55; }
.callout .h { font-weight: 800; margin-right: 6px; }

/* figures / screenshots */
figure.shot { margin: 18px 0 24px; }
figure.shot img {
  width: 100%; display: block; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: 0 12px 40px #0008;
  cursor: zoom-in; background: var(--card-2);
}
figure.shot figcaption { color: var(--muted); font-size: 13.5px; margin-top: 8px; text-align: center; }
/* graceful placeholder when a screenshot file is missing */
.shot .ph {
  aspect-ratio: 16 / 10; width: 100%; border-radius: var(--radius);
  border: 2px dashed var(--border); background:
    repeating-linear-gradient(45deg, #ffffff05, #ffffff05 12px, transparent 12px, transparent 24px), var(--card-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); text-align: center; padding: 24px; gap: 8px;
}
.shot .ph .ico { font-size: 40px; opacity: .6; }
.shot .ph .fn { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 13px; color: var(--accent); }

/* tables */
table.kv { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14.5px; }
table.kv th, table.kv td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.kv th { color: var(--accent-2); width: 30%; }

hr.div { border: none; border-top: 1px solid var(--border); margin: 36px 0 0; }

footer.docfoot { color: var(--muted); font-size: 13px; text-align: center; padding: 40px 0 0; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; background: #000d; display: none;
  align-items: center; justify-content: center; z-index: 99; padding: 30px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 94vh; border-radius: 10px; box-shadow: 0 20px 60px #000; }

/* ---------- Responsive ---------- */
.toc .menu-toggle { display: none; }
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .toc {
    position: sticky; top: 0; width: 100%; height: auto; flex-basis: auto;
    border-right: none; border-bottom: 1px solid var(--border); z-index: 30;
    padding: 12px 16px;
  }
  .toc nav { display: none; }
  .toc.open nav { display: block; max-height: 60vh; overflow-y: auto; margin-top: 8px; }
  .toc .ver { display: none; }
  .toc .menu-toggle {
    display: inline-block; margin-left: auto; background: var(--card);
    border: 1px solid var(--border); color: var(--text); border-radius: 8px;
    padding: 5px 12px; cursor: pointer;
  }
  .toc .brand { margin-bottom: 0; }
  main { padding: 0 16px 80px; }
  .cover h1 { font-size: 28px; }
}

/* print */
@media print {
  .toc, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  figure.shot img { box-shadow: none; }
}
