:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef2f7;
  --ink: #131922;
  --ink-2: #3f4854;
  --muted: #6d7786;
  --line: #dce2ea;
  --line-2: #e9edf3;
  --primary: #1d5fd0;
  --primary-600: #174fb0;
  --primary-050: #eaf1fd;
  --accent: #0f766e;
  --accent-050: #e6f4f2;
  --ok: #17703c;
  --ok-bg: #e8f4ec;
  --warn: #a25a09;
  --warn-bg: #fdf1e0;
  --danger: #b62d24;
  --danger-bg: #fceceb;
  --shadow: 0 1px 2px rgba(19, 25, 34, 0.05), 0 8px 24px -18px rgba(19, 25, 34, 0.35);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0;
}

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

.hidden {
  display: none !important;
}

/* ---------------- 顶栏 ---------------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.appbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  flex: none;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.brand-text small {
  color: var(--muted);
  font-size: 11.5px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  background: var(--surface-3);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.tab {
  border: 0;
  background: transparent;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--surface);
  color: var(--primary-600);
  box-shadow: 0 1px 2px rgba(19, 25, 34, 0.1);
}

/* ---------------- 布局 ---------------- */

.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 22px 20px 80px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.card-title > svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
  flex: none;
}

.card-title h2 {
  font-size: 15px;
}

.push-right {
  margin-left: auto;
}

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

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .appbar-inner {
    padding: 10px 14px;
  }
  .tabs {
    width: 100%;
    margin-left: 0;
  }
  .tab {
    flex: 1;
  }
  .shell {
    padding: 16px 14px 72px;
  }
}

/* ---------------- 答卷抬头 ---------------- */

.sheet-head {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  border-left: 3px solid var(--primary);
}

.sheet-head h1 {
  font-size: 21px;
  margin-bottom: 6px;
}

.lede {
  margin: 0;
  color: var(--ink-2);
  max-width: 62ch;
  font-size: 13.5px;
}

.sheet-head-side {
  display: flex;
  gap: 22px;
  padding-left: 22px;
  border-left: 1px dashed var(--line);
}

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

.metric-value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------------- 工具行 ---------------- */

.toolrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolrow-info {
  color: var(--muted);
  font-size: 12.5px;
  flex: 1;
  min-width: 180px;
}

.toolrow-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn:hover {
  background: var(--surface-2);
  border-color: #ccd4de;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn.primary:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover {
  background: var(--surface-2);
}

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

.btn.danger:hover {
  background: var(--danger-bg);
}

.btn.small {
  padding: 6px 11px;
  font-size: 12.5px;
}

.btn.small svg {
  width: 13px;
  height: 13px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--ink);
}

/* ---------------- 表单 ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.grow {
  flex: 1;
}

.field-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.req {
  color: var(--danger);
  font-style: normal;
}

.field input[type="text"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.field textarea {
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-050);
}

.field input.is-error,
.field textarea.is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.inline-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

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

.hint.tiny {
  font-size: 12px;
  margin: 10px 0 0;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 14px;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cbd3de;
  position: relative;
  transition: background 0.15s;
  flex: none;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
}

.switch-label {
  font-size: 13.5px;
}

/* ---------------- 题目卡片 ---------------- */

.question-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.question {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.question-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px 12px;
}

.q-index {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-050);
  color: var(--primary-600);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.q-main {
  flex: 1;
  min-width: 0;
}

.q-title {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.q-body {
  padding: 4px 20px 18px 58px;
}

@media (max-width: 720px) {
  .question-head {
    padding: 14px 15px 10px;
  }
  .q-body {
    padding: 4px 15px 16px 15px;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.6;
  white-space: nowrap;
}

.badge svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.badge.soft {
  background: var(--surface-3);
  color: var(--ink-2);
}

.badge.blue {
  background: var(--primary-050);
  color: var(--primary-600);
}

.badge.teal {
  background: var(--accent-050);
  color: var(--accent);
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.mono {
  font-variant-numeric: tabular-nums;
}

/* 选项 */

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  background: var(--surface);
}

.option:hover {
  border-color: #c3cdda;
  background: var(--surface-2);
}

.option input {
  margin: 3px 0 0;
  accent-color: var(--primary);
  flex: none;
}

.option.is-checked {
  border-color: var(--primary);
  background: var(--primary-050);
}

.option-label {
  flex: 1;
  min-width: 0;
}

.option-key {
  flex: none;
  font-weight: 600;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 18px;
  font-variant-numeric: tabular-nums;
}

.option-correct {
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  flex: none;
}

.option-correct svg {
  width: 14px;
  height: 14px;
}

.text-answer {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  min-height: 104px;
  resize: vertical;
  outline: none;
  line-height: 1.7;
  background: var(--surface);
}

.text-answer:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-050);
}

.q-actions {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px 58px;
}

.question-head .q-actions {
  padding: 0;
}

.options.is-error {
  outline: 2px solid var(--danger);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.text-answer.is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

@media (max-width: 720px) {
  .q-actions {
    padding: 0 15px 16px;
  }
}

/* 提交栏 */

.submitbar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.submitbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
  flex: 1;
  min-width: 160px;
}

.submitbar-info svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.submitbar-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.submitbar .btn.primary {
  padding: 9px 20px;
}

/* 空状态 */

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty svg {
  width: 34px;
  height: 34px;
  color: #b6c0cd;
}

.empty h3 {
  margin: 12px 0 4px;
  color: var(--ink-2);
  font-size: 15px;
}

.empty p {
  margin: 0;
  font-size: 13px;
}

/* ---------------- 结果 ---------------- */

.statgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 720px) {
  .statgrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary-050);
  color: var(--primary-600);
  display: grid;
  place-items: center;
  flex: none;
}

.stat-icon svg {
  width: 17px;
  height: 17px;
}

.stat-body {
  min-width: 0;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted);
}

.dist {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dist-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) minmax(90px, 2.2fr) 74px;
  gap: 10px;
  align-items: center;
}

@media (max-width: 720px) {
  .dist-row {
    grid-template-columns: 1fr 60px;
  }
  .dist-bar-wrap {
    grid-column: 1 / -1;
  }
}

.dist-label {
  font-size: 13px;
  color: var(--ink-2);
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dist-label.is-correct {
  color: var(--ok);
  font-weight: 500;
}

.dist-bar-wrap {
  height: 18px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.dist-bar {
  height: 100%;
  background: #9db6dd;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.dist-bar.is-correct {
  background: #6fb98d;
}

.dist-count {
  text-align: right;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dist-count b {
  color: var(--ink);
  font-weight: 600;
}

.answer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-item {
  border: 1px solid var(--line-2);
  border-left: 3px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  background: var(--surface-2);
}

.answer-item-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.answer-who {
  font-weight: 600;
  font-size: 13px;
}

.answer-meta {
  color: var(--muted);
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.answer-meta svg {
  width: 12px;
  height: 12px;
}

.answer-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

.answer-picks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pick {
  font-size: 12.5px;
  padding: 2px 9px;
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--ink-2);
}

.pick.is-correct {
  background: var(--ok-bg);
  color: var(--ok);
}

.ref-box {
  margin-top: 14px;
  background: var(--accent-050);
  border: 1px solid #bfe0db;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.ref-box-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.ref-box-head svg {
  width: 14px;
  height: 14px;
}

.ref-box p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.respondent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.respondent-table th {
  text-align: left;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--line);
}

.respondent-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}

.respondent-table tr:last-child td {
  border-bottom: 0;
}

.respondent-table .num {
  font-variant-numeric: tabular-nums;
}

.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.score-pill i {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
  font-size: 11.5px;
}

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

/* ---------------- 管理 ---------------- */

.admin-q-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-q {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.admin-q-body {
  flex: 1;
  min-width: 0;
}

.admin-q-title {
  font-size: 13.5px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.q-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.q-thumb {
  width: 78px;
  height: 58px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
  display: block;
}

.q-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.q-thumb:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-050);
}

.admin-q-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.admin-q-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.danger-card {
  border-color: #f0d5d2;
}

.danger-card .card-title > svg {
  color: var(--danger);
}

/* ---------------- 弹窗 ---------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 25, 34, 0.42);
  backdrop-filter: blur(2px);
}

.modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px rgba(19, 25, 34, 0.5);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 15px;
  flex: 1;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
}

.seg {
  display: inline-flex;
  background: var(--surface-3);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 3px;
  width: 100%;
}

.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}

.seg button.is-active {
  background: var(--surface);
  color: var(--primary-600);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(19, 25, 34, 0.1);
}

.opt-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.opt-row input[type="text"] {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
}

.opt-row input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-050);
}

.opt-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}

.opt-mark input {
  accent-color: var(--ok);
}

.opt-key {
  width: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
}

/* ---------------- 题目配图 ---------------- */

.q-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.q-image {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
  padding: 0;
  line-height: 0;
}

.q-image img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #fff;
  display: block;
}

.q-image:hover {
  border-color: var(--primary);
}

.q-image-tip {
  display: block;
  padding: 5px 8px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 编辑器里的配图区 */

.img-drop {
  border: 1px dashed #c4cedb;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.img-drop:hover,
.img-drop.is-over {
  border-color: var(--primary);
  background: var(--primary-050);
}

.img-drop-title {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.img-drop-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.img-drop-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

.img-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.img-thumb {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.img-thumb img {
  width: 100%;
  height: 84px;
  object-fit: contain;
  display: block;
  background: #fff;
}

.img-thumb-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}

.img-thumb-name {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.img-thumb-rm {
  flex: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--danger);
  padding: 2px;
  display: grid;
  place-items: center;
}

.img-thumb-rm svg {
  width: 13px;
  height: 13px;
}

.img-status {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------------- 大图查看 ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 14, 20, 0.88);
  display: grid;
  place-items: center;
  padding: 32px;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
}

/* ---------------- Toast ---------------- */

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #1b2330;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  font-size: 13.5px;
  max-width: min(90vw, 460px);
  animation: toast-in 0.18s ease;
}

.toast svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.toast.ok svg {
  color: #6ee7a8;
}

.toast.err svg {
  color: #fca5a5;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loading {
  color: var(--muted);
  padding: 30px 0;
  text-align: center;
  font-size: 13px;
}
