/* =========================================================
   场馆AI运营官 — 通用组件
   ========================================================= */

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card--pad { padding: 20px; }
.card--hover { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.card--hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #dbe4f5; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card__title { font-size: 15px; font-weight: 700; }
.card__sub { font-size: 12px; color: var(--faint); }
.card__actions { margin-left: auto; display: flex; gap: 8px; }
.card__foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* 统计卡 */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat__label { font-size: 12px; color: var(--muted); }
.stat__value { font-size: 24px; font-weight: 750; letter-spacing: -0.4px; }
.stat__value small { font-size: 12px; font-weight: 500; color: var(--faint); margin-left: 3px; }
.stat__trend { font-size: 11.5px; color: var(--faint); }
.trend-up { color: var(--ok); } .trend-down { color: var(--danger); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px rgba(47, 107, 255, 0.8); }
.btn--primary:hover { background: var(--brand-2); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-2); border-color: #d8dfec; color: var(--ink); }
.btn--soft { background: var(--brand-soft); color: var(--brand-2); }
.btn--soft:hover { background: #e3ebff; }
.btn--dark { background: #101a2e; color: #fff; }
.btn--dark:hover { background: #1c2942; }
.btn--danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn--lg { padding: 11px 20px; font-size: 14px; border-radius: 12px; }
.btn--sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn--icon { padding: 7px; width: 34px; height: 34px; }
.btn--block { width: 100%; }

/* 链接式按钮 */
.link-btn {
  border: 0; background: transparent; color: var(--brand-2); font-weight: 600;
  font-size: 12.5px; padding: 2px 0; display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover { color: var(--brand); text-decoration: underline; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.field__label .req { color: var(--danger); }
.field__hint { font-size: 11.5px; color: var(--faint); }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: #9db8ff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input::placeholder, .textarea::placeholder { color: #a8b3c4; }
.input-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .input-grid { grid-template-columns: minmax(0, 1fr); } }

/* 变量高亮 */
.var-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: #fff1f0; color: #d4380d; border: 1px dashed #ffa39e;
  border-radius: 6px; padding: 0 5px; font-size: 12px; font-weight: 600; margin: 0 1px;
}

/* ---------- 标签 / 徽章 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 3px 9px;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent;
  white-space: nowrap;
}
.tag--brand { background: var(--brand-soft); color: var(--brand-2); }
.tag--ok { background: var(--ok-soft); color: var(--ok); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--danger { background: var(--danger-soft); color: var(--danger); }
.tag--violet { background: var(--violet-soft); color: var(--violet); }
.tag--pink { background: var(--pink-soft); color: var(--pink); }
.tag--cyan { background: var(--cyan-soft); color: var(--cyan); }
.tag--outline { background: transparent; border-color: var(--line); color: var(--muted); }

.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.badge-dot--warn { background: var(--warn); }
.badge-dot--muted { background: var(--faint); }

/* ---------- 标签页 ---------- */
.tabs { display: inline-flex; gap: 4px; background: var(--surface-3); border-radius: 12px; padding: 4px; }
.tab {
  border: 0; background: transparent; border-radius: 9px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; color: var(--muted); transition: all 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--surface); color: var(--brand-2); box-shadow: var(--shadow-sm); }
.tabs--line { background: transparent; padding: 0; border-bottom: 1px solid var(--line); border-radius: 0; gap: 18px; display: flex; }
.tabs--line .tab { border-radius: 0; padding: 8px 0; border-bottom: 2px solid transparent; }
.tabs--line .tab.is-active { background: transparent; box-shadow: none; border-bottom-color: var(--brand); color: var(--brand-2); }

/* ---------- 步骤条 ---------- */
.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 6px 4px; border-radius: 10px;
  font-size: 12.5px; color: var(--faint); font-weight: 600;
}
.step__num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 700;
}
.step.is-active { color: var(--ink); }
.step.is-active .step__num { background: var(--brand); color: #fff; box-shadow: 0 6px 12px -6px rgba(47,107,255,.9); }
.step.is-done { color: var(--ink-2); }
.step.is-done .step__num { background: var(--ok-soft); color: var(--ok); }
.step__line { width: 18px; height: 1px; background: var(--line); }

/* ---------- 列表 / 表格 ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 4px;
  border-bottom: 1px solid var(--line-2);
}
.list-item:last-child { border-bottom: 0; }
.list-item__title { font-size: 13.5px; font-weight: 600; }
.list-item__sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.list-item__right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; color: var(--faint); font-weight: 600;
  padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.table th:first-child { border-radius: 9px 0 0 9px; }
.table th:last-child { border-radius: 0 9px 9px 0; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table--plain th { background: transparent; border-bottom: 1px solid var(--line); }

/* ---------- 气泡 / 空态 / 提示 ---------- */
.bubble { border-radius: 14px; padding: 10px 14px; font-size: 13.5px; line-height: 1.7; max-width: 78%; }
.bubble--them { background: var(--surface-3); color: var(--ink-2); border-top-left-radius: 4px; }
.bubble--me { background: var(--brand); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.chat-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.chat-row--me { align-items: flex-end; }
.chat-meta { font-size: 10.5px; color: var(--faint); padding: 0 4px; }

.empty {
  padding: 44px 20px; text-align: center; color: var(--faint);
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2);
}
.empty__icon { font-size: 26px; margin-bottom: 8px; }

.hint-box {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--brand-soft); border: 1px solid #dde7ff; font-size: 12.5px; color: var(--brand-ink);
}
.hint-box--warn { background: var(--warn-soft); border-color: #ffe2b8; color: #8a5a00; }
.hint-box--ok { background: var(--ok-soft); border-color: #c9efdc; color: #08673f; }
.hint-box__icon { flex: 0 0 auto; }

.progress { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, #5b8cff, #2f6bff); border-radius: 999px; transition: width 0.4s ease; }
.progress__bar--ok { background: linear-gradient(90deg, #3ddc97, #0fa968); }

/* ---------- 模态框 ---------- */
.modal-root {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 24px; background: rgba(11, 18, 32, 0.42); backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease both;
}
.modal {
  width: min(860px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.modal--sm { width: min(520px, 100%); }
.modal__head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px; border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; background: var(--surface); z-index: 2; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal__title { font-size: 15.5px; font-weight: 700; }
.modal__close {
  margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: transparent; color: var(--faint); font-size: 17px;
}
.modal__close:hover { background: var(--surface-3); color: var(--ink); }
.modal__body { padding: 20px 22px; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px; border-top: 1px solid var(--line-2);
  position: sticky; bottom: 0; background: var(--surface);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
.toast-root { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #0f1a2e; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 999px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px;
  animation: toastIn 0.22s ease both;
}
.toast--ok { background: #0b7a4f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 分段按钮组 ---------- */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.is-active { background: var(--brand-soft); color: var(--brand-2); }

/* ---------- 复选卡片 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); font-weight: 500;
  transition: all 0.15s ease; cursor: pointer;
}
.chip:hover { border-color: #b9cbff; color: var(--brand-2); }
.chip.is-active { background: var(--brand-soft); border-color: #b9cbff; color: var(--brand-2); font-weight: 600; }

/* ---------- 内容预览：小红书卡片 ---------- */
.xhs-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  width: 100%; max-width: 340px; margin: 0 auto;
}
.xhs-cover { aspect-ratio: 3 / 4; background: var(--surface-3); position: relative; overflow: hidden; }
.xhs-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xhs-body { padding: 12px 14px 16px; }
.xhs-title { font-size: 14.5px; font-weight: 700; line-height: 1.5; }
.xhs-text { font-size: 13px; color: var(--ink-2); margin-top: 8px; white-space: pre-wrap; line-height: 1.75; }
.xhs-tags { margin-top: 10px; font-size: 12px; color: var(--brand-2); line-height: 1.8; word-break: break-all; }
.xhs-loc { margin-top: 8px; font-size: 11.5px; color: var(--faint); display: flex; align-items: center; gap: 4px; }

/* 滚动容器 */
.scroll-x { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.scroll-y { max-height: 460px; overflow-y: auto; }

/* 代码/记录块 */
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.copy-block {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; line-height: 1.8; white-space: pre-wrap; position: relative;
}
.kbd {
  font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  padding: 0 5px; background: var(--surface); color: var(--muted);
}
