/* 加入款式库 · 核对确认向导：仅覆盖主内容区（不挡顶栏 / 左侧 ERP 菜单） */
#library-review-wizard-root {
  position: absolute;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

#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;
}

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

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

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

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

/* 双栏：左固定导航卡 + 右内容卡 */
.library-review-wizard-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
}

.library-review-wizard-sidebar {
  flex: 0 0 272px;
  min-width: 272px;
  max-width: 272px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.library-review-wizard-sidebar-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.library-review-wizard-sidebar-head {
  flex: 0 0 auto;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #F3F4F6;
  background: #FAFBFC;
}

.lar-sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  letter-spacing: 0.02em;
}

.lar-sidebar-progress {
  margin-top: 6px;
  font-size: 12px;
  color: #6B7280;
}

.lar-sidebar-progress strong {
  color: #2563EB;
  font-weight: 600;
}

.library-review-wizard-steps-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.library-review-wizard-steps {
  list-style: none;
  margin: 0;
  padding: 8px;
}

.library-review-wizard-step-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 2px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: #374151;
  font-size: 13px;
  transition: background-color 0.15s ease;
}

.library-review-wizard-step-btn:hover {
  background: #F9FAFB;
}

.library-review-wizard-step-btn.is-active {
  background: #EFF6FF;
}

.library-review-wizard-step-btn.is-active .lar-step-title {
  color: #1D4ED8;
  font-weight: 600;
}

.library-review-wizard-step-btn.is-error .lar-step-title {
  color: #DC2626;
}

.library-review-wizard-step-btn.is-done .lar-step-title {
  color: #374151;
}

/* 步骤状态圆点 */
.lar-step-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  background: #FFFFFF;
  position: relative;
}

.lar-step-icon--pending {
  border-color: #D1D5DB;
  background: #FFFFFF;
}

.lar-step-icon--active {
  border-color: #2563EB;
  background: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.lar-step-icon--confirmed {
  border-color: #10B981;
  background: #10B981;
}

.lar-step-icon--confirmed::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.lar-step-icon--error {
  border-color: #EF4444;
  background: #EF4444;
}

.lar-step-icon--error::after {
  content: "!";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1;
}

.lar-step-icon--view {
  border-color: #9CA3AF;
  background: #F3F4F6;
}

.lar-step-icon--view::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9CA3AF;
}

.library-review-wizard-step-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lar-step-index {
  font-size: 11px;
  color: #9CA3AF;
  line-height: 1.2;
}

.lar-step-title {
  font-weight: 500;
  line-height: 1.35;
  color: #374151;
}

.lar-step-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
}

.lar-step-badge--ok {
  background: #ECFDF5;
  color: #047857;
}

.lar-step-badge--warn {
  background: #FFFBEB;
  color: #B45309;
}

.lar-step-badge--error {
  background: #FEF2F2;
  color: #B91C1C;
}

.library-review-wizard-sidebar-footer {
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid #F3F4F6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FAFBFC;
}

/* 右侧内容区：独立白卡 + 内部滚动 */
.library-review-wizard-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.library-review-wizard-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.library-review-wizard-card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

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

.library-review-wizard-card-body > .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: min(48vh, 420px);
  overflow: auto;
  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-attest {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #F3F4F6;
}

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

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

.lar-footer-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #F3F4F6;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 24%);
}

.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: 991px) {
  .library-review-wizard-body {
    flex-direction: column;
    padding: 12px;
    gap: 12px;
  }

  .library-review-wizard-sidebar {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    max-height: 38vh;
  }

  .library-review-wizard-sidebar-panel {
    max-height: 38vh;
  }
}

@media (max-width: 767px) {
  .library-review-wizard-card-body {
    padding: 16px;
  }

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

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