/* ============================================================
   信息抽取子页专属样式
   独立文件，避免与其他工作人员同时修改 pages.css / components.css 产生冲突。
   仅使用 base.css 中定义的变量，浅色主题。
   ============================================================ */

.ext-page {
  gap: 14px;
}

/* ---------------- 顶部栏 ---------------- */
.ext-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-600);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.ext-head-main {
  min-width: 0;
}

.ext-eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-600);
}

.ext-head h3 {
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
}

.ext-head p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

.ext-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: none;
}

.ext-links {
  display: flex;
  gap: 6px;
}

.ext-links a {
  padding: 4px 10px;
  border: 1px solid var(--brand-100);
  border-radius: 20px;
  background: var(--brand-50);
  font-size: 12px;
  white-space: nowrap;
}

.ext-links a:hover {
  background: var(--brand-100);
}

/* ---------------- 概览 ---------------- */
.ext-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ext-kpi {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.ext-kpi-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
}

.ext-kpi-value small {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
}

.ext-kpi-value.is-warn {
  color: var(--orange-dark);
}

.ext-kpi-value.is-ok {
  color: var(--green);
}

.ext-kpi-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
}

/* ---------------- 信息板块 ---------------- */
.ext-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ext-board-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
}

.ext-board-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ext-board-no {
  font-size: 15px;
  font-weight: 700;
  color: var(--orange-dark);
  white-space: nowrap;
}

.ext-board-title b {
  font-size: 14px;
  color: var(--text);
}

.ext-board-title small {
  font-size: 12px;
  color: var(--text-3);
}

.ext-board-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ext-board-meta i {
  color: var(--line);
  font-style: normal;
}

.ext-state {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.ext-state.idle {
  color: var(--text-2);
  background: var(--line-2);
}

.ext-state.running {
  color: var(--brand-700);
  background: var(--brand-100);
}

.ext-state.done {
  color: var(--orange-dark);
  background: var(--orange-50);
}

.ext-state.applied {
  color: var(--green);
  background: var(--green-50);
}

.ext-change {
  color: var(--orange-dark);
  font-weight: 700;
}

.ext-board-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.ext-progress-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--brand-50);
  border-bottom: 1px solid var(--brand-100);
  font-size: 12px;
  color: var(--brand-700);
}

.ext-progress-line .progress {
  flex: 1;
  max-width: 320px;
}

.ext-progress-line.compact {
  padding: 0;
  background: transparent;
  border: 0;
  margin-bottom: 8px;
}

.ext-board-body {
  padding: 12px 16px 16px;
  overflow-x: auto;
}

.ext-board-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-2);
}

.ext-board-caption > span:first-child {
  padding-left: 8px;
  border-left: 3px solid var(--brand-500);
  font-weight: 700;
  color: var(--text);
}

.ext-form-head,
.ext-row {
  display: grid;
  grid-template-columns: 150px minmax(200px, 1.5fr) minmax(170px, 1fr) 130px 84px 132px;
  gap: 10px;
  align-items: center;
  min-width: 940px;
}

.ext-board .ext-form-head {
  padding: 8px 10px;
  background: #f4f7fb;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.ext-board .ext-form-head span {
  color: var(--text-2);
}

.ext-form-rows {
  border: 1px solid var(--line-2);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.ext-row {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}

.ext-row:last-child {
  border-bottom: 0;
}

.ext-row:nth-child(even) {
  background: var(--surface-2);
}

.ext-row.is-low {
  box-shadow: inset 3px 0 0 var(--orange);
}

.ext-cell {
  min-width: 0;
}

.ext-cell-key {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
}

.ext-cell-key label {
  cursor: text;
}

.ext-flag,
.ext-compare-key em {
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--orange-50);
  color: var(--orange-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.ext-cell-source {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
}

.ext-cell-source span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ext-cell-source small {
  color: var(--text-3);
}

.ext-mini-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.ext-mini-tag.ok {
  color: var(--green);
  background: var(--green-50);
}

.ext-mini-tag.warn {
  color: var(--orange-dark);
  background: var(--orange-50);
}

.ext-cell-ops {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ext-board-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 12px;
}

/* ---------------- 底部链路说明 ---------------- */
.ext-flow-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: 1px dashed var(--brand-100);
  border-radius: var(--radius);
  background: var(--brand-50);
  font-size: 12px;
  color: var(--text-2);
}

.ext-flow-note b {
  color: var(--brand-800);
}

.ext-demo-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  color: var(--text-3);
}

.ext-demo-links a {
  padding: 2px 8px;
  border: 1px dashed var(--brand-100);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
}

/* ---------------- 右侧浮层 ---------------- */
.ext-mask {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(11, 36, 71, 0.28);
}

.ext-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  width: min(960px, 94vw);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: ext-slide-in 0.18s ease-out;
}

@keyframes ext-slide-in {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.ext-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.ext-drawer-head h3 {
  font-size: 17px;
  color: var(--text);
}

.ext-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ext-close:hover {
  background: var(--line-2);
  color: var(--red);
}

.ext-drawer-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.15fr);
  flex: 1;
  min-height: 0;
}

.ext-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.ext-panel:last-child {
  border-right: 0;
}

.ext-panel h4 {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.ext-panel h4 em {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.ext-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
}

.ext-panel-tip {
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.7;
}

.ext-inline-warn {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--orange-50);
  color: var(--orange-dark);
  font-size: 12px;
}

.ext-panel-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}

.ext-panel-foot > .btn {
  align-self: flex-end;
  min-width: 96px;
}

.ext-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ext-sep {
  color: var(--line);
}

/* 文件选择 */
.ext-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ext-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ext-file-row:hover {
  border-color: var(--brand-500);
}

.ext-file-row.is-checked {
  border-color: var(--brand-100);
  background: var(--brand-50);
}

.ext-file-row input {
  flex: none;
  width: 15px;
  height: 15px;
  accent-color: var(--brand-600);
  cursor: pointer;
}

.ext-file-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}

.ext-file-name span,
.ext-file-name {
  overflow-wrap: anywhere;
}

.ext-file-name small {
  font-size: 11px;
  color: var(--text-3);
}

.ext-file-state {
  flex: none;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.ext-file-state.ok {
  color: var(--green);
  background: var(--green-50);
}

.ext-file-state.warn {
  color: var(--orange-dark);
  background: var(--orange-50);
}

/* 结果应用 */
.ext-compare-body {
  background: var(--surface-2);
}

.ext-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}

.ext-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 17px;
  font-weight: 700;
  line-height: 42px;
}

.ext-empty p {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}

.ext-empty span {
  max-width: 320px;
  line-height: 1.7;
}

.ext-compare-summary {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--brand-50);
  color: var(--brand-800);
  font-size: 12px;
}

.ext-compare-head,
.ext-compare-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.ext-compare-head {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  background: #f4f7fb;
  border-bottom: 1px solid var(--line);
}

.ext-compare-item {
  margin-bottom: 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.ext-compare-item.is-changed {
  border-color: var(--brand-100);
}

.ext-compare-row {
  padding: 8px;
}

.ext-compare-key {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.ext-choice {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  line-height: 1.5;
}

.ext-choice:hover {
  border-color: var(--brand-500);
}

.ext-choice.picked {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--text);
  font-weight: 700;
}

.ext-choice input {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  accent-color: var(--brand-600);
  cursor: pointer;
}

.ext-choice span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ext-compare-meta {
  padding: 5px 10px;
  border-top: 1px dashed var(--line-2);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-3);
}

.is-warn {
  color: var(--orange-dark);
}

/* ---------------- 自适应 ---------------- */
@media (max-width: 1080px) {
  .ext-head {
    flex-direction: column;
  }

  .ext-head-side {
    align-items: flex-start;
  }

  .ext-board-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ext-board-actions {
    justify-content: flex-start;
  }

  .ext-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ext-drawer-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .ext-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ext-panel-body {
    overflow: visible;
  }
}
