/* TWork 浏览器桥接侧栏 — 浅色主题，与桌面版品牌一致（红→橙渐变 #DC2626→#F97316） */
:root {
  --bg: #ffffff;
  --bg-soft: #f8f9fb;
  --bg-inset: #f3f4f6;
  --fg: #1f2937;
  --muted: #6b7280;
  --accent: #dc2626;
  --accent-2: #f97316;
  --accent-hover: #b91c1c;
  --brand-gradient: linear-gradient(90deg, #dc2626, #f97316);
  --danger: #dc2626;
  --ok: #16a34a;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex;
  flex-direction: column;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 12px;
  color: var(--fg);
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
}

/* ---------- 顶栏（TWork 品牌缩影） ---------- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.topbar-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-row { justify-content: space-between; }
.brand-word {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { color: var(--muted); font-size: 11px; margin-left: 6px; }
.controls-row { flex: 0 0 auto; }
.status-row { flex: 0 0 auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot.ok { background: var(--ok); }
.dot.busy { background: var(--accent-2); animation: pulse 1s infinite; }
.dot.err { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.4; } }
.status-text {
  color: var(--muted); font-size: 12px;
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 按钮 ---------- */
button {
  font: inherit; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  border-radius: 6px; padding: 6px 10px;
}
button:hover:not(:disabled) { background: var(--bg-inset); }
button:disabled { opacity: 0.5; cursor: default; }
.icon-btn { padding: 5px 9px; white-space: nowrap; }
.icon-btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.icon-btn.danger:hover:not(:disabled) { background: var(--accent-hover); }
.primary {
  background: var(--brand-gradient); color: #fff; border: none;
}
.primary:hover:not(:disabled) { background: var(--brand-gradient); filter: brightness(0.94); }
.ghost { background: transparent; }

/* ---------- 视图 ---------- */
.view { display: none; flex-direction: column; flex: 1 1 auto; min-height: 0; position: relative; }
.view.active { display: flex; }

/* ---------- 复制成功提示 / 页内浮层 ---------- */
.omeety-copied-badge {
  position: absolute;
  top: 6px;
  right: 10px;
  background: var(--ok);
  color: #fff;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 20;
}
.omeety-copied-badge.show { opacity: 1; }

/* ---------- ack 门 ---------- */
.ack-gate {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  padding: 20px;
}
.ack-gate[hidden] { display: none; }
.ack-box { max-width: 340px; text-align: center; }
.ack-box h3 { margin: 0 0 8px; }
.ack-box p { color: var(--muted); font-size: 12px; margin: 0 0 16px; line-height: 1.6; }

/* ---------- 设置 ---------- */
.settings-body {
  flex: 1 1 auto; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg);
}
.settings-body h2 { margin: 0 0 4px; font-size: 16px; }
.settings-body label { font-size: 12px; color: var(--muted); margin-top: 12px; margin-bottom: 4px; }
.settings-body input, .settings-body select {
  font: inherit; padding: 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--fg);
}
.settings-body input:focus, .settings-body select:focus { outline: 2px solid var(--accent-2); border-color: var(--accent-2); }
.settings-body input[readonly] { opacity: 0.7; }
.actions-row { display: flex; gap: 8px; margin-top: 18px; }
.actions-row button { flex: 1; }
.settings-body::-webkit-scrollbar { width: 3px; height: 3px; }
.settings-body::-webkit-scrollbar-track { background: transparent; }
.settings-body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 2px; }
.settings-body::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.35); }

/* ---------- 工具列表（设置→已注册工具） ---------- */
#toolsDetails { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
.tools-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.tool-cat { font-size: 11px; color: var(--accent); margin: 10px 0 2px; font-weight: 700; }
.tool-item { margin: 0 0 6px 10px; }
.tool-item code { font-size: 11px; font-weight: 600; }

.help { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
.help summary { cursor: pointer; color: var(--muted); }
.help ol { font-size: 12px; color: var(--muted); line-height: 1.7; padding-left: 18px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
code { background: var(--bg-inset); padding: 0 4px; border-radius: 3px; }

/* ---------- 迷你 TWork 对话框（React 应用挂载区，样式主体在 dist/assets/panel.css） ---------- */
.bridge-info { padding: 8px 10px 0; flex: 0 0 auto; }
.bridge-info p { margin: 0 0 4px; }
.bridge-info ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.chat-section {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 200px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
