/* ==========================================================================
   工具页样式
   ========================================================================== */
.tool-page { padding: 6px 0 64px; }
.tool-head {
  display: flex; align-items: flex-start; gap: 16px; padding: 18px 0 22px;
  border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap;
}
.tool-head-ico {
  width: 56px; height: 56px; flex: none; border-radius: 14px; display: grid; place-items: center;
  font-size: 27px; background: linear-gradient(135deg, #e9f2ff, #e8fbf7); border: 1px solid #dcebfa;
}
.tool-head-main { flex: 1; min-width: 240px; }
.tool-head-main h1 { font-size: 25px; margin: 2px 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tool-head-main p { color: var(--muted); font-size: 13.5px; margin: 0 0 10px; max-width: 760px; }
.tool-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #7d92a8; }
.tool-meta span { background: #f1f6fc; padding: 3px 9px; border-radius: 6px; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.tool-main { min-width: 0; }
.tool-side { position: sticky; top: 84px; display: grid; gap: 14px; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.side-card h3 { font-size: 14px; margin: 0 0 10px; color: var(--ink); }
.side-steps { margin: 0; padding: 0; list-style: none; }
.side-steps li { font-size: 12.5px; color: #4a5f76; line-height: 1.7; padding: 5px 0; border-bottom: 1px dashed #eef3f9; }
.side-steps li:last-child { border: 0; }
.side-steps b { color: var(--brand); margin-right: 4px; }
.side-card p { font-size: 12.5px; color: var(--muted); line-height: 1.75; margin: 0 0 8px; }
.side-card.warn { background: #fffbf3; border-color: #ffe3b8; }
.side-card.warn h3 { color: #b06d10; }
.side-card.warn p { color: #8a6320; }
.side-link { font-size: 12.5px; color: var(--brand); }
.side-related { list-style: none; margin: 0; padding: 0; }
.side-related li { border-bottom: 1px dashed #eef3f9; }
.side-related li:last-child { border: 0; }
.side-related a { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 12.5px; color: #3d5268; }
.side-related a:hover { color: var(--brand); }
.side-related span { width: 18px; text-align: center; }

.tool-app { min-height: 220px; }
.tool-loading { padding: 60px 0; text-align: center; color: #93a4b8; font-size: 13px; }

/* ---------------------------------------------------------------- 面板 */
.pane { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pane-head h2 { font-size: 16px; margin: 0; }
.pane-head .sub { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.pane-tip { font-size: 12.5px; color: #7d92a8; background: #f6faff; border: 1px solid #e8f1fa; border-radius: 8px; padding: 9px 12px; margin: 0 0 14px; }

.frm { display: grid; gap: 13px; }
.fld { display: grid; gap: 5px; }
.fld > label, .fld .lbl { font-size: 12.5px; color: #4d6178; font-weight: 600; }
.fld input[type=text], .fld input[type=number], .fld input[type=url], .fld textarea, .fld select {
  width: 100%; padding: 9px 12px; border: 1px solid #d9e5f2; border-radius: 9px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; outline: none;
}
.fld textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
.fld input:focus, .fld textarea:focus, .fld select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,104,227,.1); }
.fld .hint, .hint { font-size: 11.5px; color: #8ba0b5; font-weight: 400; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 34px; border: 1px solid #d9e5f2; border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.color-row .hex { width: 92px; padding: 7px 9px; border: 1px solid #d9e5f2; border-radius: 8px; font-size: 12.5px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid #dce7f4; background: #f8fbff; font-size: 12.5px; color: #45607c; cursor: pointer;
}
.seg label input { accent-color: var(--brand); }
.seg label.on, .seg input:checked + span { color: var(--brand); }
.seg label.checked { border-color: var(--brand); background: #eef5ff; color: var(--brand); }

.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; accent-color: var(--brand); }
.range-row b { min-width: 44px; text-align: right; font-size: 12.5px; color: var(--brand); }

.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btnrow .btn { padding: 9px 18px; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-line { background: #fff; color: var(--brand); border-color: #cfe1fb; }
.btn-line:hover { background: #f3f8ff; color: var(--brand); }
.btn-gray { background: #f1f5fa; color: #4d6178; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.drop {
  position: relative; border: 1.5px dashed #c9dbf0; border-radius: 12px; padding: 22px 16px;
  text-align: center; color: #688097; font-size: 13px; background: #f9fcff; cursor: pointer; transition: .2s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: #f2f8ff; color: var(--brand); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop b { display: block; color: #355273; font-size: 13.5px; margin-bottom: 4px; }
.drop .small { font-size: 11.5px; color: #93a4b8; }

.preview {
  background-color: #f6f9fc;
  background-image: linear-gradient(45deg, #e9f0f8 25%, transparent 25%, transparent 75%, #e9f0f8 75%),
    linear-gradient(45deg, #e9f0f8 25%, transparent 25%, transparent 75%, #e9f0f8 75%);
  background-size: 18px 18px; background-position: 0 0, 9px 9px;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  display: grid; place-items: center; min-height: 200px;
}
.preview canvas, .preview img { max-width: 100%; height: auto; border-radius: 6px; }
.preview.empty { color: #93a4b8; font-size: 12.5px; }

.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.result-item { background: #f7fafd; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.result-item img { width: 100%; border-radius: 6px; margin-bottom: 6px; }
.result-item a { font-size: 11.5px; color: var(--brand); word-break: break-all; }

.status { font-size: 12.5px; color: #688097; min-height: 18px; margin-top: 8px; }
.status.ok { color: #1a8a5b; }
.status.err { color: #c0392b; }

.progress { height: 6px; background: #e8f0f8; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 9px 16px; border: 0; background: none; font-size: 13.5px; color: #5c7187; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 14px; }
.mini-note { font-size: 11.5px; color: #8ba0b5; margin-top: 6px; line-height: 1.7; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid #dbe7f4; background: #f8fbff; border-radius: 999px; padding: 5px 12px; font-size: 12px; color: #45607c; cursor: pointer; }
.chips button:hover { border-color: var(--brand); color: var(--brand); }

/* 说明型工具 */
.guide-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; }
.guide-card h2 { font-size: 18px; margin: 0 0 14px; }
.guide-note { background: #fff8ec; border: 1px solid #ffe6c2; color: #8a5a13; font-size: 13px; padding: 10px 14px; border-radius: 8px; }
.guide-steps { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 12px; }
.guide-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: #3d4c60; line-height: 1.8; }
.step-no { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #eaf3ff; color: var(--brand); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.prompt-box { background: #f7fafd; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 18px 0; }
.prompt-box label { display: block; font-size: 12.5px; color: #4d6178; margin-bottom: 8px; font-weight: 600; }
.prompt-box textarea { width: 100%; border: 1px solid #d9e5f2; border-radius: 9px; padding: 10px 12px; font: inherit; font-size: 13px; line-height: 1.7; resize: vertical; }
.prompt-box .btn { margin-top: 10px; }
.guide-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1024px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-side { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .tool-head { padding-top: 10px; }
  .tool-head-main h1 { font-size: 20px; }
  .tool-side { grid-template-columns: 1fr; }
  .pane { padding: 16px 15px; }
  .row2, .row3, .grid2 { grid-template-columns: 1fr; }
  .guide-card { padding: 18px; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}
