:root {
  --export-blue: #0876ba;
  --export-soft: #edf7fc;
}

/* V1.4：班组少时不再把柱子拉散，班组多时保持横向滚动。 */
.compact-score-chart {
  min-width: max(100%, var(--chart-content-width, 590px));
  justify-content: center;
  gap: 8px;
  padding-right: 18px;
  padding-left: 18px;
}

.compact-score-chart .score-column {
  min-width: 64px;
  max-width: 64px;
  flex: 0 0 64px;
}

/* 正式评价详情：固定头部和底部，仅中间内容纵向滚动。 */
.formal-detail-backdrop {
  display: flex;
  justify-content: flex-end;
  overflow: hidden;
}

.formal-detail-drawer {
  position: relative;
  top: auto;
  right: auto;
  width: min(760px, 100vw);
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.formal-detail-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e3eaf0;
  background: linear-gradient(145deg, #f7fbfe, #fff 64%);
}

.formal-detail-head > div {
  min-width: 0;
}

.formal-detail-head .breadcrumb {
  margin: 0 0 6px;
}

.formal-detail-head h3 {
  margin: 0 0 7px;
  color: #173a58;
  font-size: 23px;
}

.formal-detail-head span {
  color: #758698;
  font-size: 11px;
}

.formal-detail-scroll {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px 26px;
  touch-action: pan-y;
}

.formal-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 15px;
  border: 1px solid #dfe8ef;
  border-radius: 14px;
  background: #f7fafc;
}

.formal-overview > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fff;
}

.formal-overview > .wide {
  grid-column: 1 / -1;
}

.formal-overview small {
  color: #8190a0;
  font-size: 10px;
}

.formal-overview strong {
  color: #29445d;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.formal-detail-section {
  margin-top: 20px;
}

.formal-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.formal-section-title > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.formal-section-title span {
  color: #193b58;
  font-size: 15px;
  font-weight: 800;
}

.formal-section-title small {
  color: #8392a1;
}

.formal-detail-list {
  display: grid;
  gap: 10px;
}

.formal-detail-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 15px;
  border: 1px solid #dfe7ed;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(17, 54, 83, .05);
}

.formal-item-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eaf5fb;
  color: #0873b2;
  font-size: 11px;
  font-weight: 800;
}

.formal-item-body,
.formal-item-meta {
  min-width: 0;
}

.formal-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.formal-item-meta > span:first-child {
  color: #6f8294;
  font-size: 10px;
  font-weight: 700;
}

.formal-item-body h4 {
  margin: 8px 0;
  color: #203f59;
  font-size: 13px;
  line-height: 1.55;
}

.formal-item-body p {
  margin: 0;
  padding: 11px 12px;
  border-left: 3px solid #1a91c7;
  border-radius: 3px 8px 8px 3px;
  background: #f5f9fc;
  color: #435a6e;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.formal-detail-scroll .formal-score-totals {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid #dfe8ef;
  border-radius: 13px;
  background: #f9fbfc;
}

.formal-detail-scroll .formal-score-totals > span {
  padding: 3px 10px;
}

.formal-detail-scroll .formal-score-totals > span + span {
  border-left: 1px solid #e0e8ee;
}

.formal-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #dfe7ed;
  background: rgba(255, 255, 255, .97);
}

.formal-detail-footer > div {
  display: flex;
  gap: 9px;
}

/* 导出页面 */
.export-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr);
  align-items: start;
  gap: 18px;
}

.export-form-card,
.export-preview-card {
  min-width: 0;
  padding: 22px;
}

.export-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e7edf2;
}

.export-card-head h3,
.export-preview-card h3 {
  margin: 0 0 5px;
  color: #183c5a;
  font-size: 18px;
}

.export-card-head p {
  margin: 0;
  color: #7b8998;
  line-height: 1.55;
}

.export-card-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #0f8ec6, #0868aa);
  color: #fff;
  box-shadow: 0 8px 18px rgba(7, 104, 170, .2);
}

.export-card-icon .ui-icon {
  width: 21px;
  height: 21px;
}

.export-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 18px;
}

.export-scope-grid label,
.export-cycle-fields label,
.export-custom-fields label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.export-scope-grid label > span,
.export-cycle-fields label > span,
.export-custom-fields label > span,
.field-caption {
  color: #51677b;
  font-size: 11px;
  font-weight: 750;
}

.export-scope-readonly {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  padding: 14px 15px;
  border: 1px solid #d9e5ed;
  border-radius: 11px;
  background: #f7fafc;
}

.export-scope-readonly span,
.export-scope-readonly small {
  color: #7c8c9b;
  font-size: 10px;
}

.export-scope-readonly strong {
  color: #284a65;
}

.export-period-block {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}

.export-mode-switch {
  width: fit-content;
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  padding: 3px;
  border: 1px solid #d7e2ea;
  border-radius: 10px;
  background: #f2f7fa;
}

.export-mode-switch button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #67798a;
  font-weight: 750;
}

.export-mode-switch button.active {
  background: #fff;
  color: #0871b3;
  box-shadow: 0 2px 8px rgba(22, 71, 106, .13);
}

.export-cycle-fields,
.export-custom-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 13px;
  padding: 14px;
  border: 1px solid #e0e8ee;
  border-radius: 11px;
  background: #fbfcfd;
}

.export-cycle-fields label {
  grid-column: 1 / 2;
}

.export-cycle-fields p {
  margin: 0;
  color: #7d8c9b;
  font-size: 10px;
  line-height: 1.55;
}

.export-cycle-fields.hidden,
.export-custom-fields.hidden {
  display: none;
}

.export-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 18px;
  padding: 12px 13px;
  border: 1px solid #dce6ed;
  border-radius: 11px;
  background: #f7fafc;
  color: #567083;
}

.export-status > span {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e6f2f8;
  color: #0874b4;
}

.export-status p {
  min-width: 0;
  display: grid;
  gap: 3px;
  margin: 0;
}

.export-status small {
  color: #7d8b99;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.export-status.working {
  border-color: #b9def0;
  background: #eff9fd;
}

.export-status.success {
  border-color: #b9dfd4;
  background: #eef9f5;
}

.export-status.error {
  border-color: #f0c3c7;
  background: #fff4f5;
  color: #a93640;
}

.export-submit {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.export-submit .ui-icon {
  width: 18px;
  height: 18px;
}

.small-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.export-preview-card {
  position: sticky;
  top: 86px;
  background: linear-gradient(155deg, #fff, #f7fbfd);
}

.export-sheet-list {
  display: grid;
  gap: 15px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.export-sheet-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
}

.export-sheet-list i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e7f4fa;
  color: #0872b2;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.export-sheet-list div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.export-sheet-list strong {
  color: #28475f;
}

.export-sheet-list small {
  color: #788998;
  line-height: 1.55;
}

.export-example {
  padding: 14px;
  border: 1px solid #dce8ef;
  border-radius: 11px;
  background: #fff;
}

.export-example span {
  color: #687b8d;
  font-size: 10px;
  font-weight: 750;
}

.export-example p {
  margin: 8px 0 0;
  color: #3f596d;
  font-size: 11px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.export-note {
  margin-top: 13px;
  padding: 11px 12px;
  border-radius: 9px;
  background: #eaf5fa;
  color: #527084;
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .export-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .export-preview-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .compact-score-chart {
    min-width: max(100%, var(--chart-content-width, 520px));
    gap: 6px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .compact-score-chart .score-column {
    min-width: 58px;
    max-width: 58px;
    flex-basis: 58px;
  }

  .formal-detail-drawer {
    width: 100vw;
  }

  .formal-detail-head {
    padding: max(16px, env(safe-area-inset-top)) 16px 14px;
  }

  .formal-detail-head h3 {
    font-size: 19px;
  }

  .formal-detail-scroll {
    padding: 14px 13px 20px;
  }

  .formal-overview {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .formal-overview > .wide {
    grid-column: auto;
  }

  .formal-detail-item {
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 9px;
    padding: 12px;
  }

  .formal-item-index {
    width: 25px;
    height: 25px;
  }

  .formal-item-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .formal-detail-scroll .formal-score-totals {
    grid-template-columns: 1fr 1fr;
  }

  .formal-detail-scroll .formal-score-totals > span + span {
    border-left: 0;
  }

  .formal-detail-scroll .formal-score-totals > span:last-child {
    grid-column: 1 / -1;
    padding-top: 11px;
    border-top: 1px solid #e0e8ee;
  }

  .formal-detail-footer {
    padding: 11px 13px calc(11px + env(safe-area-inset-bottom));
  }

  .export-form-card,
  .export-preview-card {
    padding: 16px;
  }

  .export-scope-grid,
  .export-cycle-fields,
  .export-custom-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .export-cycle-fields label {
    grid-column: auto;
  }

  .export-mode-switch {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .formal-detail-footer {
    align-items: stretch;
  }

  .formal-detail-footer > div {
    flex: 1;
  }

  .formal-detail-footer > div .btn {
    flex: 1;
  }

  .export-card-head {
    align-items: flex-start;
  }
}
