.tools-container:has(.tool-page-base64) {
  width: min(1280px, calc(100% - 32px));
  max-width: 1280px;
  padding-left: 28px;
  padding-right: 28px;
}
.tool-page.tool-page-base64 { width: 100%; max-width: 100%; min-width: 0; color: var(--tf-text); }
.b64-page, .b64-page * { box-sizing: border-box; }
.b64-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; max-width: 100%; }
.b64-page > * { min-width: 0; max-width: 100%; }
.tool-page-base64 .tool-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "mark title back" "mark text back";
  column-gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.b64-mark {
  grid-area: mark; width: 52px; height: 52px; display: grid; place-items: center; align-content: center;
  border-radius: 14px; background: #2459e0; color: #fff; font-weight: 750; font-size: 13px; line-height: 1.05; letter-spacing: 0.04em;
}
.b64-mark span { display: block; text-align: center; }
.tool-page-base64 .tool-header h1 { grid-area: title; margin: 0; font-size: 34px; line-height: 1.1; }
.tool-page-base64 .tool-description { grid-area: text; margin: 4px 0 0; }
.tool-page-base64 .tf-back { grid-area: back; align-self: start; }
.b64-card { background: var(--tf-card, #fff); border: 1px solid var(--tf-line); border-radius: 16px; padding: 22px; min-width: 0; }
.b64-toolbar, .b64-options, .b64-actions, .b64-field-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.b64-toolbar { justify-content: flex-start; }
.b64-toolbar-actions, .b64-output-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.b64-toolbar-actions { margin-left: auto; }
.b64-seg { display: inline-flex; padding: 4px; border-radius: 12px; background: #f2f4f7; gap: 4px; }
.b64-seg button, .b64-ghost, .b64-submit {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 10px;
}
.b64-seg button { height: 36px; padding: 0 16px; border: 0; background: transparent; color: #475467; }
.b64-seg button.is-on { background: #2459e0; color: #fff; }
.b64-ghost {
  height: 40px; padding: 0 12px; border: 1px solid var(--tf-line); background: #fff; color: inherit;
  display: inline-flex; align-items: center; gap: 8px;
}
.b64-ghost:disabled, .b64-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.b64-options { margin-top: 16px; align-items: center; }
.b64-label { font-weight: 700; }
.tool-page-base64 .b64-select, .tool-page-base64 .b64-text {
  border: 1px solid var(--tf-line); border-radius: 12px; background: #fff; color: #182b49;
  font-family: inherit; font-size: 16px;
}
.tool-page-base64 .b64-select { width: auto; min-width: 190px; height: 40px; min-height: 40px; flex: 0 0 auto; padding: 0 12px; }
.b64-options .b64-hint { margin-left: auto; }
.b64-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.b64-check input { width: 16px; height: 16px; accent-color: #2459e0; }
.b64-hint, .b64-muted { margin: 0; color: var(--tf-muted); font-size: 14px; line-height: 1.45; }
.b64-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.b64-field { min-width: 0; display: grid; gap: 8px; }
.b64-text {
  width: 100%; min-height: 180px; padding: 14px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.5; white-space: pre-wrap;
}
.b64-filebox { position: relative; display: grid; gap: 8px; align-content: start; min-height: 180px; padding: 16px; border: 1px dashed #d0d5dd; border-radius: 12px; }
.b64-filebox input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.b64-actions { margin-top: 16px; justify-content: space-between; }
.b64-submit {
  height: 44px; padding: 0 18px; border: 0; background: #2459e0; color: #fff;
  display: inline-flex; align-items: center; gap: 8px;
}
.b64-status-wrap { margin-left: auto; text-align: right; }
.b64-ok { margin: 0; color: #067647; font-weight: 700; }
.b64-error { margin: 12px 0 0; color: #b42318; font-weight: 700; }
.b64-live { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.b64-page [hidden] { display: none !important; }
.b64-note {
  display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 12px; background: #eef3ff; line-height: 1.45;
}
.b64-note::before {
  content: "i"; width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center;
  border: 1.5px solid #2459e0; border-radius: 999px; color: #2459e0; font-size: 12px; font-weight: 700; font-style: italic;
}
.b64-stats, .b64-follow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.b64-follow { grid-template-columns: 1fr 1fr; }
.b64-stat, .b64-follow article { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.b64-stat strong { display: block; font-size: 22px; }
.b64-stat span, .b64-follow p, .b64-details p { margin: 0; color: var(--tf-muted); font-size: 13px; line-height: 1.45; }
.b64-stat h3, .b64-follow h3 { margin: 0 0 4px; font-size: 16px; }
.b64-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; background: #eef3ff; color: #2459e0; }
.b64-details { display: grid; gap: 10px; }
.b64-details h2 { margin: 0 0 4px; font-size: 18px; }
.b64-row { display: flex; justify-content: space-between; gap: 16px; padding-top: 10px; border-top: 1px solid var(--tf-line); }
.b64-row span { color: var(--tf-muted); }
.b64-faq details { border-top: 1px solid var(--tf-line); }
.b64-faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer; font-weight: 650; list-style: none; }
.b64-faq summary::-webkit-details-marker, .b64-faq summary::marker { display: none; content: ""; }
.b64-faq summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid #5c6b82; border-bottom: 2px solid #5c6b82; transform: rotate(45deg); flex: 0 0 auto; }
.b64-faq details[open] summary::after { transform: rotate(-135deg); }
.b64-faq details:not([open]) > :not(summary) { display: none; }
.b64-faq p { margin: 0 0 16px; color: var(--tf-muted); line-height: 1.55; }
.b64-faq h2, .b64-related h2 { margin: 8px 0 12px; }
.tools-container:has(.tool-page-base64) .b64-rel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tools-container:has(.tool-page-base64) .b64-rel {
  display: flex; gap: 12px; align-items: center; min-height: 84px; padding: 16px; border: 1px solid var(--tf-line);
  border-radius: 16px; text-decoration: none; color: inherit; background: var(--tf-card, #fff);
}
.tools-container:has(.tool-page-base64) .b64-rel .b64-rel-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 999px; }
.tools-container:has(.tool-page-base64) .b64-rel-icon.pw { background: #fff7ed; color: #9a3412; }
.tools-container:has(.tool-page-base64) .b64-rel-icon.uuid { background: #eef3ff; color: #2459e0; }
.tools-container:has(.tool-page-base64) .b64-rel-icon.url { background: #eef3ff; color: #2459e0; }
.tools-container:has(.tool-page-base64) .b64-rel strong,
.tools-container:has(.tool-page-base64) .b64-rel > span:not(.b64-rel-icon),
.tools-container:has(.tool-page-base64) .b64-rel > span span { display: block; width: auto; height: auto; }
.tools-container:has(.tool-page-base64) .b64-rel span span { color: var(--tf-muted); font-size: 13px; }
.tools-container:has(.tool-page-base64) .b64-rel::after {
  content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid #98a2b3; border-top: 2px solid #98a2b3; transform: rotate(45deg);
}
.b64-submit:focus-visible, .b64-ghost:focus-visible, .b64-seg button:focus-visible, .b64-select:focus-visible,
.b64-text:focus-visible, .b64-check input:focus-visible, .b64-faq summary:focus-visible, .b64-rel:focus-visible {
  outline: 2px solid #2459e0; outline-offset: 2px;
}
[data-theme="dark"] .tool-page-base64 .b64-select,
[data-theme="dark"] .tool-page-base64 .b64-text,
[data-theme="dark"] .tool-page-base64 .b64-ghost,
[data-theme="dark"] .tool-page-base64 .b64-filebox { background: #070d18; color: var(--tf-text); }
[data-theme="dark"] .tool-page-base64 .b64-seg,
[data-theme="dark"] .tool-page-base64 .b64-note,
[data-theme="dark"] .tool-page-base64 .b64-ico { background: #13203a; }
@media (max-width: 860px) {
  .tool-page-base64 .tool-header { grid-template-columns: auto 1fr; grid-template-areas: "mark title" "text text" "back back"; }
  .tool-page-base64 .tool-header h1 { font-size: 28px; }
}
@media (max-width: 900px) {
  .b64-columns, .b64-stats, .b64-follow, .tools-container:has(.tool-page-base64) .b64-rel-grid { grid-template-columns: 1fr; }
  .b64-status-wrap { margin-left: 0; text-align: left; }
}
