*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: #303133;
  background: #f5f7fa;
}

.quiz-page {
  min-height: 100vh;
  padding: 24px 16px 48px;
  background: linear-gradient(160deg, #e8f4f1 0%, #f5f7fa 45%, #eef2f7 100%);
}

.quiz-card {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 28px 36px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(31, 45, 61, 0.08);
}

.title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 700;
  color: #1f2d3d;
  text-align: center;
  line-height: 1.4;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-success {
  color: #067d3f;
  background: #e8f8ef;
  border: 1px solid #b7ebc6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

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

.field-label {
  font-size: 14px;
  color: #606266;
}

.field-label .req {
  margin-right: 4px;
  color: #f56c6c;
  font-family: SimSun, serif;
}

.field input[type="text"],
.field input[type="tel"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus {
  border-color: #409eff;
}

.field-error {
  min-height: 18px;
  font-size: 12px;
  color: #f56c6c;
}

.section-title {
  margin: 16px 0;
  padding-left: 10px;
  border-left: 4px solid #409eff;
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}

.req-inline {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: #f56c6c;
}

.question {
  margin: 0 0 18px;
  padding: 0;
  border: none;
}

.question legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: #303133;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 24px;
  font-size: 14px;
  color: #606266;
  cursor: pointer;
}

.upload-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  align-items: start;
}

.upload-left,
.upload-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.col-label {
  margin-bottom: 8px;
  height: 22px;
  line-height: 22px;
  font-size: 14px;
  color: #606266;
  text-align: center;
}

.drop-zone {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px dashed #d9d9d9;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: #409eff;
  background: #f0f7ff;
}

.drop-zone.is-invalid {
  border-color: #f56c6c;
  background: #fff5f5;
}

.drop-zone.is-uploading {
  opacity: 0.7;
  pointer-events: none;
}

.upload-placeholder {
  text-align: center;
  color: #606266;
}

.upload-icon {
  font-size: 36px;
  color: #c0c4cc;
  margin-bottom: 8px;
  line-height: 1;
}

.upload-text span {
  color: #409eff;
}

.upload-tip {
  margin: 8px 0 0;
  font-size: 12px;
  color: #909399;
}

.preview-wrap {
  text-align: center;
  width: 100%;
}

.preview-img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 6px;
}

.example-frame {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
  padding: 8px;
  margin: 0;
  width: 100%;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}

.example-frame:hover {
  border-color: #409eff;
}

.example-frame:hover .example-hint {
  opacity: 1;
}

.example-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.example-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  opacity: 0.85;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-img {
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  cursor: default;
  background: #fff;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.actions {
  margin-top: 20px;
  text-align: center;
}

.btn-primary {
  min-width: 120px;
  height: 42px;
  padding: 0 28px;
  border: none;
  border-radius: 8px;
  background: #409eff;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.btn-primary:hover {
  background: #66b1ff;
}

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

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 90vw;
  padding: 10px 18px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  pointer-events: none;
}

.toast.is-error {
  background: rgba(245, 108, 108, 0.95);
}

.toast.is-success {
  background: rgba(103, 194, 58, 0.95);
}

@media (max-width: 768px) {
  .quiz-card {
    padding: 20px 16px 28px;
  }

  .title {
    font-size: 18px;
  }

  .form-grid,
  .upload-layout {
    grid-template-columns: 1fr;
  }

  .drop-zone,
  .example-frame {
    height: 220px;
  }
}
