:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #5d6b7a;
  --line: #d8e0ea;
  --accent: #1d6f78;
  --accent-strong: #15565e;
  --danger: #9f2f2f;
  --warn: #8a5c00;
  --ok: #287348;
  --shadow: 0 12px 28px rgba(30, 42, 56, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost:hover {
  border-color: var(--accent);
  background: #eef8fa;
}

.danger {
  background: var(--danger);
}

.danger:hover {
  background: #7f2525;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

label,
.label {
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

.notice {
  border: 1px solid #f1d28c;
  background: #fff8e6;
  color: var(--warn);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 14px 0;
}

.ok {
  border-color: #b8dfc8;
  background: #eefaf3;
  color: var(--ok);
}

.error {
  border-color: #e5b8b8;
  background: #fff0f0;
  color: var(--danger);
}

.attention-check {
  margin: 18px 0;
  padding: 16px 18px;
  border: 2px solid var(--warn);
  border-radius: 8px;
  background: #fff8e6;
}

.attention-title {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--warn);
}

.progress {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.progress-line {
  height: 8px;
  background: #e8eef5;
  border-radius: 999px;
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.video-wrap {
  display: grid;
  gap: 14px;
}

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d1117;
  border-radius: 6px;
  object-fit: contain;
}

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

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: #f8fafc;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.choice input {
  width: auto;
}

.question {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.question:first-child {
  border-top: 0;
}

.likert {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.likert label {
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 4px;
  font-weight: 500;
  background: #fff;
}

.likert input {
  width: auto;
}

.scale-anchors {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.summary-table th,
.summary-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px;
  text-align: left;
}

@media (max-width: 780px) {
  .shell {
    width: min(100vw - 20px, 1120px);
    margin-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel {
    padding: 18px;
  }

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

  .likert {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 5px;
  }
}
