/* ==================== 名片 / 挪车卡生成器（首页 Tab 内） ==================== */
.cc-wrap { max-width: 560px; margin: 0 auto; }

/* 卡片类型分段切换 */
.cc-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2, #f0f2f5);
  border: 1px solid var(--line, #e9ecef);
  border-radius: 12px;
}
.cc-switch__btn {
  border: none;
  background: transparent;
  padding: 8px 20px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.cc-switch__btn i { margin-right: 5px; font-size: 16px; vertical-align: -2px; }
.cc-switch__btn:hover { color: #374151; }
.cc-switch__btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #00bde9, #7ed957);
  box-shadow: 0 4px 12px rgba(0, 189, 233, .32);
}

/* 表单栅格 */
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.cc-field { min-width: 0; }
.cc-field--full { grid-column: 1 / -1; }
.cc-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 4px;
}
.cc-field label .req { color: #ff4d4f; margin-left: 2px; }
.cc-field input,
.cc-field textarea {
  width: 100%;
  border: 1px solid var(--line, #e9ecef);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: #1f2937;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.cc-field textarea { resize: vertical; min-height: 64px; }
.cc-field input:focus,
.cc-field textarea:focus {
  outline: none;
  border-color: #00bde9;
  box-shadow: 0 0 0 3px rgba(0, 189, 233, .14);
}
.cc-field input.is-invalid { border-color: #ff4d4f; box-shadow: 0 0 0 3px rgba(255, 77, 79, .12); }

/* 小标题 */
.cc-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.cc-subtitle i { color: #00bde9; font-size: 16px; }
.cc-subtitle .cc-subtitle__hint { margin-left: auto; font-size: 12px; font-weight: 400; color: #9ca3af; }

/* 二维码内容选择 */
.cc-payloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; }
.cc-payload {
  position: relative;
  padding: 10px 6px;
  border: 1px solid var(--line, #e9ecef);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  color: #4b5563;
  transition: all .18s ease;
}
.cc-payload:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 189, 233, .14); }
.cc-payload i { display: block; font-size: 20px; margin-bottom: 4px; color: #00bde9; }
.cc-payload.is-active {
  border-color: #00bde9;
  color: #0891b2;
  background: linear-gradient(135deg, rgba(0, 189, 233, .10), rgba(126, 217, 87, .10));
  box-shadow: 0 6px 16px rgba(0, 189, 233, .18);
}
.cc-payload.is-active::after {
  content: "\F012C";
  font-family: "Material Design Icons";
  position: absolute;
  top: -8px;
  right: -6px;
  width: 20px;
  height: 20px;
  line-height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00bde9, #7ed957);
  color: #fff;
  font-size: 13px;
}

/* 模板选择 */
.cc-templates {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.cc-templates::-webkit-scrollbar { height: 6px; }
.cc-templates::-webkit-scrollbar-thumb { background: rgba(0, 189, 233, .3); border-radius: 6px; }
.cc-tpl {
  flex: 0 0 auto;
  width: 84px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all .18s ease;
}
.cc-tpl:hover { transform: translateY(-2px); }
.cc-tpl__thumb {
  height: 54px;
  border-radius: 8px;
  margin-bottom: 5px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
  position: relative;
  overflow: hidden;
}
.cc-tpl__thumb::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .55);
}
.cc-tpl__name { font-size: 12px; color: #4b5563; white-space: nowrap; }
.cc-tpl.is-active { border-color: #00bde9; box-shadow: 0 6px 16px rgba(0, 189, 233, .2); }
.cc-tpl.is-active .cc-tpl__name { color: #0891b2; font-weight: 600; }

/* 预览区（卡片为横版比例：挪车卡 2.8:1、名片 5:3，故预览容器放宽） */
.cc-preview {
  margin: 14px auto 0;
  width: 100%;
  max-width: 520px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line, #e9ecef);
  box-shadow: 0 10px 30px rgba(0, 189, 233, .12);
  animation: ccFade .35s ease both;
}
.cc-preview img { border-radius: 12px; -webkit-touch-callout: default; }
.cc-preview__empty {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  line-height: 1.8;
}
@keyframes ccFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 操作按钮 */
.cc-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.cc-btn {
  border: none;
  border-radius: 12px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
}
.cc-btn:active { transform: scale(.97); }
.cc-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #00bde9, #7ed957);
  box-shadow: 0 8px 20px rgba(0, 189, 233, .28);
}
.cc-btn--ghost {
  color: #0891b2;
  background: #fff;
  border: 1px solid rgba(0, 189, 233, .35);
}
.cc-btn--ghost:hover { box-shadow: 0 6px 16px rgba(0, 189, 233, .16); }

.cc-tip {
  margin-top: 8px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.7;
}

.cc-switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: #4b5563;
}
.cc-switch-row input { width: 16px; height: 16px; accent-color: #00bde9; }

/* 移动端 */
@media (max-width: 576px) {
  .cc-grid { grid-template-columns: 1fr; }
  .cc-payloads { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .cc-preview { max-width: 100%; }
}
