/* 专家库界面样式。后台工具风格：信息密度优先，克制装饰。 */

:root {
  --eb-primary: #1d4ed8;
  --eb-primary-dark: #1e40af;
  --eb-ink: #0f172a;
  --eb-ink-soft: #334155;
  --eb-muted: #64748b;
  --eb-faint: #94a3b8;
  --eb-line: #e2e8f0;
  --eb-line-soft: #f1f5f9;
  --eb-bg: #f6f8fb;
  --eb-surface: #ffffff;
  --eb-ok: #16a34a;
  --eb-warn: #b45309;
  --eb-danger: #dc2626;
  --eb-side: 232px;
}

* { box-sizing: border-box; }

.eb-body {
  margin: 0;
  background: var(--eb-bg);
  color: var(--eb-ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
}

/* ---------------- 整体骨架 ---------------- */
.eb-shell { display: flex; min-height: 100vh; }

.eb-side {
  width: var(--eb-side); flex: none;
  background: var(--eb-surface);
  border-right: 1px solid var(--eb-line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.eb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px; font-weight: 600; font-size: 15.5px;
  color: var(--eb-ink); text-decoration: none;
  border-bottom: 1px solid var(--eb-line-soft);
}
.eb-brand i { color: var(--eb-primary); font-size: 19px; }

.eb-nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.eb-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px; border-radius: 8px;
  color: var(--eb-ink-soft); text-decoration: none; font-size: 14.5px;
}
.eb-nav a:hover { background: var(--eb-line-soft); }
.eb-nav a.active { background: #eaf0ff; color: var(--eb-primary); font-weight: 600; }
.eb-nav a i { font-size: 16px; width: 18px; }
.eb-nav-sep {
  font-size: 11.5px; color: var(--eb-faint); letter-spacing: .08em;
  padding: 16px 12px 6px; text-transform: uppercase;
}
.eb-badge {
  margin-left: auto; background: var(--eb-danger); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 100px; font-weight: 600;
}

.eb-side-foot { border-top: 1px solid var(--eb-line-soft); padding: 14px 16px; }
.eb-who { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.eb-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--eb-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.eb-who-name { font-size: 14px; font-weight: 600; }
.eb-who-role { font-size: 12px; color: var(--eb-muted); }
.eb-side-links { display: flex; gap: 12px; font-size: 13px; }
.eb-side-links a, .eb-linkbtn {
  color: var(--eb-muted); text-decoration: none;
  background: none; border: none; padding: 0; font-size: 13px; cursor: pointer;
}
.eb-side-links a:hover, .eb-linkbtn:hover { color: var(--eb-primary); }

.eb-main { flex: 1; padding: 26px 30px 60px; min-width: 0; }

.eb-alarm {
  background: #fee2e2; border: 1px solid #fecaca; color: #991b1b;
  padding: 11px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 14.5px;
}
.eb-alarm a { color: #991b1b; font-weight: 600; }

/* ---------------- 通用元素 ---------------- */
.eb-h1 { font-size: 23px; font-weight: 600; margin: 0 0 4px; }
.eb-h1-sub { font-size: 16px; font-weight: 400; color: var(--eb-muted); margin-left: 8px; }
.eb-h2 { font-size: 16px; font-weight: 600; margin: 28px 0 12px; }
.eb-head-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.eb-head-actions { display: flex; gap: 8px; align-items: center; }
.eb-back {
  display: inline-block; color: var(--eb-muted); text-decoration: none;
  font-size: 13.5px; margin-bottom: 6px;
}
.eb-back:hover { color: var(--eb-primary); }

.eb-card {
  background: var(--eb-surface); border: 1px solid var(--eb-line);
  border-radius: 11px; padding: 20px;
}
.eb-card-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.eb-card-subtitle { font-size: 13.5px; font-weight: 600; margin: 18px 0 8px; color: var(--eb-muted); }
.eb-note-card { background: #f8fafc; }
.eb-page-narrow { max-width: 560px; }
.eb-page-wide { max-width: 940px; }

.eb-facts { margin: 0; }
.eb-facts > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--eb-line-soft);
}
.eb-facts > div:last-child { border-bottom: none; }
.eb-facts dt { color: var(--eb-muted); font-weight: 400; font-size: 13.5px; }
.eb-facts dd { margin: 0; font-size: 14px; text-align: right; word-break: break-all; }
.eb-num { font-variant-numeric: tabular-nums; }

.eb-longtext { white-space: pre-wrap; line-height: 1.8; font-size: 14.5px; }
.eb-notes { color: var(--eb-muted); }

.eb-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.eb-stat {
  background: var(--eb-surface); border: 1px solid var(--eb-line);
  border-radius: 11px; padding: 16px 22px; min-width: 130px;
}
.eb-stat-num { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.eb-stat-label { font-size: 13px; color: var(--eb-muted); margin-top: 2px; }
.eb-quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }

.eb-empty {
  text-align: center; padding: 54px 20px; color: var(--eb-muted);
  background: var(--eb-surface); border: 1px dashed var(--eb-line); border-radius: 11px;
}
.eb-empty i { font-size: 34px; color: var(--eb-faint); display: block; margin-bottom: 12px; }
.eb-empty p { margin-bottom: 10px; }

/* ---------------- 搜索 ---------------- */
.eb-search-wrap { margin-bottom: 16px; }
.eb-searchbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--eb-surface); border: 1px solid var(--eb-line);
  border-radius: 10px; padding: 0 14px; height: 46px;
}
.eb-searchbar:focus-within { border-color: var(--eb-primary); box-shadow: 0 0 0 3px #eaf0ff; }
.eb-searchbar i { color: var(--eb-faint); }
.eb-searchbar input { flex: 1; border: none; outline: none; font-size: 15px; background: none; }
.eb-search-hint { font-size: 12.5px; color: var(--eb-faint); margin: 6px 2px 0; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

.eb-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.eb-filter-btn {
  background: var(--eb-surface); border: 1px solid var(--eb-line);
  border-radius: 8px; padding: 5px 12px; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px; color: var(--eb-ink-soft);
}
.eb-filter-btn:hover { border-color: var(--eb-primary); color: var(--eb-primary); }
.eb-filter-btn i { font-size: 11px; }
.eb-filter-menu { max-height: 320px; overflow-y: auto; min-width: 220px; }
.eb-filter-menu .dropdown-item {
  display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer;
}
.eb-count { margin-left: auto; color: var(--eb-faint); font-size: 12px; }
.eb-sort { width: auto; max-width: 160px; margin-left: auto; }

.eb-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; align-items: center; }
.eb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eaf0ff; color: var(--eb-primary);
  border-radius: 100px; padding: 3px 6px 3px 12px; font-size: 13px;
}
.eb-chip-x {
  background: none; border: none; color: var(--eb-primary);
  font-size: 15px; line-height: 1; padding: 0 5px; cursor: pointer;
}
.eb-chip-clear { font-size: 13px; color: var(--eb-muted); text-decoration: none; }

.eb-result-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 4px 2px 10px; font-size: 14px; color: var(--eb-muted);
}

/* ---------------- 表格 ---------------- */
.eb-table th {
  font-size: 12.5px; color: var(--eb-muted); font-weight: 600;
  text-transform: none; background: var(--eb-line-soft); white-space: nowrap;
}
.eb-table td { font-size: 14px; }
.eb-name { font-weight: 600; color: var(--eb-ink); text-decoration: none; }
.eb-name:hover { color: var(--eb-primary); }
.eb-sub-line { font-size: 12.5px; color: var(--eb-faint); }
.eb-tag {
  display: inline-block; background: var(--eb-line-soft); color: var(--eb-ink-soft);
  border-radius: 5px; padding: 1px 8px; font-size: 12.5px; margin-right: 4px;
}
.eb-row-actions { white-space: nowrap; display: flex; gap: 5px; justify-content: flex-end; }
.eb-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; }

/* ---------------- 详情 ---------------- */
.eb-detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .eb-detail-grid { grid-template-columns: 1fr; } }
.eb-reveal-note { font-size: 12.5px; color: var(--eb-faint); margin: 10px 0 0; }
.eb-revealed { font-weight: 600; color: var(--eb-primary); }

.eb-timeline { list-style: none; margin: 0; padding: 0; }
.eb-timeline li {
  display: flex; gap: 14px; padding: 11px 0;
  border-bottom: 1px solid var(--eb-line-soft);
}
.eb-timeline-date {
  flex: none; width: 92px; color: var(--eb-muted);
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.eb-rating { color: #f59e0b; margin-left: 8px; }
.eb-inline-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.eb-inline-form .form-control, .eb-inline-form .form-select { width: auto; flex: 1; min-width: 110px; }

/* ---------------- 表单 ---------------- */
.eb-form fieldset { border: 1px solid var(--eb-line); }
.eb-form legend { float: none; width: auto; padding: 0; }
.eb-form-actions { display: flex; gap: 10px; margin-top: 18px; }
.eb-tag-picker, .eb-field-picker { display: flex; gap: 7px; flex-wrap: wrap; }
.eb-tag-option {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--eb-line); border-radius: 7px;
  padding: 4px 11px; font-size: 13.5px; cursor: pointer; background: var(--eb-surface);
}
.eb-tag-option:has(input:checked) {
  border-color: var(--eb-primary); background: #eaf0ff; color: var(--eb-primary);
}
.eb-check-big { padding: 12px 0 12px 30px; border-bottom: 1px solid var(--eb-line-soft); }
.eb-check-big:last-of-type { border-bottom: none; }

/* ---------------- 导入 ---------------- */
.eb-summary { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.eb-summary-item {
  flex: 1; min-width: 150px; background: var(--eb-surface);
  border: 1px solid var(--eb-line); border-radius: 11px;
  padding: 16px 20px; border-left-width: 4px;
}
.eb-summary-item.ok { border-left-color: var(--eb-ok); }
.eb-summary-item.warn { border-left-color: var(--eb-warn); }
.eb-summary-item.err { border-left-color: var(--eb-danger); }
.eb-summary-num { font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }

.eb-issues { max-height: 320px; overflow-y: auto; }
.eb-issue { font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--eb-line-soft); }
.eb-issue-row { display: inline-block; width: 76px; color: var(--eb-faint); }
.eb-issue.error { color: var(--eb-danger); }
.eb-issue.warn { color: var(--eb-warn); }

.eb-mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.eb-map-row { display: flex; align-items: center; gap: 9px; }
.eb-map-src {
  flex: 1; font-size: 13.5px; background: var(--eb-line-soft);
  padding: 5px 10px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.eb-map-row .form-select { flex: 1; }
.eb-errorlog {
  background: var(--eb-line-soft); border-radius: 8px; padding: 12px;
  font-size: 12.5px; max-height: 260px; overflow: auto; margin: 0;
}

/* ---------------- 备份 ---------------- */
.eb-steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.eb-step {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px;
  color: var(--eb-faint); padding: 6px 14px 6px 6px;
}
.eb-step span {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid currentColor; display: flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.eb-step.done { color: var(--eb-ok); }
.eb-step.active { color: var(--eb-primary); font-weight: 600; }
.eb-compare td, .eb-compare th { font-size: 14px; }
.eb-after { font-weight: 600; color: var(--eb-primary); }
.eb-password {
  font-size: 17px; background: #fff; padding: 3px 10px;
  border-radius: 6px; border: 1px solid var(--eb-line); user-select: all;
}

/* ---------------- 收件箱 ---------------- */
.eb-inbox { display: grid; gap: 12px; }
.eb-inbox-item { padding: 16px 18px; }
.eb-inbox-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eb-inbox-contact {
  display: flex; gap: 18px; margin: 8px 0; font-size: 13.5px; color: var(--eb-muted);
}
.eb-inbox-msg {
  background: var(--eb-line-soft); border-radius: 8px; padding: 10px 13px;
  font-size: 14px; white-space: pre-wrap; margin-bottom: 12px;
}
.eb-inbox-actions { display: flex; gap: 8px; }

/* ---------------- 审计 ---------------- */
.eb-audit td { font-size: 13.5px; }
.eb-audit-detail { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 登录页 ---------------- */
.eb-center {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px; background: var(--eb-bg);
}
.eb-login { max-width: 380px; width: 100%; text-align: center; padding: 36px 32px; }
.eb-login-brand {
  width: 52px; height: 52px; border-radius: 13px; background: var(--eb-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 25px; margin: 0 auto 18px;
}
.eb-title { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.eb-sub { color: var(--eb-muted); font-size: 14px; margin: 0 0 22px; }
.eb-login-tip { font-size: 12.5px; color: var(--eb-faint); margin: 14px 0 0; }
.eb-code { font-size: 42px; font-weight: 700; color: var(--eb-faint); line-height: 1; margin-bottom: 10px; }

.btn-primary {
  --bs-btn-bg: var(--eb-primary); --bs-btn-border-color: var(--eb-primary);
  --bs-btn-hover-bg: var(--eb-primary-dark); --bs-btn-hover-border-color: var(--eb-primary-dark);
}
.form-label { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }

@media (max-width: 780px) {
  .eb-shell { flex-direction: column; }
  .eb-side { width: 100%; height: auto; position: static; flex-direction: row;
             flex-wrap: wrap; align-items: center; }
  .eb-nav { display: flex; overflow-x: auto; padding: 8px; flex: 1; }
  .eb-nav a { white-space: nowrap; }
  .eb-nav-sep { display: none; }
  .eb-side-foot { border-top: none; }
  .eb-main { padding: 18px 16px 50px; }
}
