/* ==========================================================================
   设备终端页复刻 —— 对齐 sh1008.shapk.one/device_terminal/{device_id}/{uid}
   所有数值来自原版实测 getComputedStyle + 采集产物里的原版 CSS 模板

   原版结构（react-grid-layout，5 面板横向）：
     页面    .device_terminal_page  p8 gap8 渐变底
     顶栏    h56 bg rgba(255,255,255,.596) r8 pad 6/12
     面板    r8 bg rgba(255,255,255,.596) 拖拽手柄 28×28 r6
     tab     高 28 / pad 4×12 / r8 / fs14
   ========================================================================== */

/* ---------- 页面根 ---------- */
.device_terminal_page {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    padding: 8px;
    background: linear-gradient(to bottom right, rgba(250, 250, 250, 0.5), #f4f4f5);
    height: calc(100vh - var(--global-header-height));
    box-sizing: border-box;
}

/* 隐藏滚动条（原版同款规则） */
.device_terminal_page,
.device_terminal_page * {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.device_terminal_page::-webkit-scrollbar,
.device_terminal_page *::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
    background: transparent !important;
}

/* ---------- 设备状态顶栏 ---------- */
.term-header {
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.596);
    /* 原版用 backdrop-blur，父容器需要有背景才看得出效果 */
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

/* 左侧身份块：品牌 logo + 型号 + 系统 */
.term-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    flex-shrink: 0;
}

.term-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
}

/* 品牌旁的小绿点（在线指示） */
.term-brand-logo::after {
    content: '';
    position: absolute;
    left: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: #22c55e;
    border: 2px solid #fff;
}

.term-identity__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.term-identity__brand {
    font-size: 15px;
    font-weight: 600;
    color: #1e2329;
    white-space: nowrap;
}

.term-identity__os {
    font-size: 12px;
    color: #71717a;
    white-space: nowrap;
}

.term-identity__android-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    margin-top: 1px;
}

/* 状态指标行 */
.term-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 20px;
    min-width: 0;
    flex: 1;
}

.term-metric {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #71717a;
    white-space: nowrap;
}

.term-metric__label { color: #71717a; }

/* 网络质量徽标：绿底圆角胶囊 */
.term-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 10px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.term-badge--good { background: #22c55e; color: #fff; }
.term-badge--ok   { background: #f59e0b; color: #fff; }
.term-badge--err  { background: #ef4444; color: #fff; }
.term-badge--fair { background: #f59e0b; color: #fff; }
.term-badge--poor { background: #ef4444; color: #fff; }
.term-badge--net  { background: #14b8a6; color: #fff; }

/* 网络质量圆点 */
.term-net-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.term-metric__val {
    font-size: 13px;
    color: #1e2329;
    font-variant-numeric: tabular-nums;
}

/* 电池图标 */
.term-battery {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.term-battery__bar {
    width: 26px;
    height: 13px;
    border: 1.5px solid #1e2329;
    border-radius: 3px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 1.5px;
}

.term-battery__bar::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 3px;
    width: 2px;
    height: 5px;
    background: #1e2329;
    border-radius: 0 1px 1px 0;
}

.term-battery__fill {
    height: 100%;
    background: #22c55e;
    border-radius: 1px;
}

/* 顶栏里的节点树控制条（从屏幕下方移来） */
.term-header__tree {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding-left: 4px;
}

.term-header__tree-label {
    font-size: 13px;
    color: #71717a;
    white-space: nowrap;
}

.term-header__tree select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #e4e4e7;
    border-radius: 7px;
    background: #fff;
    font-size: 13px;
    color: #1e2329;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.term-header__tree .tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 9999px;
    background: #f4f4f5;
    color: #71717a;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 右上终端设置按钮 */
.btn-term-setting {
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 111, 238, 0.2);
    color: #005bc4;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background-color 0.15s;
}

.btn-term-setting:hover { background: rgba(0, 111, 238, 0.3); }

/* ---------- 五栏网格 ---------- */
.term-grid {
    display: flex;
    gap: 12px;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    /* 滚动条不占位，避免最后一栏被挤 */
    scrollbar-width: none;
}

.term-grid::-webkit-scrollbar { display: none; }

/* 面板顶部（只放拖拽手柄的占位行） */
.term-panel__head {
    height: 0;
    position: relative;
    flex-shrink: 0;
}

/* 单个面板 */
.term-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.596);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: visible;
}

/* 宽度约束（紧凑版：两个手机屏占大头，日志/控制区收窄并可滚动）
   a 日志/采集   340 固定，内部纵向滚动
   b 遮盖层/伪页 185 固定
   c 屏幕预览    弹性，尽量大
   d 控制区      195 固定，内部纵向滚动
   e 投屏预览    弹性，尽量大 */
.term-panel--a { width: 420px; min-width: 360px; max-width: 480px; flex-shrink: 0; }
.term-panel--b { width: 185px; min-width: 185px; max-width: 185px; flex-shrink: 0; }
.term-panel--c { flex: 1 1 0; min-width: 240px; }
.term-panel--d { width: 195px; min-width: 195px; max-width: 195px; flex-shrink: 0; }
.term-panel--e { flex: 1 1 0; min-width: 240px; }

/* 面板内的可滚动正文 */
.term-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    /* 细滚动条，不占太多宽度 */
    scrollbar-width: thin;
    scrollbar-color: #d4d4d8 transparent;
}

.term-panel__body::-webkit-scrollbar {
    width: 6px;
}

.term-panel__body::-webkit-scrollbar-track {
    background: transparent;
}

.term-panel__body::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 3px;
}

.term-panel__body::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* 拖拽手柄（原版 28×28，绝对定位在面板右上角外侧） */
.term-drag-handle {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #71717a;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    cursor: grab;
    z-index: 40;
    opacity: 0.8;
    transition: opacity 0.15s, background-color 0.15s;
    user-select: none;
}

.term-panel:hover .term-drag-handle { opacity: 1; }
.term-drag-handle:hover { background: #f4f4f5; }
.term-drag-handle:active { cursor: grabbing; }

/* ---------- 面板内 Tab 条 ---------- */
.term-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    /* 右侧留出 34px 给拖拽手柄，避免最后一个 tab 被压住 */
    padding: 6px 34px 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    /* 原版 tab 条 9 项一屏铺满；超出时横向滚动 */
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.term-tabs::-webkit-scrollbar { display: none; }

/* 面板 a 的 tab 条：等分铺满，超过 9 项后自动滚动 */
.term-panel--a .term-tabs {
    flex-wrap: nowrap;
}

.term-tabs::-webkit-scrollbar { display: none; }

.term-tab {
    height: 26px;
    padding: 3px 7px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #1e2329;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-family: inherit;
    transition: background-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.term-tab:hover { background: rgba(0, 0, 0, 0.05); }

.term-tab.is-active,
.term-tab.active {
    background: #fff;
    color: #1e2329;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.term-tab svg { width: 16px; height: 16px; flex-shrink: 0; }

/* tab 图标颜色区分（原版每个 tab 图标不同色） */
.term-tab[data-tone="blue"] svg { color: #0958d9; }
.term-tab[data-tone="cyan"] svg { color: #06b6d4; }
.term-tab[data-tone="green"] svg { color: #22c55e; }
.term-tab[data-tone="violet"] svg { color: #8b5cf6; }
.term-tab[data-tone="amber"] svg { color: #f59e0b; }
.term-tab[data-tone="pink"] svg { color: #ec4899; }

/* ---------- 二级 Tab（全部/三方APP/锁屏/应用锁） ---------- */
.term-subtabs {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    background: #f4f4f5;
    border-radius: 9px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.term-subtab {
    flex: 1;
    height: 26px;
    border: none;
    border-radius: 7px;
    background: transparent;
    font-size: 12px;
    color: #1e2329;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background-color 0.15s;
    padding: 0;
}

.term-subtab:hover { background: rgba(255, 255, 255, 0.7); }

.term-subtab.is-active {
    background: #fff;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ---------- 表单控件 ---------- */
.term-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 7px;
}

.term-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.term-field__label {
    font-size: 11px;
    color: #71717a;
}

.term-select {
    height: 32px;
    padding: 0 8px;
    border: 1px solid #e4e4e7;
    border-radius: 7px;
    background: #fafafa;
    font-size: 13px;
    color: #1e2329;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    width: 100%;
    min-width: 0;
}

.term-search-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.term-search {
    flex: 1;
    height: 32px;
    padding: 0 9px;
    border: 1px solid #e4e4e7;
    border-radius: 7px;
    background: #fff;
    font-size: 12px;
    color: #1e2329;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.term-search::placeholder { color: #a1a1aa; }

.term-search-btn {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 7px;
    background: #006fee;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

.term-search-btn:hover { opacity: 0.9; }

/* ---------- 记录卡片（锁屏-图案 那种） ---------- */
.term-record {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 0;
    background: #fff;
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid #f4f4f5;
}

.term-record:last-child { border-bottom: none; }

.term-record__thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.term-record__main { flex: 1; min-width: 0; }

.term-record__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1e2329;
    margin-bottom: 3px;
}

.term-record__actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.term-record__meta {
    font-size: 12px;
    color: #71717a;
    margin-bottom: 6px;
}

.term-record__body {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1e2329;
    width: 100%;
}

.term-record__body > span:first-child {
    flex-shrink: 0;
}

.term-record__body > .term-record__code {
    flex: 1;
}

.term-link-btn {
    border: none;
    background: transparent;
    color: #3b82f6;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    font-family: inherit;
    border-radius: 4px;
    white-space: nowrap;
}

.term-link-btn:hover { text-decoration: underline; }

.term-link-btn--danger { color: #f31260; }

.term-btn-primary-sm {
    height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: #006fee;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.term-btn-primary-sm:hover { opacity: 0.9; }

/* ---------- 面板小节标题 ---------- */
.term-shell-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 34px 8px 4px;
    font-size: 14px;
    font-weight: 500;
    color: #1e2329;
    flex-shrink: 0;
    border-bottom: 1px solid #f4f4f5;
    margin-bottom: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

/* 标题文字不能被压掉 */
.term-shell-head > span:first-child {
    flex-shrink: 0;
    white-space: nowrap;
}

.term-shell-head .spacer { flex: 1; min-width: 0; }

.term-shell-head select {
    height: 26px;
    padding: 0 6px;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #1e2329;
    font-family: inherit;
    max-width: 84px;
    min-width: 0;
}

.term-shell-head .tag {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 9999px;
    background: #f4f4f5;
    color: #71717a;
    white-space: nowrap;
    flex-shrink: 0;
}

.term-section {
    padding: 8px 4px;
    border-bottom: 1px solid #f4f4f5;
    margin-bottom: 8px;
}

.term-section__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1e2329;
    margin-bottom: 4px;
}

.term-section__head .spacer { flex: 1; }

/* 最近操作 / 通知详情 子 tab */
.term-tab-btn {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #71717a;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
    transition: color 0.15s, border-color 0.15s;
}
.term-tab-btn:hover { color: #1e2329; }
.term-tab-btn.is-active {
    color: #1677ff;
    border-bottom-color: #1677ff;
}

.term-section__sub {
    font-size: 12px;
    color: #71717a;
    line-height: 1.5;
}

/* ---------- 开关行（锁屏/防删/桌面图标/内置浏览器） ---------- */
.term-switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 2px;
    border-bottom: 1px solid #f4f4f5;
}

.term-switch-row__text { flex: 1; min-width: 0; }

.term-switch-row__title {
    font-size: 13px;
    color: #1e2329;
    margin-bottom: 1px;
}

.term-switch-row__desc {
    font-size: 11px;
    color: #a1a1aa;
    line-height: 1.3;
    /* 副标题最多两行，超出省略，避免面板被撑高 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* iOS 风格开关 */
.term-switch {
    width: 40px;
    height: 22px;
    border-radius: 9999px;
    background: #d4d4d8;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    border: none;
    transition: background-color 0.2s;
    padding: 0;
}

.term-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.term-switch.on { background: #006fee; }
.term-switch.on::after { transform: translateX(18px); }

/* ---------- 状态胶囊（在线 / 息屏） ---------- */
.term-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px 10px;
}

.term-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #22c55e;
    flex-shrink: 0;
}

.term-status-text {
    font-size: 14px;
    color: #1e2329;
}

.term-status-pill {
    height: 28px;
    padding: 0 14px;
    border-radius: 9999px;
    background: #9ca3af;
    color: #fff;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.term-status-pill.on {
    background: #006fee;
}

/* ---------- 大按钮（一键解锁 / 显示投屏 等） ---------- */
.term-action-btn {
    width: 100%;
    height: 38px;
    border: 1px solid #e4e4e7;
    border-radius: 9px;
    background: #fff;
    color: #1e2329;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: inherit;
    margin-bottom: 6px;
    transition: background-color 0.15s;
    white-space: nowrap;
    padding: 0 8px;
}

.term-action-btn:hover { background: #fafafa; }

/* 绿色系（一键解锁 / 已解锁·锁屏验证） */
.term-action-btn--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.term-action-btn--success:hover { background: #dcfce7; }

/* 紫色系（一键翻译） */
.term-action-btn--violet {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #6d28d9;
}

.term-action-btn--violet:hover { background: #ede9fe; }

/* 静音按钮（红色系） */
.term-action-btn--mute {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}
.term-action-btn--mute:hover { background: #ffe4e6; }

/* 震动按钮（绿色系） */
.term-action-btn--vibrate {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
.term-action-btn--vibrate:hover { background: #dcfce7; }

/* keyguard 按钮默认（未解锁）：白底带绿边 */
.term-action-btn--keyguard {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
    font-size: 12px;
}

/* keyguard 按钮已解锁：绿色背景（对齐原版） */
.term-action-btn--keyguard-ok {
    background: rgba(23, 201, 100, 0.15);
    border-color: rgba(23, 201, 100, 0.25);
    color: #15803d;
    font-size: 12px;
}
.term-action-btn--keyguard-ok:hover { background: rgba(23, 201, 100, 0.25); }
.term-action-btn--keyguard:hover { background: #dcfce7; }.term-action-btn--keyguard:hover { background: #dcfce7; }

/* 蓝色系（调整音量 / 调整音量那种浅蓝） */
.term-action-btn--info {
    background: #eff6ff;
    border-color: #dbeafe;
    color: #1d4ed8;
}

/* 两列并排按钮 */
.term-action-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

.term-action-pair .term-action-btn {
    margin-bottom: 0;
    padding: 0 4px;
    font-size: 12px;
    gap: 3px;
}

/* 窄面板里图标按钮压缩 */
.term-action-pair .term-btn-ico {
    font-size: 13px;
}

/* 图标按钮（静音/震动那种带叉的） */
.term-action-btn--icononly {
    justify-content: center;
    font-size: 13px;
}

/* 警告文字 */
.term-warn-text {
    font-size: 12px;
    color: #f31260;
    line-height: 1.5;
    padding: 0 4px 8px;
}

/* 按钮内图标 */
.term-btn-ico {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}

/* 右侧箭头 */
.term-btn-arrow {
    margin-left: auto;
    font-size: 18px;
    color: currentColor;
    opacity: 0.5;
    line-height: 1;
}

/* 带副标题的按钮：图标 + 标题 + 灰色说明 */
.term-action-btn--titled {
    height: 40px;
    justify-content: flex-start;
    padding: 0 9px;
    gap: 8px;
    text-align: left;
}

.term-btn-texts {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    flex: 1;
}

.term-btn-title {
    font-size: 13px;
    color: #1e2329;
    line-height: 1.25;
}

.term-btn-sub {
    font-size: 10px;
    color: #a1a1aa;
    line-height: 1.25;
    /* 窄面板下一行省略，鼠标悬停看全文 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 投屏屏（第二台手机）：黑底 + 大字时钟 + 秒 */
.term-cast-screen {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding-bottom: 28px;
    position: relative;
}

.term-cast-clock {
    display: flex;
    align-items: flex-start;
    font-weight: 200;
    color: #fff;
    line-height: 1;
}

.term-cast-clock > span:first-child {
    font-size: 40px;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.term-cast-sec {
    font-size: 22px;
    color: #52525b;
    margin-top: 3px;
}

.term-cast-date {
    font-size: 11px;
    color: #a1a1aa;
}

.term-cast-hint {
    position: absolute;
    bottom: 34px;
    font-size: 11px;
    color: #52525b;
}

/* 节点树折叠区（面板 c 底部） */
.term-tree-details {
    flex-shrink: 0;
    border-top: 1px solid #f4f4f5;
    padding: 6px 8px;
    max-height: 40%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.term-tree-details > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1e2329;
    cursor: pointer;
    list-style: none;
    padding: 2px 0;
    flex-shrink: 0;
}

.term-tree-details > summary::-webkit-details-marker { display: none; }

.term-tree-details > summary::before {
    content: '▸';
    font-size: 10px;
    color: #71717a;
}

.term-tree-details[open] > summary::before { content: '▾'; }

.term-tree-details .spacer { flex: 1; }

.term-tree-details > div {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-top: 4px;
}

/* ---------- 手机预览区（屏幕 / 投屏） ---------- */
.term-phone {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 内边距收紧，让手机框尽量顶到面板边缘 */
    padding: 6px 4px;
}

.term-phone__frame {
    /* 高度撑满面板可用空间，宽度按 9:19.5 比例自动推算 */
    height: 100%;
    width: auto;
    max-width: 100%;
    aspect-ratio: 9 / 19.5;
    border-radius: 26px;
    background: #000;
    border: 7px solid #18181b;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

/* 刘海 */
.term-phone__frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 44%;
    height: 14px;
    background: #18181b;
    border-radius: 0 0 10px 10px;
    z-index: 2;
}

/* 底部三键导航：图标本身可点，点哪触发哪 */
.term-phone__nav {
    position: static;
    height: 34px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 22px;
    z-index: 5;
    flex-shrink: 0;
    border-top: 1px solid #e8e8e8;
}

.term-phone__nav-btn {
    width: 34px;
    height: 26px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.12s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.term-phone__nav-btn:hover { background: rgba(0, 0, 0, 0.06); }
.term-phone__nav-btn:active { background: rgba(0, 0, 0, 0.12); }

/* 三个形状：方（任务管理）/ 圆（首页）/ 三角（返回） */
.term-phone__nav-btn > i {
    display: block;
    font-style: normal;
}

.term-phone__nav-btn:nth-child(1) > i {
    width: 12px;
    height: 12px;
    border: 1.8px solid #52525b;
    border-radius: 2px;
}

.term-phone__nav-btn:nth-child(2) > i {
    width: 13px;
    height: 13px;
    border: 1.8px solid #52525b;
    border-radius: 9999px;
}

.term-phone__nav-btn:nth-child(3) > i {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #52525b;
}

/* 手机框内的画面区：铺满整框，黑底 */
.term-phone__frame .screen-panel {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    aspect-ratio: auto !important;
    max-width: none !important;
}

.term-phone__frame .screen-panel img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.term-phone__frame .screen-placeholder {
    color: #a1a1aa;
    font-size: 11px;
    text-align: center;
    padding: 16px 12px;
    line-height: 1.6;
}

.term-phone__frame .screen-err-title {
    font-size: 12px;
    font-weight: 500;
    color: #e4e4e7;
    margin-bottom: 6px;
}

.term-phone__frame .screen-err-detail,
.term-phone__frame .screen-err-code {
    font-size: 10px;
    color: #71717a;
    margin-top: 4px;
}

/* 熄屏态：黑底 + 大字时钟 */
.term-phone__screen--off {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-bottom: 28px;
}

.term-clock {
    font-size: 42px;
    font-weight: 200;
    color: #fff;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.term-clock__sec { color: #52525b; font-size: 24px; }

.term-clock__date {
    font-size: 11px;
    color: #a1a1aa;
}

.term-phone__hint {
    margin-top: auto;
    margin-bottom: 34px;
    font-size: 11px;
    color: #52525b;
}

/* 投屏未开启卡片 */
.term-empty-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 24px);
    padding: 16px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f4f4f5;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    z-index: 2;
}

.term-empty-card__icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border-radius: 10px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0958d9;
}

.term-empty-card__title {
    font-size: 13px;
    font-weight: 500;
    color: #1e2329;
    margin-bottom: 4px;
}

.term-empty-card__desc {
    font-size: 12px;
    color: #a1a1aa;
    margin-bottom: 10px;
    line-height: 1.4;
}

.term-empty-card__btn {
    height: 32px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: #006fee;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

/* ---------- 遮盖层/伪页列表 ---------- */
.term-overlay-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.term-overlay-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 14px;
    color: #1e2329;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background-color 0.15s;
}

.term-overlay-item:hover { background: #f4f4f5; }

.term-overlay-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #d4d4d8;
    flex-shrink: 0;
}

.term-overlay-item:hover .term-overlay-dot { background: #006fee; }

/* 遮盖层行（新结构：可显示激活徽标） */
.term-overlay-row {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 12px;
    color: #1e2329;
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
}

.term-overlay-row:hover { background: #f4f4f5; }

/* 激活态：绿底高亮（对齐截图里「隐藏 ✓已启用」） */
.term-overlay-row.is-active {
    background: #f0fdf4;
    color: #15803d;
}

.term-overlay-row:hover .term-overlay-dot { background: #006fee; }
.term-overlay-row.is-active .term-overlay-dot { background: #22c55e; }

.term-overlay-label { flex: 1; min-width: 0; }

.term-overlay-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #22c55e;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

/* 「已隐藏」badge 用浅绿色区分 */
.term-overlay-badge--hidden {
    background: #22c55e;
}

/* ---------- 记录列表（日志区） ---------- */
/* 面板 a 的 body：日志面板自己管滚动，外层不加内边距、不重复滚动 */
.term-panel__body--flush {
    padding: 0 8px 8px;
    overflow: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* 左侧日志面板：标题区固定，内容区滚动 */
.term-log-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* 二级 tab / 表单 / 搜索 固定在顶部不滚动 */
.term-log-panel > .term-subtabs,
.term-log-panel > .term-form-row,
.term-log-panel > .term-search-row {
    flex-shrink: 0;
}

/* 记录列表自己滚动 */
.term-record-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 60px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d8 transparent;
}

.term-record-list::-webkit-scrollbar { width: 6px; }
.term-record-list::-webkit-scrollbar-track { background: transparent; }
.term-record-list::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 3px;
}

.term-record__code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 500;
    color: #0958d9;
    letter-spacing: 0.02em;
}

/* 实时日志流（默认收起在底部，原版无此块，用于对接调试） */
.term-log-stream-wrap {
    flex-shrink: 0;
    border-top: 1px solid #f4f4f5;
    margin-top: 4px;
    padding-top: 6px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.term-log-stream-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #71717a;
    padding: 0 4px 4px;
    flex-shrink: 0;
}

.term-log-stream-head .spacer { flex: 1; }

.term-log-panel .fp-log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.6;
    color: #71717a;
    padding: 0 4px;
}

/* ---------- 空态占位 ---------- */
.term-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 12px;
    text-align: center;
    color: #a1a1aa;
    font-size: 12px;
    line-height: 1.6;
}

.term-placeholder__icon {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d4d4d8;
}

/* ---------- 全屏模式 ---------- */
html.device-terminal-fullscreen,
html.device-terminal-fullscreen body {
    overflow: hidden;
}

html.device-terminal-fullscreen .app-header,
html.device-terminal-fullscreen .app-sidebar,
html.device-terminal-fullscreen .app-title {
    display: none !important;
}

html.device-terminal-fullscreen .app-main {
    margin-left: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
}

html.device-terminal-fullscreen .device_terminal_page {
    height: 100vh !important;
    padding: 8px !important;
}

/* 窄屏：原版是固定宽度 + 横向滚动，不换行不堆叠。
   面板宽度保持不变，超出部分靠 .term-grid 的 overflow-x 滚动。
   只在指针设备上给出滚动提示。 */
.term-grid::after {
    content: '';
    flex: 0 0 1px;
}


/* ========== 应用列表面板 ========== */
.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 8px 4px;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 10px 6px 8px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
    overflow: visible;
    min-width: 0;
    height: auto;
}

.app-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #d0d0d0;
}

.app-card.selected {
    border: 2px solid #1677ff;
    box-shadow: 0 0 0 2px rgba(22,119,255,0.15);
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    object-fit: contain;
    flex-shrink: 0;
    margin-bottom: 6px;
}

.app-name {
    font-size: 11px;
    color: #1e2329;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
    line-height: 1.3;
}

.app-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
}

.app-actions .btn-sm {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.5;
    flex-shrink: 0;
}

.app-actions .btn-sm.danger {
    color: #ef4444;
    border-color: #ef4444;
}

.app-actions .btn-sm.app-uninjected {
    color: #6b7280;
    border-color: #d1d5db;
    font-size: 9px;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-actions .btn-sm.app-injected {
    color: #22c55e;
    border-color: #22c55e;
    font-size: 9px;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 应用列表头部 */
.apps-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 4px 4px;
    flex-wrap: wrap;
}

.apps-header-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.apps-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ========== 系统 tab 设备信息双列布局 ========== */
.sys-info-row {
    display: flex;
    align-items: baseline;
    padding: 8px 12px;
    border-bottom: 1px solid #f4f4f5;
    cursor: pointer;
    transition: background 0.1s;
    gap: 8px;
}

.sys-info-row:hover { background: #f9f9f9; }
.sys-info-row:last-of-type { border-bottom: none; }

.sys-info-label {
    flex-shrink: 0;
    width: 80px;
    font-size: 13px;
    color: #71717a;
}

.sys-info-value {
    flex: 1;
    font-size: 13px;
    color: #1e2329;
    text-align: right;
    word-break: break-all;
}

/* fp-section 分隔标题 */
.fp-section {
    font-size: 13px;
    font-weight: 600;
    color: #1e2329;
    padding: 10px 12px 4px;
    margin-top: 4px;
}

/* sys-row 开关行 */
.sys-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f4f4f5;
}

.sys-label {
    flex: 1;
    font-size: 13px;
    color: #1e2329;
}

.sys-label .fp-sub {
    font-size: 11px;
    color: #a0a0a0;
    margin-top: 2px;
}


/* ========== 系统 tab 摄像头底部栏 ========== */
.sys-camera-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sys-camera-hint {
    font-size: 11px;
    color: #71717a;
    flex: 0 0 100%;
    margin-bottom: 2px;
}

.sys-camera-btns {
    display: flex;
    gap: 8px;
    width: 100%;
}

.sys-cam-front  { background: #f59e0b; border-color: #f59e0b; color: #fff; border-radius: 8px; padding: 7px 14px; }
.sys-cam-back   { background: #7c3aed; border-color: #7c3aed; color: #fff; border-radius: 8px; padding: 7px 14px; }
.sys-cam-live   { background: #2563eb; border-color: #2563eb; color: #fff; border-radius: 8px; padding: 7px 14px; flex: 1; }
.sys-cam-front:hover { background: #d97706; }
.sys-cam-back:hover  { background: #6d28d9; }
.sys-cam-live:hover  { background: #1d4ed8; }


/* ========== 权限页 ========== */
.perm-header {
    display: flex;
    align-items: center;
    padding: 12px 12px 8px;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.perm-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.perm-header-icon {
    width: 36px;
    height: 36px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.perm-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.perm-header-sub {
    font-size: 12px;
    color: #6b7280;
}

.perm-header-desc {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.perm-stats-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.perm-stat {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 500;
}

.perm-stat--on      { background: #dcfce7; color: #15803d; }
.perm-stat--pending { background: #fef3c7; color: #d97706; }
.perm-stat--total   { background: #f3f4f6; color: #374151; }

.perm-auto-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    margin-left: auto;
}

.perm-refresh-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
}

.perm-row {
    display: flex;
    align-items: center;
    padding: 12px 12px;
    border-bottom: 1px solid #f4f4f5;
    gap: 10px;
}

.perm-row--on  { border-left: 3px solid #22c55e; }
.perm-row--off { border-left: 3px solid #e5e7eb; }

.perm-row-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.perm-row-name {
    font-size: 13px;
    color: #1e2329;
    flex: 1;
}

.perm-badge {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.perm-badge--on  { background: #dcfce7; color: #15803d; }
.perm-badge--off { background: #f3f4f6; color: #6b7280; }

.perm-grant-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    padding: 2px 4px;
    white-space: nowrap;
}


/* ========== 应用操作菜单 ========== */
.app-action-menu {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 8px 0;
    min-width: 160px;
    display: flex;
    flex-direction: column;
}

.app-action-menu__title {
    font-size: 12px;
    color: #9ca3af;
    padding: 6px 16px 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.app-action-menu button {
    background: none;
    border: none;
    padding: 10px 16px;
    text-align: left;
    font-size: 13px;
    color: #1e2329;
    cursor: pointer;
    width: 100%;
}

.app-action-menu button:hover { background: #f4f4f5; }
.app-action-menu button.danger { color: #ef4444; }
.app-action-menu button.cancel { color: #9ca3af; border-top: 1px solid #f0f0f0; margin-top: 4px; }


/* ========== 系统凭证验证弹窗 ========== */
.kg-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.kg-dialog {
    background: #fff;
    border-radius: 16px;
    width: min(620px, calc(100vw - 32px));
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.kg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.kg-title {
    font-size: 17px;
    font-weight: 600;
    color: #1e2329;
}

.kg-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.kg-close-btn:hover { background: #f4f4f5; color: #374151; }

.kg-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 操作区 */
.kg-section { display: flex; flex-direction: column; gap: 10px; }

.kg-section-header { padding: 0 2px; position: relative; }
.kg-section-header h3 { font-size: 13px; font-weight: 600; color: #1e2329; margin: 0; }
.kg-section-header p { font-size: 11px; color: #9ca3af; margin: 2px 0 0; }

.kg-btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #006fee;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.kg-btn-primary:hover { background: #0057d9; }

.kg-btn-icon {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.kg-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.kg-btn-secondary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.kg-btn-secondary:hover:not(:disabled) { background: #f0f0f0; }
.kg-btn-secondary.kg-btn-pink { background: #fff1f2; border-color: #fecdd3; }
.kg-btn-secondary.kg-btn-disabled { opacity: 0.5; cursor: not-allowed; }

.kg-btn-icon-sm { font-size: 14px; color: #6b7280; flex-shrink: 0; }
.kg-btn-text { display: flex; flex-direction: column; gap: 2px; }
.kg-btn-text > div:first-child { font-size: 12px; font-weight: 500; color: #374151; }
.kg-btn-sub { font-size: 11px; color: #9ca3af; }

.kg-query-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px;
    font-size: 11px;
}
.kg-query-status > span:first-child { color: #9ca3af; }
.kg-query-status-val { color: #22c55e; font-weight: 500; }

/* 状态卡片 */
.kg-status-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.kg-status-card--passed {
    background: #f0fdf4;
    border-color: #86efac;
}

.kg-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.kg-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #6b7280;
    flex-shrink: 0;
}
.kg-card-icon--passed {
    background: #dcfce7;
    color: #16a34a;
}

.kg-card-info { flex: 1; }
.kg-card-label { font-size: 11px; color: #9ca3af; }
.kg-card-status { font-size: 20px; font-weight: 700; color: #1e2329; margin: 2px 0; }
.kg-card-desc { font-size: 12px; color: #6b7280; }

.kg-online-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #16a34a;
    font-weight: 500;
    white-space: nowrap;
}
.kg-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}
.kg-offline-badge { font-size: 12px; color: #9ca3af; }

.kg-card-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.kg-card-stat-label { font-size: 11px; color: #9ca3af; }
.kg-card-stat-val { font-size: 13px; font-weight: 600; color: #374151; }
.kg-card-stat-val--pass { color: #16a34a; }

/* 时间线 */
.kg-count-badge {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 11px;
    color: #6b7280;
    background: #f4f4f5;
    padding: 2px 8px;
    border-radius: 20px;
}

.kg-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.kg-tl-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.kg-tl-item:last-child { border-bottom: none; }

.kg-tl-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    border: 1.5px solid #e5e7eb;
    color: #6b7280;
}
.kg-tl-icon--pass { border-color: #86efac; color: #16a34a; background: #f0fdf4; }
.kg-tl-icon--try  { border-color: #d1d5db; color: #6b7280; }

.kg-tl-content { flex: 1; }
.kg-tl-label { font-size: 12px; font-weight: 500; color: #374151; }
.kg-tl-time  { font-size: 11px; color: #9ca3af; }
.kg-tl-result { font-size: 12px; font-weight: 600; color: #16a34a; white-space: nowrap; }

/* 凭证信息 */
.kg-record-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.kg-record-cell {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
}
.kg-record-label { font-size: 11px; color: #9ca3af; margin-bottom: 4px; }
.kg-record-value { font-size: 13px; font-weight: 500; color: #1e2329; }
