/* =========================================================
 * Pentest Tools · Shared Design System
 * 现代化安全仪表盘风格：深色底 + 青/靛蓝渐变 + 发光描边
 * ========================================================= */

:root {
  /* 品牌色板 */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;

  --accent-300: #67e8f9;
  --accent-400: #22d3ee;
  --accent-500: #06b6d4;

  /* 背景层级 */
  --bg-0: #0a0e1a;   /* 最深：页面底 */
  --bg-1: #0f1424;   /* 次级 */
  --bg-2: #151b2e;   /* 卡片 */
  --bg-3: #1c2340;   /* 悬停/输入 */

  /* 边框 & 文字 */
  --line:        rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text-1: #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #64748b;

  /* 阴影 */
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.25), 0 10px 40px -10px rgba(99, 102, 241, 0.25);
}

/* ============ 全局基础 ============ */
html { scrollbar-gutter: stable; overflow-y: scroll; }

body.pt-body {
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(99,102,241,.10), transparent 60%),
    radial-gradient(1000px 700px at 90% -10%, rgba(34,211,238,.08), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(99,102,241,.06), transparent 60%),
    var(--bg-0);
  color: var(--text-1);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(99, 102, 241, .35); }

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: rgba(99,102,241,.35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(99,102,241,.35); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============ 通用容器 ============ */
.pt-card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)) , var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(6px);
}

.pt-card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.pt-card-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.35);
  box-shadow: var(--shadow-glow);
}

/* 页面大标题（带渐变文字） */
.pt-title {
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #a5b4fc 0%, #67e8f9 50%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pt-subtitle { color: var(--text-2); }

/* 标题左边的小标记条 */
.pt-section-title {
  position: relative;
  padding-left: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.pt-section-title::before {
  content: "";
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-400), var(--brand-500));
  box-shadow: 0 0 12px rgba(34, 211, 238, .5);
}

/* ============ 按钮体系 ============ */
.pt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  user-select: none;
  white-space: nowrap;
}
.pt-btn:active { transform: translateY(1px) scale(.98); }

.pt-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--accent-500) 100%);
  box-shadow: 0 4px 18px -4px rgba(99, 102, 241, .55), inset 0 0 0 1px rgba(255,255,255,.08);
}
.pt-btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-400) 0%, var(--accent-400) 100%);
  box-shadow: 0 6px 22px -4px rgba(99, 102, 241, .75), inset 0 0 0 1px rgba(255,255,255,.12);
}

.pt-btn-ghost {
  color: var(--text-1);
  background: rgba(255,255,255,.04);
  border-color: var(--line);
}
.pt-btn-ghost:hover {
  background: rgba(255,255,255,.08);
  border-color: var(--line-strong);
}

.pt-btn-success {
  color: #fff;
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 4px 18px -4px rgba(16, 185, 129, .5);
}
.pt-btn-success:hover { filter: brightness(1.06); }

.pt-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

/* ============ 表单 ============ */
.pt-input, .pt-select, .pt-textarea {
  width: 100%;
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.pt-input::placeholder, .pt-textarea::placeholder { color: var(--text-3); }
.pt-input:focus, .pt-select:focus, .pt-textarea:focus {
  border-color: rgba(99,102,241,.55);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
  background: var(--bg-3);
}
.pt-textarea { resize: vertical; min-height: 120px; }

.pt-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ============ 表格 ============ */
.pt-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-1);
}
.pt-table { width: 100%; font-size: 14px; border-collapse: separate; border-spacing: 0; }
.pt-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-2);
  background: linear-gradient(180deg, rgba(99,102,241,.08), rgba(99,102,241,.02));
  border-bottom: 1px solid var(--line);
}
.pt-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
}
.pt-table tbody tr:last-child td { border-bottom: none; }
.pt-table tbody tr { transition: background .12s ease; }
.pt-table tbody tr:hover { background: rgba(99,102,241,.08); }

/* ============ 代码 / pre ============ */
.pt-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  background: rgba(99,102,241,.12);
  color: #a5b4fc;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: .88em;
  border: 1px solid rgba(99,102,241,.2);
}
.pt-pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  background: #0c1122;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: #c4b5fd;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* ============ 徽章 / 提示 ============ */
.pt-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text-2);
}
.pt-badge-success { color: #34d399; border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.pt-badge-warn    { color: #fbbf24; border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.pt-badge-danger  { color: #f87171; border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.pt-badge-info    { color: #67e8f9; border-color: rgba(103,232,249,.35); background: rgba(103,232,249,.08); }

.pt-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text-2);
}
.pt-alert-info    { border-color: rgba(103,232,249,.3); color: #a5f3fc; background: rgba(34,211,238,.06); }
.pt-alert-success { border-color: rgba(52,211,153,.3); color: #a7f3d0; background: rgba(52,211,153,.06); }
.pt-alert-danger  { border-color: rgba(248,113,113,.3); color: #fecaca; background: rgba(248,113,113,.06); }

/* ============ Hero / 顶部标题区 ============ */
.pt-hero {
  position: relative;
  padding: 34px 0 18px;
  margin-bottom: 22px;
  text-align: center;
}
.pt-hero::after {
  content: "";
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 180px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,.55), transparent);
}

/* ============ Toast ============ */
.pt-toast {
  position: fixed; right: 20px; top: 20px; z-index: 9999;
  padding: 10px 16px; border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff; font-size: 13px; font-weight: 500;
  box-shadow: 0 10px 30px -10px rgba(16,185,129,.6);
  animation: pt-toast-in .18s ease-out;
}
@keyframes pt-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ 入场动画 ============ */
@keyframes pt-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pt-fade-up { animation: pt-fade-up .35s ease-out both; }
.pt-fade-up-1 { animation-delay: .05s; }
.pt-fade-up-2 { animation-delay: .10s; }
.pt-fade-up-3 { animation-delay: .15s; }

/* =========================================================
 * Vue 3 编码工具（#tool-root 由 tool.min.js 渲染）
 * 其模板使用 Bootstrap 类，这里补一份与本主题匹配的样式
 * ========================================================= */
#tool-root .ui-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 1rem;
  padding-left: 14px;
  position: relative;
}
#tool-root .ui-heading::before {
  content: "";
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-400), var(--brand-500));
  box-shadow: 0 0 12px rgba(34,211,238,.5);
}

#tool-root .row { display: flex; flex-wrap: wrap; margin: 0 -0.5rem; }
#tool-root .row + .row { margin-top: 1rem; }
#tool-root .col, #tool-root .col-12, #tool-root .col-md-12 {
  padding: 0 0.5rem;
  width: 100%;
  max-width: 100%;
}
#tool-root .col { flex: 1 1 0; }
#tool-root .col-12, #tool-root .col-md-12 { flex: 0 0 100%; }

/* Vue 把所有编码 btn-group 都放在一个 .col-md-12 里（兄弟节点）。
   让该容器用 flex-wrap 把所有按钮组横向铺，自动折行；不再有"一组占一行"的竖向堆叠 */
#tool-root .col-md-12 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-content: flex-start;
}

/* btn-group 自身：inline-flex，让里面的按钮紧挨着，组与组之间靠父容器 gap 分隔 */
#tool-root .btn-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  vertical-align: top;
}
/* 组内按钮更紧凑 */
#tool-root .btn-group .btn + .btn { margin-left: 0; }

/* 基础 .btn（不带颜色修饰） */
#tool-root .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text-1);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
  user-select: none;
  white-space: nowrap;
}
#tool-root .btn:hover {
  background: rgba(255,255,255,.08);
  border-color: var(--line-strong);
}
#tool-root .btn:active { transform: translateY(1px) scale(.98); }

/* outline-secondary → ghost */
#tool-root .btn-outline-secondary {
  background: rgba(255,255,255,.04);
  border-color: var(--line);
  color: var(--text-1);
}
#tool-root .btn-outline-secondary:hover {
  background: rgba(99,102,241,.12);
  border-color: rgba(99,102,241,.4);
  color: #c7d2fe;
}

/* primary（"直接执行"/"复制"） */
#tool-root .btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(99,102,241,.55);
}
#tool-root .btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-400), var(--accent-400));
  box-shadow: 0 6px 20px -4px rgba(99,102,241,.7);
}

/* success（如有） */
#tool-root .btn-success,
#tool-root .btn-outline-success {
  background: linear-gradient(135deg, #10b981, #34d399);
  border-color: transparent;
  color: #fff;
}

/* 高亮当前选中的编码方式（highlight 由 Vue 动态加） */
#tool-root .btn.btn-secondary,
#tool-root .btn.active,
#tool-root .btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(34,211,238,.18));
  border-color: rgba(99,102,241,.5);
  color: #c7d2fe;
  box-shadow: 0 0 12px -2px rgba(99,102,241,.4);
}

/* form-control → 与 .pt-textarea 对齐 */
#tool-root .form-control {
  display: block;
  width: 100%;
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.55;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
#tool-root .form-control::placeholder { color: var(--text-3); }
#tool-root .form-control:focus {
  border-color: rgba(99,102,241,.55);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
  background: var(--bg-3);
}
#tool-root textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

/* 输出框（generated-password 在 Vue 里也是 form-control） */
#tool-root textarea#generated-password {
  background: #0c1122;
  color: #a5b4fc;
  cursor: pointer;
}

/* Vue 渲染出来的布局间距微调 */
#tool-root > .row { margin-bottom: 0; }
#tool-root .col-12 > .btn-group:first-child { margin-top: 4px; }
#tool-root input[type="text"].form-control { min-height: 38px; }

