* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 16px 90px;
}

h1 {
  font-size: 22px;
  margin: 8px 0 14px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

input[type="text"] {
  width: 100%;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0 12px;
  margin-top: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; }
}

.room {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

/* 图片容器 */
.room-media {
  position: relative;
}

.room img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

/* 房间名覆盖在图片左上角 */
.room-name-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(2px);
}

.room .content {
  padding: 10px 12px;
}

/* 第一行：可住人数 + 已选人数 */
.badge {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 0 0 6px 0;
  padding: 0;

  font-size: 13px;
  line-height: 20px;
  color: #374151;
}

.room-cap {
  margin: 0;
  padding: 0;
  color: #374151;
  font-weight: 600;
}

.picked-count {
  margin: 0;
  padding: 0;
  color: #111827;
  font-weight: 700;
}

/* 第二行：已选姓名，和 badge 左侧对齐 */
.names {
  margin: 0 0 8px 0;
  padding: 0;
  min-height: 22px;
  font-size: 14px;
  line-height: 22px;
  font-weight: 700;
}

/* 角色颜色 */
.name-chip.role-1 { color: #2563eb; }   /* 蓝 */
.name-chip.role-05 { color: #16a34a; }  /* 绿 */
.name-chip.role-0 { color: #dc2626; }   /* 红 */

.pick-btn {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.pick-btn.full { background: #9ca3af; }
.pick-btn.active { background: #16a34a; }

.save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: #ffffffd9;
  backdrop-filter: blur(8px);
  border-top: 1px solid #e5e7eb;
}

#saveBtn {
  width: min(980px, calc(100% - 32px));
  display: block;
  margin: 0 auto;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

/* 角色选择区 */
.role-group {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.role-label {
  font-size: 14px;
  color: #374151;
  font-weight: 600;
}

.role-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #111827;
}

.role-item input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
}
