/* 小工具页样式：沿用 app.css 的主题变量与按钮样式 */

.tools-main {
  max-width: 1080px; margin: 0 auto; padding: 20px 20px 48px;
}

.tool-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 6px; margin-bottom: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
}
.tool-tab {
  flex: 1 1 auto; text-align: center; text-decoration: none;
  padding: 9px 14px; border-radius: 10px;
  font-size: 13px; color: var(--muted); white-space: nowrap;
  transition: .16s;
}
.tool-tab:hover { background: #f2f6fe; color: var(--ink); }
.tool-tab.active { background: var(--accent); color: #fff; font-weight: 600; }

.tool-panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 22px;
}
.tool-panel:not(.active) { display: none; }

.tool-head { margin-bottom: 14px; }
.tool-head h2 { margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.tool-head p { margin: 0; font-size: 12px; color: var(--muted); }

.tool-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.tool-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tool-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff;
}
.tool-card h3 {
  margin: 0; font-size: 12.5px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

.tools-main .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.tools-main .field.inline { flex-direction: row; align-items: center; gap: 8px; }
.tools-main .field.block { margin-bottom: 10px; }
.tools-main .field.off { opacity: .45; pointer-events: none; }
.tools-main input[type=text],
.tools-main input[type=number],
.tools-main select,
.tools-main textarea {
  width: 100%; padding: 7px 10px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
  box-sizing: border-box;
}
.tools-main input[type=text]:focus,
.tools-main input[type=number]:focus,
.tools-main select:focus,
.tools-main textarea:focus { outline: 2px solid rgba(47, 109, 246, .28); outline-offset: 1px; }
.tools-main textarea { resize: vertical; line-height: 1.6; }
.tools-main .field.inline input[type=number] { width: 92px; }
.tools-main input[type=range] { width: 100%; accent-color: var(--accent); }
.tools-main input[type=color] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.check-row {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  font-size: 12px; color: var(--ink);
}
.check-row label { display: inline-flex; align-items: center; gap: 5px; }
.check-row input { accent-color: var(--accent); }
.check-row.inline { align-items: center; }

.radio-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink);
}
.radio-row input { accent-color: var(--accent); }

.tool-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 14px 0;
}
.tool-actions.small { margin: 6px 0 0; }
.tool-actions .primary-btn { width: auto; margin: 0; padding: 9px 20px; }
.tool-actions .ghost-btn { width: auto; margin: 0; padding: 8px 14px; }

.count { font-size: 11px; color: var(--muted); font-weight: 400; }

/* 密码结果表 */
.tool-result { margin-top: 4px; }
.result-empty {
  padding: 22px; text-align: center; font-size: 12px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 10px;
}
.pw-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pw-table th {
  text-align: left; font-weight: 600; color: var(--muted);
  padding: 7px 8px; border-bottom: 1px solid var(--line);
}
.pw-table td { padding: 6px 8px; border-bottom: 1px solid #eef2f8; }
.pw-table input {
  width: 100%; border: 0; background: transparent; padding: 2px 4px;
  font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; color: var(--ink);
}
.pw-table .mini-btn { margin: 0; padding: 3px 9px; }

/* 分组 */
.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; min-width: 0; }
.inline-add .mini-btn { white-space: nowrap; }
.name-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  flex: 1 1 auto; align-content: flex-start;
  min-height: 44px; max-height: 190px; overflow: auto;
  padding: 8px; border: 1px dashed var(--line); border-radius: 10px; background: #fff;
}
.name-empty { font-size: 12px; color: var(--muted); padding: 8px; }
.name-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 16px;
  background: var(--accent-soft); color: #2b4d9c; font-size: 12px;
}
.name-chip button {
  border: 0; background: transparent; color: #5a6b8c; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0;
}
.name-chip button:hover { color: var(--accent); }

.group-result {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-top: 16px;
}
.group-card {
  border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden;
  animation: fadeUp .2s ease-out;
}
.group-card h4 {
  margin: 0; padding: 8px 12px; font-size: 12.5px; color: #2b4d9c;
  background: var(--accent-soft);
}
.group-card ul { list-style: none; margin: 0; padding: 8px 12px 12px; }
.group-card li {
  font-size: 13px; color: var(--ink); padding: 4px 0;
  border-bottom: 1px dashed #eef2f8;
}
.group-card li:last-child { border-bottom: 0; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.result-area {
  width: 100%; box-sizing: border-box; margin-top: 4px;
  font-family: ui-monospace, Consolas, monospace;
}

/* 小屏 */
@media (max-width: 820px) {
  .tools-main { padding: 14px 12px 40px; }
  .tool-grid, .tool-grid.three { grid-template-columns: 1fr; }
  .tool-tab { flex: 1 1 45%; }
  .tool-actions .primary-btn, .tool-actions .ghost-btn { width: 100%; }
}
