/* ============================================================
   LIMI v2 · 组件层：按钮 / 表单 / 卡片 / 专家卡 / 聊天 /
   房源卡 / 匹配 / 来源 / 抽屉 / 弹窗 / 提示
   ============================================================ */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-sm); letter-spacing: 0.06em;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: var(--green); border-color: var(--green);
  color: #f3e9d7;
}
.btn-primary:hover { background: var(--green-2); border-color: var(--green-2); color: #f8f2e6; }
.btn-gold {
  background: var(--gold); border-color: var(--gold); color: #fff;
}
.btn-gold:hover { background: #997a52; border-color: #997a52; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--gold); border-color: transparent; background: transparent; }
.btn-outline-gold { border-color: var(--gold-2); color: var(--gold); background: transparent; }
.btn-outline-gold:hover { background: var(--gold-soft); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 12px; font-size: var(--fs-xs); }
.btn-lg { height: 44px; padding: 0 26px; font-size: var(--fs-md); letter-spacing: 0.12em; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-sm); color: var(--ink);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: 12px; resize: vertical; line-height: 1.8; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(169, 134, 91, 0.1);
}
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8377' stroke-width='1.8'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field-row { display: flex; gap: 10px; }
.field-row .input { flex: 1; }
.field-row .dash { color: var(--muted); align-self: center; font-size: 12px; }

.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); }
.search .input { padding-left: 36px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: var(--fs-sm); }
.switch input { display: none; }
.switch .track { width: 34px; height: 18px; background: #d9d0bf; position: relative; transition: background var(--dur) var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; transition: transform var(--dur) var(--ease); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); background: var(--surface); }
.seg button {
  border: 0; background: none; padding: 6px 14px;
  font-size: var(--fs-xs); letter-spacing: 0.08em; color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--green); color: #f3e9d7; }

/* ---------- 标签 / 筛选片 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: var(--fs-xs); letter-spacing: 0.04em; color: var(--ink-2);
  user-select: none; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--gold-2); color: var(--gold); }
.chip.on { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.chip small { font-size: 10px; color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-2xs); line-height: 1.6; letter-spacing: 0.06em;
  padding: 1px 7px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.tag.gold { border-color: var(--gold-2); color: var(--gold); background: transparent; }
.tag.green { border-color: #b9cdc2; color: var(--ok); background: #eef4ef; }
.tag.warn { border-color: #e0cba4; color: var(--warn); background: #fbf3e2; }
.tag.dark { background: var(--green); border-color: var(--green); color: #eee4d2; }
.tag.plain { background: transparent; }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.card-pad { padding: var(--sp-6); }
.card-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.08em; }
.card-head .grow { flex: 1; }
.card-body { padding: var(--sp-5) var(--sp-6); }

/* 统计卡 */
.stat { padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: 4px; }
.stat .stat-label { font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stat .stat-value { font-family: var(--font-num); font-size: 30px; line-height: 1.2; letter-spacing: 0.02em; }
.stat .stat-value small { font-family: var(--font-ui); font-size: var(--fs-xs); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .stat-foot { font-size: var(--fs-2xs); color: var(--muted); letter-spacing: 0.04em; }

/* ---------- 专家卡 ---------- */
.expert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.expert-card {
  display: flex; gap: 14px;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer; text-align: left;
  transition: all var(--dur) var(--ease);
}
.expert-card:hover { border-color: var(--gold-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.expert-card.active { border-color: var(--gold); background: var(--surface-2); }
.expert-mark {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
}
.expert-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.expert-body b { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.06em; }
.expert-body .ex-spec { font-size: var(--fs-2xs); color: var(--gold); letter-spacing: 0.1em; }
.expert-body .ex-desc { font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; margin-top: 3px; }
.expert-mini { display: flex; align-items: center; gap: 10px; padding: 9px 10px; cursor: pointer; }
.expert-mini:hover { background: var(--surface-2); }
.expert-mini .expert-mark { width: 30px; height: 30px; font-size: 13px; }
.expert-mini b { font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0.04em; }
.expert-mini span { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; }

/* ---------- 回答（聊天） ---------- */
.chat-layout {
  display: grid; grid-template-columns: 264px minmax(0, 1fr) 312px;
  gap: var(--sp-4);
  height: calc(100vh - var(--topbar-h) - var(--sp-6) - var(--sp-6));
  min-height: 560px;
}
.panel { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-head { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; }
.panel-head h3 { font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.12em; }
.panel-head .grow { flex: 1; }
.panel-body { flex: 1; overflow: auto; }

.session-list { padding: var(--sp-2); }
.session {
  padding: 12px; cursor: pointer; border-left: 2px solid transparent;
  display: flex; flex-direction: column; gap: 2px;
  transition: background var(--dur) var(--ease);
}
.session:hover { background: var(--surface-2); }
.session.on { border-left-color: var(--gold); background: var(--surface-2); }
.session b { font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session span { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-top {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line-2);
}
.chat-top-row1 { display: flex; align-items: center; gap: 10px; }
.chat-top-row2 { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.chat-top .grow { flex: 1; min-width: 0; }
.chat-top .ct-title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.06em; }
.chat-top .ct-sub { font-size: var(--fs-2xs); color: var(--muted); letter-spacing: 0.06em; }
.participants { display: flex; align-items: center; }
.p-chip {
  width: 28px; height: 28px; margin-left: -6px;
  display: grid; place-items: center;
  border: 1px solid var(--gold-2);
  background: var(--surface-2);
  color: var(--gold); font-family: var(--font-display); font-size: 12px;
  position: relative;
}
.p-chip:first-child { margin-left: 0; }
.p-chip.me { background: var(--green); color: var(--gold-2); }
.p-chip.ai::after {
  content: "AI"; position: absolute; bottom: -4px; right: -4px;
  font-family: var(--font-ui); font-size: 7px; letter-spacing: 0;
  background: var(--gold); color: #fff; padding: 0 2px; line-height: 10px;
}
.p-add { width: 28px; height: 28px; margin-left: -6px; display: grid; place-items: center; border: 1px dashed var(--line); color: var(--muted); background: var(--surface); }
.p-add:hover { border-color: var(--gold); color: var(--gold); }

.chat-scroll { flex: 1; overflow: auto; padding: var(--sp-6) var(--sp-7, 28px); background: var(--surface); }
.msg { margin-bottom: var(--sp-6); }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user .bubble {
  max-width: 78%;
  background: var(--green); color: #f4efe5;
  padding: 12px 16px; font-size: var(--fs-sm); line-height: 1.85;
  border-radius: var(--r-sm) 0 var(--r-sm) var(--r-sm);
  white-space: pre-wrap;
}
.msg-user .m-meta { text-align: right; font-size: 10px; color: var(--muted-2); margin-top: 6px; letter-spacing: 0.08em; }

.answer { display: flex; gap: 14px; }
.answer-mark {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--gold-2);
  background: var(--surface-2);
  color: var(--gold);
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
}
.answer-main { flex: 1; min-width: 0; }
.answer-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.answer-head b { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.08em; }
.answer-head .role { font-size: 10px; letter-spacing: 0.12em; color: var(--gold); border: 1px solid var(--gold-2); padding: 0 5px; }
.answer-head .time { font-size: 10px; color: var(--muted-2); letter-spacing: 0.06em; }
.answer-body { font-size: var(--fs-md); line-height: 1.95; color: var(--ink-2); white-space: pre-wrap; }
.answer-body strong { color: var(--ink); font-weight: 600; }
.answer-body .conclusion {
  font-family: var(--font-display);
  font-size: var(--fs-lg); color: var(--ink); letter-spacing: 0.03em;
  padding-left: 14px; border-left: 2px solid var(--gold);
  margin-bottom: 12px; line-height: 1.7;
}
.answer-body p + p { margin-top: 10px; }
.answer-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.answer-actions .hint { margin-left: auto; }
.answer-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- 房源卡 ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin-top: 14px; }
.house-card {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  padding: var(--sp-4);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  display: flex; flex-direction: column; gap: 6px;
}
.house-card:hover { border-color: var(--gold-2); background: var(--surface); box-shadow: var(--shadow-2); }
.house-card .hc-top { display: flex; align-items: flex-start; gap: 8px; }
.house-card .hc-name { flex: 1; min-width: 0; }
.house-card .hc-name b { display: block; font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.house-card .hc-name span { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }
.house-card .hc-price { text-align: right; }
.house-card .hc-price b { display: block; font-family: var(--font-num); font-size: 20px; color: var(--ink); line-height: 1.1; }
.house-card .hc-price span { font-size: 10px; color: var(--muted); }
.house-card .hc-meta { font-size: var(--fs-xs); color: var(--ink-2); letter-spacing: 0.02em; }
.house-card .hc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.house-card .hc-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 10px; color: var(--muted); }
.house-card .hc-foot .cut { color: var(--ok); }

/* 匹配分 */
.score {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--v, 80) * 1%), var(--line-2) 0);
  display: grid; place-items: center; position: relative;
}
.score::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.score b { position: relative; font-family: var(--font-num); font-size: 13px; color: var(--gold); }
.score small { position: relative; font-size: 7px; color: var(--muted); }

/* ---------- 来源 ---------- */
.source-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: 0.04em; color: var(--muted);
  border: 1px solid var(--line); padding: 2px 8px; background: var(--surface);
}
.source-chip i { width: 4px; height: 4px; background: var(--gold); }
.source-item { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.source-item:last-child { border-bottom: 0; }
.source-item .st { font-size: var(--fs-xs); color: var(--ink-2); }
.source-item .sd { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.6; }

/* ---------- 空状态 ---------- */
.empty { padding: 42px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 30px; height: 30px; margin: 0 auto 10px; opacity: 0.5; }
.empty p { font-size: var(--fs-sm); letter-spacing: 0.04em; }

/* ---------- 抽屉 / 弹窗 / 提示 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 35, 28, 0.36); z-index: 70; opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 94vw);
  background: var(--bg); z-index: 80; transform: translateX(102%);
  transition: transform 220ms var(--ease); display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
}
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: var(--sp-5); border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-head h3 { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; letter-spacing: 0.08em; }
.drawer-head .grow { flex: 1; }
.drawer-body { flex: 1; overflow: auto; padding: var(--sp-5); }
.drawer-foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px; }
.drawer-foot .btn { flex: 1; }

.modal {
  position: fixed; left: 50%; top: 50%;
  width: min(560px, 94vw); max-height: 86vh; overflow: auto;
  background: var(--surface); z-index: 90;
  transform: translate(-50%, -48%) scale(0.98); opacity: 0; pointer-events: none;
  transition: all 220ms var(--ease);
  box-shadow: var(--shadow-3);
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { padding: var(--sp-6) var(--sp-6) var(--sp-2); }
.modal-head h3 { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; letter-spacing: 0.08em; }
.modal-body { padding: var(--sp-3) var(--sp-6) var(--sp-5); }
.modal-foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }

.toast-wrap { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--green); color: #f3e9d7;
  font-size: var(--fs-sm); letter-spacing: 0.06em;
  padding: 10px 18px; border: 1px solid rgba(199, 169, 124, 0.35);
  box-shadow: var(--shadow-3); opacity: 0; transform: translateY(8px);
  transition: all 200ms var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.gold { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ---------- 上传 ---------- */
.dropzone {
  border: 1px dashed var(--gold-2);
  background: var(--surface-2);
  padding: 24px; text-align: center; color: var(--muted);
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.dropzone:hover { background: var(--gold-soft); color: var(--ink-2); }
.dropzone b { display: block; font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: 4px; letter-spacing: 0.06em; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
  text-align: left; padding: 11px 14px;
  font-size: var(--fs-2xs); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--sp-5); }
.tab {
  border: 0; background: none; padding: 11px 18px;
  font-size: var(--fs-sm); letter-spacing: 0.08em; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- 进度 ---------- */
.progress { height: 4px; background: var(--line-2); flex: 1; }
.progress i { display: block; height: 100%; background: var(--gold); }

/* ============================================================
   正式前端补充组件（v1）：去内联样式后的通用件
   ============================================================ */

/* 匹配分环：SVG 画环（动态值走 SVG 属性，不写内联样式） */
.score { position: relative; background: none; }
.score svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.score circle { fill: none; stroke-width: 4; }
.score .score-track { stroke: var(--line-2); }
.score .score-fill { stroke: var(--gold); stroke-linecap: round; }
.score b { position: relative; display: block; }
.score small { position: relative; display: block; }
.score-mini { color: var(--gold); font-size: var(--fs-2xs); white-space: nowrap; }

button.chip { font-family: inherit; }

/* 原生进度条（替代内联 width） */
progress.progress { appearance: none; -webkit-appearance: none; border: 0; background: var(--line-2); height: 4px; flex: 1; }
progress.progress::-webkit-progress-bar { background: var(--line-2); }
progress.progress::-webkit-progress-value { background: var(--gold); }
progress.progress::-moz-progress-bar { background: var(--gold); }

/* 空内容占位 / 加载骨架 */
.skeleton { background: var(--bg-soft-2); border-radius: var(--r-sm); height: 14px; animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.loading-line { display: flex; flex-direction: column; gap: 10px; padding: var(--sp-5) 0; }
.loading-line .skeleton:nth-child(2) { width: 80%; }
.loading-line .skeleton:nth-child(3) { width: 62%; }

/* 提示条 */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); font-size: var(--fs-xs); color: var(--muted); line-height: 1.8; }
.notice.accent { border-color: var(--gold-2); background: var(--gold-soft); color: var(--ink-2); }
.notice svg { width: 15px; height: 15px; margin-top: 2px; flex: none; color: var(--accent); }

/* 表单 / 表格补充 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.table-actions { text-align: right; white-space: nowrap; }
.table-actions .btn + .btn { margin-left: 4px; }
.table .num { font-family: var(--font-num); }

/* 上传区里的原生文件框隐藏（点击 dropzone 触发） */
.dropzone input[type="file"] { display: none; }

/* 聊天流里的系统消息（邀请专家等协作反馈） */
.msg-system { display: flex; justify-content: center; margin-bottom: var(--sp-4); }
.msg-system span { font-size: var(--fs-2xs); color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 3px 12px; letter-spacing: 0.04em; }

/* 检查清单 / 键值行 */
.kv { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: var(--fs-sm); }
.kv:last-child { border-bottom: 0; }
.kv .kv-k { width: 96px; flex: none; color: var(--muted); font-size: var(--fs-xs); }
.kv .kv-v { flex: 1; min-width: 0; }

/* 只读横条 */
.readonly-strip { font-size: var(--fs-2xs); color: var(--muted); letter-spacing: 0.06em; }

/* Agent 接入 */
.agent-code { background: #0b1220; color: #dbeafe; border-radius: var(--r-sm); padding: 14px 16px; overflow-x: auto; font: 12px/1.7 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }

/* Agent 一键接入 */
.agent-onboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.agent-onboard-card { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.agent-onboard-card:hover { border-color: var(--accent); box-shadow: var(--shadow-1); }
.agent-onboard-card b { display: block; font-size: var(--fs-sm); color: var(--ink); }
.agent-onboard-card span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
@media (max-width: 900px) { .agent-onboard-grid { grid-template-columns: 1fr; } }

/* Agent 接入：默认简洁，高级折叠 */
.agent-advanced { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.agent-advanced > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--muted); list-style: none; }
.agent-advanced > summary::-webkit-details-marker { display: none; }
.agent-advanced > summary::before { content: "＋ "; color: var(--accent); }
.agent-advanced[open] > summary::before { content: "－ "; }
.agent-adv-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.agent-adv-body h4 { margin: 18px 0 6px; font-size: var(--fs-sm); }

/* 右侧 Agent 对话面板 */
.agent-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: var(--fs-xs); cursor: pointer; white-space: nowrap; }
.agent-toggle:hover { border-color: var(--accent); color: var(--accent); }
.agent-toggle svg { width: 14px; height: 14px; }
.agent-drawer { position: fixed; top: var(--topbar-h, 64px); right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 36px rgba(15,23,42,.10); z-index: 80; transform: translateX(102%); transition: transform .22s ease; display: flex; flex-direction: column; }
.agent-drawer.open { transform: translateX(0); }
.agent-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.agent-drawer-head .icon-btn { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.agent-drawer-body { flex: 1; min-height: 0; overflow: hidden; }
.agent-drawer .agent-page { height: 100%; min-height: 0; padding: 0; }
.agent-drawer .agent-panel { height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.agent-drawer .agent-msgs { padding: 16px; }
.m-agent { border: 0; background: transparent; color: var(--ink); padding: 4px; cursor: pointer; display: inline-flex; }
.m-agent svg { width: 19px; height: 19px; }
@media (max-width: 900px) {
  .agent-toggle { display: none; }
  .agent-drawer { top: var(--mobile-topbar-h, 56px); bottom: var(--mobile-tab-h, 60px); width: 100vw; }
}

/* Agent 面板：可拖动宽度 + 推开主界面（丝滑） */
:root { --agent-w: 420px; }
.main { transition: margin-right .28s cubic-bezier(.22,.8,.2,1); }
.agent-drawer { width: var(--agent-w); pointer-events: none; transition: transform .28s cubic-bezier(.22,.8,.2,1); will-change: transform; }
.agent-drawer.open { pointer-events: auto; }
.agent-resizer { display: none; position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; }
.agent-drawer.open .agent-resizer { display: block; }
.agent-resizer::after { content: ""; position: absolute; left: 3px; top: 50%; width: 1px; height: 46px; transform: translateY(-50%); background: var(--line); }
.agent-resizer:hover::after { background: var(--accent); height: 72px; }
body.agent-panel-open .main { margin-right: var(--agent-w); }
body.agent-resizing { cursor: col-resize; user-select: none; }
body.agent-resizing .agent-drawer, body.agent-resizing .main { transition: none; }
body.agent-panel-open .agent-toggle { border-color: var(--accent); color: var(--accent); background: var(--accent-soft, #eef4ff); }
@media (max-width: 900px) {
  .agent-drawer { width: 100vw; }
  body.agent-panel-open .main { margin-right: 0; }
  .agent-resizer { display: none !important; }
}

/* Agent 顶部切换器 */
.agent-head { gap: 8px; flex-wrap: wrap; }
.agent-profile-select { width: auto; min-width: 132px; height: 30px; padding: 0 26px 0 9px; font-size: 12px; border-radius: 8px; }
.agent-head .hint.agent-host { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.agent-profile-bar { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.agent-profile-bar .agent-profile-select { flex: 1; }

/* Agent 面板：柔和浮层，不挤压主界面 */
.agent-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,.12); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); opacity: 0; pointer-events: none; transition: opacity .26s ease; }
body.agent-panel-open .agent-scrim { opacity: 1; pointer-events: auto; }
body.agent-panel-open .main { margin-right: 0; }
.agent-drawer { border-radius: 18px 0 0 18px; border-left: 1px solid rgba(15,23,42,.08); box-shadow: -18px 0 50px rgba(15,23,42,.14); background: var(--surface); }
body.agent-panel-open .agent-drawer { animation: agentPanelIn .3s cubic-bezier(.2,.9,.2,1); }
@keyframes agentPanelIn { from { box-shadow: 0 0 0 rgba(15,23,42,0); } to { box-shadow: -18px 0 50px rgba(15,23,42,.14); } }
@media (max-width: 900px) { .agent-drawer { border-radius: 16px 16px 0 0; } }
