:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #142033;
  --muted: #61708a;
  --line: #d9e2ea;
  --brand: #006b80;
  --brand-dark: #005467;
  --soft: #e7f3f6;
  --danger: #b42318;
  --ok: #157347;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

.shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 800;
  font-size: 22px;
}

.sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.auth {
  width: min(520px, calc(100% - 32px));
  margin: 7vh auto;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(28, 42, 68, 0.08);
}

.card h1,
.card h2,
.card h3 {
  margin: 0 0 18px;
}

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

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tabs button,
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
}

.tabs button.active,
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

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

.btn.danger {
  color: var(--danger);
}

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

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

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

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

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

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

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

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
}

.item h3 {
  margin: 8px 0;
  font-size: 18px;
}

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

.answer {
  white-space: pre-wrap;
  background: #f7fafb;
  border-left: 3px solid var(--brand);
  padding: 12px;
  margin-top: 10px;
}

.ai-box {
  display: grid;
  gap: 10px;
  background: #f6fbfc;
  border: 1px solid #cce1e7;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}

.candidate {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.score {
  font-weight: 800;
  color: var(--brand-dark);
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.attachment {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  width: 150px;
  background: #fbfdfe;
}

.attachment img,
.attachment video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: #eef3f6;
}

.attachment a {
  color: var(--brand);
  word-break: break-all;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

@media (max-width: 760px) {
  .topbar {
    padding: 16px;
    align-items: flex-start;
  }

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

  .card {
    padding: 18px;
  }
}
