:root {
  color-scheme: light;
  --bg: #eef2f1;
  --panel: #ffffff;
  --panel-soft: #f8faf9;
  --ink: #17201f;
  --muted: #65706d;
  --line: #d7dfdc;
  --accent: #0e766d;
  --accent-dark: #0a5b54;
  --warning: #b44926;
  --warning-soft: #fff1ea;
  --shadow: 0 18px 50px rgba(23, 32, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
}

button,
textarea,
input {
  font: inherit;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.left-pane,
.right-pane {
  display: grid;
  gap: 16px;
}

.title-block {
  padding: 4px 2px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.85rem, 3vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  line-height: 1.3;
}

.subline {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.model-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.model-strip div {
  min-width: 0;
  padding: 12px;
  background: var(--panel);
}

.model-strip span,
.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.model-strip strong,
.summary-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.panel,
.result-summary,
.image-table-wrap,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head span {
  color: var(--muted);
  font-size: 0.85rem;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 156px;
  border: 1px dashed #9bb3ae;
  border-radius: 8px;
  background: var(--panel-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: #f0f8f6;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: #e8f6f2;
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-main {
  display: block;
  color: var(--accent-dark);
  font-weight: 800;
}

.drop-sub {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.preview-item {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.preview-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #dce4e1;
}

.preview-item span,
.preview-more {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfdfc;
  color: var(--ink);
  line-height: 1.5;
}

textarea:focus,
button:focus-visible,
.drop-zone:focus-within {
  outline: 3px solid rgba(14, 118, 109, 0.18);
  outline-offset: 2px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

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

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

.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.status {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.status.busy {
  border-color: rgba(14, 118, 109, 0.35);
  color: var(--accent-dark);
}

.status.done {
  color: var(--accent-dark);
}

.status.error {
  border-color: rgba(180, 73, 38, 0.4);
  background: var(--warning-soft);
  color: var(--warning);
}

.result-summary {
  padding: 18px;
}

.result-summary > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.label {
  color: var(--muted);
  font-weight: 700;
}

#eye-grade {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.prob-stack {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.prob-row {
  display: grid;
  grid-template-columns: 48px minmax(120px, 1fr) 56px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.prob-row strong {
  color: var(--ink);
  text-align: right;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ece9;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #65a88d);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.summary-grid > div {
  min-width: 0;
  padding: 12px;
  background: var(--panel-soft);
}

.clinical-note {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.image-table-wrap {
  padding: 16px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

td {
  font-size: 0.92rem;
}

td:first-child {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

.grade-pill {
  display: inline-flex;
  min-width: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e8f3f0;
  color: var(--accent-dark);
  font-weight: 800;
}

.grade-pill.alert {
  background: var(--warning-soft);
  color: var(--warning);
}

.notice {
  padding: 16px;
}

.notice strong {
  display: block;
  margin-bottom: 8px;
}

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

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

@media (max-width: 720px) {
  .shell {
    padding: 12px;
  }

  .model-strip,
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-summary > div:first-child,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
