/* Shared layout: top menu + page shell */



@media (prefers-color-scheme: dark) {
  
}


/* Tool pages that still use class="bg" (not only tool-page.css) */
.bg{
  overflow: hidden;
}



/* Tool pages: same outer column as home / category */
.tool-shell{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-pad-y) var(--page-pad-x) 48px;
  box-sizing: border-box;
  animation: tool-shell-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes tool-shell-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tool-shell{ animation: none; }
}

/* —— Nav switch: View Transitions + leave state —— */
@supports (view-transition-name: none) {
  ::view-transition-old(root),::view-transition-new(root){
    animation-duration: 0.18s;
    animation-timing-function: ease-out;
  }
}
html.nav-leaving body{
  cursor: progress;
}
html.nav-leaving .topbar-link.active{
  pointer-events: none;
}

/* —— Top navigation bar —— */
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 10px 12px;
  margin-bottom: 28px;
  /* Solid-ish surface: avoid backdrop-filter (expensive on every paint / nav) */
  background: var(--panel-bg, rgba(255, 255, 255, 0.94));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  contain: layout style;
}
.topbar-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.topbar-logo{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #818cf8 0%, #4f46e5 55%, #d97706 100%);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
}
.topbar-logo svg{ width: 18px; height: 18px; }
.topbar-brand-text{ line-height: 1.2; }
.topbar-brand-name{
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.topbar-brand-sub{
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 1px;
}

.topbar-menu{
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
  min-width: 0;
}
.topbar-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
  /* Faster perceived click */
  touch-action: manipulation;
}
.topbar-link:hover{
  color: var(--ink);
  background: var(--surface-solid);
  border-color: var(--line);
}
.topbar-link.active{
  color: var(--indigo);
  background: var(--surface-solid);
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}
.topbar-link .menu-icon{ font-size: 14px; line-height: 1; }
.topbar-link .menu-count{
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 999px;
}
.topbar-link.active .menu-count{
  color: #4f46e5;
  background: #eef2ff;
}

.topbar-right{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-search{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  touch-action: manipulation;
}
.topbar-search:hover{
  color: #4338ca;
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(79, 70, 229, 0.1);
}
.topbar-search svg{ flex-shrink: 0; }
.topbar-kbd{
  font-family: var(--mono, ui-monospace, Consolas, monospace);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-2);
  background: var(--chip-bg, #f1f5f9);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 5px;
  line-height: 1.3;
}
.topbar-theme{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid, #fff);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: border-color 0.12s, background 0.12s;
  touch-action: manipulation;
}
.topbar-theme:hover{
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(79, 70, 229, 0.1);
}
.topbar-theme-icon::before{
  content: var(--theme-toggle-icon, "☾");
}
@media (max-width: 720px) {
  .topbar-search-label,.topbar-kbd{ display: none; }
  .topbar-search{ padding: 8px; border-radius: 10px; }
}

/* —— Command palette —— */
.cmd-palette[hidden]{ display: none !important; }
.cmd-palette{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(18vh, 120px) 16px 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cmd-palette-panel{
  width: min(560px, 100%);
  background: var(--surface-solid, #fff);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 520px);
}
.cmd-palette-head{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.cmd-palette-head svg{
  width: 18px;
  height: 18px;
  color: #94a3b8;
  flex-shrink: 0;
}
.cmd-palette-input{
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  min-width: 0;
}
.cmd-palette-input::placeholder{ color: var(--muted-2); font-weight: 500; }
.cmd-palette-hint{
  font-size: 11px;
  font-weight: 650;
  color: var(--muted-2);
  white-space: nowrap;
}
.cmd-palette-list{
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  flex: 1;
}
.cmd-palette-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}
.cmd-palette-item[aria-selected="true"],.cmd-palette-item:hover{
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(99, 102, 241, 0.22);
}
.cmd-palette-item .cmd-icon{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: var(--chip-bg, #f1f5f9);
  flex-shrink: 0;
}
.cmd-palette-item .cmd-body{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmd-palette-item .cmd-name{
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink-2);
}
.cmd-palette-item .cmd-desc{
  font-size: 12px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-palette-item .cmd-badge{
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--chip-bg);
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.cmd-palette-empty{
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-2);
  font-weight: 600;
}
.cmd-palette-foot{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted-2);
  font-weight: 600;
}
.cmd-palette-foot kbd{
  font-family: var(--mono, ui-monospace, Consolas, monospace);
  font-size: 10px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 4px;
}

/* —— Active jobs tray —— */
.jobs-tray{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9000;
  width: min(320px, calc(100vw - 24px));
  font-family: var(--font, system-ui, sans-serif);
}
.jobs-tray[hidden]{ display: none !important; }
.jobs-tray-toggle{
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.35);
  float: right;
}
.jobs-tray-toggle .jobs-count{
  background: rgba(255, 255, 255, 0.22);
  padding: 1px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.jobs-tray-panel{
  clear: both;
  margin-top: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.jobs-tray-panel[hidden]{ display: none !important; }
.jobs-tray-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 750;
  color: var(--ink-2);
}
.jobs-tray-head button{
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.jobs-tray-list{
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.jobs-tray-item{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 4px;
  background: var(--bg-elevated, #f8fafc);
  border: 1px solid var(--line);
}
.jobs-tray-item:last-child{ margin-bottom: 0; }
.jobs-tray-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.jobs-tray-title{
  font-size: 12.5px;
  font-weight: 750;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jobs-tray-st{
  font-size: 10.5px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.jobs-tray-st.running,.jobs-tray-st.queued{ background: #eef2ff; color: #4338ca; }
.jobs-tray-st.done{ background: #ecfdf5; color: #047857; }
.jobs-tray-st.error{ background: #fef2f2; color: #b91c1c; }
.jobs-tray-meta{
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.jobs-tray-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.jobs-tray-actions button,.jobs-tray-actions a{
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 8px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
}
.jobs-tray-actions button.primary,.jobs-tray-actions a.primary{
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.jobs-tray-empty{
  padding: 16px;
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
  font-weight: 600;
}

html.toolkit-busy,html.toolkit-busy body{
  cursor: progress;
}

/* —— Toast —— */
.toolkit-toast-host{
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 11000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}
.toolkit-toast{
  pointer-events: none;
  font-family: var(--font, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 11px 16px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  animation: toolkit-toast-in 0.2s ease-out both;
  max-width: 100%;
  text-align: center;
}
.toolkit-toast.kind-ok{
  background: rgba(6, 95, 70, 0.95);
  border-color: rgba(52, 211, 153, 0.35);
}
.toolkit-toast.kind-err{
  background: rgba(127, 29, 29, 0.95);
  border-color: rgba(248, 113, 113, 0.35);
}
.toolkit-toast.kind-warn{
  background: rgba(120, 53, 15, 0.95);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fffbeb;
}
.toolkit-toast.kind-info{
  background: rgba(30, 41, 59, 0.95);
}
@keyframes toolkit-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .toolkit-toast{ animation: none; }
}
.topbar-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 999px;
}
.topbar-dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Mobile menu toggle */
.topbar-toggle{
  display: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .topbar{
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  .topbar-toggle{ display: inline-flex; align-items: center; gap: 6px; }
  .topbar-menu{
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    margin-top: 4px;
  }
  .topbar-menu.is-open{ display: flex; }
  .topbar-link{
    justify-content: flex-start;
    border-radius: 12px;
    padding: 10px 12px;
  }
  .topbar-right .topbar-pill span:not(.topbar-dot){ display: none; }
  .topbar-brand-sub{ display: none; }
}

/* —— Tool cards (shared) —— */

.tool-card{
  --c: #4f46e5;
  --c2: #8b5cf6;
  --soft: #eef2ff;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 22px 20px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease, border-color 0.28s ease;
}
html[data-theme="dark"] .tool-card{
  --soft: rgba(79, 70, 229, 0.18);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tool-card{ --soft: rgba(79, 70, 229, 0.18); }
}
.tool-card:hover{
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-lg);
}
.tool-card:focus-visible{
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}
.tool-card .glow{
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  top: -70px;
  right: -50px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.tool-card:hover .glow{
  transform: scale(1.12) translate(-6px, 6px);
  opacity: 0.72;
}
.tool-card[data-accent="indigo"]{ --c: #4f46e5; --c2: #8b5cf6; --soft: #eef2ff; }
.tool-card[data-accent="emerald"]{ --c: #059669; --c2: #10b981; --soft: #ecfdf5; }
.tool-card[data-accent="amber"]{ --c: #d97706; --c2: #f59e0b; --soft: #fffbeb; }
.tool-card[data-accent="sky"]{ --c: #0284c7; --c2: #0ea5e9; --soft: #f0f9ff; }
.tool-card[data-accent="violet"]{ --c: #7c3aed; --c2: #8b5cf6; --soft: #f5f3ff; }
.tool-card[data-accent="indigo"] .glow{ background: radial-gradient(circle, #c7d2fe 0%, transparent 70%); }
.tool-card[data-accent="emerald"] .glow{ background: radial-gradient(circle, #a7f3d0 0%, transparent 70%); }
.tool-card[data-accent="amber"] .glow{ background: radial-gradient(circle, #fde68a 0%, transparent 70%); }
.tool-card[data-accent="sky"] .glow{ background: radial-gradient(circle, #bae6fd 0%, transparent 70%); }
.tool-card[data-accent="violet"] .glow{ background: radial-gradient(circle, #ddd6fe 0%, transparent 70%); }
.tool-card:hover{ border-color: rgba(79, 70, 229, 0.28); }















.site-footer{
  margin-top: auto;
  padding-top: 48px;
}


@media (max-width: 800px) {
  
}















@media (max-width: 800px) {
  
}





/* Compact full-width footer (category pages etc.) — aligns with tool-card grid */
.site-footer-inner{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  width: 100%;
  box-sizing: border-box;
  padding: 16px 22px;
  border-radius: 16px;
  background: var(--surface-solid, #fff);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.site-footer-brand{
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink-2, #1e293b);
  letter-spacing: -0.01em;
}
.site-footer-note{
  font-size: 12.5px;
  color: var(--muted-2);
  line-height: 1.45;
}
.site-footer-note a{
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
  transition: color 0.15s ease;
}
.site-footer-note a:hover{
  color: var(--indigo, #4f46e5);
}
@media (max-width: 560px) {
  .site-footer-inner{
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
  }
}

/* --- Donation (打赏) block shown in page footers --- */
.donation-block{
  display: flex;
  justify-content: center;
  padding: 26px 16px 8px;
}
.donation-card{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 300px;
  width: 100%;
  padding: 20px 24px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.10), rgba(217, 119, 6, 0.02));
  border: 1px solid rgba(217, 119, 6, 0.18);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.donation-head{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber, #d97706);
}
.donation-heart{
  font-style: normal;
  color: #ef4444;
  font-size: 14px;
}
.donation-title{
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-2, #1e293b);
}
.donation-subtitle{
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-2);
}
.donation-qr{
  width: 152px;
  height: 152px;
  margin-top: 8px;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  object-fit: contain;
}
.donation-hint{
  font-size: 11.5px;
  color: var(--muted-3, #94a3b8);
}

