:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panelBorder: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.66);
  --faint: rgba(255, 255, 255, 0.42);
  --accent: #6d5efc;
  --accent2: #00d4ff;
  --danger: #ff4d6d;
  --ok: #33d69f;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

html[data-theme="light"] {
  --bg: #f7f9ff;
  --panel: rgba(20, 30, 60, 0.11);
  --panelBorder: rgba(20, 30, 60, 0.18);
  --text: rgba(10, 12, 20, 0.92);
  --muted: rgba(10, 12, 20, 0.62);
  --faint: rgba(10, 12, 20, 0.42);
  --shadow: 0 18px 60px rgba(30, 40, 90, 0.22);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(1200px 800px at 10% 0%, rgba(109, 94, 252, 0.35), transparent 60%),
    radial-gradient(900px 700px at 90% 10%, rgba(0, 212, 255, 0.24), transparent 60%),
    radial-gradient(900px 700px at 40% 90%, rgba(51, 214, 159, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg), rgba(0, 0, 0, 0.06));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 22px;
  background: transparent;
  border-bottom: none;
}

.topTitle {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0.4px;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.actions {
  position: absolute;
  right: 16px;
  top: 12px;
  transform: none;
  z-index: 20;
}

.container {
  width: 100%;
  margin: 0;
  padding: 10px 28px 160px;
  display: grid;
  gap: 18px;
}

.panel {
  width: min(1080px, 100%);
  margin: 0 auto;
  border: 1px solid var(--panelBorder);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panelHeader {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 14px;
}

.panelTitle {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.2px;
}

.panelHint {
  font-size: 12px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.historyActions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.historyList {
  display: grid;
  gap: 12px;
}

.historyItem {
  border: 1px dashed var(--panelBorder);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.08);
  position: relative;
  cursor: pointer;
}

html[data-theme="light"] .historyItem {
  background: rgba(255, 255, 255, 0.55);
}

.historyMain {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-right: 34px;
}

.historyFile {
  font-size: 14px;
  font-weight: 850;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.historyMeta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.historyBtns {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.historyBtn {
  border: 1px solid var(--panelBorder);
  border-radius: 14px;
  padding: 8px 10px;
  font-weight: 800;
  color: var(--text);
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.historyBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="light"] .historyBtn:hover {
  border-color: rgba(20, 30, 60, 0.24);
}

.historyDeleteBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.historyDeleteBtn:hover {
  transform: translateY(-1px) scale(1.04);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.historyToggleBtn {
  position: fixed;
  left: 16px;
  top: 160px;
  z-index: 45;
  border: 1px solid var(--panelBorder);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 850;
  color: var(--text);
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .historyToggleBtn {
  background: rgba(255, 255, 255, 0.55);
}

.historySidebar {
  position: fixed;
  left: 16px;
  top: 96px;
  z-index: 50;
}

.historySidebarShell {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--panelBorder);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.10);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transform-origin: left top;
  transform: translateX(-8px) scale(0.98);
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}

html[data-theme="light"] .historySidebarShell {
  background: rgba(255, 255, 255, 0.55);
}

.historySidebarShell[data-open="1"] {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.historySidebarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
}

.historySidebarTitle {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.historySidebarBody {
  border-top: 1px solid var(--panelBorder);
  border-bottom: 1px solid var(--panelBorder);
  padding: 12px;
  max-height: min(70vh, 680px);
  overflow: auto;
  overscroll-behavior: contain;
}

.historySidebarFooter {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.historyPager {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.historyPageInfo {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 860px) {
  .container {
    padding: 8px 14px 24px;
  }

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

.field {
  display: grid;
  gap: 8px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

.codeBox {
  border: 1px solid var(--panelBorder);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(0, 0, 0, 0.16);
}

html[data-theme="light"] .codeBox {
  background: rgba(255, 255, 255, 0.65);
}

.codeMuted {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  user-select: all;
}

.input {
  border: 1px solid var(--panelBorder);
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
  border-radius: 14px;
  padding: 11px 12px;
  outline: none;
  font-size: 13px;
}

html[data-theme="light"] .input {
  background: rgba(255, 255, 255, 0.65);
}

.apiKeyInput::placeholder {
  color: rgba(160, 165, 190, 0.9);
}

html[data-theme="light"] .apiKeyInput::placeholder {
  color: rgba(120, 128, 155, 0.9);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status {
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}

.uploadCenter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 0 2px;
}

.btnRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btnDanger {
  background: rgba(255, 77, 109, 0.14);
  border-color: rgba(255, 77, 109, 0.35);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.uploadField {
  width: min(920px, 100%);
}

.fileInput {
  width: 100%;
}

.uploadCenter .label {
  text-align: left;
}

.uploadCenter .status {
  text-align: center;
}

.progressBox {
  width: min(720px, 100%);
  border: 1px solid var(--panelBorder);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.10);
}

html[data-theme="light"] .progressBox {
  background: rgba(255, 255, 255, 0.55);
}

.progressTitle {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

.progressList {
  display: grid;
  gap: 8px;
}

.progressItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed var(--panelBorder);
  border-radius: 14px;
  padding: 9px 10px;
}

.progressName {
  font-size: 12px;
  font-weight: 750;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progressState {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.progressStateDone {
  color: rgba(51, 214, 159, 0.98);
}

.progressStateErr {
  color: rgba(255, 77, 109, 0.96);
}

.btn {
  border: 1px solid var(--panelBorder);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--text);
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="light"] .btn:hover {
  border-color: rgba(20, 30, 60, 0.24);
}

.btnPrimary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 34px rgba(0, 212, 255, 0.18);
}

.btnGhost {
  background: rgba(0, 0, 0, 0.16);
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 860px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.resultsRoot {
  display: grid;
  gap: 14px;
}

.chapterGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 980px) {
  .chapterGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .chapterGrid {
    grid-template-columns: 1fr;
  }
}

.chapterTile {
  border: 1px solid var(--panelBorder);
  background: rgba(0, 0, 0, 0.14);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

html[data-theme="light"] .chapterTile {
  background: rgba(255, 255, 255, 0.65);
}

.chapterTile:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="light"] .chapterTile:hover {
  border-color: rgba(20, 30, 60, 0.24);
}

.chapterTileActive {
  border-color: rgba(0, 212, 255, 0.45);
  box-shadow: 0 18px 60px rgba(0, 212, 255, 0.12);
}

html[data-theme="light"] .chapterTileActive {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 18px 60px rgba(0, 212, 255, 0.14);
}

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

.chapterTileTitle {
  font-size: 13px;
  font-weight: 850;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapterTileMeta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.chapterTileCount {
  font-family: var(--mono);
  font-weight: 850;
}

.chapterCards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 860px) {
  .chapterCards {
    grid-template-columns: 1fr;
  }
}

.chapterCard {
  width: 100%;
}

.chapterDetailWrap {
  display: flex;
  justify-content: center;
}

.chapterDetailPanel {
  width: min(980px, 100%);
}

.chapterCardBody {
  margin-top: 12px;
  border: 1px solid var(--panelBorder);
  border-radius: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.10);
  display: grid;
  gap: 12px;
  width: 100%;
}

html[data-theme="light"] .chapterCardBody {
  background: rgba(255, 255, 255, 0.55);
}

.chapterBodyTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chapterBodyTitle {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.footerBar {
  width: min(1080px, calc(100% - 56px));
  margin: 0 auto;
  border: 1px solid var(--panelBorder);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.10);
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 30;
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .footerBar {
  background: rgba(255, 255, 255, 0.55);
}

.footerStats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 820px) {
  .footerStats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.statCard {
  border: 1px solid var(--panelBorder);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  gap: 6px;
}

html[data-theme="light"] .statCard {
  background: rgba(255, 255, 255, 0.65);
}

.statNumber {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 950;
  color: var(--text);
  line-height: 1;
}

.statOk {
  color: rgba(51, 214, 159, 0.98);
}

.statWarn {
  color: rgba(255, 210, 77, 0.98);
}

.statBad {
  color: rgba(255, 77, 109, 0.96);
}

.statLabel {
  font-size: 12px;
  color: var(--muted);
}

.footerHint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.card {
  border: 1px solid var(--panelBorder);
  background: rgba(0, 0, 0, 0.14);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

html[data-theme="light"] .card {
  background: rgba(255, 255, 255, 0.65);
}

.cardTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cardTitle {
  font-weight: 800;
  font-size: 13px;
}

.pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--panelBorder);
  color: var(--muted);
}

.pillOk {
  color: rgba(51, 214, 159, 0.98);
  border-color: rgba(51, 214, 159, 0.35);
}

.pillMissing {
  color: rgba(255, 77, 109, 0.96);
  border-color: rgba(255, 77, 109, 0.35);
}

.meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.box {
  border: 1px dashed var(--panelBorder);
  border-radius: 14px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(0, 0, 0, 0.10);
}

.box pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.auditBox {
  display: grid;
  gap: 10px;
}

.chapterCardBody .auditBox {
  max-height: min(64vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.auditItem {
  border: 1px dashed var(--panelBorder);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 8px;
  position: relative;
}

html[data-theme="light"] .auditItem {
  background: rgba(255, 255, 255, 0.55);
}

.auditHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-right: 84px;
}

.auditTitle {
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auditMeta {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  padding-right: 84px;
}

.auditBrief {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  padding-right: 84px;
}

.auditToggle {
  width: min(320px, 100%);
  justify-self: center;
}

.auditDetail pre {
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auditBadge {
  border: 1px solid var(--panelBorder);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  font-family: var(--mono);
  white-space: nowrap;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.auditItem:has(.auditDetail:not([hidden])) .auditBadge {
  top: 12px;
  transform: none;
}

.auditBadgeOk {
  color: rgba(51, 214, 159, 0.98);
  border-color: rgba(51, 214, 159, 0.35);
  background: rgba(51, 214, 159, 0.10);
}

.auditBadgeBad {
  color: rgba(255, 77, 109, 0.96);
  border-color: rgba(255, 77, 109, 0.35);
  background: rgba(255, 77, 109, 0.10);
}

.auditBadgeWarn {
  color: rgba(255, 210, 77, 0.98);
  border-color: rgba(255, 210, 77, 0.35);
  background: rgba(255, 210, 77, 0.10);
}

html[data-theme="light"] .box {
  background: rgba(255, 255, 255, 0.5);
}

html[data-theme="light"] .box,
html[data-theme="light"] .meta,
html[data-theme="light"] .auditMeta,
html[data-theme="light"] .auditTitle {
  color: rgba(0, 0, 0, 0.88);
}

.err {
  color: rgba(255, 77, 109, 0.96);
}

.footer {
  padding: 16px 0 26px;
  opacity: 0.95;
}

.footerInner {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
}

.footerText {
  font-size: 12px;
  color: var(--muted);
}

.auditSidebar {
  position: fixed;
  left: 16px;
  top: 96px;
  z-index: 40;
}

.auditSidebarShell {
  width: 330px;
  border: 1px solid var(--panelBorder);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.10);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 12px;
  display: grid;
  gap: 10px;
  position: relative;
}

html[data-theme="light"] .auditSidebarShell {
  background: rgba(255, 255, 255, 0.55);
}

.auditSidebarSummary {
  display: grid;
  gap: 10px;
}

.auditSidebarSummaryRow {
  border: 1px solid var(--panelBorder);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

html[data-theme="light"] .auditSidebarSummaryRow {
  background: rgba(255, 255, 255, 0.65);
}

.auditSidebarSummaryRowActive {
  border-color: rgba(109, 94, 252, 0.55);
  box-shadow: 0 0 0 2px rgba(109, 94, 252, 0.18) inset;
}

.auditSidebarSummaryNum {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.auditSidebarSummaryLabel {
  font-size: 13px;
  font-weight: 850;
  color: var(--text);
}

.auditSidebarBody {
  border-top: 1px solid var(--panelBorder);
  padding-top: 10px;
  display: grid;
  gap: 10px;
  max-height: min(70vh, 640px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.auditSidebarShell[data-open="0"] .auditSidebarBody {
  display: none;
}

.auditSidebarGroupTitle {
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auditSidebarList {
  display: grid;
  gap: 10px;
}

.auditSidebarItem {
  border: 1px dashed var(--panelBorder);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 6px;
  cursor: pointer;
}

html[data-theme="light"] .auditSidebarItem {
  background: rgba(255, 255, 255, 0.55);
}

.auditSidebarItem:hover {
  border-color: rgba(109, 94, 252, 0.55);
}

.auditSidebarItemTitle {
  font-size: 14px;
  font-weight: 850;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auditSidebarItemMeta {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Conclusion View Styles */
#conclusionView {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.conclusionHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 0;
  padding: 0;
}

.conclusionTitle {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  color: var(--text);
  line-height: 1.25;
  flex: 1 1 auto;
}

.conclusionHeaderActions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.conclusionHeaderActions .btn {
  min-width: 180px;
}

.conclusionSubHeader {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.conclusionBody {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.conclusionLeft {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.conclusionRight {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.conclusionListPanel, .conclusionIssuesPanel, .conclusionDetailPanel, .conclusionSummaryPanel, .conclusionMessagePanel {
  width: 100%;
  margin: 0;
  text-align: left;
}

.conclusionListPanel .panelTitle, .conclusionIssuesPanel .panelTitle, .conclusionDetailPanel .panelTitle {
  text-align: left;
  font-size: 18px;
  font-weight: bold;
}

.feedbackBody {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.feedbackText {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.feedbackActions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feedbackStatus {
  font-size: 13px;
  color: var(--muted);
}

.feedbackStatus.error {
  color: var(--danger);
}

.feedbackStatus.ok {
  color: var(--ok);
}

.conclusionListContent {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  margin-top: 14px;
  max-height: min(54vh, 640px);
  overflow-y: auto;
  padding-right: 4px;
}

.conclusionIssuesContent {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  margin-top: 14px;
  max-height: min(34vh, 400px);
  overflow-y: auto;
  padding-right: 4px;
}

.conclusionListItem {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  line-height: 1.4;
  border: 1px solid transparent;
}
.conclusionListItem:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(59, 130, 246, 0.18);
}
html[data-theme="light"] .conclusionListItem:hover {
  background: rgba(255,255,255,0.72);
  border-color: rgba(59, 130, 246, 0.18);
}
.conclusionListItem.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(59, 130, 246, 0.42);
}
html[data-theme="light"] .conclusionListItem.active {
  background: rgba(255,255,255,0.96);
  border-color: rgba(59, 130, 246, 0.42);
  box-shadow: 0 12px 28px -26px rgba(37, 99, 235, 0.35);
}

.conclusionListText {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conclusionListLabel {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.conclusionListMeta {
  font-size: 12px;
  color: var(--muted);
}

.iconCircle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid var(--muted);
  flex-shrink: 0;
}
.iconCircle.red {
  border-color: #ff4d4f;
  background-color: #ff4d4f;
}
.iconCircle.grey {
  border-color: #d9d9d9;
  background-color: transparent;
}
.iconCircle.green {
  border-color: #52c41a;
  background-color: transparent;
}
.iconCircle.yellow {
  border-color: #faad14;
  background-color: transparent;
}

.issueGroupTitle {
  font-weight: bold;
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 16px;
}
.issueGroup:first-child .issueGroupTitle {
  margin-top: 0;
}
.issueList {
  list-style-type: disc;
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.issueItem {
  cursor: pointer;
  padding: 4px 0;
  line-height: 1.5;
}
.issueItem:hover {
  text-decoration: underline;
}
.issueItem.active {
  color: #2563eb;
  font-weight: 700;
}

.issueItemId {
  color: var(--muted);
}

.conclusionDetailContent {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 15px;
  margin-top: 14px;
  min-height: 420px;
}

.detailRow {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.7;
}

.detailLabel {
  font-weight: bold;
  white-space: nowrap;
}

.detailValue {
  color: var(--text);
  overflow-wrap: anywhere;
}

.detailValue.red {
  color: #ff4d4f;
  font-weight: bold;
}
.detailValue.green {
  color: #52c41a;
  font-weight: bold;
}
.detailValue.yellow {
  color: #faad14;
  font-weight: bold;
}

.detailBox {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-top: 0;
}
html[data-theme="light"] .detailBox {
  background: transparent;
}
.detailBoxTitle {
  font-weight: bold;
  margin-bottom: 12px;
  font-size: 18px;
}
.detailBoxContent {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--panelBorder);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--sans);
  font-size: 15px;
  white-space: pre-wrap;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}
html[data-theme="light"] .detailBoxContent {
  background: rgba(255, 255, 255, 0.6);
}

.detailSummary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detailDivider {
  height: 1px;
  background: rgba(148, 163, 184, 0.28);
}

.detailEmpty {
  padding: 20px 16px;
  border: 1px dashed var(--panelBorder);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
}

.detailAnalysisBox {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analysisConclusion {
  padding: 10px 14px;
  border: 1px solid var(--panelBorder);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  font-weight: 700;
  line-height: 1.6;
}
html[data-theme="light"] .analysisConclusion {
  background: rgba(255, 255, 255, 0.62);
}

.reasonDetails {
  margin-top: 0;
}
.reasonSummary {
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  user-select: none;
  list-style: none;
  margin-top: 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--panelBorder);
  border-top: none;
  border-radius: 0 0 8px 8px;
}
html[data-theme="light"] .reasonSummary {
  background: rgba(255, 255, 255, 0.4);
}
.reasonSummary::-webkit-details-marker {
  display: none;
}
.reasonSummary:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .reasonSummary:hover {
  background: rgba(255, 255, 255, 0.6);
}

.finalConclusionBox {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--panelBorder);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
}
html[data-theme="light"] .finalConclusionBox {
  background: rgba(255, 255, 255, 0.6);
}
.finalConclusionBox.has-details {
  border-radius: 8px 8px 0 0;
}

.conclusionSummaryContent {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-top: 10px;
}

.summaryCard {
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--panelBorder);
  border-radius: 8px;
  padding: 18px 16px;
  text-align: center;
}
html[data-theme="light"] .summaryCard {
  background: #fff;
}
.summaryCardValue {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 5px;
}
.summaryCardLabel {
  font-size: 14px;
  color: var(--muted);
}
.color-blue { color: #1890ff; }
.color-green { color: #52c41a; }
.color-yellow { color: #faad14; }
.color-red { color: #ff4d4f; }

body.uploadPage.conclusion-mode .heroHeader {
  padding: 10px 0 16px;
}

body.uploadPage.conclusion-mode .heroTitle {
  display: none;
}

body.uploadPage.conclusion-mode .container {
  padding-top: 0;
}

body.uploadPage.conclusion-mode #conclusionView {
  margin-top: 0;
}

body.uploadPage.embedded-mode.conclusion-mode .conclusionTitle {
  padding-left: 164px;
}

@media (max-width: 860px) {
  .conclusionHeader {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .conclusionTitle {
    font-size: 20px;
  }

  .conclusionHeaderActions {
    justify-content: flex-start;
  }

  .conclusionHeaderActions .btn {
    min-width: 0;
    width: 100%;
  }

  body.uploadPage.embedded-mode.conclusion-mode .conclusionTitle {
    padding-left: 0;
  }

  .conclusionBody {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .conclusionListContent,
  .conclusionIssuesContent {
    max-height: none;
  }

  .conclusionSummaryContent {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detailRow {
    flex-direction: column;
    gap: 4px;
  }

  .detailLabel {
    white-space: normal;
  }

  .auditSidebar {
    position: fixed;
    left: 12px;
    top: 84px;
    right: 12px;
  }

  .auditSidebarShell {
    width: min(360px, calc(100vw - 24px));
  }
}

body.uploadPage {
  --panel: rgba(255, 255, 255, 0.46);
  --panelBorder: rgba(148, 163, 184, 0.28);
  --text: rgba(15, 23, 42, 0.96);
  --muted: rgba(15, 23, 42, 0.6);
  --faint: rgba(15, 23, 42, 0.42);
  --accent: #0f766e;
  --accent2: #14b8a6;
  --danger: #94a3b8;
  --ok: #10b981;
  --shadow: 0 24px 60px -36px rgba(15, 23, 42, 0.32);
  --radius: 22px;
  --history-column-width: 360px;
  min-height: 100vh;
  justify-content: flex-start;
  background:
    radial-gradient(960px 680px at 8% 10%, rgba(250, 204, 21, 0.2), transparent 60%),
    radial-gradient(920px 760px at 94% 0%, rgba(56, 189, 248, 0.2), transparent 58%),
    radial-gradient(760px 640px at 18% 92%, rgba(196, 181, 253, 0.22), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
}

body.uploadPage:not(.history-open) {
  --history-column-width: 64px;
}

body.uploadPage .actions {
  position: absolute;
  right: 16px;
  top: 12px;
}

body.uploadPage.embedded-mode .actions {
  display: none;
}

body.uploadPage .themeBtn {
  border-radius: 18px;
  min-height: 40px;
  padding: 10px 16px;
  color: #334155;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 16px 36px -30px rgba(15, 23, 42, 0.24);
}

body.uploadPage .heroHeader {
  padding: 44px 0 56px;
}

body.uploadPage.embedded-mode .heroHeader {
  padding-top: 22px;
}

body.uploadPage .heroTitle {
  margin: 0;
  text-align: center;
  font-size: clamp(34px, 3.4vw, 56px);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0f172a;
  text-shadow: 0 12px 32px rgba(255, 255, 255, 0.3);
}

body.uploadPage .container {
  width: 100%;
  max-width: 1940px;
  margin: 0 auto;
  padding: 0 28px 96px;
  gap: 0;
}

body.uploadPage .workspaceGrid {
  display: grid;
  grid-template-columns: var(--history-column-width) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

body.uploadPage .historyColumn {
  position: relative;
  min-width: 0;
  min-height: 220px;
  padding-left: 48px;
}

body.uploadPage .historyToggleBtn {
  position: fixed;
  left: 6px;
  top: clamp(220px, 34vh, 280px);
  z-index: 42;
  width: 42px;
  height: 66px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 20px 44px -34px rgba(15, 23, 42, 0.26);
  backdrop-filter: blur(10px);
  color: transparent;
  font-size: 0;
  line-height: 0;
  transform: none;
}

body.uploadPage .historyToggleBtn::before {
  content: "";
  display: block;
  width: 11px;
  height: 14px;
  background: #64748b;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

body.uploadPage:not(.history-open) .historyToggleBtn::before {
  transform: rotate(180deg);
}

body.uploadPage .historySidebar {
  position: relative;
  left: 0;
  top: 0;
  z-index: 1;
}

body.uploadPage .historySidebarShell {
  width: 100%;
  min-height: 196px;
  padding: 24px 18px 18px;
  border-radius: 18px;
  border: 1px solid rgba(191, 219, 254, 0.3);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 24px 56px -38px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  transform-origin: left center;
  transform: translateX(0) scale(1);
  opacity: 1;
  transition: transform 160ms ease, opacity 160ms ease;
}

body.uploadPage .historySidebarShell[data-open="0"] {
  transform: translateX(-8px) scale(0.98);
  opacity: 0;
}

body.uploadPage:not(.history-open) .historySidebar[hidden] {
  display: none !important;
}

body.uploadPage .historySidebarHeader {
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 18px;
}

body.uploadPage .historySidebarTitle {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
}

body.uploadPage .historyCloseBtn,
body.uploadPage .historySidebarFooter {
  display: none;
}

body.uploadPage .historySidebarBody {
  border: 0;
  padding: 0;
  max-height: 460px;
}

body.uploadPage .historyList {
  display: grid;
  gap: 12px;
}

body.uploadPage .historyList > .muted {
  font-size: 14px;
  color: #64748b;
}

body.uploadPage .historyItem {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(191, 219, 254, 0.28);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.uploadPage .historyMain {
  gap: 8px;
}

body.uploadPage .historyFile {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

body.uploadPage .historyMeta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #64748b;
}

body.uploadPage .historyBtns {
  gap: 8px;
}

body.uploadPage .historyBtn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(248, 250, 252, 0.96);
  box-shadow: none;
}

body.uploadPage .historyDeleteBtn {
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
}

body.uploadPage .uploadPanel {
  width: 100%;
  min-width: 0;
  padding: 28px 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(191, 219, 254, 0.32);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 24px 56px -38px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(10px);
}

body.uploadPage .uploadPanelHeader {
  margin-bottom: 24px;
}

body.uploadPage .uploadPanelTitle {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
}

body.uploadPage .uploadPanelHint {
  font-size: 14px;
  color: rgba(15, 23, 42, 0.6);
}

body.uploadPage .uploadCenterWide {
  align-items: stretch;
  gap: 18px;
  padding: 0;
}

body.uploadPage .uploadDropShell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 164px;
  padding: 24px 26px;
  border: 2px dashed rgba(148, 163, 184, 0.42);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

body.uploadPage .uploadDropActive {
  border-color: rgba(20, 184, 166, 0.68);
  box-shadow: 0 18px 46px -36px rgba(20, 184, 166, 0.4);
  transform: translateY(-1px);
}

body.uploadPage .uploadDropReady {
  border-color: rgba(20, 184, 166, 0.52);
  box-shadow: 0 18px 46px -36px rgba(20, 184, 166, 0.32);
  background: rgba(255, 255, 255, 0.9);
}

body.uploadPage .uploadDropLead {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: rgba(148, 163, 184, 0.96);
  flex: 0 0 auto;
}

body.uploadPage .uploadDropIcon {
  width: 38px;
  height: 38px;
  color: rgba(148, 163, 184, 0.98);
}

body.uploadPage .uploadDropCopy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

body.uploadPage .uploadDropMeta {
  font-size: 14px;
  color: rgba(100, 116, 139, 0.88);
}

body.uploadPage .uploadDropTitle {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

body.uploadPage .uploadDropName {
  font-size: 14px;
  font-weight: 700;
  color: #0f766e;
  overflow-wrap: anywhere;
}

body.uploadPage .uploadBrowseBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 32px -30px rgba(15, 23, 42, 0.28);
}

body.uploadPage .uploadBrowseBtn:hover {
  background: #f8fafc;
}

body.uploadPage .fileInputHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.uploadPage .btnRowWide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

body.uploadPage .actionBtn,
body.uploadPage .actionBtnWide {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
}

body.uploadPage .btnPrimary,
body.uploadPage .btnDanger {
  background: #f3f4f6;
  border-color: rgba(148, 163, 184, 0.35);
  color: #64748b;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.12);
}

body.uploadPage .actionBtn:hover:not(:disabled),
body.uploadPage .actionBtnWide:hover:not(:disabled) {
  background: #e5e7eb;
  color: #334155;
  border-color: rgba(148, 163, 184, 0.5);
}

body.uploadPage .actionBtn:disabled,
body.uploadPage .actionBtnWide:disabled {
  background: #f3f4f6;
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(100, 116, 139, 0.7);
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.08);
  opacity: 1;
}

body.uploadPage .statusWide {
  min-height: 22px;
  font-size: 14px;
  color: #475569;
  text-align: left;
}

body.uploadPage .progressBoxWide {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(191, 219, 254, 0.28);
  background: rgba(255, 255, 255, 0.6);
}

body.uploadPage .progressTitle {
  font-size: 14px;
  font-weight: 800;
  color: #334155;
}

body.uploadPage .progressItem {
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.8);
}

body.uploadPage .progressName {
  font-size: 14px;
  color: #0f172a;
}

body.uploadPage .progressState {
  color: #64748b;
}

body.uploadPage .viewResultBtnBox,
body.uploadPage .resultsRoot {
  width: 100%;
}

@media (max-width: 1180px) {
  body.uploadPage {
    --history-column-width: 1fr;
  }

  body.uploadPage .workspaceGrid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  body.uploadPage .historyColumn {
    order: 2;
    padding-left: 0;
    min-height: 0;
  }

  body.uploadPage .historyToggleBtn {
    position: relative;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    padding: 9px 14px;
    margin-bottom: 12px;
    transform: none;
    color: #0f172a;
    font-size: 14px;
  }

  body.uploadPage .historyToggleBtn::before,
  body.uploadPage:not(.history-open) .historyToggleBtn::before {
    content: none;
  }
}

@media (max-width: 860px) {
  body.uploadPage .container {
    padding: 0 12px 56px;
  }

  body.uploadPage .heroHeader {
    padding: 22px 0 28px;
  }

  body.uploadPage .heroTitle {
    font-size: 28px;
  }

  body.uploadPage .uploadPanel {
    padding: 18px 14px;
  }

  body.uploadPage .uploadDropShell {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 18px 16px;
  }

  body.uploadPage .uploadBrowseBtn,
  body.uploadPage .actionBtn,
  body.uploadPage .actionBtnWide {
    width: 100%;
  }

  body.uploadPage .btnRowWide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .conclusionSummaryContent {
    grid-template-columns: 1fr;
  }
}
