/* ============================================================
   在线工具箱 · 样式
   ============================================================ */

.tb-head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.tb-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 18px;
  align-items: start; margin-top: 6px;
}

/* ------------------------------- 左侧目录 ------------------------------- */
.tb-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.tb-cat { }
.tb-cat-hd {
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--dim); margin-bottom: 6px; display: flex; justify-content: space-between;
}
.tb-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; background: transparent; border: 1px solid transparent;
  border-left: 2px solid transparent; color: var(--muted);
  font-size: 13px; text-align: left; cursor: pointer; font-family: var(--sans);
  transition: background .12s, color .12s;
}
.tb-item:hover { background: rgba(140, 165, 200, .06); color: var(--text); }
.tb-item.on {
  background: rgba(34, 211, 238, .09); color: var(--cyan);
  border-left-color: var(--cyan);
}
.tb-item i {
  font-style: normal; font-family: var(--mono); font-size: 12px;
  width: 20px; text-align: center; opacity: .85;
}
.tb-item b { font-weight: 500; }
.tb-item .hot {
  margin-left: auto; font-family: var(--mono); font-size: 9px;
  color: var(--amber); border: 1px solid rgba(251, 191, 36, .4);
  padding: 0 3px; border-radius: 2px;
}

/* ------------------------------- 主区域 ------------------------------- */
.tb-main { min-width: 0; }
.tb-hero { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tb-quick {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px; background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; cursor: pointer; border-radius: var(--radius);
}
.tb-quick:hover { border-color: var(--line-strong); color: var(--text); }
.tb-quick i { font-style: normal; font-family: var(--mono); color: var(--violet); }

.tb-panel { min-height: 420px; }
.tb-panel .panel-bd { padding: 18px; }
#tb-title { font-size: 15px; }

.tb-note {
  font-size: 12px; line-height: 1.9; color: var(--dim);
  margin: 12px 0 40px; padding-left: 12px; border-left: 2px solid var(--line-strong);
}

/* ------------------------------- 表单控件 ------------------------------- */
.t-field { margin-bottom: 12px; }
.t-field > label {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--dim); margin-bottom: 5px;
}
.t-area, .t-input, .t-select {
  width: 100%; background: #080d16; border: 1px solid var(--line);
  color: var(--text); padding: 9px 11px; font-size: 13px;
  font-family: var(--mono); border-radius: var(--radius); outline: none;
  transition: border-color .15s;
}
.t-area { min-height: 140px; resize: vertical; line-height: 1.7; }
.t-area:focus, .t-input:focus, .t-select:focus { border-color: var(--cyan); }
.t-area[readonly] { color: var(--muted); background: #060a11; }

.t-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.t-row > * { flex: none; }
.t-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.t-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.t-btn {
  padding: 8px 14px; background: var(--panel-2); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 12.5px; cursor: pointer; border-radius: var(--radius);
  font-family: var(--sans); transition: background .12s, border-color .12s;
}
.t-btn:hover { background: #1a2436; }
.t-btn-primary { background: var(--cyan); border-color: var(--cyan); color: #04141c; font-weight: 600; }
.t-btn-primary:hover { background: #6ee7f9; }
.t-btn-ghost { background: transparent; }
.t-btn-sm { padding: 5px 9px; font-size: 11.5px; }

.t-out {
  font-family: var(--mono); font-size: 13px; line-height: 1.9;
  background: #060a11; border: 1px solid var(--line);
  padding: 12px 14px; border-radius: var(--radius);
  word-break: break-all; white-space: pre-wrap; min-height: 46px;
}
.t-out.big { font-size: 20px; color: var(--amber); letter-spacing: 1px; }
.t-hint { font-size: 11.5px; color: var(--dim); margin-top: 6px; line-height: 1.7; }
.t-err { color: var(--red); font-size: 12px; margin-top: 6px; }
.t-ok { color: var(--lime); }

.t-kv { display: grid; grid-template-columns: 92px 1fr; gap: 0; border-top: 1px solid var(--line); }
.t-kv > div {
  padding: 8px 2px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; display: flex; align-items: center; gap: 8px;
}
.t-kv > div:nth-child(odd) { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.t-kv code {
  font-family: var(--mono); color: var(--text); font-size: 12.5px;
  word-break: break-all; flex: 1;
}

.t-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.t-chip {
  padding: 4px 9px; border: 1px solid var(--line); background: #0a111b;
  color: var(--muted); font-size: 11.5px; cursor: pointer; border-radius: 999px;
}
.t-chip.on { border-color: var(--cyan); color: var(--cyan); background: rgba(34, 211, 238, .1); }

.t-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.t-table th, .t-table td {
  padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left;
  font-family: var(--mono);
}
.t-table th { color: var(--dim); font-weight: 400; font-size: 10px; letter-spacing: 1px; }
.t-table td { color: var(--muted); }

.t-qr { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.t-qr img {
  width: 200px; height: 200px; background: #fff; padding: 8px;
  border-radius: 4px; image-rendering: pixelated;
}

.t-timer {
  font-family: var(--mono); font-size: 56px; font-weight: 700;
  color: var(--text); letter-spacing: 2px; line-height: 1;
  text-align: center; margin: 10px 0 4px;
}
.t-timer.rest { color: var(--lime); }
.t-timer.work { color: var(--pink); }

.t-img-preview { max-width: 100%; border: 1px solid var(--line); border-radius: 4px; margin-top: 10px; }

/* 滚动条 */
.t-area::-webkit-scrollbar { width: 8px; }
.t-area::-webkit-scrollbar-thumb { background: #223047; border-radius: 4px; }

@media (max-width: 860px) {
  .tb-layout { grid-template-columns: 1fr; }
  .tb-nav {
    position: static; flex-direction: row; overflow-x: auto; gap: 8px;
    padding-bottom: 4px;
  }
  .tb-cat { display: flex; gap: 6px; align-items: center; }
  .tb-cat-hd { display: none; }
  .tb-item { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; padding: 6px 8px; }
  .tb-item.on { border-bottom-color: var(--cyan); }
  .tb-item .hot { display: none; }
  .tb-panel .panel-bd { padding: 12px; }
  .t-grid2, .t-grid3 { grid-template-columns: 1fr; }
  .tb-head-right { width: 100%; }
  .tb-head-right .input { width: 100% !important; }
}
