/* ============================================================
   工具箱
   ============================================================ */
.tb-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 12, 18, .55);
  backdrop-filter: blur(10px);
  animation: tbFade .2s ease;
}
@keyframes tbFade { from { opacity: 0; } }

.tb-panel {
  width: min(940px, 100%);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 253, 254, .96);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 40px 90px rgba(120, 60, 90, .3), inset 0 1px 0 #fff;
  animation: tbIn .32s cubic-bezier(.22, 1, .36, 1);
}
@keyframes tbIn {
  from { opacity: 0; transform: translateY(25px) scale(.96); }
}

.tb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 158, 190, .25);
  background: linear-gradient(120deg, rgba(255, 228, 239, .9), rgba(255, 250, 252, .8));
}
.tb-head h2 {
  font-size: 17px;
  font-weight: 850;
  color: #3d2b33;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tb-head h2 svg { width: 18px; height: 18px; color: #ff5c9d; }
.tb-head .rc-sp { flex: 1; }
.tb-x {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; border-radius: 9px;
  background: rgba(255, 158, 190, .16);
  color: #d6457e; cursor: pointer;
  transition: all .18s;
}
.tb-x:hover { background: #ff5c9d; color: #fff; transform: rotate(90deg); }
.tb-x svg { width: 14px; height: 14px; }

.tb-body { display: flex; min-height: 0; flex: 1; }

.tb-nav {
  flex: 0 0 168px;
  padding: 12px 10px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 158, 190, .2);
  background: rgba(255, 246, 250, .7);
}
.tb-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 3px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #8a6b78;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all .16s;
}
.tb-nav button:hover { background: rgba(255, 158, 190, .16); color: #d6457e; }
.tb-nav button.on {
  background: linear-gradient(120deg, #ff5c9d, #ff8fab);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 92, 157, .32);
}
.tb-nav button svg { width: 15px; height: 15px; }

.tb-view {
  flex: 1;
  min-width: 0;
  padding: 20px 24px 26px;
  overflow-y: auto;
}
.tb-view h3 {
  font-size: 15px;
  font-weight: 800;
  color: #3d2b33;
  margin-bottom: 6px;
}
.tb-view .tb-desc {
  font-size: 12.5px;
  color: #a98a97;
  margin-bottom: 16px;
  line-height: 1.6;
}
.tb-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tb-row label { font-size: 12.5px; color: #8a6b78; font-weight: 600; min-width: 56px; }
.tb-in, .tb-ta, .tb-sel {
  flex: 1;
  min-width: 120px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 158, 190, .32);
  background: #fff;
  font-size: 13px;
  color: #3d2b33;
  font-family: inherit;
  transition: all .18s;
}
.tb-in:focus, .tb-ta:focus, .tb-sel:focus {
  outline: none;
  border-color: #ff5c9d;
  box-shadow: 0 0 0 3.5px rgba(255, 92, 157, .13);
}
.tb-ta { min-height: 110px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12.5px; line-height: 1.6; }
.tb-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(120deg, #ff5c9d, #ff8fab);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s cubic-bezier(.22, 1, .36, 1);
  box-shadow: 0 8px 20px rgba(255, 92, 157, .28);
}
.tb-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 92, 157, .4); }
.tb-btn:active { transform: translateY(0); }
.tb-btn.ghost {
  background: #fff;
  color: #d6457e;
  border: 1.5px solid rgba(255, 158, 190, .4);
  box-shadow: none;
}
.tb-btn.ghost:hover { background: #fff5f9; box-shadow: 0 6px 16px rgba(255, 158, 190, .2); }
.tb-out {
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(255, 246, 250, .85);
  border: 1.5px dashed rgba(255, 158, 190, .4);
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-all;
  color: #3d2b33;
  min-height: 44px;
  white-space: pre-wrap;
}
.tb-hint { font-size: 12px; color: #b391a0; margin-top: 8px; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.tb-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 158, 190, .35);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #8a6b78;
  cursor: pointer;
  transition: all .16s;
}
.tb-chip:hover { border-color: #ff5c9d; color: #d6457e; transform: translateY(-1px); }
.tb-chip.on { background: linear-gradient(120deg, #ff5c9d, #ff8fab); color: #fff; border-color: transparent; }

.tb-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) {
  .tb-body { flex-direction: column; }
  .tb-nav {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 158, 190, .2);
    padding: 10px;
  }
  .tb-nav button { width: auto; white-space: nowrap; margin: 0; }
  .tb-grid2 { grid-template-columns: 1fr; }
}

/* 深色 */
html[data-theme="dark"] .tb-panel { background: rgba(20, 17, 26, .97); border-color: rgba(255,255,255,.09); }
html[data-theme="dark"] .tb-head { background: linear-gradient(120deg, rgba(255,92,157,.12), rgba(255,255,255,.03)); border-bottom-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .tb-head h2 { color: #e9eef8; }
html[data-theme="dark"] .tb-nav { background: rgba(255,255,255,.02); border-right-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .tb-nav button { color: #8a93a8; }
html[data-theme="dark"] .tb-nav button:hover { background: rgba(255,92,157,.14); color: #ff9ec1; }
html[data-theme="dark"] .tb-view h3 { color: #e9eef8; }
html[data-theme="dark"] .tb-in, html[data-theme="dark"] .tb-ta, html[data-theme="dark"] .tb-sel {
  background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #e9eef8;
}
html[data-theme="dark"] .tb-out { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: #d6deeb; }
html[data-theme="dark"] .tb-btn.ghost { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: #ff9ec1; }
html[data-theme="dark"] .tb-chip { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: #8a93a8; }

/* Edge 屏蔽工具 */
.eb-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  background: linear-gradient(120deg, #ff5c9d, #ff8fab);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
}
.eb-admin {
  display: inline-block;
  margin-left: 8px;
  padding: 1.5px 8px;
  border-radius: 6px;
  background: rgba(255, 92, 157, .14);
  color: #d6457e;
  font-size: 11px;
  font-weight: 800;
  vertical-align: 2px;
}
.eb-hint {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px dashed rgba(255, 158, 190, .45);
  background: rgba(255, 246, 250, .8);
  font-size: 12.5px;
  color: #a98a97;
  text-align: center;
}
html[data-theme="dark"] .eb-hint {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .1);
  color: #8a93a8;
}
#ebBlock, #ebRestore {
  max-height: 340px;
  overflow-y: auto;
  white-space: pre;
  font-size: 12px;
  line-height: 1.65;
}

/* Edge 屏蔽卡片 */
.eb-card {
  padding: 18px 20px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 158, 190, .34);
  background: linear-gradient(150deg, rgba(255,255,255,.92), rgba(255,246,250,.75));
  box-shadow: 0 8px 22px rgba(255, 158, 190, .12);
}
.eb-card-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14.5px;
}
.eb-card-h b { font-weight: 850; color: #3d2b33; }
.eb-card p {
  font-size: 12.8px;
  line-height: 1.75;
  color: #8a6b78;
  margin-bottom: 12px;
}
.eb-card .tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 9px 20px;
  font-size: 13px;
}
.eb-tag-gray {
  background: linear-gradient(120deg, #9aa5b8, #7c8ba3) !important;
}
.eb-list {
  padding-left: 20px;
  font-size: 12.8px;
  line-height: 1.9;
  color: #8a6b78;
}
.eb-list code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 158, 190, .16);
  font-size: 11.8px;
  color: #d6457e;
}
.eb-note {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 3px solid #ffb703;
  background: rgba(255, 183, 3, .09);
  font-size: 12.8px;
  line-height: 1.75;
  color: #8a6b78;
}
.eb-note b { color: #3d2b33; }
.eb-note code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0,0,0,.06);
  font-size: 11.8px;
}
html[data-theme="dark"] .eb-card {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.1);
}
html[data-theme="dark"] .eb-card-h b { color: #e9eef8; }
html[data-theme="dark"] .eb-note { background: rgba(255,183,3,.1); color: #a0a8b8; }
.eb-pw {
  margin-top: 10px !important;
  margin-bottom: 0 !important;
  font-size: 11.5px !important;
  color: #b391a0 !important;
}
.eb-tag-blue { background: linear-gradient(120deg, #4a8cff, #6c8cff) !important; }
.eb-diag { border-color: rgba(108, 140, 255, .35) !important; }


/* ============ 密钥保险箱 ============ */
.vg-lock {
  display: flex;
  gap: 8px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed rgba(0, 0, 0, .1);
}
.vg-pin {
  flex: 1;
  max-width: 130px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .1);
  background: #fff;
  font: inherit;
  font-size: 13px;
  letter-spacing: .28em;
  text-align: center;
  color: #2d3748;
}
.vg-pin:focus { outline: 0; border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74,108,247,.12); }
.vg-lock.shake { animation: vgShake .34s ease; }
@keyframes vgShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  40%     { transform: translateX(5px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(3px); }
}

.vg-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(74, 108, 247, .25);
  background: linear-gradient(160deg, rgba(74,108,247,.06), rgba(255,255,255,.7));
}
.vg-card.hidden { display: none; }
.vg-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 13px;
}
.vg-head b { font-weight: 850; color: #2d3748; }
.vg-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
  animation: vgPulse 2s ease-in-out infinite;
}
@keyframes vgPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
  50%     { box-shadow: 0 0 0 6px rgba(34,197,94,.06); }
}
.vg-len {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  font-family: ui-monospace, monospace;
}
.vg-mask {
  padding: 12px 15px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .05);
  border: 1px dashed rgba(0, 0, 0, .1);
  font: 13.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: #475569;
  letter-spacing: .04em;
  word-break: break-all;
  user-select: none;
}
.vg-note {
  margin: 10px 0 14px;
  font-size: 11.5px;
  line-height: 1.8;
  color: #8a94a6;
}
.vg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.vg-status {
  margin-top: 10px;
  font-size: 12px;
  min-height: 18px;
  color: #8a94a6;
}
.vg-status.ok { color: #16a34a; }
.vg-status.err { color: #dc2626; }
.vg-warn {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .3);
  font-size: 12px;
  color: #b45309;
}
.vg-loading, .vg-err {
  padding: 18px;
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
}
.vg-err { color: #dc2626; }

/* 深色 */
html[data-theme="dark"] .vg-card {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
}
html[data-theme="dark"] .vg-head b { color: #e2e8f0; }
html[data-theme="dark"] .vg-mask {
  background: rgba(0,0,0,.35);
  border-color: rgba(255,255,255,.1);
  color: #94a3b8;
}
html[data-theme="dark"] .vg-pin {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: #e2e8f0;
}

/* Linux 主题 */
html[data-style="linux"] .vg-card {
  border: 1px solid rgba(0, 255, 65, .32);
  background: rgba(0, 255, 65, .04);
  border-radius: 3px;
}
html[data-style="linux"] .vg-head b { color: #00ff41; text-shadow: 0 0 10px rgba(0,255,65,.4); }
html[data-style="linux"] .vg-dot { background: #00ff41; }
html[data-style="linux"] .vg-mask {
  background: rgba(0, 0, 0, .4);
  border: 1px dashed rgba(0, 255, 65, .3);
  color: #7dffa5;
  border-radius: 2px;
}
html[data-style="linux"] .vg-pin {
  border: 1px solid rgba(0, 255, 65, .35);
  background: rgba(0, 255, 65, .04);
  color: #00ff41;
  border-radius: 3px;
  font-family: ui-monospace, Consolas, monospace;
}
html[data-style="linux"] .vg-note { color: rgba(0,255,65,.45); }
html[data-style="linux"] .vg-status { color: rgba(0,255,65,.6); }
html[data-style="linux"] .vg-status.ok { color: #00ff41; }
html[data-style="linux"] .vg-status.err { color: #ff4d4d; }


/* 隐藏触发链接（做得很不起眼） */
.vg-trigger {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, .06);
  text-align: right;
}
.vg-trigger a {
  font-size: 11px;
  color: #b8c0cc;
  text-decoration: none;
  letter-spacing: .02em;
  transition: color .18s;
  cursor: pointer;
}
.vg-trigger a:hover { color: #8a94a6; }
html[data-theme="dark"] .vg-trigger { border-top-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .vg-trigger a { color: #4a5568; }
html[data-theme="dark"] .vg-trigger a:hover { color: #8899aa; }
html[data-style="linux"] .vg-trigger { border-top: 1px dashed rgba(0,255,65,.15); }
html[data-style="linux"] .vg-trigger a {
  color: rgba(0, 255, 65, .28);
  font-family: ui-monospace, Consolas, monospace;
}
html[data-style="linux"] .vg-trigger a:hover { color: rgba(0, 255, 65, .7); }


/* 第二层链接 */
.vg-stage2 {
  margin-top: 18px;
  text-align: right;
}
.vg-stage2.hidden { display: none; }
.vg-stage2 a {
  display: inline-block;
  padding: 7px 14px;
  font-size: 12px;
  color: #8a94a6;
  text-decoration: none;
  border: 1px dashed rgba(0, 0, 0, .14);
  border-radius: 8px;
  transition: all .18s;
  cursor: pointer;
}
.vg-stage2 a:hover {
  color: #4a6cf7;
  border-color: rgba(74, 108, 247, .4);
  background: rgba(74, 108, 247, .05);
}
html[data-theme="dark"] .vg-stage2 a {
  color: #6b7788;
  border-color: rgba(255, 255, 255, .14);
}
html[data-theme="dark"] .vg-stage2 a:hover {
  color: #8aa4ff;
  border-color: rgba(138, 164, 255, .4);
}

/* Linux */
html[data-style="linux"] .vg-stage2 a {
  color: rgba(0, 255, 65, .45);
  border: 1px dashed rgba(0, 255, 65, .28);
  border-radius: 2px;
  font-family: ui-monospace, Consolas, monospace;
}
html[data-style="linux"] .vg-stage2 a:hover {
  color: #00ff41;
  border-color: #00ff41;
  background: rgba(0, 255, 65, .08);
}

/* 恢复 lock 行的隐藏态 */
.vg-lock.hidden { display: none; }

.eb-size {
  margin-left: auto;
  font-size: 10.5px;
  color: #b0b8c4;
  font-family: ui-monospace, monospace;
}
html[data-theme="dark"] .eb-size { color: #6b7788; }
html[data-style="linux"] .eb-size { color: rgba(0,255,65,.4); }
