* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: #f2f4f8;
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #303133;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px 64px;
}
.wrap {
  width: 100%;
  max-width: 1060px;
  display: grid;
  grid-template-columns: 460px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(29, 41, 57, .06);
  padding: 22px 22px 20px;
}
h2 { margin: 0 0 16px; font-size: 17px; font-weight: 700; color: #1f2329; }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tab {
  border: 1px solid #e3e7ef;
  background: #fff;
  color: #4b5160;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 64px;
}
.tab .tab-name { font-size: 13px; font-weight: 600; }
.tab .tab-badge { font-size: 10px; color: #9aa1af; margin-top: 3px; }
.tab.active {
  border-color: #2f6bff;
  background: #eef3ff;
  color: #2f6bff;
}
.tab.active .tab-badge { color: #6f8ee6; }
.tab.disabled { opacity: .45; cursor: not-allowed; }

/* fields */
.field { margin-bottom: 14px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.field-head label { font-size: 13px; font-weight: 600; color: #303133; }
.hint { font-size: 12px; color: #a2a8b4; }
input[type=text], textarea {
  width: 100%;
  border: 1px solid #e1e5ee;
  border-radius: 8px;
  background: #fff;
  color: #303133;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, textarea:focus {
  border-color: #2f6bff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .1);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; font-family: Consolas, "Microsoft YaHei", monospace; }

/* captcha slider */
.captcha {
  border: 1px solid #e7eaf1;
  background: #f7f8fb;
  border-radius: 9px;
  padding: 12px;
  margin: 4px 0 16px;
}
.captcha-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.captcha-head strong { font-size: 13px; color: #303133; }
.captcha-head span { font-size: 12px; color: #a2a8b4; }
.slider {
  position: relative;
  height: 40px;
  background: #eef0f5;
  border-radius: 7px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.slider-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #dfe8ff; }
.slider-knob {
  position: absolute; left: 2px; top: 2px;
  width: 44px; height: 36px;
  background: #fff;
  border: 1px solid #dbe0ea;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #8b93a3;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  z-index: 2;
}
.slider-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: #9aa1af;
  pointer-events: none;
}
.slider.ok .slider-fill { background: #e2f6e9; }
.slider.ok .slider-text { color: #2e9e5b; font-weight: 600; }
.slider.ok .slider-knob { color: #2e9e5b; }

/* actions */
.actions { display: flex; gap: 12px; }
.btn-primary, .btn-ghost, .btn-copy {
  border: 0; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  height: 42px;
}
.btn-primary { flex: 1; background: #2f6bff; color: #fff; }
.btn-primary:hover { background: #245ae0; }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { width: 92px; background: #fff; color: #4b5160; border: 1px solid #e1e5ee; }
.btn-copy { height: 30px; padding: 0 14px; background: #f3f5f9; color: #6b7280; font-size: 12.5px; }
.btn-copy:hover { background: #e9edf4; }

/* result */
.result-head { display: flex; justify-content: space-between; align-items: center; }
.chips { display: flex; gap: 10px; margin: 4px 0 14px; }
.chip {
  font-size: 12px; color: #8b93a3; background: #f2f4f8;
  border-radius: 999px; padding: 5px 12px;
  border: 1px solid #e7eaf1;
}
.chip.ok { color: #2e9e5b; background: #eafaf0; border-color: #c9eed6; }
.result-box {
  width: 100%; min-height: 250px; resize: vertical;
  background: #fbfcfe; border: 1px solid #e7eaf1; border-radius: 9px;
  padding: 12px; font-size: 13px; line-height: 1.6;
  font-family: Consolas, "Microsoft YaHei", monospace;
  word-break: break-all;
}
.foot { font-size: 12.5px; color: #6b7280; margin: 12px 0 0; line-height: 1.7; }
.foot.muted { color: #a2a8b4; margin-top: 6px; }

@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  body { padding: 24px 14px 40px; }
}

/* 管理后台 iframe 内嵌时收紧留白 */
body.embed { padding: 18px 16px 24px; min-height: 0; }
body.embed .wrap { max-width: 1000px; }
