:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #60707a;
  --line: #d8e0e4;
  --paper: #f7f9f8;
  --surface: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b5d56;
  --warn: #b7791f;
  --danger: #b42318;
  --blue: #235789;
  --shadow: 0 20px 45px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #f2f6f5 0%, #f9fbfb 46%, #eef3f2 100%);
  color: var(--ink);
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.workspace,
.report-head,
.summary-band,
.segment,
.panel,
.upload-panel,
.score-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workspace {
  padding: clamp(22px, 4vw, 44px);
}

.mast {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 14px;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: #33434b;
}

.notice {
  color: var(--muted);
  line-height: 1.75;
}

.engine-line {
  margin-bottom: 0;
  color: #33434b;
  font-size: 0.92rem;
}

.warning-list {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8ea;
  border: 1px solid #ecc56c;
  color: #6f4300;
}

.warning-list p {
  margin: 0;
  line-height: 1.65;
}

.alert {
  margin: 22px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #f2c078;
  color: #6f4300;
}

.alert p {
  margin: 0;
}

.upload-panel {
  margin-top: 28px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  box-shadow: none;
}

.drop-zone {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 22px;
  border: 1px dashed #98a8ae;
  border-radius: 8px;
  background: #f9fbfb;
  cursor: pointer;
  align-content: center;
}

.drop-zone input {
  margin-top: 8px;
  max-width: 100%;
}

.file-status {
  color: #33434b;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.drop-title {
  font-weight: 700;
  font-size: 1.08rem;
}

.drop-meta,
.metric-label,
small {
  color: var(--muted);
}

.primary-button,
.ghost-button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-button {
  color: var(--ink);
  background: #edf3f2;
  border: 1px solid #cad8d5;
}

.small {
  min-height: 40px;
}

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

.progress-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #cddbd8;
  border-radius: 8px;
  background: #f7fbfa;
}

.progress-panel[hidden] {
  display: none;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.progress-copy strong,
.progress-copy span {
  line-height: 1.4;
}

.progress-track {
  height: 10px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #d7e3e0;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #235789);
  transition: width 240ms ease;
}

.progress-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.progress-panel.is-error {
  background: #fff4e5;
  border-color: #f2c078;
}

.progress-panel.is-error .progress-bar {
  background: var(--danger);
}

.panel {
  padding: 20px;
  box-shadow: none;
}

ul {
  margin: 0;
  padding-left: 1.2rem;
  color: #34434b;
  line-height: 1.8;
}

.report-shell {
  width: min(1240px, calc(100vw - 32px));
}

.report-head {
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: start;
}

.report-head h1 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  word-break: break-word;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.score-strip {
  margin-top: 18px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.score-strip div {
  min-width: 0;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.score-strip div:last-child {
  border-right: 0;
}

.score-strip strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 2rem;
  line-height: 1;
}

.metric-label {
  display: block;
  font-size: 0.82rem;
}

.summary-band {
  margin-top: 18px;
  padding: 22px;
  box-shadow: none;
}

.summary-band p:last-child {
  margin-bottom: 0;
}

.segments {
  margin-top: 26px;
}

.segments > h2 {
  margin-left: 2px;
}

.segment {
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: none;
}

.segment header {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: #f8faf9;
  border-bottom: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  margin-bottom: 7px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--blue);
}

.level-高 .badge {
  background: var(--danger);
}

.level-中 .badge {
  background: var(--warn);
}

.level-低 .badge {
  background: var(--accent);
}

.segment-score {
  text-align: right;
}

.segment-score strong {
  display: inline-block;
  font-size: 2rem;
}

.segment-body {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.8fr) minmax(0, 1fr);
  gap: 20px;
}

.source-text,
.revision-text {
  margin-bottom: 0;
  color: #27353c;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.revision-text {
  padding: 14px;
  border-radius: 8px;
  background: #f2f7f6;
  border: 1px solid #d4e4e1;
}

h4 span {
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 860px) {
  .shell,
  .report-shell {
    width: min(100vw - 20px, 760px);
    padding-top: 18px;
  }

  .upload-panel,
  .grid,
  .report-head,
  .score-strip,
  .segment-body {
    grid-template-columns: 1fr;
  }

  .score-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }

  .score-strip div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .actions {
    justify-content: stretch;
  }

  .actions a,
  .primary-button {
    width: 100%;
  }
}
