:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-sub: #8a8f99;
  --line: #ebedf0;
  --blue: #2f7ef3;
  --red: #f5453d;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.nav__close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-left: -8px;
  border: 0;
  background: transparent;
  color: #333;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.nav__title {
  flex: 1;
  margin: 0;
  padding-right: 44px;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ---------- 主体 ---------- */
.page {
  padding: 12px 12px 4px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 16px 8px;
}

.card + .card {
  margin-top: 12px;
}

/* 校验失败时定位到对应分组 */
.card.is-error {
  box-shadow: 0 0 0 2px rgba(245, 69, 61, 0.45);
  animation: card-shake 0.4s;
}

@keyframes card-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.card__head {
  display: flex;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.card__no {
  color: var(--red);
  margin-right: 6px;
  font-weight: 700;
}

.card__title {
  flex: 1;
}

/* 选项 */
.option {
  position: relative;
  display: flex;
  align-items: center;
  padding: 13px 0;
  cursor: pointer;
}

/*
 * 真实 radio 覆盖每行左侧 46px 的点击区：
 * 不依赖 <label> 的隐式关联，任何 WebView（企微/微信内置浏览器、Android X5）
 * 里直接点圆点都能命中真实控件，避免“看着选中了其实没选中”。
 */
.option input {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 46px;
  margin: 0;
  padding: 0;
  opacity: 0;
  z-index: 1;
  cursor: pointer;
}

.option__dot {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-right: 12px;
  border: 1.5px solid #c9ced6;
  border-radius: 50%;
  transition: border-color 0.15s;
}

.option__label {
  flex: 1;
  font-size: 16px;
  color: #222;
  word-break: break-all;
}

.option:active .option__label {
  opacity: 0.6;
}

.option input:checked + .option__dot {
  border-color: var(--blue);
  background: var(--blue);
}

.option input:checked + .option__dot::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}

.option input:checked ~ .option__label {
  color: var(--blue);
  font-weight: 500;
}

.option input:focus-visible + .option__dot {
  box-shadow: 0 0 0 3px rgba(47, 126, 243, 0.18);
}

/* ---------- 图片上传 ---------- */
.upload-hint {
  margin: 2px 0 12px;
  font-size: 13px;
  color: var(--text-sub);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-bottom: 12px;
}

.thumb {
  position: relative;
  padding-top: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f3f5;
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb__del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.thumb__mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 12px;
}

.thumb.is-loading .thumb__del {
  display: none;
}

.thumb.is-error .thumb__mask {
  background: rgba(245, 69, 61, 0.75);
  text-align: center;
  padding: 4px;
}

.uploader {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 104px;
  border: 1px solid #e3e6eb;
  border-radius: 8px;
  background: #fafbfc;
  color: #4b5160;
  font-size: 15px;
  cursor: pointer;
}

.uploader input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.uploader__icon {
  width: 30px;
  height: 30px;
  opacity: 0.75;
}

.uploader__count {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-sub);
}

/* ---------- 底部提交 ---------- */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

.submit {
  display: block;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 2px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.submit:active {
  opacity: 0.85;
}

.submit[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- 空态 ---------- */
.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-sub);
  font-size: 15px;
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 60;
  max-width: 80vw;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 结果弹窗 ---------- */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.45);
}

.dialog[hidden] {
  display: none;
}

.dialog__panel {
  width: 100%;
  max-width: 300px;
  padding: 24px 20px 20px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.dialog__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #eaf3ff;
  color: var(--blue);
  font-size: 24px;
  line-height: 48px;
}

.dialog__title {
  font-size: 17px;
  font-weight: 600;
}

.dialog__desc {
  margin: 8px 0 20px;
  font-size: 14px;
  color: var(--text-sub);
}

.dialog__btn {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
