/* 模块：Bento 数据看板、浮动内容盘与通用全屏工作流框架 (assets/dashboard-workflow.css) */
/* Dashboard B */
.dashboard-outer {
  background: #EDE9E3;
  min-height: 100%;
  padding: 24px 26px 40px;
}
.dashboard-float {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 32px;
  box-shadow: var(--shadow-float);
  padding: 28px 32px 36px;
  position: relative;
  overflow: hidden;
}
.dashboard-float::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -60px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(62, 197, 131, 0.18), transparent 70%);
  pointer-events: none;
}
.kpi-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  padding: 22px 24px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-hairline);
  background: var(--surface);
  transition: border-color 0.3s;
}
.kpi:hover { border-color: rgba(62, 197, 131, 0.25); }
.kpi-hero {
  grid-column: span 2;
  min-height: 156px;
  display: flex;
  flex-direction: column;
}
.kpi-hero-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}
.kpi-sparkline {
  width: 140px;
  height: 48px;
  flex-shrink: 0;
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--primary-dark);
}
.kpi-delta {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(47, 158, 107, 0.12);
  color: var(--success);
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-hero .kpi-value { font-size: 30px; }
.kpi-sub { font-size: 11.5px; color: var(--ink2); margin-top: 6px; }
.charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.activity-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.activity-section .list-card { padding: 0; overflow: hidden; }
.preview-body img.specimen {
  width: 100%;
  border-radius: 10px;
  margin-top: 10px;
  display: block;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.chart-card { padding: 18px 20px; }
.chart-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.chart-area {
  height: 200px;
  border-radius: var(--radius-nested);
  background: linear-gradient(180deg, var(--surface-muted) 0%, transparent 100%);
  position: relative;
}
.chart-line {
  position: absolute;
  inset: 20px 16px 24px;
}
.chart-line svg { width: 100%; height: 100%; }

/* Dashboard 形态 B 浮动内容盘 (对应 05 §7 & 02 §5.2) */
.dashboard-floating-wrap {
  background: #EDEAE4;
  padding: 24px 20px;
  min-height: calc(100vh - var(--titlebar-h));
  display: flex;
  justify-content: center;
}
.dashboard-plate {
  width: 100%;
  max-width: 1380px;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: 0 30px 80px -40px rgba(26, 29, 26, 0.16), 0 0 0 1px rgba(232, 228, 220, 0.6);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
}
.dashboard-plate::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle at top right, rgba(62, 197, 131, 0.09), transparent 70%);
  pointer-events: none;
}
.kpi-interactive {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, border-color 0.2s;
}
.kpi-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: rgba(62, 197, 131, 0.4);
}
.chart-segmented-control {
  display: inline-flex;
  background: var(--card-subtle);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.chart-seg-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--ink2);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}
.chart-seg-btn.active {
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.chart-x-axis {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink2);
  font-family: inherit;
}
.donut-center-metric {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.activity-table-row {
  cursor: pointer;
  transition: background-color 0.15s;
}
.activity-table-row:hover {
  background-color: var(--card-subtle);
}

/* Workflow */
.workflow {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--titlebar-h));
}
.workflow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: linear-gradient(180deg, var(--surface) 0%, #EEF6F2 100%);
  border-bottom: 1px solid var(--border-hairline);
}
.workflow-top h2 { margin: 0; font-size: 18px; font-weight: 600; }
.workflow-steps {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--ink2);
}
.workflow-steps .on { color: var(--primary-dark); font-weight: 600; }
.workflow-body {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  padding: 24px 20px 100px;
}
.section-card {
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-hairline);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(45, 122, 82, 0.12);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.section-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.section-head div[style*="letter-spacing"] { text-transform: uppercase; font-size: 10.5px !important; letter-spacing: 0.05em !important; font-weight: 700 !important; }
.section-head p { margin: 3px 0 0; font-size: 12px; color: var(--ink2); }
.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink1);
}
.form-row label .req { color: var(--error); }
.textbox {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  background: var(--surface);
  font: inherit;
  font-size: 12.5px;
}
.upload {
  border: 1.5px dashed rgba(232, 228, 220, 0.8);
  border-radius: var(--radius-nested);
  padding: 24px;
  text-align: center;
  color: var(--ink2);
  font-size: 13px;
  background: var(--surface-muted);
}
.preview-frame {
  width: 300px;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid var(--border-hairline);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.preview-chrome {
  height: 4px;
  background: var(--surface-muted);
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
}
.preview-chrome span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--divider);
}
.preview-body {
  min-height: 520px;
  padding: 12px;
  font-size: 13px;
}
.preview-disclaimer {
  font-size: 12px;
  color: var(--ink2);
  text-align: center;
  margin-top: 10px;
  padding: 0 8px;
}
.workflow-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 32px;
  background: rgba(253, 252, 249, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-hairline);
}
.dirty-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #b8860b;
  margin-right: auto;
}
.dirty-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

/* ==========================================================================
   全站响应式布局断点架构 (Responsive Breakpoint Architecture: 1200 / 1040 / 860)
   ========================================================================== */
.stat-charts-grid { grid-template-columns: 1fr 1fr; }
.taxonomy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
}
.taxonomy-layout > .list-card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#taxo-tree-root,
#taxo-damage-group-view {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}
.taxonomy-layout > aside {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.taxonomy-layout > aside > * {
  flex-shrink: 0;
}
.chart-card, .charts > *, .taxonomy-layout > *, .kpi-bento > *, .form-grid-2 > * { min-width: 0; }
.page-header, .batch-bar { flex-wrap: wrap; gap: 10px; }

/* 1. 紧凑笔记本视口 (≤ 1200px：13/14寸 MacBook 默认缩放与紧凑桌面) */
@media (max-width: 1200px) {
  .charts, .stat-charts-grid, .taxonomy-layout { grid-template-columns: 1fr !important; }
  .taxonomy-layout { overflow-y: auto; padding-right: 2px; }
  .taxonomy-layout > .list-card, .taxonomy-layout > aside { height: auto; overflow: visible; }
  #taxo-tree-root, #taxo-damage-group-view { max-height: 520px; overflow-y: auto; }
  .kpi-bento { grid-template-columns: repeat(2, 1fr); }
  .workflow-body { flex-direction: column !important; align-items: stretch !important; }
  .workflow-body > div:first-child { max-width: 100% !important; }
  .workflow-aside {
    width: 100% !important;
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
  }
  .taxo-inspector-card { position: static !important; }
}

/* 2. 分屏对照与平板横屏视口 (≤ 1040px：左屏文献/右半屏后台对照 & iPad 横屏) */
@media (max-width: 1040px) {
  #scene-review.scene.active { overflow-y: auto; }
  .review-workbench-header { height: auto !important; padding: 10px 18px !important; flex-wrap: wrap; gap: 10px; }
  #review-split-root, #review-split-root.split-flex-container {
    flex: 0 0 auto !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  #review-split-root > .gutter { display: none !important; }
  #review-col-left, #review-col-center, #review-col-right {
    width: 100% !important;
    height: auto !important;
    max-height: 580px;
    border-bottom: 1px solid var(--border);
  }
  .titlebar .search kbd { display: none; }
}

/* 3. 窄窗与平板竖屏视口 (≤ 860px：表单双列折叠、抽屉防溢出与内边距收敛) */
@media (max-width: 860px) {
  .form-grid-2, .img-edit-modal-grid, .category-cards-grid { grid-template-columns: 1fr !important; }
  .kpi-bento, .stat-kpi-row { grid-template-columns: 1fr !important; }
  .kpi-hero { grid-column: span 1 !important; }
  .proto-drawer-panel, .ai-assistant-drawer { width: min(480px, 92vw) !important; }
  .page-padding, .dashboard-plate { padding: 16px !important; }
  .filter-bar input.field { min-width: 180px !important; flex: 1 1 200px; }
  .taxo-node-children { margin-left: 10px; padding-left: 8px; }
}

@media (max-width: 768px) {
  .scene.active { overflow-y: auto; }
  .scene.active > .table-wrap { min-height: 360px; }
  #image-grid-container { min-height: 340px; }
}

