/* 加入款式库 · 核对确认向导：覆盖当前标签页内容区（不挡 ERP 顶栏 / 左侧菜单）
 * LAR-05：z-index 须高于工作台 sticky-top(1020)；打开时隐藏 tab-inner-content 避免双进度条与标题裁切。 */
#library-review-wizard-root {
  position: absolute;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}

#library-review-wizard-root:not([hidden]) {
  pointer-events: auto;
}

.tab-panel.lar-wizard-mount-active,
#content-wrapper.lar-wizard-mount-active {
  overflow: hidden !important;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 向导打开时隐藏标签页内原页面（工作台/版单），避免 sticky 顶区与「就绪模块」叠在 stepper 上 */
.tab-panel.lar-wizard-mount-active > .tab-inner-content {
  visibility: hidden;
  pointer-events: none;
  flex: 0 0 0;
  width: 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
}

.library-review-wizard-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #F8F9FA;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.library-review-wizard-overlay[hidden] {
  display: none !important;
}

/* 方案 E 三段壳：flex 列；顶/底固定，仅中间滚动 — 勿删 min-height:0 / overflow 链 */
.lar-e-wizard {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.library-review-wizard-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: #FFFFFF;
  border-bottom: 1px solid #F3F4F6;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
}

.lar-e-wizard-top-lead {
  flex: 1 1 auto;
  min-width: 0;
}

.lar-e-wizard-top-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.library-review-wizard-topbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.lar-e-wizard-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #6B7280;
  line-height: 1.4;
}

/* 顶栏横向 stepper 容器（LAR-02 填充节点） */
.lar-e-stepper-shell {
  flex: 0 0 auto;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lar-e-stepper-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.lar-e-stepper-scroll::-webkit-scrollbar {
  height: 4px;
}

.lar-e-stepper-scroll::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 4px;
}

.lar-e-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 14px 20px 10px;
  min-width: max-content;
}

/* 顶栏 stepper 节点（全称标题 + 横向滚动，C-06） */
.lar-e-step {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
  min-width: 76px;
  max-width: 104px;
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0 6px;
}

.lar-e-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 18px);
  width: calc(100% - 36px + 8px);
  height: 2px;
  background: #E5E7EB;
  z-index: 0;
}

.lar-e-step.is-done:not(:last-child)::after {
  background: #10B981;
}

.lar-e-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  position: relative;
  z-index: 1;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.lar-e-step.is-active .lar-e-step-dot {
  border-color: #2563EB;
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.lar-e-step.is-done .lar-e-step-dot {
  border-color: #10B981;
  background: #10B981;
  color: #FFFFFF;
}

.lar-e-step.is-error .lar-e-step-dot {
  border-color: #EF4444;
  background: #EF4444;
  color: #FFFFFF;
}

.lar-e-step.is-view .lar-e-step-dot {
  border-color: #9CA3AF;
  background: #F3F4F6;
  color: #6B7280;
}

.lar-e-step-label {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  color: #6B7280;
  max-width: 100%;
  word-break: keep-all;
}

.lar-e-step.is-active .lar-e-step-label {
  color: #2563EB;
  font-weight: 600;
}

.lar-e-step.is-done .lar-e-step-label {
  color: #047857;
  font-weight: 500;
}

.lar-e-step.is-error .lar-e-step-label {
  color: #B91C1C;
  font-weight: 600;
}

.lar-e-step:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.lar-e-step-panel--readonly .lar-e-readonly-hint {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #F3F4F6;
}

/* 中间内容 — 唯一纵向滚动区（固定三段布局勿删 flex/min-height） */
.library-review-wizard-e-main,
.lar-e-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  -webkit-overflow-scrolling: touch;
  background: #F8F9FA;
}

/* 底栏行动条 — 固定不滚动（LAR-03 填充勾选/确认） */
.lar-e-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  min-height: 56px;
}

.lar-e-footer-attest {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lar-e-footer-attest label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  margin: 0;
}

.lar-e-footer-attest input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #2563EB;
}

.lar-e-footer-attest input:disabled + span {
  color: #9CA3AF;
  cursor: not-allowed;
}

.lar-e-footer-na {
  margin-left: 0;
}

.lar-e-footer-hint--error {
  color: #B91C1C;
}

.lar-e-footer-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
  width: 100%;
}

.lar-e-footer-style-code {
  flex: 0 1 240px;
  min-width: 180px;
}

.lar-e-footer-style-code .form-label {
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 4px;
}

.lar-e-footer-attest-checks {
  flex: 1 1 auto;
  min-width: 200px;
}

.lar-e-footer-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lar-e-footer-hint {
  font-size: 12px;
  color: #6B7280;
}

.lar-e-stepper-progress {
  padding: 8px 20px 0;
  font-size: 12px;
  font-weight: 500;
  color: #2563EB;
  line-height: 1.4;
}

/* 换步 loading skeleton（P1-2；checklist 刷新时仅中间区占位） */
.lar-e-main--loading {
  display: flex;
  align-items: flex-start;
}

.lar-e-main-skeleton {
  width: 100%;
  max-width: 640px;
}

.lar-e-skeleton-line {
  height: 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #E5E7EB 0%, #F3F4F6 50%, #E5E7EB 100%);
  background-size: 200% 100%;
  animation: lar-e-skeleton-shimmer 1.2s ease-in-out infinite;
}

.lar-e-skeleton-line--title {
  height: 18px;
  width: 42%;
  margin-bottom: 16px;
}

.lar-e-skeleton-line--short {
  width: 58%;
}

.lar-e-main-loading-text {
  margin: 8px 0 0;
  font-size: 12px;
  color: #9CA3AF;
}

@keyframes lar-e-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.library-review-wizard-step-panel {
  max-width: 960px;
}

.library-review-wizard-e-main > .library-review-wizard-step-panel > h3:first-child,
.lar-e-main > .library-review-wizard-step-panel > h3:first-child {
  margin-top: 0;
}

.lar-status-pill {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.lar-status-pill--ok {
  background: #D1FAE5;
  color: #065F46;
}

.lar-status-pill--warn {
  background: #FEF3C7;
  color: #92400E;
}

.lar-status-pill--error {
  background: #FEE2E2;
  color: #991B1B;
}

.lar-summary-block {
  background: #F9FAFB;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  font-size: 14px;
  color: #374151;
  border: 1px solid #F3F4F6;
}

.lar-preview-block {
  margin: 16px 0;
}

.lar-preview-caption {
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 8px;
}

.lar-preview-table-wrap {
  max-height: none;
  overflow: visible;
  border: 1px solid #F3F4F6;
  border-radius: 8px;
  background: #FFFFFF;
}

.lar-preview-table {
  margin-bottom: 0;
  font-size: 13px;
}

.lar-preview-table th,
.lar-preview-table td {
  white-space: nowrap;
}

.lar-preview-table td {
  color: #374151;
}

.lar-readiness-hint {
  font-size: 13px;
  color: #374151;
}

.lar-readiness-hint ul {
  margin-top: 4px;
}

.lar-preview-text {
  margin: 0;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid #F3F4F6;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(40vh, 360px);
  overflow: auto;
}

.lar-issues {
  margin: 16px 0;
  padding: 0;
  list-style: none;
  border: 1px solid #F3F4F6;
  border-radius: 8px;
  overflow: hidden;
}

.lar-issues li {
  padding: 8px 12px;
  border-bottom: 1px solid #F3F4F6;
  font-size: 14px;
}

.lar-issues li:last-child {
  border-bottom: none;
}

.lar-issue--error {
  color: #991B1B;
  background: #FEF2F2;
}

.lar-issue--warn {
  color: #92400E;
  background: #FFFBEB;
}

.lar-issue--info {
  color: #6B7280;
}

.lar-actions {
  margin: 16px 0;
}

.lar-style-code-input {
  max-width: 320px;
}

.lar-blocking-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #991B1B;
  font-size: 14px;
}

@media (max-width: 767px) {
  .library-review-wizard-e-main,
  .lar-e-main {
    padding: 16px;
  }

  .library-review-wizard-topbar {
    padding: 10px 12px;
    flex-wrap: wrap;
  }

  .library-review-wizard-topbar h2 {
    font-size: 16px;
  }

  .lar-e-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .lar-e-stepper {
    padding: 12px 16px 8px;
  }
}
