/* 模块：通用筛选栏、全局搜索下拉、数据表格、状态徽标与图库网格 (assets/tables-lists.css) */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.field {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  background: var(--surface);
  font: inherit;
  font-size: 12.5px;
  color: var(--ink1);
  min-width: 170px;
}
.filter-meta { margin-left: auto; font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.list-demo-states {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
}
.chip.on {
  background: var(--secondary);
  color: var(--ink1);
  border-color: rgba(62, 197, 131, 0.35);
}
.batch-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: var(--secondary);
  border-radius: var(--radius-nested);
  border: 1px solid var(--border-hairline);
  position: sticky;
  top: 0;
  z-index: 2;
}
.batch-bar.visible { display: flex; }
.batch-bar span { font-size: 13px; font-weight: 600; flex: 1; }
.skeleton {
  background: linear-gradient(90deg, var(--surface-muted) 25%, #eee9e2 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  height: 14px;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.2s ease infinite; }
  @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
}
tr.skeleton-row td { padding: 12px 16px; }
.empty-state {
  display: none;
  text-align: center;
  padding: 48px 24px;
  color: var(--ink2);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.5; }
.empty-state.visible, #img-empty-state:not(.hidden), #trash-empty-state:not(.hidden), #member-empty-state:not(.hidden) { display: flex; flex: 1 1 0%; flex-direction: column; align-items: center; justify-content: center; }
.table-body-wrap.hidden { display: none; }
.search-wrap { position: relative; }
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-nested);
  box-shadow: var(--shadow-soft);
  padding: 8px 0;
  z-index: 20;
  max-height: 280px;
  overflow: auto;
}
.search-dropdown.open { display: block; }
.search-group {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink3);
  padding: 8px 14px 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.search-hit:hover { background: var(--surface-muted); }
.command-palette {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(22, 24, 22, 0.4);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.command-palette.open { display: flex; }
.command-panel {
  width: min(520px, calc(100vw - 32px));
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.command-panel input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border-hairline);
  padding: 16px 18px;
  font: inherit;
  font-size: 15px;
  background: var(--surface);
}
.command-list { padding: 8px; max-height: 320px; overflow: auto; }

.table-wrap { overflow: hidden; }
.scene.active > .table-wrap {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.table-body-wrap {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  container-type: inline-size;
  -webkit-overflow-scrolling: touch;
}
.table-wrap > .pagination { flex-shrink: 0; }
.activity-section .table-body-wrap { max-height: 280px; }
#image-grid-container {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  grid-auto-rows: max-content;
  padding-right: 4px;
  padding-bottom: 8px;
  margin-bottom: 12px !important;
}
.table-body-wrap > table { min-width: 820px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink2);
  padding: 10px 14px; background: var(--surface-muted);
  border-bottom: 1px solid var(--border-hairline); height: 40px;
  position: sticky; top: 0; inset-block-start: 0; z-index: 4;
  box-shadow: 0 1px 0 var(--border-hairline);
}
tbody td {
  padding: 0 14px; height: 48px;
  border-bottom: 1px solid rgba(22, 32, 25, 0.055); vertical-align: middle;
}
#member-table-wrap th, #member-table-wrap td { padding-left: 8px; padding-right: 8px; }
.table-body-wrap:not(#member-table-wrap) thead th:last-child,
.table-body-wrap:not(#member-table-wrap) tbody td:last-child {
  position: sticky; inset-inline-end: 0; z-index: 2;
}
.table-body-wrap thead th:last-child { background: var(--surface-muted); z-index: 5; }
.table-body-wrap tbody td:last-child { background: var(--surface); box-shadow: -4px 0 10px rgba(18, 32, 24, 0.03); }
tbody tr:hover td, .table-body-wrap tbody tr:hover td:last-child { background: var(--surface-muted); }
tbody tr.selected td, .table-body-wrap tbody tr.selected td:last-child { background: var(--secondary); box-shadow: inset 3px 0 0 var(--primary); }
.num { font-family: var(--tabular); font-variant-numeric: tabular-nums; text-align: right; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.badge-draft { background: var(--surface-muted); color: var(--ink2); border: 1px solid var(--border-hairline); }
.badge-pending { background: rgba(212, 168, 67, 0.15); color: #9a7a2e; }
.badge-published { background: rgba(47, 158, 107, 0.12); color: var(--success); }
.badge-severity {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.badge-severity-high { background: rgba(197, 48, 48, 0.12); color: #C53030; }
.badge-severity-high::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #C53030; }
.badge-severity-medium { background: rgba(217, 119, 6, 0.12); color: #D97706; }
.badge-severity-medium::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #D97706; }
.badge-severity-low { background: rgba(47, 158, 107, 0.12); color: #2F9E6B; }
.badge-severity-low::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2F9E6B; }

.specimen-thumb-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.specimen-thumb-box:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.specimen-thumb-box .zoom-icon {
  position: absolute;
  inset: 0;
  background: rgba(26,29,26,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  color: #fff;
}
.specimen-thumb-box:hover .zoom-icon {
  opacity: 1;
}
.ellipsis-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 280px;
}
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-size: 12px; color: var(--ink2);
  border-top: 1px solid var(--border-hairline); font-variant-numeric: tabular-nums;
}

/* Login */
#view-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}
body.authed #view-login { display: none; }
#view-app { display: none; height: 100vh; }
body.authed #view-app { display: grid; }

.auth-card {
  width: 100%;
  max-width: 1000px;
  max-height: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--secondary);
  border-radius: 16px;
  border: 1px solid var(--border-hairline);
  box-shadow: 0 8px 32px rgba(26, 29, 26, 0.08);
  overflow: hidden;
}
@media (max-width: 800px) {
  .auth-card { grid-template-columns: 1fr; max-height: none; }
  .auth-deco { display: none; }
}
.auth-form {
  padding: 48px;
  position: relative;
}
.auth-deco {
  background: linear-gradient(145deg, var(--primary-light), var(--primary));
  display: grid;
  place-items: center;
  color: var(--text-on-primary);
  padding: 32px;
  text-align: center;
}
.auth-deco h2 { margin: 0 0 8px; font-size: 22px; }
body:not(.show-top-search) .titlebar .search-wrap {
  display: none;
}
body.show-top-search .titlebar .titlebar-center {
  display: none;
}
body.show-top-search .titlebar .search-wrap {
  display: block;
}
.titlebar .titlebar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
  font-weight: 600;
  font-size: 13px;
}
.workflow-route {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--canvas);
  display: none;
}
.workflow-route.active { display: block; }
.workflow-route .workflow-inner {
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.nav-separator {
  height: 1px;
  margin: 8px 12px;
  background: rgba(255,255,255,0.08);
}
.date-capsule {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border-hairline);
}
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title-row h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.chart-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  height: 100%;
  padding: 8px;
}
.chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--ink2);
}
.chart-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.chart-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stat-kpi-row {
  grid-template-columns: repeat(3, 1fr);
}
.stat-footnote {
  font-size: 12px;
  color: var(--ink3);
  margin-top: 16px;
}
.stat-bar-label {
  width: 80px;
  font-size: 13px;
  color: var(--ink2);
}
tbody tr.trash-row td {
  background: rgba(237, 233, 227, 0.35);
}
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
  margin-top: 0;
}
.grid-cards.hidden {
  display: none;
}
.img-card {
  position: relative;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.img-card:hover {
  border-color: rgba(62, 197, 131, 0.35);
  box-shadow: var(--shadow-soft);
}
.img-card .thumb-img {
  aspect-ratio: 4/3;
  background: var(--surface-muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--ink2);
}
.img-card .meta {
  padding: 10px 12px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.img-card-title {
  font-weight: 600;
  color: var(--ink1);
}
.img-card-step {
  color: var(--ink2);
}
.img-primary-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--text-on-primary);
}
.nav-item .nav-item-label {
  flex: 1;
  text-align: left;
}
.tabs-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.tabs-row button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-hairline);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
}
.tabs-row button.active {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
}
.stat-bars { padding: 24px 32px; }
.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.stat-bar-row .bar {
  flex: 1;
  height: 10px;
  background: var(--surface-muted);
  border-radius: 99px;
  overflow: hidden;
}
.stat-bar-row .bar span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
}

