:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --text-sub: #6b7280;
  --primary: #2f6bff;
  --primary-dark: #1f53d6;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

/* ---------- 首页：工作区选择 ---------- */
.home {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.home-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.home-card h1 {
  font-size: 22px;
  margin-bottom: 4px;
}
.home-card .subtitle {
  color: var(--text-sub);
  font-size: 14px;
  margin-bottom: 24px;
}
.section-label {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 8px;
  font-weight: 600;
}
.ws-list {
  list-style: none;
  margin-bottom: 20px;
  max-height: 260px;
  overflow-y: auto;
}
.ws-select-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.ws-select {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  background: #fff;
  cursor: pointer;
}
.ws-select:focus { border-color: var(--primary); }
.ws-enter-btn {
  padding: 11px 16px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: #fff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.ws-enter-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
.ws-enter-btn:disabled { opacity: .4; cursor: not-allowed; }
.ws-delete-btn {
  padding: 11px 16px;
  border: 1px solid var(--danger);
  border-radius: 10px;
  background: #fff;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.ws-delete-btn:hover:not(:disabled) { background: var(--danger); color: #fff; }
.ws-delete-btn:disabled { opacity: .4; cursor: not-allowed; }
.ws-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
}
.ws-item:hover { border-color: var(--primary); background: #f0f5ff; }
.ws-item .itcode { font-weight: 600; }
.ws-item .meta { font-size: 12px; color: var(--text-sub); }
.ws-item .badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.badge.done { background: #dcfce7; color: #15803d; }
.badge.doing { background: #fef3c7; color: #b45309; }

.new-ws-form { display: flex; gap: 8px; }
.new-ws-form input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}
.new-ws-form input:focus { border-color: var(--primary); }
.new-ws-form button {
  padding: 11px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.new-ws-form button:hover { background: var(--primary-dark); }

.export-bar {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.export-btn {
  padding: 10px 20px;
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: 10px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.export-btn:hover { background: var(--primary); color: #fff; }

/* ---------- 工作区（审核页）---------- */
.workspace {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar .itcode {
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.topbar .back-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-sub);
}
.topbar .back-btn:hover { border-color: var(--primary); color: var(--primary); }

/* 进度条 */
.progress-wrap {
  padding: 16px 20px 8px;
  background: var(--card);
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.progress-info .pct { font-weight: 700; color: var(--primary); }
.progress-bar {
  height: 8px;
  background: #eef0f3;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #6b9bff);
  border-radius: 999px;
  transition: width .25s ease;
}

/* 图片区域 */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 16px;
}
.image-frame {
  width: 100%;
  max-width: 860px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.img-body {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-frame img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 68vh;
  object-fit: contain;
}
.image-frame .img-placeholder {
  color: var(--text-sub);
  padding: 40px;
  text-align: center;
}

/* 图片上的左右箭头 */
.img-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 4px 0;
  z-index: 5;
  transition: background .15s, opacity .15s;
}
.img-arrow:hover:not(:disabled) { background: rgba(0, 0, 0, 0.6); }
.img-arrow:disabled { opacity: 0.25; cursor: not-allowed; }
.arrow-left { left: 12px; }
.arrow-right { right: 12px; }

/* 图片上的进度徽标 */
.img-counter {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  z-index: 5;
  letter-spacing: .5px;
}

/* 问题 + 选项 */
.question-panel {
  width: 100%;
  max-width: 860px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.question-panel .q-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
}
.options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.option {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.option .key {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-sub);
}
.option .opt-label { font-weight: 600; }
.option.selected {
  border-color: var(--primary);
  background: #eef4ff;
}
.option.selected .key { background: var(--primary); color: #fff; }
.option.selected-a { border-color: #f59e0b; background: #fff7ed; }
.option.selected-a .key { background: #f59e0b; color: #fff; }
.option.selected-b { border-color: #16a34a; background: #f0fdf4; }
.option.selected-b .key { background: #16a34a; color: #fff; }
.option.selected-c { border-color: #6b7280; background: #f3f4f6; }
.option.selected-c .key { background: #6b7280; color: #fff; }
.option .default-tag {
  font-size: 11px;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}

/* 完成提示 */
.done-banner {
  width: 100%;
  max-width: 860px;
  background: #dcfce7;
  color: #15803d;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-weight: 600;
  text-align: center;
}

/* 键盘提示 */
.kbd-hint {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
  padding: 0 20px 8px;
}
.kbd-hint kbd {
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}

/* 加载/空状态 */
.loading, .empty {
  text-align: center;
  color: var(--text-sub);
  padding: 40px;
}

/* 移动端 */
@media (max-width: 600px) {
  .options { flex-direction: column; }
  .option { min-width: 100%; }
  .stage { padding: 12px; }
  .img-arrow { width: 40px; height: 40px; font-size: 28px; }
  .arrow-left { left: 8px; }
  .arrow-right { right: 8px; }
}

/* 删除确认弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}
.modal-body p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
}
.modal-hint {
  color: var(--text-sub);
}
.modal-hint strong {
  color: var(--danger);
}
.modal-body input {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}
.modal-body input:focus { border-color: var(--primary); }
.modal-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}
.modal-btn {
  padding: 9px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}
.modal-btn.danger {
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}
.modal-btn.danger:not(:disabled):hover { background: var(--danger); color: #fff; }
.modal-btn.danger:disabled { opacity: .4; cursor: not-allowed; }
