/* ============================================================
   湛煌丰稷 · 管理后台样式
   ============================================================ */
:root {
  --brand: #16a34a;
  --brand-dark: #0f7c3a;
  --brand-soft: #e9f8ee;
  --brand-line: #bfe8cd;

  --teal: #0d9488;
  --blue: #2f7fe0;
  --amber: #e08a12;
  --red: #e05252;
  --purple: #7c5ce0;

  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #fafbfa;
  --line: #e5ebe7;
  --line-strong: #d5dfd9;

  --text: #12211b;
  --text-2: #43574e;
  --muted: #7b8d84;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(18, 33, 27, .05), 0 1px 3px rgba(18, 33, 27, .04);
  --shadow-md: 0 4px 16px rgba(18, 33, 27, .07);
  --shadow-lg: 0 18px 48px rgba(18, 33, 27, .14);

  --sidebar-w: 224px;
  --topbar-h: 60px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfdad4; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c5bd; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
}
.login-art {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #0b3d24 0%, #12603a 45%, #17864a 100%);
  color: #eafbf0;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-art::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto auto;
  width: 620px; height: 620px;
  background: radial-gradient(circle at 30% 30%, rgba(120, 255, 180, .28), transparent 62%);
  border-radius: 50%;
}
.login-art::after {
  content: "";
  position: absolute;
  inset: auto auto -25% -15%;
  width: 520px; height: 520px;
  background: radial-gradient(circle at 60% 40%, rgba(90, 220, 200, .2), transparent 65%);
  border-radius: 50%;
}
.login-art .art-brand { position: relative; display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.login-art h1 { position: relative; font-size: 40px; line-height: 1.25; margin: 0 0 18px; font-weight: 650; letter-spacing: -.5px; }
.login-art p.lead { position: relative; color: rgba(234, 251, 240, .78); font-size: 15px; max-width: 420px; margin: 0; }
.art-metrics { position: relative; display: flex; gap: 34px; margin-top: 40px; }
.art-metrics b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.5px; }
.art-metrics span { color: rgba(234, 251, 240, .66); font-size: 12.5px; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; position: relative; }
.login-card { width: 100%; max-width: 356px; }
.login-card h2 { margin: 0 0 6px; font-size: 24px; font-weight: 650; letter-spacing: -.4px; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; font-size: 13.5px; }
.login-card .field { margin-bottom: 16px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.login-card .btn-block { width: 100%; justify-content: center; height: 44px; margin-top: 8px; }
.demo-accounts { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line); }
.demo-accounts .hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.demo-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-chip {
  border: 1px solid var(--line-strong); background: var(--surface-2);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer;
  transition: .15s; color: var(--text-2);
}
.demo-chip:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.login-err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; }

/* ---------------- 骨架布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, #1eb565, #0d7a3a);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, .28);
  flex: 0 0 auto;
}
.brand-text b { display: block; font-size: 15px; letter-spacing: .3px; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .4px; }

.nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.nav-group { margin-bottom: 6px; }
.nav-group-title { font-size: 11px; color: var(--muted); padding: 12px 8px 6px; letter-spacing: .8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  color: var(--text-2); font-size: 13.5px; margin-bottom: 2px;
  transition: background .16s, color .16s;
  border: 1px solid transparent;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .82; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 550; border-color: var(--brand-line);
}
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10.5px; min-width: 17px; height: 17px; border-radius: 9px;
  display: grid; place-items: center; padding: 0 5px; font-weight: 600;
}
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.user-mini:hover { background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(140deg, #cdeed9, #9fdcb8);
  color: var(--brand-dark); display: grid; place-items: center;
  font-size: 12.5px; font-weight: 650; flex: 0 0 auto;
}
.user-mini .u-name { font-size: 13px; font-weight: 550; line-height: 1.2; }
.user-mini .u-role { font-size: 11px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: -.2px; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--brand); box-shadow: 0 0 0 3px rgba(22, 163, 74, .16); }
.dot.off { background: var(--red); }
.dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.content { padding: 20px 24px 44px; flex: 1; }
.page { animation: fadeUp .28s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 移动端：汉堡菜单按钮 + 抽屉遮罩 */
.btn-menu { display: none; margin-right: 4px; }
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(10, 20, 16, .4); z-index: 25; }
@media (max-width: 1080px) {
  .btn-menu { display: inline-flex; }
  .sb-backdrop.show { display: block; }
}

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1240px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

/* 手机端：设备列表转为卡片式，避免横向滚动 */
@media (max-width: 760px) {
  .tbl.responsive thead { display: none; }
  .tbl.responsive, .tbl.responsive tbody, .tbl.responsive tr, .tbl.responsive td { display: block; width: 100%; }
  .tbl.responsive tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--surface); }
  .tbl.responsive tbody tr:hover { background: var(--surface); }
  .tbl.responsive td { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: right;
    border-bottom: 1px solid #f0f4f1; padding: 9px 14px; }
  .tbl.responsive td:last-child { border-bottom: none; justify-content: flex-start; }
  .tbl.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 550;
    white-space: nowrap; text-align: left; }
  .tbl.responsive td:first-child::before, .tbl.responsive td[data-label=""]::before { display: none; }
  .tbl.responsive td:first-child { justify-content: flex-start; }
  .tbl.responsive .row-actions { justify-content: flex-start; }
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, #1ba85a, var(--brand)); color: #fff;
  border-color: transparent; box-shadow: 0 2px 8px rgba(22, 163, 74, .28);
}
.btn-primary:hover { background: linear-gradient(180deg, #19a054, var(--brand-dark)); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-danger { color: var(--red); border-color: #f0cfcf; }
.btn-danger:hover { background: #fdf2f2; border-color: var(--red); color: var(--red); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 7px; }

.input, .select, .textarea {
  height: 34px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface);
  outline: none; transition: .15s; width: 100%; font-size: 13px;
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 70px; font-family: var(--mono); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}
.select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8d84' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field .tip { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 550; line-height: 1;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.green { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-line); }
.badge.red { background: #fdeeee; color: #b93b3b; border-color: #f4d4d4; }
.badge.amber { background: #fdf4e5; color: #a86a08; border-color: #f5e2c2; }
.badge.blue { background: #ecf3fd; color: #2564b8; border-color: #d3e3f8; }
.badge.gray { background: #f2f5f3; color: var(--muted); border-color: var(--line); }
.badge.purple { background: #f1edfd; color: #5b40b8; border-color: #ded5f7; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 550; color: var(--muted); font-size: 12px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid #f0f4f1; vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #f9fbfa; }
table.tbl tr.clickable { cursor: pointer; }
.td-strong { font-weight: 550; color: var(--text); }
.td-mono { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.td-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* 统计卡 */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .st-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.stat .st-icon {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark);
}
.stat .st-icon svg { width: 15px; height: 15px; }
.stat .st-value { font-size: 26px; font-weight: 650; letter-spacing: -.8px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat .st-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat .st-foot { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.stat.amber .st-icon { background: #fdf4e5; color: #a86a08; }
.stat.red .st-icon { background: #fdeeee; color: #b93b3b; }
.stat.blue .st-icon { background: #ecf3fd; color: #2564b8; }
.stat.teal .st-icon { background: #e7f6f4; color: #0b7a70; }

/* 指标卡 */
.metric {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; background: var(--surface); position: relative;
  transition: .18s;
}
.metric:hover { border-color: var(--brand-line); box-shadow: var(--shadow-md); }
.metric .m-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.metric .m-value {
  font-size: 27px; font-weight: 650; letter-spacing: -1px; margin: 6px 0 2px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.metric .m-value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; letter-spacing: 0; }
.metric .m-range { font-size: 11.5px; color: var(--muted); }
.metric .m-bar { height: 4px; border-radius: 3px; background: #eef2ef; margin-top: 10px; overflow: hidden; position: relative; }
.metric .m-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--brand); transition: left .4s, width .4s; }
.metric .m-ts { font-size: 11px; color: var(--muted); margin-top: 8px; }
.metric.warn { border-color: #f5e2c2; background: #fffdf8; }
.metric.warn .m-bar i { background: var(--amber); }
.metric.danger { border-color: #f4d4d4; background: #fffafa; }
.metric.danger .m-bar i { background: var(--red); }
.metric .m-live { position: absolute; top: 13px; right: 14px; }

/* 筛选栏 */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters .select, .filters .input { width: auto; min-width: 130px; }
.filters .grow { flex: 1; min-width: 160px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 32px; min-width: 220px; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pager .right { margin-left: auto; display: flex; gap: 6px; }
.pager button {
  min-width: 30px; height: 28px; border-radius: 7px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-size: 12.5px; color: var(--text-2);
}
.pager button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button[disabled] { opacity: .45; cursor: not-allowed; }

/* 空状态 */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); font-size: 13px; }
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: 10px; }

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  padding: 9px 14px; font-size: 13.5px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s; font-weight: 500;
}
.tab:hover { color: var(--brand-dark); }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 28, 22, .38);
  backdrop-filter: blur(2px); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px 40px; overflow-y: auto;
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); animation: modalIn .2s cubic-bezier(.2, .9, .3, 1.2);
  margin: auto;
}
.modal.wide { max-width: 760px; }
.modal.xwide { max-width: 940px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--muted); border: none; background: none; padding: 4px; border-radius: 6px; display: grid; place-items: center; }
.modal-head .x:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 20px; max-height: 64vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* Toast */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #12211b; color: #f2f7f4; padding: 9px 16px; border-radius: 9px;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .22s ease;
  display: flex; align-items: center; gap: 8px; pointer-events: auto;
}
.toast.error { background: #8e2f2f; }
.toast.success { background: #0f6b38; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 进度条 */
.progress { height: 6px; background: #eef2ef; border-radius: 4px; overflow: hidden; min-width: 70px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #26b56a, #12a35a); border-radius: 4px; transition: width .4s; }
.progress.amber i { background: linear-gradient(90deg, #f0b849, #e08a12); }

/* 终端 */
.terminal {
  background: #0d1a14; border-radius: 10px; padding: 14px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  color: #c9e8d6; height: 300px; overflow-y: auto;
  border: 1px solid #1c2f24;
}
.terminal .line { white-space: pre-wrap; word-break: break-all; }
.terminal .prompt { color: #4ade80; }
.terminal .down { color: #93c5fd; }
.terminal .up { color: #c9e8d6; }
.terminal .err { color: #fca5a5; }
.terminal .time { color: #4b6b5a; margin-right: 8px; }
.term-input-row { display: flex; gap: 8px; margin-top: 10px; }
.term-input-row .input { font-family: var(--mono); }

/* 远程调试：AT 指令速查列表 */
.at-scroll { max-height: 460px; overflow-y: auto; }
.at-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 10px; margin-bottom: 2px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; text-align: left; font: inherit;
}
.at-item:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.at-item code { font-size: 12px; color: var(--brand-dark); min-width: 122px; }
.at-item span { font-size: 12px; color: var(--muted); }

/* 杂项 */
.hstack { display: flex; align-items: center; gap: 8px; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }

/* 接入密钥：完整显示 + 悬浮“点击复制” + 点击复制 */
.secret-copy {
  position: relative; display: inline-flex; align-items: center;
  padding: 2px 7px; margin: -2px -7px; border-radius: 7px;
  border: 1px dashed transparent; cursor: pointer; transition: .15s;
  word-break: break-all;
}
.secret-copy:hover { background: var(--surface-2); border-color: var(--brand-line); color: var(--brand-dark); }
.secret-copy:active { transform: scale(.99); }
.secret-copy:focus-visible { outline: 2px solid var(--brand-line); outline-offset: 1px; }
.secret-tip {
  position: absolute; left: 0; bottom: calc(100% + 7px);
  background: #12211b; color: #fff; font-family: inherit; font-size: 11.5px;
  line-height: 1.2; padding: 5px 9px; border-radius: 7px; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,.16);
  opacity: 0; pointer-events: none; transform: translateY(3px);
  transition: opacity .15s, transform .15s; z-index: 20;
}
.secret-tip::after {
  content: ''; position: absolute; top: 100%; left: 14px;
  border: 5px solid transparent; border-top-color: #12211b;
}
.secret-copy:hover .secret-tip,
.secret-copy:focus-visible .secret-tip { opacity: 1; transform: translateY(0); }
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--line-strong);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 图表 */
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.chart-tip {
  position: absolute; pointer-events: none; background: rgba(18, 33, 27, .93);
  color: #fff; font-size: 11.5px; padding: 6px 9px; border-radius: 7px;
  white-space: nowrap; transform: translate(-50%, -120%); opacity: 0; transition: opacity .12s; z-index: 5;
}
.chart-tip.on { opacity: 1; }

/* 基地卡 */
.base-card { padding: 18px; }
.base-card .bc-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.base-card .bc-title { font-size: 15px; font-weight: 600; }
.base-card .bc-sub { font-size: 12px; color: var(--muted); }
.base-card .bc-stats { display: flex; gap: 22px; margin-bottom: 14px; }
.base-card .bc-stat b { font-size: 19px; font-weight: 650; letter-spacing: -.4px; display: block; }
.base-card .bc-stat span { font-size: 11.5px; color: var(--muted); }
.gh-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; background: var(--surface-2); cursor: pointer; transition: .15s;
}
.gh-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.gh-chip .dot { margin: 0; }

/* 物模型卡 */
.model-card { padding: 16px; cursor: pointer; transition: .18s; }
.model-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand-line); transform: translateY(-1px); }
.model-card .mc-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.model-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); flex: 0 0 auto;
}
.model-icon svg { width: 18px; height: 18px; }
.model-card .mc-name { font-size: 14px; font-weight: 600; }
.model-card .mc-code { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.metric-rows { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.metric-rows .mr-head, .metric-rows .mr-row { display: grid; grid-template-columns: 1.1fr 1.1fr .8fr .8fr .8fr .8fr 34px; gap: 8px; padding: 8px 10px; align-items: center; }
.metric-rows .mr-head { background: var(--surface-2); font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.metric-rows .mr-row { border-bottom: 1px solid #f0f4f1; }
.metric-rows .mr-row:last-child { border-bottom: none; }
.metric-rows .input { height: 30px; font-size: 12.5px; padding: 0 8px; }

@media (max-width: 1080px) {
  .sidebar { position: fixed; left: -240px; transition: left .22s; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .content { padding: 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

/* ---------------- 页脚：公司 + ICP / 公安备案号 ----------------
 * 备案号由服务端环境变量注入（ZH_ICP_NO / ZH_ICP_GOV_NO），
 * 未配置时这里只显示公司名，不会出现占位符。 */
.site-foot {
  flex: 0 0 auto;
  padding: 14px 24px 16px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: .2px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.site-foot a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-foot a:hover { color: var(--text-2); border-bottom-color: var(--line-strong); }
.site-foot .foot-sep { margin: 0 8px; opacity: .55; }
.login-foot {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  border-top: 0;
  background: transparent;
  padding: 0 24px;
}
