/* ============================================================
   Audit pages — not part of the main composition.
   ============================================================ */

body.audit-mode,
body.audit-mode #app {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  background: #1a222a;
}

body.audit-mode .intro,
body.audit-mode .stage {
  display: none !important;
}

.audit {
  position: relative;
  z-index: 2;
  width: min(1280px, 96vw);
  margin: 0 auto;
  padding: 3.4vh 0 8vh;
  color: rgba(226, 232, 240, 0.82);
}

.audit__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2vw;
  border-bottom: 1px solid rgba(198, 161, 91, 0.24);
  padding-bottom: 1.6vh;
  margin-bottom: 2.2vh;
}

.audit__head h1 {
  margin: 0;
  color: #e2e8f0;
  font-size: clamp(18px, 2.6vh, 28px);
  font-weight: 400;
  letter-spacing: 0.24em;
}

.audit__head p {
  margin: 0.6vh 0 0;
  color: rgba(226, 232, 240, 0.46);
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.7;
}

.audit__actions {
  display: flex;
  gap: 1.2vw;
  align-items: center;
}

.audit__btn {
  padding: 0.7vh 1.2vw;
  border: 1px solid rgba(198, 161, 91, 0.3);
  color: rgba(226, 232, 240, 0.72);
  font-size: 11px;
  letter-spacing: 0.16em;
  transition:
    color 240ms ease,
    border-color 240ms ease;
}

.audit__btn:hover {
  color: #f4d894;
  border-color: rgba(244, 216, 148, 0.5);
}

.audit__report {
  margin: 0 0 2.2vh;
  padding: 1.2vh 1.4vw;
  border: 1px solid rgba(198, 161, 91, 0.2);
  background: rgba(8, 12, 16, 0.5);
  color: rgba(226, 232, 240, 0.7);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2.4vh 1.4vw;
}

.audit-card {
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
}

.audit-card__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #f2e6d0;
  border: 1px solid rgba(112, 84, 48, 0.2);
  overflow: hidden;
}

.audit-card__frame .window__paper,
.audit-card__frame .window__woodcut {
  position: absolute;
  inset: 0;
}

.audit-card__frame .window__paper {
  opacity: 1;
  transition: opacity 0.8s var(--ease);
}

.audit-card__frame .window__woodcut {
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}

#app[data-face="back"] .audit-card__frame .window__paper {
  opacity: 0;
}

#app[data-face="back"] .audit-card__frame .window__woodcut {
  opacity: 1;
}

.audit-card__name {
  color: rgba(226, 232, 240, 0.8);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.audit-card__id {
  color: rgba(226, 232, 240, 0.34);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.audit-shared {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3vw;
}

.audit-verdict-panel {
  height: 68vh;
  min-height: 420px;
  padding: 2vh 2vw;
  background: #f4e8d3;
  color: #3b332b;
  border: 1px solid rgba(112, 84, 48, 0.22);
  overflow: hidden;
}

.audit-verdict-panel h2 {
  margin: 0 0 1.2vh;
  color: #4b3420;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.2em;
}

.audit-verdict-panel .scroll__verdict {
  height: calc(100% - 7vh);
  padding: 0;
  gap: 3vw;
  font-size: 14px;
}

.audit-verdict-panel .audit__count {
  color: rgba(94, 69, 42, 0.62);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.7;
}

.audit-inv-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2.4vh 1.4vw;
}

.audit-inv {
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
}

.audit-inv__figure {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: rgba(226, 232, 240, 0.78);
  -webkit-mask-image: var(--mask);
  mask-image: var(--mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transform: scaleY(-1);
  filter: url(#filter-ink-wash);
  border: 1px solid rgba(198, 161, 91, 0.16);
  background-color: rgba(226, 232, 240, 0.7);
}

.audit-inv__name {
  color: rgba(226, 232, 240, 0.76);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.audit-inv__note {
  color: rgba(226, 232, 240, 0.34);
  font-size: 9px;
  line-height: 1.6;
}

.audit-verdict-empty {
  padding: 4vh 2vw;
  border: 1px dashed rgba(198, 161, 91, 0.3);
  color: rgba(226, 232, 240, 0.4);
  font-size: 12px;
  line-height: 1.8;
}

/* width audit */

.audit-width {
  margin-bottom: 4vh;
  padding-bottom: 2vh;
  border-bottom: 1px solid rgba(198, 161, 91, 0.14);
}

.audit-width h2 {
  margin: 0 0 1vh;
  color: rgba(244, 216, 148, 0.85);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.audit-frame-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(198, 161, 91, 0.26);
  background: #1e293b;
  transform-origin: top left;
}

.audit-frame-wrap iframe {
  display: block;
  border: 0;
  transform-origin: top left;
  background: #1e293b;
}

.audit-width__report {
  margin: 1.2vh 0 0;
  color: rgba(226, 232, 240, 0.66);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .audit-grid,
  .audit-inv-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .audit-shared {
    grid-template-columns: 1fr;
  }

  .audit-verdict-panel {
    height: auto;
    min-height: 44vh;
  }

  .audit__head {
    display: block;
  }

  .audit__actions {
    margin-top: 1vh;
  }
}

/* 统一倒挂复核：按钮切到上界实际浓度，只看形体，不看亮度。 */
body.audit-inv--faint .audit-inv__figure {
  opacity: 0.12;
  border-color: transparent;
}
