/* waf-console 工作台样式（r400 由独立页并入控制台） */
  /* ============================================================
     实例详情页专有样式（命名统一加 dt- 前缀，避免与站点样式冲突）
     基础令牌、控制台壳层与通用组件（button/tag/status/table/field）
     全部沿用 assets/style.css?v=20261126swiftidc2，本页不重复定义。
     ============================================================ */

  /* 控制台侧栏样式统一由 assets/style.css?v=20261126swiftidc2 提供（r192 合并），本页不再重复定义。 */

  /* ---------- 面包屑 ---------- */
  .dt-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-3);
    margin-bottom: 14px;
  }
  .dt-crumbs a { color: var(--ink-2); }
  .dt-crumbs a:hover { color: var(--brand-strong); }
  .dt-crumbs .sep { color: var(--line-strong); }
  .dt-crumbs strong { color: var(--ink); font-weight: 600; }

  /* ---------- 工作台头右侧操作区 ---------- */
  .dt-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .dt-head-actions .btn { white-space: nowrap; }

  /* ---------- 页签 ---------- */
  .dt-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    padding: 0 12px;
  }
  .dt-tabs button {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font: inherit;
    font-size: 14px;
    color: var(--ink-2);
    padding: 13px 14px;
    cursor: pointer;
    white-space: nowrap;
  }
  .dt-tabs button:hover { color: var(--ink); }
  .dt-tabs button[aria-selected="true"] {
    color: var(--brand-strong);
    font-weight: 600;
    border-bottom-color: var(--brand);
  }
  .dt-panel { padding: 20px; }
  .dt-panel:focus { outline: none; }

  /* ---------- 描述列表（三列网格） ---------- */
  .dt-desc { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
  .dt-desc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dt-desc-item {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: 11px 14px;
    min-width: 0;
  }
  .dt-desc-item .k { font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }
  .dt-desc-item .v { font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; word-break: break-all; }

  /* ---------- 小节标题 / 布局 ---------- */
  .dt-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 10px;
  }
  .dt-section-head h3 { font-size: 15px; font-weight: 700; }
  .waf-buy-mask { position: fixed; inset: 0; background: rgba(16,37,41,.45); display: flex; align-items: center; justify-content: center; z-index: 90; }
  .waf-buy-mask[hidden] { display: none; }
  .waf-buy-dialog { width: min(440px, 92vw); background: #fff; border-radius: 12px; box-shadow: 0 18px 48px rgba(16,37,41,.25); overflow: hidden; }
  .waf-buy-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
  .waf-buy-head h3 { margin: 0; font-size: 15px; }
  .waf-buy-x { border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: #64748b; }
  .waf-buy-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
  .waf-buy-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
  .waf-buy-field select { min-width: 190px; padding: 6px 8px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; }
  .waf-buy-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid #e2e8f0; background: #f9fbfb; }
  .dt-section-head .footnote { margin: 0; }
  .dt-stack { display: flex; flex-direction: column; gap: 20px; }
  .dt-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .dt-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .dt-box {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--canvas);
    min-width: 0;
  }
  .dt-box > strong { font-size: 14.5px; }

  /* ---------- 监控：分段按钮 / 图表 / 指标卡 ---------- */
  .dt-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
  .dt-chart-head h3 { font-size: 15px; font-weight: 700; }
  .dt-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; }
  .dt-seg button {
    border: 0;
    background: var(--canvas);
    font: inherit;
    font-size: 13px;
    padding: 7px 12px;
    cursor: pointer;
    color: var(--ink-2);
  }
  .dt-seg button + button { border-left: 1px solid var(--line); }
  .dt-seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
  .dt-chart-wrap { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px; }
  .dt-chart-wrap svg { display: block; width: 100%; height: 240px; }
  .dt-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
  .dt-legend i { display: inline-block; width: 10px; height: 8px; border-radius: 2px; margin-right: 5px; }
  .dt-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
  .dt-metric { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 11px 12px; }
  .dt-metric .k { font-size: 12.5px; color: var(--ink-3); }
  .dt-metric .v { font-size: 19px; font-weight: 700; font-family: var(--font-mono); }
  .dt-skeleton {
    background: linear-gradient(90deg, #eef1f6, #f8fbfb, #eef1f6);
    border-radius: var(--radius-sm);
    height: 200px;
    animation: dt-pulse 1.2s infinite;
  }
  @keyframes dt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

  /* ---------- 行内提示 / 键值行 ---------- */
  .dt-hint {
    background: var(--brand-soft);
    border: 1px solid var(--brand-soft-line);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 12.5px;
    color: #157885;
    margin-top: 12px;
  }
  .dt-hint-soft {
    background: var(--canvas-subtle);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 12.5px;
    color: var(--ink-2);
    margin-top: 12px;
  }
  .dt-kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
    flex-wrap: wrap;
  }
  .dt-kv:last-child { border-bottom: 0; }
  .dt-kv .k { color: var(--ink-3); font-size: 13px; }
  .dt-kv .v { font-size: 13.5px; overflow-wrap: anywhere; }

  /* ---------- 表格操作链接 ---------- */
  .dt-link-act {
    border: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
  }
  .dt-link-act:hover { background: var(--brand-soft); }
  .dt-link-act.danger { color: var(--danger); }
  .dt-link-act.danger:hover { background: var(--danger-soft); }
  .dt-link-act:disabled { color: var(--line-strong); cursor: not-allowed; background: transparent; }

  /* ---------- 提示与弹层 ---------- */
  .dt-alert {
    border: 1px solid #abe5ed;
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .dt-alert-error { background: var(--danger-soft); border-color: #f2c3bf; color: var(--danger); }
  .dt-alert .icon { width: 16px; height: 16px; }

  .dt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,36,39, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 120;
  }
  .dt-dialog {
    background: var(--canvas);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
  }
  .dt-dialog header { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
  .dt-dialog .body { padding: 16px; }
  .dt-dialog footer { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

  .dt-toast-wrap {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 140;
    max-width: calc(100vw - 36px);
  }
  .dt-toast {
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 11px 15px;
    font-size: 13.5px;
    box-shadow: var(--shadow-md);
  }
  .dt-toast.ok { background: #1f7a45; }
  .dt-toast.warn { background: #9a5b00; }
  .dt-toast.err { background: #b42318; }

  /* ---------- 字段错误信息 ---------- */
  .dt-field-error-msg { color: var(--danger); font-size: 12.5px; margin: 6px 0 0; }

  /* ---------- 顶栏内的用户名 ---------- */
  #consoleLoginName { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ---------- 窄屏重排 ---------- */
  @media (max-width: 1080px) {
    .dt-desc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dt-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 767px) {
    .dt-desc-grid, .dt-metric-grid, .dt-two-col { grid-template-columns: minmax(0, 1fr); }
    .dt-panel { padding: 16px; }
    .dt-head-actions { width: 100%; }
    .dt-head-actions .btn { flex: 1 1 auto; }
  }
  @media (max-width: 640px) {
    .instance-table { min-width: 0; }
    .instance-table thead { display: none; }
    .instance-table, .instance-table tbody, .instance-table tr, .instance-table td { display: block; width: 100%; }
    .instance-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
    .instance-table tr:last-child { border-bottom: 0; }
    .instance-table td {
      border: 0;
      padding: 7px 12px;
      display: flex;
      gap: 10px;
      justify-content: space-between;
      align-items: flex-start;
    }
    .instance-table td::before {
      content: attr(data-label);
      color: var(--ink-3);
      font-size: 12.5px;
      flex: 0 0 88px;
      font-weight: 500;
    }
    .table-scroll { border: 0; }
  }

  /* ---------- VNC 控制台（noVNC 实时画面，以弹窗呈现） ---------- */
  .vnc-modal { z-index: 130; }
  .vnc-modal-card {
    background: var(--canvas);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 1080px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .vnc-modal-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
  }
  .vnc-modal-title { display: inline-flex; align-items: center; gap: 8px; }
  .vnc-modal-body { padding: 14px 16px 16px; overflow: auto; }
  .vnc-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
  .vnc-sep { flex: 1 1 auto; }
  .vnc-status { font-size: 12.5px; color: var(--ink-2); }
  .vnc-status.is-ok { color: #1a7f4b; font-weight: 600; }
  .vnc-status.is-warn { color: #157885; }
  .vnc-status.is-err { color: var(--danger); }
  .vnc-stage {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #10141c;
    overflow: hidden;
  }
  .vnc-screen { width: 100%; height: min(62vh, 560px); min-height: 320px; outline: none; }
  .vnc-screen canvas { display: block; }
  .vnc-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-size: 13.5px;
    color: #c7d0dd;
    background: rgba(16, 20, 28, .92);
  }
  .vnc-overlay[hidden] { display: none !important; }

  /* ---------- 安全组页签（沿用 dt- 组件，仅补充少量尺寸） ---------- */
  #sgRuleForm {
    margin: 4px 0 16px;
    padding: 12px 14px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fafbfc;
  }
  #sgRulesBox .instance-table td:last-child { white-space: nowrap; }
  /* 我的SwiftIdc • WAF 应用防火墙：状态徽标与表格间距 */
  .waf-pill{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;padding:3px 10px;border-radius:999px;white-space:nowrap}
  .waf-pill::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
  .waf-pill.is-on{color:var(--success);background:var(--success-soft)}
  .waf-pill.is-off{color:var(--warning);background:var(--warning-soft)}
  #wafTableBox{margin-top:16px}
  #wafEmpty{margin-top:16px}
  #view-waf .stat-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
  @media (max-width:1080px){#view-waf .stat-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
  @media (max-width:520px){#view-waf .stat-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
