:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.2);
  --text: #111827;
  --muted: #667085;
  --red: #ef4056;
  --cyan: #0ea5b7;
  --gold: #b77b20;
  --green: #188455;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg) url("beam.png") center top / cover fixed no-repeat;
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(246, 248, 251, 0.94) 0%, rgba(246, 248, 251, 0.78) 48%, rgba(246, 248, 251, 0.56) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(246, 248, 251, 0.95));
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.stage {
  width: min(1320px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, #0f172a 0%, #67d9ea 42%, #ff5060 100%);
  transform: rotate(45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 13px;
}

.nav-links a:hover {
  color: var(--text);
}

.ghost-button,
.primary-button,
.secondary-button,
.preset,
.tab {
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ghost-button {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-top: 42px;
}

.control-panel,
.result-panel,
.report-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(18px);
}

.control-panel {
  padding: 24px;
}

.section-title p,
.review-head p {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.section-title h1 {
  margin: 0;
  max-width: 360px;
  font-size: clamp(31px, 3.2vw, 38px);
  font-weight: 750;
  line-height: 1.08;
}

.review-head h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 750;
  line-height: 1.08;
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  padding: 10px 12px;
}

input:focus {
  border-color: rgba(14, 165, 183, 0.58);
  box-shadow: 0 0 0 3px rgba(14, 165, 183, 0.14);
}

.preset-row,
.tab-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preset,
.tab {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.preset.is-active,
.tab.is-active {
  border-color: rgba(14, 165, 183, 0.55);
  background: rgba(14, 165, 183, 0.11);
  color: var(--text);
}

.threshold-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--cyan);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-color: #101828;
  background: #101828;
  color: #ffffff;
  font-weight: 760;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-button {
  min-height: 44px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-weight: 700;
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-icon {
  color: var(--red);
}

.result-panel {
  padding: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.metrics div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
}

.review-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.tab-row {
  width: 236px;
  grid-template-columns: repeat(2, 1fr);
}

.preview-frame {
  position: relative;
  width: 100%;
  height: clamp(560px, 70vh, 920px);
  margin-top: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.preview-image {
  display: none;
  width: auto;
  min-width: 100%;
  max-width: none;
  height: auto;
  background: #f5f5f5;
}

.preview-image.is-active {
  display: block;
}

.run-log {
  min-height: 92px;
  max-height: 180px;
  margin: 16px 0 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #344054;
  padding: 12px;
  white-space: pre-wrap;
}

.hint-text {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.report-panel {
  margin-top: 24px;
  padding: 18px;
}

.table-wrap {
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-strong);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 700;
}

td {
  color: #1f2937;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
}

.status.accepted {
  background: rgba(24, 132, 85, 0.12);
  color: var(--green);
}

.status.rejected {
  background: rgba(239, 64, 86, 0.12);
  color: var(--red);
}

.file-cell {
  max-width: 360px;
}

.caption-cell {
  min-width: 320px;
}

.muted {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .stage {
    width: min(100% - 28px, 760px);
    padding-top: 18px;
  }

  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .workspace {
    padding-top: 24px;
  }

  .review-head {
    align-items: start;
    flex-direction: column;
  }

  .tab-row {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .threshold-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .section-title h1,
  .review-head h2 {
    font-size: 28px;
  }
}
