/* Hub Web 模拟面板 —— 纯静态 / 无框架 / 零依赖 */
:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232d;
  --border: #2a2f3b;
  --text: #e6e8ed;
  --text-dim: #a0a8b6;
  --text-faint: #6a7080;
  --accent: #6ea8ff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, "SF Pro Text", "PingFang SC", system-ui, sans-serif; }
body { min-height: 100vh; padding: 24px; }

/* 顶部 */
.app { max-width: 1080px; margin: 0 auto; }
.app-header {
  display: flex; align-items: center; gap: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.header-title h1 { font-size: 20px; margin: 0; }
.subtitle { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; }
.header-status { margin-left: auto; color: var(--text-dim); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }

/* Hub 标志：三同心圆 */
.hub-glyph { position: relative; width: 32px; height: 32px; }
.hub-glyph span { position: absolute; border: 1.5px solid var(--accent); border-radius: 50%; }
.hub-glyph span:nth-child(1) { inset: 0; }
.hub-glyph span:nth-child(2) { inset: 7px; }
.hub-glyph span:nth-child(3) { inset: 13px; background: var(--accent); border: none; }

/* 能力位 + 降级提示 */
.capability-bar { padding: 12px 0 14px; }
.cap-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
}
.chip.ok { color: var(--ok); border-color: rgba(74,222,128,0.25); }
.chip.warn { color: var(--warn); border-color: rgba(251,191,36,0.25); }
.degraded-notes { margin-top: 8px; font-size: 12px; color: var(--warn); }
.degraded-notes ul { margin: 0; padding-left: 18px; }

/* 网格 */
.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; margin: 0 0 10px; }
.hint { font-size: 12px; color: var(--text-dim); margin: 0 0 12px; }
.hint.small { font-size: 11px; line-height: 1.5; }

/* 响应式：375px 窄屏单列 */
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  body { padding: 12px; }
}

/* 音频通道 */
.persons { display: flex; flex-direction: column; gap: 12px; }
.person-row {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px;
}
.person-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #0a0c10; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.person-name { font-weight: 600; }
.person-endpoint { font-size: 12px; color: var(--text-dim); margin-left: auto; }
.volume-row { display: flex; align-items: center; gap: 10px; }
.volume-row .val { width: 36px; font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13px; text-align: right; }
.volume-row input[type="range"] {
  flex: 1; accent-color: var(--accent);
}
.volume-row .mute { font-size: 11px; color: var(--text-faint); cursor: pointer; }

/* Agent 状态 */
.agent-status { min-height: 80px; display: flex; flex-direction: column; gap: 8px; }
.agent-waiting { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 13px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.agent-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; font-size: 13px;
}
.agent-item .title { font-weight: 600; }
.agent-item .meta { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

/* 按钮 */
.btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: #272c38; }
.btn:active { transform: scale(0.98); }
.btn-ok { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.4); color: var(--ok); }
.btn-ok:hover { background: rgba(74,222,128,0.25); }
.btn-danger { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.4); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,0.22); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); margin-top: 10px; width: 100%; }

/* 审批卡片 */
.approval-card .approval-meta {
  display: flex; gap: 10px; margin-bottom: 8px; align-items: center;
}
.agent-tag {
  background: var(--accent); color: #0a0c10; font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.approval-expiry { font-size: 12px; color: var(--warn); font-variant-numeric: tabular-nums; margin-left: auto; }
.approval-expiry.soon { color: var(--danger); }
.approval-prompt {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; line-height: 1.5;
}
.approval-actions { display: flex; gap: 10px; }
.hold-indicator {
  position: absolute; left: 0; top: 0; height: 100%; width: 0;
  background: rgba(74,222,128,0.4); border-radius: 7px 0 0 7px; transition: width 0.8s linear;
}
.btn-ok { position: relative; overflow: hidden; flex: 1; display: flex; justify-content: center; align-items: center; }
.btn-danger { flex: 1; }
.btn-ok.holding .hold-indicator { width: 100%; }

/* 腕上小屏 */
.watch-face {
  background: #0a0c10; border: 2px solid var(--border); border-radius: 22px;
  width: 160px; height: 200px; margin: 6px auto 14px; padding: 14px 12px;
  font-family: "SF Mono", ui-monospace, monospace; position: relative;
  box-shadow: inset 0 0 12px rgba(110,168,255,0.1);
}
.wf-line { font-size: 12px; line-height: 1.5; }
.wf-line.mono { font-family: "SF Mono", ui-monospace, monospace; font-size: 10px; color: var(--text-faint); }
.wf-status {
  margin-top: 14px; font-size: 11px; color: var(--warn);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.wf-title { margin-top: 6px; font-size: 13px; color: var(--text); font-weight: 600; }
.wf-actions { display: flex; gap: 8px; margin-top: 12px; }
.wf-btn {
  flex: 1; text-align: center; padding: 6px 0; border-radius: 6px; font-size: 11px;
  background: rgba(74,222,128,0.2); border: 1px solid rgba(74,222,128,0.5);
  color: var(--ok); cursor: pointer; user-select: none;
}
.wf-btn.reject {
  background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.5);
  color: var(--danger);
}
.wf-result {
  margin-top: 12px; text-align: center; padding: 6px 0; border-radius: 6px;
  font-size: 11px; background: rgba(74,222,128,0.15);
  border: 1px solid rgba(74,222,128,0.4); color: var(--ok);
}
.wf-line:first-of-type { margin-top: 14px; }
.wf-badge {
  position: absolute; top: 6px; right: 10px; color: var(--warn); font-weight: 700;
}
.wf-btn {
  position: absolute; bottom: 14px; left: 14px; right: 14px;
  background: rgba(74,222,128,0.2); border: 1px solid rgba(74,222,128,0.5);
  color: var(--ok); text-align: center; padding: 6px; border-radius: 6px; font-size: 11px;
}
.watch-transport label { font-size: 12px; color: var(--text-dim); display: block; margin-bottom: 6px; }
.watch-transport select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; font-size: 13px; width: 100%;
}
.watch-status { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* 底部 */
.app-footer {
  display: flex; gap: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  margin-top: 18px; font-size: 12px; color: var(--text-faint);
}
