:root {
  --bg: #061018;
  --panel: rgba(12, 24, 36, 0.72);
  --panel-strong: rgba(16, 31, 45, 0.9);
  --line: rgba(231, 241, 248, 0.11);
  --text: #edf6fb;
  --muted: rgba(237, 246, 251, 0.64);
  --dim: rgba(237, 246, 251, 0.42);
  --accent: #38d4c3;
  --accent-warm: #ff9b5f;
  --danger: #ff6b6b;
  --ok: #7be4a1;
  --shadow: rgba(0, 0, 0, 0.34);
  --radius: 10px;
  --font: "Sora", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.tool-shell {
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 155, 95, 0.16), transparent 28rem),
    radial-gradient(circle at 86% 22%, rgba(56, 212, 195, 0.15), transparent 34rem),
    linear-gradient(180deg, #061018, #091622 48%, #050b11);
}

body.tool-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 28%, #000, transparent 74%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.tool-nav,
.tool-main,
.tool-footer {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 40px), 1380px);
  margin-inline: auto;
}

.tool-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

.tool-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.tool-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-warm), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 16px 40px rgba(56, 212, 195, 0.18);
}

.tool-brand strong {
  display: block;
  letter-spacing: 0;
}

.tool-brand span:last-child {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.tool-links {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-weight: 700;
}

.tool-links a {
  transition: color 0.22s ease, transform 0.22s ease;
}

.tool-links a:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.tool-hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  padding: 54px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.62fr);
  gap: 54px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
    rgba(8, 18, 28, 0.76);
  box-shadow: 0 34px 100px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tool-hero::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  pointer-events: none;
}

.tool-kicker,
.tool-card-number,
.stat-label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tool-hero h1 {
  margin: 16px 0 18px;
  max-width: 10ch;
  font-size: 5.4rem;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.tool-hero p {
  max-width: 66ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.85;
}

.tool-hero.compact {
  min-height: 280px;
  align-items: center;
}

.tool-hero.compact h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 8vw, 6.4rem);
}

.tool-hero-panel {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 18, 28, 0.66);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.tool-hero-panel strong {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  line-height: 1.15;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 22px;
  margin-top: 22px;
}

.tool-grid.wide {
  grid-template-columns: minmax(0, 1fr);
}

.tool-panel,
.tool-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.tool-panel {
  padding: 24px;
}

.tool-panel h2,
.tool-panel h3,
.tool-card h3 {
  margin: 0 0 16px;
  letter-spacing: 0;
}

.tool-library {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  grid-auto-rows: minmax(220px, auto);
  gap: 18px;
  margin-top: 22px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 26px;
  display: grid;
  align-content: space-between;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease, background 0.28s ease;
}

.tool-card.featured {
  grid-row: span 2;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 212, 195, 0.34);
  background:
    linear-gradient(180deg, rgba(56, 212, 195, 0.08), rgba(255, 255, 255, 0.018)),
    var(--panel);
}

.tool-card p {
  color: var(--muted);
  line-height: 1.75;
}

.tool-card-action {
  color: var(--text);
  font-weight: 800;
}

.flagship-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.flagship-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 460px;
  padding: 34px;
  border: 1px solid rgba(237, 246, 251, 0.1);
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 216, 112, 0.18), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(56, 212, 195, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(17, 29, 47, 0.94), rgba(5, 13, 23, 0.96));
  box-shadow: 0 28px 78px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.flagship-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 35%, rgba(255, 255, 255, 0.08) 48%, transparent 62%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 72px);
  opacity: 0.45;
  transform: translateX(-18%);
  transition: transform 0.55s ease, opacity 0.28s ease;
}

.flagship-card:hover {
  transform: translateY(-7px);
  border-color: rgba(56, 212, 195, 0.36);
  box-shadow: 0 38px 95px rgba(0, 0, 0, 0.44), 0 0 42px rgba(56, 212, 195, 0.1);
}

.flagship-card:hover::before {
  opacity: 0.72;
  transform: translateX(0);
}

.flagship-card-large {
  min-height: 640px;
}

.flagship-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}

.flagship-kicker {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.flagship-card h2,
.flagship-card h3 {
  max-width: 760px;
  margin: 18px 0;
  color: var(--text);
  font-size: clamp(2.2rem, 6vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.flagship-card:not(.flagship-card-large) h2,
.flagship-card:not(.flagship-card-large) h3 {
  font-size: clamp(1.9rem, 3vw, 3.35rem);
}

.flagship-card p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.flagship-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.flagship-meta span {
  padding: 8px 12px;
  border: 1px solid rgba(237, 246, 251, 0.1);
  border-radius: 999px;
  color: rgba(237, 246, 251, 0.78);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.88rem;
  font-weight: 800;
}

.flagship-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid rgba(56, 212, 195, 0.34);
  border-radius: 999px;
  color: var(--text);
  background: rgba(56, 212, 195, 0.11);
  font-weight: 900;
}

.flagship-link:hover {
  background: rgba(56, 212, 195, 0.18);
}

.support-tool-strip {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 18px;
  align-items: stretch;
}

.support-copy {
  padding: 28px;
  border: 1px solid rgba(237, 246, 251, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.support-copy h2,
.support-copy h3 {
  margin: 0 0 12px;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.support-copy p {
  color: var(--muted);
  line-height: 1.75;
}

.support-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.support-link-card {
  padding: 20px;
  border: 1px solid rgba(237, 246, 251, 0.08);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.support-link-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 216, 112, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.support-link-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.support-link-card span {
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span,
.field label {
  color: rgba(237, 246, 251, 0.78);
  font-size: 0.92rem;
  font-weight: 700;
}

.field small {
  color: var(--dim);
  line-height: 1.6;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.control,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(237, 246, 251, 0.09);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.control:focus {
  border-color: rgba(56, 212, 195, 0.72);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(56, 212, 195, 0.12);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.tool-btn {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(237, 246, 251, 0.12);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tool-btn.primary {
  color: #061018;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-warm), #ffd36d);
}

.tool-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 212, 195, 0.34);
}

.tool-btn:active {
  transform: translateY(1px) scale(0.985);
}

.output-box,
.preview-box,
.table-wrap {
  min-height: 220px;
  padding: 18px;
  overflow: auto;
  border: 1px dashed rgba(237, 246, 251, 0.12);
  border-radius: 8px;
  color: rgba(237, 246, 251, 0.82);
  background: rgba(0, 0, 0, 0.18);
  line-height: 1.75;
  white-space: pre-wrap;
}

.preview-box {
  white-space: normal;
}

.output-box.small {
  min-height: 92px;
}

.output-box.as-textarea {
  width: 100%;
  display: block;
  resize: vertical;
  font: inherit;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(237, 246, 251, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.chip.active {
  color: #061018;
  border-color: transparent;
  background: var(--accent);
}

.diff-added {
  color: var(--ok);
  background: rgba(123, 228, 161, 0.12);
}

.diff-removed {
  color: var(--danger);
  background: rgba(255, 107, 107, 0.12);
  text-decoration: line-through;
}

.palette-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.swatch {
  min-height: 136px;
  padding: 12px;
  display: flex;
  align-items: end;
  border-radius: 8px;
  color: #061018;
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.image-preview canvas,
.poster-canvas,
.qr-canvas {
  width: 100%;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.qr-canvas {
  max-width: 420px;
  aspect-ratio: 1;
  padding: 18px;
  background: #fff;
}

.tool-video {
  width: 100%;
  max-height: 360px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.tool-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.rename-list {
  display: grid;
  gap: 10px;
}

.rename-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(237, 246, 251, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.rename-item small {
  color: var(--dim);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(237, 246, 251, 0.08);
  text-align: left;
}

.table-wrap th {
  color: var(--accent);
  position: sticky;
  top: 0;
  background: #0b1722;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: 340px;
  padding: 12px 14px;
  border: 1px solid rgba(56, 212, 195, 0.22);
  border-radius: 8px;
  background: rgba(9, 20, 30, 0.92);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
}

.share-panel {
  margin-top: 22px;
}

.share-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  border-color: rgba(56, 212, 195, 0.2);
  background:
    radial-gradient(circle at 92% 0%, rgba(56, 212, 195, 0.14), transparent 22rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.02)),
    rgba(8, 18, 28, 0.8);
}

.share-box p {
  max-width: 62ch;
  margin: -6px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.share-url {
  grid-column: 1 / -1;
  min-height: 72px;
}

.share-url a {
  color: var(--accent);
  word-break: break-all;
}

.tool-footer {
  padding: 44px 0 28px;
  color: var(--dim);
}

@media (max-width: 980px) {
  .tool-hero,
  .tool-grid,
  .tool-library,
  .flagship-grid,
  .support-tool-strip {
    grid-template-columns: 1fr;
  }

  .tool-card.featured {
    grid-row: auto;
  }

  .flagship-card-large {
    min-height: 500px;
  }

  .tool-hero h1 {
    font-size: 4rem;
  }

  .share-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .tool-nav,
  .tool-main,
  .tool-footer {
    width: min(calc(100% - 22px), 1380px);
  }

  .tool-nav,
  .tool-links,
  .field-row,
  .stat-grid,
  .image-preview,
  .palette-row,
  .support-links {
    grid-template-columns: 1fr;
  }

  .tool-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-hero {
    min-height: auto;
    padding: 28px;
  }

  .tool-hero h1 {
    font-size: 3rem;
  }

  .flagship-card,
  .flagship-card-large {
    min-height: 360px;
    padding: 26px;
  }

  .flagship-card h3 {
    font-size: clamp(2.3rem, 16vw, 4.2rem);
  }

  .flagship-card h2 {
    font-size: clamp(2.3rem, 16vw, 4.2rem);
  }
}
