:root {
  --zbtool-shell-padding: 24px;
}

.zbtool-card {
  max-width: none;
}

.panel-work,
.panel-related,
.panel-comments {
  display: grid;
  gap: 18px;
}

.rmb-layout {
  display: grid;
  gap: 14px;
}

.rmb-top-row,
.rmb-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 14px;
  align-items: stretch;
}

.rmb-bottom-row {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: start;
  margin-top: 38px;
}

.input-card,
.result-card {
  height: 100%;
}

.tool-block {
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 14px;
  padding: 18px;
  border: 1px solid #ebe1cf;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 233, 201, 0.55), transparent 34%),
    linear-gradient(180deg, #fffdfa 0%, #fff8ef 100%);
}

.input-card,
.result-card {
  align-content: start;
}

.result-card {
  grid-template-rows: auto auto auto 1fr auto;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  align-self: start;
  width: fit-content;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff0d6 0%, #ffe1ad 100%);
  color: #8b4c00;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #f2c98a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.section-pill-soft {
  background: linear-gradient(180deg, #faf4e9 0%, #f7ead4 100%);
  border-color: #ead8bb;
  color: #6f5630;
}

.control {
  display: grid;
  gap: 8px;
}

.control span {
  font-size: 13px;
  color: #6c5634;
}

.control input,
.result-box,
.zbtool-comments .com_box textarea,
.zbtool-comments .com_info li input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #ddccb1;
  border-radius: 20px;
  background: #fff;
  color: #3d2e18;
  padding: 14px 16px;
  font-size: 15px;
}

.control input:focus,
.result-box:focus,
.zbtool-comments .com_box textarea:focus,
.zbtool-comments .com_info li input:focus {
  outline: none;
  border-color: #d18d1f;
  box-shadow: 0 0 0 4px rgba(209, 141, 31, 0.12);
}

.option-grid {
  display: grid;
  gap: 12px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #ebdcc2;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  color: #5d4a29;
  line-height: 1.6;
}

.check-item input {
  margin-top: 4px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row button,
.zbtool-comments .com_info button {
  border: 1px solid #e3c9a3;
  background: #fff8ee;
  color: #75460d;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.action-row button:hover,
.zbtool-comments .com_info button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -18px rgba(117, 70, 13, 0.45);
  background: #ffffff;
}

.action-row button.primary {
  background: linear-gradient(180deg, #d38b16 0%, #a85c00 100%);
  border-color: #a85c00;
  color: #fffdf8;
  box-shadow: 0 16px 26px -18px rgba(168, 92, 0, 0.9);
}

.helper-card,
.scene-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 251, 244, 0.88);
  border: 1px solid #eadcc5;
}

.scene-card {
  height: auto;
  align-content: start;
}

.helper-list,
.feature-list,
.empty-state {
  margin: 0;
  padding-left: 18px;
  color: #6d5a3b;
  line-height: 1.9;
}

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

.digit-card {
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: center;
  min-height: 78px;
  padding: 12px 8px;
  border: 1px solid #eadcc1;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffefb 0%, #fdf5e7 100%);
}

.digit-card strong {
  font-size: 24px;
  color: #7b4300;
  line-height: 1;
}

.digit-card span {
  font-size: 13px;
  color: #7f6b4b;
}

.helper-note {
  margin: 0;
  color: #7a6544;
  line-height: 1.8;
}

.result-card {
  gap: 14px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff3de;
  color: #8d530b;
  border: 1px solid #f0cf9b;
  font-size: 13px;
  font-weight: 600;
}

.tool-tip {
  min-height: 22px;
  color: #67492a;
  font-size: 13px;
}

.tool-tip.error {
  color: #b42318;
}

.result-preview {
  min-height: 120px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff7ea 0%, #ffe8be 100%);
  border: 1px solid #f0d098;
  color: #7a4000;
  font-size: 21px;
  line-height: 1.55;
  font-weight: 700;
  word-break: break-all;
}

.result-box {
  min-height: 210px;
  line-height: 1.75;
  resize: vertical;
}

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

.stat-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid #eadcc5;
  background: rgba(255, 255, 255, 0.78);
}

.stat-card span {
  font-size: 12px;
  color: #7a694d;
}

.stat-card strong {
  font-size: 18px;
  line-height: 1.2;
  color: #473019;
  font-weight: 700;
  word-break: break-word;
}

/* Related-tools and comments should reuse the project's standard modules. */
.panel-related h2,
.zbtool-comments h3 {
  display: block !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-left: 0 !important;
  background: transparent !important;
  color: #333 !important;
  text-indent: 0 !important;
  font-size: 18px !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
}

.panel-related .zbtool-related-list {
  margin-right: -2%;
}

.panel-related .zbtool-related-list li {
  box-shadow: 1px 2px 8px rgba(76, 49, 14, 0.08);
}

.zbtool-comments .compost {
  margin: 15px 0;
}

.zbtool-comments .com_name {
  display: block;
  color: #5781bf;
}

.zbtool-comments .com_name a,
.zbtool-comments .clbody .cinfo h5,
.zbtool-comments .clbody .cinfo span a,
.zbtool-comments .clbody p a {
  color: #5781bf;
}

.zbtool-comments .com_info {
  margin-top: 15px;
  overflow: hidden;
}

.zbtool-comments .com_info ul {
  display: inline-block;
  float: left;
  list-style: none;
  margin: 0;
  padding: 0;
}

.zbtool-comments .com_info li {
  float: left;
  margin: 0 15px 15px 0;
}

.zbtool-comments .com_info li input {
  width: 160px;
  height: 30px;
  line-height: 30px;
  padding: 0 0 0 4px;
  border: 1px solid #ddd;
  border-radius: 0;
  box-sizing: border-box;
  background: #fff;
  font-size: 14px;
}

.zbtool-comments .com_box {
  margin-bottom: 15px;
}

.zbtool-comments .com_box textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  border: 1px solid #ddd;
  border-radius: 0;
  padding: 10px;
  box-sizing: border-box;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
}

.zbtool-comments .com_info button {
  background: #5781bf;
  border: 0;
  border-radius: 3px;
  padding: 8px 20px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.zbtool-comments .com_info button:hover {
  background: #6b90c7;
}

.zbtool-comments .comlist ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #ededed;
}

.zbtool-comments .comlist ul ul {
  margin-left: 28px;
}

.zbtool-comments .comlist li {
  display: block;
  overflow: hidden;
  padding: 15px 0;
}

.zbtool-comments .comlist li img {
  float: left;
  width: 40px;
  height: 40px;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
}

.zbtool-comments .comlist li .clbody {
  margin-left: 50px;
}

.zbtool-comments .clbody .cinfo {
  display: block;
  overflow: hidden;
}

.zbtool-comments .clbody .cinfo h5 {
  float: left;
  margin: 0;
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
}

.zbtool-comments .clbody .cinfo span {
  float: right;
}

.zbtool-comments .clbody em {
  display: block;
  margin-top: 0;
  color: #888;
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  font-style: normal;
}

.zbtool-comments .clbody p {
  margin: 0;
  line-height: 24px;
  color: #4a4a4a;
  overflow: hidden;
}

.pagebar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagebar a,
.pagebar .now-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #d6deea;
  text-decoration: none;
  color: #334155;
  background: #fff;
}

.pagebar .now-page {
  background: #eef6ff;
  border-color: #c8def6;
  color: #225282;
}

@media (max-width: 980px) {
  .rmb-top-row,
  .rmb-bottom-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .rmb-bottom-row {
    margin-top: 4px;
  }
}

@media (max-width: 760px) {
  .digit-grid,
  .stats-grid,
  .zbtool-comments .com_info ul {
    grid-template-columns: 1fr 1fr;
  }

  .tool-block {
    border-radius: 18px;
  }

  .control input,
  .result-box,
  .result-preview {
    border-radius: 18px;
  }

  .zbtool-comments .comlist ul ul {
    margin-left: 16px;
  }
}

@media (max-width: 560px) {
  .digit-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .result-preview {
    font-size: 18px;
  }
}
