#tool-body {
  --primary: #e06b8a;
  --primary-deep: #c94f6d;
  --ink: #2d2430;
  --ink-soft: #6b5f72;
  --paper: #fbf6f8;
  --paper-deep: #f3e8ed;
  --line: rgba(45, 36, 48, 0.1);
  --panel: rgba(255, 252, 253, 0.92);
  --shadow: 0 14px 36px rgba(120, 60, 80, 0.08);
  --radius: 14px;
  --font-display: 'STXingkai', '華文行楷', 'FZKai-Z03', 'KaiTi', 'STKaiti', 'Songti SC', serif;
  --font-body: 'Songti SC', 'STSong', 'SimSun', 'Noto Serif SC', 'Georgia', serif;
  position: relative;
  color: var(--ink);
  font-family: var(--font-body);
  padding: 8px 4px 24px;
  overflow: hidden;
  border-radius: 12px;
}

.theme-dark-mode #tool-body {
  --primary: #f08aa5;
  --primary-deep: #ffb0c4;
  --ink: #f5eef2;
  --ink-soft: #c9b8c0;
  --paper: #1c1619;
  --paper-deep: #261e23;
  --line: rgba(245, 238, 242, 0.12);
  --panel: rgba(34, 28, 32, 0.94);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

#tool-body::before {
  content: '';
  position: absolute;
  inset: -40px -20px auto;
  height: 220px;
  background:
    radial-gradient(ellipse 60% 70% at 20% 30%, rgba(224, 107, 138, 0.16), transparent 60%),
    radial-gradient(ellipse 45% 55% at 88% 8%, rgba(200, 140, 170, 0.1), transparent 55%),
    linear-gradient(180deg, var(--paper-deep), transparent);
  pointer-events: none;
  z-index: 0;
}

#tool-body > * {
  position: relative;
  z-index: 1;
}

#tool-body .chp-hero {
  text-align: center;
  padding: 24px 12px 14px;
  animation: chp-fade-up 0.65s ease both;
}

#tool-body .chp-brand {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(26px, 4.8vw, 38px);
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 8px;
}

#tool-body .chp-brand span {
  color: var(--primary);
}

#tool-body .chp-sub {
  max-width: 480px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.7;
}

#tool-body .chp-stage {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 8px;
}

#tool-body .chp-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 20px 20px 16px;
  animation: chp-fade-up 0.7s ease 0.06s both;
}

#tool-body .chp-field-label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

#tool-body .chp-panel .layui-input {
  height: 44px;
  border-radius: 10px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.55);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ink);
  margin-bottom: 16px;
}

.theme-dark-mode #tool-body .chp-panel .layui-input {
  background: rgba(0, 0, 0, 0.25);
}

#tool-body .chp-panel .layui-input:focus {
  border-color: var(--primary) !important;
}

#tool-body .chp-len-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

#tool-body .chp-len-options .layui-form-radio {
  margin: 0 !important;
  padding: 0 !important;
}

#tool-body .chp-len-options .layui-form-radio > i {
  display: none !important;
}

#tool-body .chp-len-options .layui-form-radio > div {
  margin: 0 !important;
  padding: 8px 16px !important;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.2;
  transition: all 0.2s ease;
}

#tool-body .chp-len-options .layui-form-radioed > div,
#tool-body .chp-len-options .layui-form-radio:hover > div {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(224, 107, 138, 0.1);
}

#tool-body .chp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

#tool-body .chp-btn-main {
  background: var(--primary) !important;
  border-radius: 10px !important;
  height: 42px;
  line-height: 42px;
  padding: 0 26px;
  font-size: 15px;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 18px rgba(224, 107, 138, 0.28);
  transition: transform 0.2s, box-shadow 0.2s;
}

#tool-body .chp-btn-main:hover {
  background: var(--primary-deep) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(224, 107, 138, 0.35);
}

#tool-body .chp-btn-ghost {
  border-radius: 10px !important;
  height: 42px;
  line-height: 42px;
  border-color: var(--line) !important;
  color: var(--ink-soft) !important;
  background: transparent !important;
}

#tool-body .chp-btn-ghost:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

#tool-body .chp-result {
  max-width: 860px;
  margin: 20px auto 0;
  padding: 0 8px;
  display: none;
  animation: chp-fade-up 0.5s ease both;
}

#tool-body .chp-result.is-show {
  display: block;
}

#tool-body .chp-paper {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 40%),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 26px 20px;
  position: relative;
}

.theme-dark-mode #tool-body .chp-paper {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%),
    var(--paper);
}

#tool-body .chp-paper::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--primary), transparent);
  opacity: 0.75;
}

#tool-body .chp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

#tool-body .chp-count {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

#tool-body .chp-count em {
  font-style: normal;
  color: var(--primary);
  font-weight: 700;
}

#tool-body .chp-copy-btn {
  height: 32px !important;
  line-height: 32px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  border-color: var(--line) !important;
  color: var(--ink-soft) !important;
  background: transparent !important;
}

#tool-body .chp-copy-btn:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

#tool-body .chp-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.2vw, 28px);
  text-align: center;
  margin: 6px 0 18px;
  letter-spacing: 0.1em;
  line-height: 1.4;
}

#tool-body .chp-title .chp-name {
  color: var(--primary);
}

#tool-body .chp-article {
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink);
  text-align: justify;
}

#tool-body .chp-article p {
  margin: 0 0 1.1em;
  text-indent: 2em;
}

#tool-body .chp-article p:last-child {
  margin-bottom: 0;
}

#tool-body .chp-ending {
  margin-top: 8px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--primary);
  letter-spacing: 0.06em;
  line-height: 1.6;
  text-indent: 0 !important;
}

#tool-body .chp-disclaimer {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(224, 107, 138, 0.08);
  border: 1px solid rgba(224, 107, 138, 0.16);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.7;
}

#tool-body .chp-disclaimer strong {
  color: var(--primary);
  font-weight: 700;
}

@keyframes chp-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media screen and (max-width: 768px) {
  #tool-body {
    padding: 0 0 16px;
    overflow: initial;
  }

  #tool-body::before {
    background: unset;
  }

  #tool-body .chp-hero {
    display: none;
  }

  #tool-body .chp-stage,
  #tool-body .chp-result {
    padding: 0;
    max-width: none;
  }

  #tool-body .chp-panel,
  #tool-body .chp-paper {
    padding: 14px 12px 12px;
    border-radius: 12px;
  }

  #tool-body .chp-article {
    font-size: 15px;
    line-height: 1.85;
  }

  #tool-body .chp-btn-main {
    flex: 1 1 auto;
  }
}