:root {
  --tool-bg: #edf8fc;
  --tool-ink: #2f334a;
  --tool-muted: #6d718d;
  --tool-line: #d6def3;
  --tool-panel: rgba(255, 253, 252, 0.88);
  --tool-panel-solid: #fffdfc;
  --tool-panel-soft: #f4f8ff;
  --tool-blue: #93c5e8;
  --tool-blue-dark: #5d89b5;
  --tool-lavender: #cfc2ef;
  --tool-lavender-dark: #8171af;
  --tool-mint: #afd8ca;
  --tool-peach: #e9b8a9;
  --tool-cream: #fff3d4;
  --tool-danger: #b46677;
  --tool-shadow: 0 18px 42px rgba(81, 101, 142, 0.13);
  --tool-mono: "Fira Code", "Cascadia Code", Consolas, monospace;
  --tool-sans: "Noto Sans TC", "Yu Gothic UI", "Microsoft JhengHei", system-ui, sans-serif;
}

body.toolbox-page {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(207, 194, 239, 0.32), transparent 23rem),
    radial-gradient(circle at 88% 10%, rgba(147, 197, 232, 0.34), transparent 26rem),
    radial-gradient(circle at 72% 90%, rgba(175, 216, 202, 0.22), transparent 25rem),
    linear-gradient(180deg, #f8fbff 0%, #edf8fc 48%, #f7f3ff 100%),
    var(--tool-bg) !important;
  background-size: auto !important;
  color: var(--tool-ink) !important;
  font-family: var(--tool-sans) !important;
}

.toolbox-nav {
  position: sticky;
  top: 0;
  z-index: 9000 !important;
  border-bottom: 1px solid rgba(137, 156, 205, 0.18);
  background: rgba(248, 251, 255, 0.78);
  backdrop-filter: blur(18px) saturate(1.1);
}

.toolbox-nav-inner {
  width: min(1180px, calc(100% - 28px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.toolbox-brand {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 250px;
  color: var(--tool-ink);
  text-decoration: none;
}

.toolbox-brand-copy strong {
  display: block;
  font-size: 0.96rem;
  line-height: 1.22;
  letter-spacing: 0.02em;
}

.toolbox-brand-copy span {
  display: block;
  margin-top: 3px;
  color: var(--tool-muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.toolbox-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbox-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid rgba(137, 156, 205, 0.24);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(255, 253, 252, 0.76);
  color: var(--tool-muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.84rem;
  box-shadow: 0 8px 18px rgba(81, 101, 142, 0.07);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.toolbox-link:hover {
  transform: translateY(-1px);
  border-color: var(--tool-blue);
  color: var(--tool-blue-dark);
  background: #fff;
}

.toolbox-link.active {
  border-color: rgba(137, 156, 205, 0.38);
  background: #fffdfc;
  color: var(--tool-blue-dark);
  box-shadow:
    inset 0 0 0 2px rgba(147, 197, 232, 0.32),
    0 10px 22px rgba(81, 101, 142, 0.12);
}

.toolbox-page-note {
  width: min(1180px, calc(100% - 28px));
  margin: 14px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(137, 156, 205, 0.22);
  border-radius: 14px;
  padding: 12px 15px;
  background: rgba(255, 253, 252, 0.72);
  box-shadow: 0 10px 24px rgba(81, 101, 142, 0.08);
  color: var(--tool-muted);
  font-size: 0.88rem;
  line-height: 1.58;
}

.toolbox-page-note strong {
  color: var(--tool-ink);
}

.toolbox-note-chip {
  border-radius: 999px;
  padding: 7px 11px;
  background: linear-gradient(135deg, #e8f6ff, #f3ebff);
  color: var(--tool-lavender-dark);
  font: 800 0.72rem/1 var(--tool-mono);
  white-space: nowrap;
}

.toolbox-footer {
  width: min(1180px, calc(100% - 28px));
  margin: 28px auto 34px;
  padding: 18px 16px;
  border-top: 1px solid rgba(137, 156, 205, 0.22);
  color: var(--tool-muted);
  text-align: center;
  font-size: 0.86rem;
  line-height: 1.65;
}

.toolbox-footer p {
  margin: 0.1rem 0;
}

body.toolbox-page .container {
  max-width: 1180px !important;
  padding-top: 1.25rem !important;
}

body.toolbox-page .container > header:first-child,
body.toolbox-page .preset-header,
body.toolbox-page .panel,
body.toolbox-page .section,
body.toolbox-page .upload-section,
body.toolbox-page .instruction-box,
body.toolbox-page .preview-container,
body.toolbox-page .stat-card,
body.toolbox-page .stat-item,
body.toolbox-page .edit-mode-bar,
body.toolbox-page .metric,
body.toolbox-page .item,
body.toolbox-page .entry-item,
body.toolbox-page .entry-manager,
body.toolbox-page .code-block,
body.toolbox-page .meta-chip {
  border-radius: 14px !important;
  border-color: rgba(137, 156, 205, 0.22) !important;
  box-shadow: var(--tool-shadow);
}

body.toolbox-page .container > header:first-child {
  padding: 1.8rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(242, 248, 255, 0.72)),
    var(--tool-panel);
  border: 1px solid var(--tool-line);
  text-align: left;
}

body.toolbox-page header h1,
body.toolbox-page .brand h1,
body.toolbox-page .preset-name {
  color: var(--tool-ink) !important;
  letter-spacing: 0 !important;
}

body.toolbox-page .subtitle,
body.toolbox-page .brand p,
body.toolbox-page .instruction-box li,
body.toolbox-page .footer-note {
  color: var(--tool-muted) !important;
}

body.toolbox-page .upload-section {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(232, 246, 255, 0.66)),
    var(--tool-panel-solid) !important;
  border-width: 1px !important;
}

body.toolbox-page .btn,
body.toolbox-page button.primary,
body.toolbox-page .open {
  border-radius: 999px !important;
}

body.toolbox-page .btn-info,
body.toolbox-page .btn-success,
body.toolbox-page .btn-warning,
body.toolbox-page button.primary {
  background: linear-gradient(135deg, #6ea6cf, #8b79bd) !important;
  border-color: transparent !important;
  color: #fff !important;
}

body.toolbox-page .btn-info:hover,
body.toolbox-page .btn-success:hover,
body.toolbox-page .btn-warning:hover,
body.toolbox-page button.primary:hover {
  background: linear-gradient(135deg, #5f96c0, #7b69ad) !important;
}

body.toolbox-page .edit-mode-bar,
body.toolbox-page .panel,
body.toolbox-page .section,
body.toolbox-page .metric,
body.toolbox-page .item,
body.toolbox-page .entry-item,
body.toolbox-page .stat-item,
body.toolbox-page .entry-manager,
body.toolbox-page .code-block,
body.toolbox-page .meta-chip {
  background: var(--tool-panel-solid) !important;
}

body.toolbox-page .section-title,
body.toolbox-page .panel-head,
body.toolbox-page .entry-header,
body.toolbox-page .entry-manager-header,
body.toolbox-page .entry-list-header {
  background: linear-gradient(90deg, rgba(232, 246, 255, 0.92), rgba(245, 237, 255, 0.92)) !important;
  border-color: rgba(137, 156, 205, 0.22) !important;
}

body.toolbox-page textarea,
body.toolbox-page input,
body.toolbox-page select,
body.toolbox-page pre {
  border-color: rgba(137, 156, 205, 0.24) !important;
  background-color: #fffdfc !important;
}

body.toolbox-page .app {
  min-height: calc(100vh - 74px);
}

body.toolbox-page .app aside {
  top: 74px;
  height: calc(100vh - 74px);
  background:
    linear-gradient(180deg, rgba(238, 243, 251, 0.96), rgba(245, 237, 255, 0.96)) !important;
}

body.toolbox-page .tab.active {
  border-color: var(--tool-lavender) !important;
  background: #fffdfc !important;
}

body.toolbox-page .badge,
body.toolbox-page .tag {
  border-color: rgba(137, 156, 205, 0.22) !important;
}

body.toolbox-page .preset-type {
  background: #e8f6ff !important;
  color: var(--tool-blue-dark) !important;
  border: 1px solid rgba(147, 197, 232, 0.48) !important;
}

body.toolbox-page .upload-icon,
body.toolbox-page header h1 i,
body.toolbox-page .entry-manager-title i,
body.toolbox-page .section-title h3 i {
  color: var(--tool-blue-dark) !important;
}

body.toolbox-page .toast {
  border-radius: 999px !important;
  box-shadow: 0 16px 30px rgba(81, 101, 142, 0.2) !important;
}

body.toolbox-page code {
  font-family: var(--tool-mono);
  color: var(--tool-lavender-dark);
}

@media (max-width: 920px) {
  .toolbox-nav-inner {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbox-links {
    justify-content: flex-start;
  }

  .toolbox-page-note {
    align-items: flex-start;
    flex-direction: column;
  }

  body.toolbox-page .app aside {
    top: 0;
    height: auto;
  }
}

@media (max-width: 560px) {
  .toolbox-brand {
    min-width: 0;
  }

  .toolbox-link {
    flex: 1 1 calc(50% - 8px);
  }
}
