/* 司空看板
 *
 * 设计取向：墨底 + 青瓷 + 朱砂，标题用宋体。
 * 「司空」是古代掌土木水利的六卿之一——界面上留一点那个来处，
 * 但骨架是现代基础设施面板该有的样子：留白足、线条细、数据用等宽对齐。
 *
 * 三个序列色都跑过色盲/对比度校验（全对校验，浅深两套各自成立）：
 *   青瓷 #0aa583 / #25ac8e   朱砂 #c9472f / #dd5c43   靛 #4a5bc4 / #7f8cd8
 * 琥珀在色盲模拟下与朱砂 ΔE 只有 3.2，所以它只当状态色（永远配图标和文字），
 * 绝不拿去当第四条曲线。
 */

:root {
  color-scheme: light;

  --surface-0: #f4f2ed;      /* 页面底 */
  --surface-1: #ffffff;      /* 卡片 / 图表面 */
  --surface-2: #faf9f6;      /* 次级块 */
  --hairline:  rgba(26, 26, 24, 0.10);
  --hairline-strong: rgba(26, 26, 24, 0.18);

  --text-primary:   #1a1a18;
  --text-secondary: #57554e;
  --text-muted:     #8a887f;

  --series-1: #0aa583;       /* 青瓷 */
  --series-2: #c9472f;       /* 朱砂 */
  --series-3: #4a5bc4;       /* 靛 */

  --good:     #0aa583;
  --warning:  #a8791b;       /* 只做状态，永不当序列色 */
  --critical: #c9472f;

  --grid: rgba(26, 26, 24, 0.08);
  --shadow: 0 1px 2px rgba(26, 26, 24, 0.05), 0 8px 24px rgba(26, 26, 24, 0.04);

  --font-serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC",
                "Noto Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --radius: 10px;
  --gutter: 20px;
}

/* 深色是这个面板的主场——机房面板本来就该在暗处看。
 * 但深色不是把浅色反过来：序列色是按深色表面单独选并单独校验过的。 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --surface-0: #0e0f10;
    --surface-1: #17181a;
    --surface-2: #1d1f21;
    --hairline:  rgba(236, 234, 228, 0.09);
    --hairline-strong: rgba(236, 234, 228, 0.16);

    --text-primary:   #eceae4;
    --text-secondary: #a8a69e;
    --text-muted:     #75736c;

    --series-1: #25ac8e;
    --series-2: #dd5c43;
    --series-3: #7f8cd8;

    --good:     #25ac8e;
    --warning:  #c98f2a;
    --critical: #dd5c43;

    --grid: rgba(236, 234, 228, 0.07);
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --surface-0: #0e0f10;
  --surface-1: #17181a;
  --surface-2: #1d1f21;
  --hairline:  rgba(236, 234, 228, 0.09);
  --hairline-strong: rgba(236, 234, 228, 0.16);

  --text-primary:   #eceae4;
  --text-secondary: #a8a69e;
  --text-muted:     #75736c;

  --series-1: #25ac8e;
  --series-2: #dd5c43;
  --series-3: #7f8cd8;

  --good:     #25ac8e;
  --warning:  #c98f2a;
  --critical: #dd5c43;

  --grid: rgba(236, 234, 228, 0.07);
  --shadow: none;
}

* { box-sizing: border-box; }

/* 必须压过 .gate 那条 display:grid：类选择器的优先级高于 UA 给 [hidden] 的
 * display:none，不写这一条，已登录时登录卡片还会占着整屏版面。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* 数字一律等宽对齐——面板上的数一直在跳，不对齐会看得人眼晕 */
.num, .metric-value, td.num, .stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ---------------------------------------------------------------------------
   顶栏
   --------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 var(--gutter);
  height: 60px;
  background: color-mix(in srgb, var(--surface-0) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.wordmark .glyph {
  font-family: var(--font-serif);
  font-size: 25px;
  letter-spacing: 0.16em;
  font-weight: 500;
  color: var(--text-primary);
}

/* 朱砂小印。整个界面里唯一一处纯装饰，就这一枚。 */
.wordmark .seal {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--series-2);
  transform: translateY(-4px);
  flex-shrink: 0;
}

.wordmark .sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }

.nav button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13.5px;
  white-space: nowrap;
  transition: color .15s;
}
.nav button:hover { color: var(--text-primary); }
.nav button.active {
  color: var(--text-primary);
  border-bottom-color: var(--series-1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.icon-btn {
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--hairline-strong); color: var(--text-primary); }

/* 采集心跳。呼吸一次 = 面板刚拉过一次数据。 */
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
  animation: breathe 2.4s ease-in-out infinite;
}
.pulse.stale { background: var(--text-muted); animation: none; }
@keyframes breathe {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; opacity: .9; }
}

/* ---------------------------------------------------------------------------
   版心
   --------------------------------------------------------------------------- */

.page { max-width: 1320px; margin: 0 auto; padding: 26px var(--gutter) 80px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 14px;
}
.section-head:first-child { margin-top: 4px; }

h2.section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin: 0;
  color: var(--text-primary);
}

.section-note { font-size: 12.5px; color: var(--text-muted); }

.card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------------------
   KPI 行。单个当下数值配一条趋势——这是统计块的活，不是柱状图的活。
   --------------------------------------------------------------------------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px 16px 15px;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 27px;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.stat-value .unit {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 3px;
  letter-spacing: 0;
}

.stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.stat-sub .bad { color: var(--critical); }

/* ---------------------------------------------------------------------------
   设备网格
   --------------------------------------------------------------------------- */

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.device-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 15px 16px 16px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  text-align: left;
  width: 100%;
  display: block;
  font: inherit;
}
.device-card:hover { border-color: var(--hairline-strong); transform: translateY(-1px); }
.device-card:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.device-card.offline { opacity: .62; }

.device-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 3px;
}

.device-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 状态永远是「点 + 文字」，不靠颜色单独承担意思 */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: auto;
}
.status .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status.on  .dot { background: var(--good); }
.status.off .dot { background: var(--critical); }
.status.man .dot { background: transparent; border: 1.5px solid var(--text-muted); }
.status.off { color: var(--critical); }

.device-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meters { display: grid; gap: 7px; margin-bottom: 11px; }

.meter-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.meter {
  height: 4px;
  border-radius: 2px;
  background: var(--grid);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--series-1);
  transition: width .5s ease;
}
.meter > i.warn { background: var(--warning); }
.meter > i.crit { background: var(--critical); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }

.chip {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 1px 7px;
}

/* ---------------------------------------------------------------------------
   图表
   --------------------------------------------------------------------------- */

/* 宽一点、两列排——时序图挤到三列，横轴上一小时就只剩几十像素，
 * 尖峰全糊在一起，看不出什么时候发生的。 */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
  gap: 12px;
}

.chart-card { padding: 15px 16px 10px; }

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.chart-title { font-size: 13px; color: var(--text-secondary); letter-spacing: 0.04em; }

.chart-current {
  font-size: 20px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.chart-current .unit { font-size: 12px; color: var(--text-muted); margin-left: 2px; }

.legend {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 2px 0 4px;
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 2px; border-radius: 1px; flex-shrink: 0; }

.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis-label { fill: var(--text-muted); font-size: 10px; font-family: var(--font-sans); }
.chart-svg .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .crosshair { stroke: var(--hairline-strong); stroke-width: 1; stroke-dasharray: 3 3; }
/* 交点上那圈是表面色，不是白色——浅深两套都要贴住各自的底 */
.chart-svg .focus-dot { stroke: var(--surface-1); stroke-width: 2; }

.chart-empty {
  height: 120px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

.tooltip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  background: var(--surface-1);
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .1s;
}
.tooltip.on { opacity: 1; }
.tooltip .t-time { color: var(--text-muted); font-size: 11px; margin-bottom: 3px; }
.tooltip .t-row { display: flex; align-items: center; gap: 6px; }
.tooltip .t-row i { width: 8px; height: 2px; border-radius: 1px; }
.tooltip .t-val { font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 12px; }

/* ---------------------------------------------------------------------------
   筛选条与色块墙
   --------------------------------------------------------------------------- */

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

input.search {
  flex: 1;
  min-width: 220px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  padding: 8px 13px;
}

/* 分段控件：比下拉菜单少一次点击，选项少的时候值得占这点地方 */
.seg {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px 13px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover { color: var(--text-primary); }
.seg button.active { background: var(--surface-1); color: var(--text-primary); }

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.check input { accent-color: var(--series-1); }

.result-line {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 12px 2px;
}
.result-line b { color: var(--text-primary); font-weight: 500; }

mark {
  background: color-mix(in srgb, var(--series-1) 26%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* 一台机器一张卡，回答「这台上面跑着什么」 */
.svc-card { padding: 14px 16px 16px; margin-bottom: 12px; }

.svc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}

.svc-name {
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.svc-name:hover { border-bottom-color: var(--series-1); }

.svc-head .status { margin-left: 0; }
.svc-counts { margin-left: auto; font-size: 12px; color: var(--text-muted); }

.svc-sub {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin: 13px 0 7px;
}
.svc-sub b { color: var(--text-primary); font-weight: 500; }
.svc-sub .hint { font-size: 11px; opacity: .75; letter-spacing: 0; }

.disclose {
  background: none;
  border: none;
  padding: 0;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  cursor: pointer;
}
.disclose:hover { color: var(--text-primary); }

.chip-wall { display: flex; flex-wrap: wrap; gap: 5px; }

/* 端口做成能一眼扫完的色块。密度是重点：51 个端口摊成表格要滚半天，
   摊成色块墙一屏就看完了。 */
.chip-port, .chip-ctr, .chip-unit {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
  cursor: default;
}

.chip-port b { color: var(--text-primary); font-weight: 500; font-size: 12.5px; }
.chip-port .proto { color: var(--text-muted); font-size: 10.5px; }
.chip-port .pname { color: var(--text-secondary); font-family: var(--font-sans); }

/* 对外暴露的用朱砂左边条标出来。语义写在上面的小标题里，
   颜色只是让它在墙里跳出来，不单独承担含义。 */
.chip-port.exposed {
  border-left: 3px solid var(--series-2);
  background: color-mix(in srgb, var(--series-2) 7%, var(--surface-2));
}

.chip-ctr .dot { width: 6px; height: 6px; border-radius: 50%; align-self: center; }
.chip-ctr.up .dot { background: var(--good); }
.chip-ctr.down .dot { background: var(--text-muted); }
.chip-ctr .pname { color: var(--text-muted); font-size: 10.5px; }

.chip-unit { font-size: 11px; opacity: .85; }

/* ---------------------------------------------------------------------------
   表格
   --------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-secondary);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

td.strong { color: var(--text-primary); }
td.num { text-align: right; }
td.wrap { white-space: normal; word-break: break-all; }

.empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* 当前正在用的身份要一眼认出来——换发它会影响自己 */
tr.is-me td { background: color-mix(in srgb, var(--series-1) 6%, transparent); }
.me-tag {
  margin-left: 8px;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--series-1);
  border: 1px solid color-mix(in srgb, var(--series-1) 45%, transparent);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* 成功/失败在日志里出现上百次，用小标记比大段彩字安静 */
.ok-mark { color: var(--text-muted); }
.fail-mark {
  color: var(--critical);
  border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11.5px;
}
.fail-why { color: var(--text-muted); font-size: 12px; }

/* ---------------------------------------------------------------------------
   设备详情
   --------------------------------------------------------------------------- */

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.detail-title {
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0;
}

.back-btn {
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 4px 11px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.back-btn:hover { border-color: var(--hairline-strong); color: var(--text-primary); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
  padding: 4px 0;
}

.fact { padding: 11px 16px; border-right: 1px solid var(--hairline); }
.fact:last-child { border-right: none; }
.fact-k { font-size: 11.5px; color: var(--text-muted); letter-spacing: 0.06em; }
/* break-all 会把 amd64、Skylake 这种词从中间劈开；用 break-word 只在
 * 整个词确实放不下时才断，正常单词保持完整。 */
.fact-v {
  font-size: 13.5px;
  margin-top: 2px;
  color: var(--text-primary);
  overflow-wrap: break-word;
}

/* 编辑 / 手录表单 */
.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.edit-grid label {
  display: grid;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
}
select:focus { outline: none; border-color: var(--series-1); }

/* 删除是不可逆的，让它看起来就像不可逆的 */
#e-delete { color: var(--critical); }
#e-delete:hover { border-color: var(--critical); color: var(--critical); }

.range-tabs { display: flex; gap: 2px; }

.range-tabs button {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.range-tabs button:hover { color: var(--text-primary); }
.range-tabs button.active {
  color: var(--text-primary);
  border-color: var(--hairline);
  background: var(--surface-1);
}

/* ---------------------------------------------------------------------------
   拓扑
   --------------------------------------------------------------------------- */

.topo-wrap { padding: 14px; overflow-x: auto; display: grid; justify-items: center; }
/* 按自身像素尺寸画，别让 viewBox 撑满容器——那样节点少的时候整张图会被
 * 放大好几倍，字大得离谱。宽了就横向滚，不缩放。 */
.topo-svg { display: block; max-width: none; }
.topo-svg .edge { fill: none; stroke-width: 1.4; opacity: .55; }
.topo-svg .edge.ssh   { stroke: var(--series-1); }
.topo-svg .edge.frp   { stroke: var(--series-2); }
.topo-svg .edge.proxy { stroke: var(--series-3); }
.topo-svg .edge.manual{ stroke: var(--text-muted); stroke-dasharray: 4 3; }
.topo-svg .edge:hover { opacity: 1; stroke-width: 2.4; }
.topo-svg .node-box {
  fill: var(--surface-2);
  stroke: var(--hairline-strong);
  stroke-width: 1;
}
.topo-svg .node-box.external { fill: none; stroke-dasharray: 3 3; }
.topo-svg .node-label { fill: var(--text-primary); font-size: 12px; font-family: var(--font-sans); }
.topo-svg .node-sub { fill: var(--text-muted); font-size: 10px; font-family: var(--font-sans); }

/* ---------------------------------------------------------------------------
   登录 / 接入说明
   --------------------------------------------------------------------------- */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 34px 30px 28px;
  box-shadow: var(--shadow);
}

.gate .wordmark { justify-content: center; margin-bottom: 6px; }
.gate .wordmark .glyph { font-size: 34px; }

.gate-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 22px;
  line-height: 1.7;
}

input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--series-1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--series-1);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  cursor: pointer;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.block { width: 100%; margin-top: 14px; }
.btn.ghost {
  background: none;
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
}
.btn.ghost:hover { border-color: var(--hairline-strong); color: var(--text-primary); }

.gate-err {
  color: var(--critical);
  font-size: 12.5px;
  margin-top: 12px;
  text-align: center;
  min-height: 18px;
}

pre.snippet {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 8px 0 0;
}
pre.snippet b { color: var(--text-primary); font-weight: 500; }

.prose { font-size: 13.5px; color: var(--text-secondary); line-height: 1.8; }
.prose p { margin: 0 0 10px; }
.prose strong { color: var(--text-primary); font-weight: 500; }

.pad { padding: 16px 18px 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-1);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .topbar { gap: 12px; height: 54px; }
  .wordmark .sub { display: none; }
  .page { padding: 18px 14px 60px; }
  .fact { border-right: none; border-bottom: 1px solid var(--hairline); }
  .detail-title { font-size: 21px; }
}
