/* ============================================================
   胖阿杰工具箱 - 工具页公共样式
   ============================================================ */
.tool-page { padding: 32px 0 10px; max-width: 980px; margin: 0 auto; width: 100%; padding-left: 24px; padding-right: 24px; }
.tool-page .crumbs { margin-bottom: 18px; }
.tool-title { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.3; }
.tool-desc { margin-top: 8px; color: var(--ink-2); font-size: 14px; max-width: 720px; }

/* ---------- 工具主体 ---------- */
.tool-body { margin-top: 24px; display: flex; flex-direction: column; gap: 18px; }
.tool-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.tool-panel > .panel-title {
  font-size: 11.5px; font-weight: 700; color: var(--ink-3);
  letter-spacing: .6px; text-transform: uppercase;
}
.tool-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.tool-row > * { flex: 1; min-width: 130px; }
.tool-row > .btn, .tool-row > .btn-sm { flex: 0 0 auto; }
.tool-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* 输出面板：右上操作条 */
.tool-output { position: relative; }
.tool-output .output-bar {
  position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2;
}
.tool-output .result-box {
  width: 100%; min-height: 96px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--cream); font-family: var(--font-mono); font-size: 14px;
  line-height: 1.75; word-break: break-all; white-space: pre-wrap; overflow-x: auto;
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s;
}
.tool-output .result-box.plain { font-family: var(--font-sans); }
.tool-output .result-box.click-copy { cursor: pointer; }
.tool-output .result-box:empty::before { content: "结果将显示在这里"; color: var(--ink-3); }
.tool-output textarea.result-box { resize: vertical; }
.tool-output textarea.result-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 130, 92, .14); }

/* 结果统计条 */
.stat-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-strip .stat {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  padding: 10px 18px; min-width: 96px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-strip .stat b { display: block; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; color: var(--ink); }
.stat-strip .stat span { font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* 结果表格 */
.result-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.result-table th, .result-table td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.result-table th {
  background: var(--cream); color: var(--ink-2);
  font-weight: 700; font-size: 12.5px; white-space: nowrap;
}
.result-table tr:nth-child(even) td { background: rgba(251, 248, 241, .55); }
[data-theme="dark"] .result-table tr:nth-child(even) td { background: rgba(32, 29, 24, .5); }
.result-table tbody tr:hover td { background: var(--bg-soft); }
.result-table td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.table-wrap .result-table th, .table-wrap .result-table td { border-width: 0 0 1px 0; }
.table-wrap .result-table th { border-bottom: 1px solid var(--line-strong); }
.table-wrap .result-table tr:last-child td { border-bottom: none; }

/* 说明区 */
.tool-help {
  margin-top: 36px; border-radius: var(--radius);
  background: var(--cream); padding: 22px 24px;
  border: 1px solid var(--line);
}
.tool-help h2 {
  font-size: 15px; font-weight: 800; margin-bottom: 10px;
  display: flex; align-items: center; gap: 9px;
}
.tool-help h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  display: inline-block;
}
.tool-help p, .tool-help li { font-size: 13.5px; color: var(--ink-2); line-height: 1.9; }
.tool-help ul, .tool-help ol { padding-left: 20px; list-style: disc; }
.tool-help li { margin: 2px 0; }
.tool-help code {
  font-family: var(--font-mono); font-size: 12.5px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--accent-ink);
}
[data-theme="dark"] .tool-help code { color: var(--accent); }

/* 相关工具推荐 */
.tool-related { margin-top: 36px; }
.tool-related h2 {
  font-size: 15px; font-weight: 800; margin-bottom: 14px;
  display: flex; align-items: center; gap: 9px;
}
.tool-related h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  display: inline-block;
}
.tool-related .tool-grid { grid-template-columns: repeat(4, 1fr); }

/* JSON 编辑器分栏 */
.je-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 420px; }
.je-split > div:first-child { border-right: 1px solid var(--line); }

/* 开发中占位 */
.tool-coming {
  text-align: center; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 52px 20px; box-shadow: var(--shadow-sm);
}
.tool-coming img { width: 170px; margin: 0 auto 12px; opacity: .95; }
.tool-coming h2 { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.tool-coming p { color: var(--ink-2); font-size: 13.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .tool-page { padding-left: 18px; padding-right: 18px; padding-top: 24px; }
  .tool-title { font-size: 24px; }
  .tool-row { flex-direction: column; align-items: stretch; }
  .tool-row > * { min-width: 0; }
  .tool-row > .btn { width: 100%; }
  .tool-panel { padding: 17px 16px; border-radius: 16px; }
  .tool-related .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-output .result-box { padding-right: 104px; }
  .tool-help { padding: 18px; }
  .je-split { grid-template-columns: 1fr; min-height: 0; }
  .je-split > div:first-child { border-right: none; border-bottom: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .tool-related .tool-grid { grid-template-columns: 1fr; }
  .stat-strip .stat { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 9px 12px; }
}
