/* overlay.css — 弹窗、搜索、空状态、登录页 */
/* ------------------------------------------------------------------ modal */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(1, 4, 9, 0.72);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; z-index: 100; overflow-y: auto;
  overscroll-behavior: contain;   /* 滚到底不再把滚动传给页面 */
  animation: fade 0.12s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 560px; background: var(--canvas-subtle);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  animation: pop 0.14s ease;
}
.modal.wide { max-width: 720px; }
@keyframes pop { from { transform: translateY(-6px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.modal-body {
  padding: 16px; display: flex; flex-direction: column; gap: 13px;
  max-height: 66vh; overflow-y: auto; overscroll-behavior: contain;
}
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }

/* 弹窗打开时锁住页面滚动，避免滚动穿透 */
body.modal-open { overflow: hidden; }

/* ------------------------------------------------------------------ 搜索 */

.search-box { position: relative; }
.search-box .input { width: 100%; padding-left: 30px; height: 34px; font-size: 13px; }
.search-box > svg { position: absolute; left: 9px; top: 10px; width: 15px; height: 15px; color: var(--fg-subtle); }
.search-results { display: flex; flex-direction: column; gap: 1px; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }
.sr-group { font-size: 11px; color: var(--fg-subtle); letter-spacing: 0.5px; padding: 8px 8px 3px; }
.sr-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px;
  border-radius: var(--radius); cursor: pointer; color: inherit;
}
.sr-item:hover { background: var(--canvas-overlay); text-decoration: none; }
.sr-body { min-width: 0; flex: 1; }
.sr-title { font-size: 13px; line-height: 1.45; }
.sr-meta { font-size: 11px; color: var(--fg-subtle); margin-top: 2px; }
.sr-empty { padding: 26px; text-align: center; color: var(--fg-muted); font-size: 13px; }

/* ------------------------------------------------------------------ 空工作区 */

.onboard .card-body { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.onboard h3 { margin: 0; font-size: 14px; font-weight: 600; }
.onboard p { margin: 0; font-size: 12.5px; color: var(--fg-muted); }

.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--fg-muted); }
.field .input, .field .select, .field .textarea { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.hint { font-size: 11.5px; color: var(--fg-subtle); margin-top: 4px; }

/* ------------------------------------------------------------------ misc */

.empty { text-align: center; padding: 44px 20px; color: var(--fg-muted); }
.empty svg { width: 32px; height: 32px; opacity: .4; margin-bottom: 10px; }
.empty h3 { margin: 0 0 4px; font-size: 14px; color: var(--fg); font-weight: 600; }
.empty p { margin: 0 0 14px; font-size: 12.5px; }

.soon { color: var(--attention); }
.dim { color: var(--fg-muted); }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb14 { margin-bottom: 14px; }
.grow { flex: 1; }

#toast-root {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: calc(100vw - 36px);
}
.toast {
  padding: 9px 14px; border-radius: var(--radius); font-size: 13px;
  background: var(--canvas-overlay); border: 1px solid var(--border);
  box-shadow: var(--shadow); animation: slidein 0.16s ease;
  max-width: 380px; pointer-events: auto;
}
@keyframes slidein { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.err { border-color: rgba(248, 81, 73, 0.5); color: var(--danger); }
.toast.ok { border-color: rgba(63, 185, 80, 0.5); }

/* ------------------------------------------------------------------ auth */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background:
  radial-gradient(900px 420px at 50% -10%, rgba(47, 129, 247, 0.10), transparent 70%), var(--canvas); }
.auth-card { width: 100%; max-width: 384px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 20px; }
.auth-logo h1 { margin: 0; font-size: 19px; font-weight: 600; }
.auth-logo p { margin: 0; color: var(--fg-muted); font-size: 12.5px; }
.auth-card .card { background: var(--canvas-subtle); }
.auth-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 16px; }
.auth-tabs button {
  background: none; border: none; color: var(--fg-muted); font: inherit; font-size: 13px;
  padding: 11px 10px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tabs button.on { color: var(--fg); border-bottom-color: #f78166; font-weight: 600; }
.auth-note { font-size: 12px; color: var(--fg-muted); text-align: center; margin-top: 14px; line-height: 1.7; }

.public-list { display: grid; gap: 10px; }
.public-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--canvas-subtle);
}
.public-item:hover { border-color: var(--fg-subtle); }
.public-item .info { flex: 1; min-width: 0; }
.public-item .nm { font-size: 13.5px; font-weight: 600; }
.public-item .ds { font-size: 12px; color: var(--fg-muted); }
