/* VTY 响应式 Demo 模拟器外壳（demo.html / index.html 共用） */
:root {
  --bg: #0b0d12;
  --panel: #141821;
  --line: #2a3140;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --accent: #f37f13;
  --bar-h: 52px;
  --sub-h: 44px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.top {
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #0f131a;
}
.brand { font-weight: 800; font-size: 14px; white-space: nowrap; }
.brand small { display: block; font-weight: 400; font-size: 10px; color: var(--muted); }
.top-links { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-links a {
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.top-links a:hover { border-color: var(--accent); color: var(--accent); }
.top-links a.cta {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}
.top-links a.cta:hover { filter: brightness(1.05); }
.sub { height: auto; min-height: var(--sub-h); padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sub2, .sub4 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--line);
  background: #12161e;
}
.sub4 { background: #10141c; }
.tri-toggle.on { border-color: #ec4899 !important; color: #f9a8d4 !important; background: #2a1020 !important; }
.sub label { font-size: 11px; color: var(--muted); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line);
  background: #1a1f2a;
  color: #ccc;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.seg button.on { border-color: var(--accent); color: var(--accent); background: #2a1c0c; font-weight: 700; }
.seg.sec button { font-size: 11px; padding: 4px 8px; }
.wlabel {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 72px;
}
.open-tab {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.sub3 {
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  background: #0e1218;
  max-height: 32vh;
  overflow: auto;
}
.sub3 details { font-size: 11px; color: #bbb; }
.sub3 summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
  padding: 6px 0;
  list-style: none;
  user-select: none;
}
.sub3 summary::-webkit-details-marker { display: none; }
.sub3 summary::before { content: "▸ "; }
.sub3 details[open] summary::before { content: "▾ "; }
.bp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.bp-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #141821;
}
.bp-card h4 { font-size: 11px; color: var(--accent); margin-bottom: 6px; }
.bp-card table { width: 100%; border-collapse: collapse; font-size: 10px; }
.bp-card th, .bp-card td { border-bottom: 1px solid #222; padding: 3px 4px; text-align: left; }
.bp-card th { color: var(--muted); font-weight: 600; }
.bp-card code { color: #fbbf24; font-size: 10px; }
.bp-active {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1a1508;
  border: 1px solid #553a12;
  font-size: 11px;
  line-height: 1.5;
}
.bp-active b { color: var(--accent); }
.bp-link { font-size: 11px; color: var(--accent); margin-left: 8px; }
.stage {
  height: calc(100vh - 280px);
  min-height: 200px;
  background: #05070c;
  position: relative;
}
body.demo-compact .stage { height: calc(100vh - 240px); }
body.demo-expanded .stage { height: calc(100vh - 360px); }
@media (max-height: 700px) {
  .stage { height: calc(100vh - 220px); min-height: 160px; }
  .sub3 { max-height: 24vh; }
}
.frame-wrap {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, #0a0c12 0, #0a0c12 12px, transparent 12px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,.03) 39px, rgba(255,255,255,.03) 40px);
  overflow: auto;
  padding: 12px;
}
.frame-wrap.frame-fluid {
  justify-content: stretch;
  align-items: stretch;
}
.device.device-fluid {
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  align-self: stretch;
}
.device {
  height: calc(100% - 8px);
  max-height: 100%;
  background: #000;
  border: 2px solid #3a4254;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  overflow: hidden;
  transition: width .15s ease;
  flex: 0 0 auto;
}
.device iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #121212;
}
.ruler {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  background: rgba(0,0,0,.82);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: #ccc;
  line-height: 1.5;
  pointer-events: none;
}
.ruler b { color: var(--accent); }
