:root {
  --bg: #06070a;
  --bg-soft: #0c1016;
  --panel: rgba(13, 17, 24, 0.9);
  --panel-strong: rgba(18, 23, 31, 0.96);
  --panel-highlight: rgba(25, 32, 43, 0.95);
  --text: #f5f7fb;
  --muted: #8d97a7;
  --line: rgba(164, 179, 202, 0.14);
  --line-strong: rgba(164, 179, 202, 0.28);
  --brand: #61dafb;
  --brand-strong: #88f1ff;
  --accent: #7c8cff;
  --danger: #ff7a7a;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --mono: "SFMono-Regular", "SF Mono", "Cascadia Mono", "JetBrains Mono", "Fira Code", "Menlo", "Consolas", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--text);
  font-size: 14px;
  background:
    radial-gradient(circle at top left, rgba(124, 140, 255, 0.18), transparent 28%),
    radial-gradient(circle at right 20%, rgba(97, 218, 251, 0.12), transparent 24%),
    radial-gradient(circle at bottom center, rgba(255, 255, 255, 0.04), transparent 22%),
    linear-gradient(180deg, #05060a 0%, var(--bg) 42%, var(--bg-soft) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 50%, transparent 100%);
}

.page-shell {
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 13, 19, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

.brand-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.eyebrow-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topnav a {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.topnav a:hover,
.topnav a.is-current {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 55%),
    linear-gradient(180deg, rgba(16, 20, 28, 0.92), rgba(8, 10, 14, 0.95));
  box-shadow: var(--shadow);
}

.hero-compact {
  margin-bottom: 10px;
}

.hero-side {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.metric-card {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 26, 35, 0.92), rgba(11, 14, 20, 0.96));
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.eyebrow,
.section-kicker,
.tool-badge,
.editor-label,
.metric-label,
.hash-chip {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.section-kicker {
  color: var(--brand);
  font-size: 0.74rem;
  margin: 0 0 10px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.66rem;
}

.hero h1,
.section-head h2,
.tool-card h3 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(1.1rem, 1.35vw, 1.7rem);
  line-height: 1.15;
  max-width: 14ch;
  letter-spacing: -0.01em;
}

.hero-text,
.section-summary,
.tool-card p,
.status-line {
  color: var(--muted);
}

.hero-text {
  margin: 10px 0 0;
  max-width: 62ch;
  font-size: 0.84rem;
  line-height: 1.6;
}

main {
  margin-top: 10px;
}

.home-layout,
.tool-layout {
  display: grid;
  gap: 10px;
}

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

.panel {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 1.02rem;
  line-height: 1.25;
}

.section-summary {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.tool-grid,
.editor-grid,
.result-grid {
  display: grid;
  gap: 12px;
}

.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.tool-card,
.editor-card,
.hash-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
}

.tool-card {
  display: block;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(97, 218, 251, 0.4);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.tool-badge {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.58rem;
  color: var(--brand);
}

.tool-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 600;
}

.tool-card h3 {
  font-size: 0.94rem;
  margin-bottom: 8px;
}

.tool-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
}

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

.editor-card {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-label {
  font-size: 0.6rem;
  color: var(--brand);
}

.tool-select {
  appearance: none;
  min-width: 168px;
  padding: 9px 34px 9px 12px;
  border: 1px solid rgba(124, 140, 255, 0.32);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(124, 140, 255, 0.18), rgba(124, 140, 255, 0.08));
  color: var(--text);
  font: 600 0.82rem/1 var(--sans);
  outline: none;
  background-image:
    linear-gradient(135deg, rgba(124, 140, 255, 0.18), rgba(124, 140, 255, 0.08)),
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size: auto, 6px 6px, 6px 6px;
  background-position: 0 0, calc(100% - 18px) calc(50% - 2px), calc(100% - 13px) calc(50% - 2px);
}

.tool-select:focus {
  border-color: rgba(97, 218, 251, 0.55);
  box-shadow: 0 0 0 4px rgba(97, 218, 251, 0.1);
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #090d13;
  color: var(--text);
  font: 0.88rem/1.65 var(--mono);
  outline: none;
}

textarea:focus {
  border-color: rgba(97, 218, 251, 0.55);
  box-shadow: 0 0 0 4px rgba(97, 218, 251, 0.1);
}

.json-output {
  min-height: 280px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #090d13;
  color: var(--text);
  font: 0.88rem/1.65 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.json-key {
  color: #7dd3fc;
}

.json-string {
  color: #86efac;
}

.json-number {
  color: #f9a8d4;
}

.json-boolean {
  color: #fcd34d;
}

.json-null {
  color: #c4b5fd;
}

.json-punctuation {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 12px;
}

.hash-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: start;
}

.url-workspace-stack {
  grid-template-columns: 1fr;
}

.hash-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.url-workspace-stack .hash-column-output {
  position: static;
}

.url-workspace-stack textarea {
  min-height: 76px;
}

.hash-column-output {
  position: sticky;
  top: 18px;
}

.hash-output-frame {
  position: relative;
  min-height: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  overflow: hidden;
}

.hash-output-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 10, 14, 0.76);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.hash-output-frame.is-covered .hash-output-overlay {
  display: flex;
}

.hash-output-overlay-card {
  width: min(320px, 100%);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 20, 27, 0.96);
  text-align: center;
}

.hash-output-overlay-card strong {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
}

.hash-output-overlay-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.hash-output-frame .result-grid {
  grid-template-columns: 1fr;
}

.result-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hash-card {
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(18, 23, 31, 0.98), rgba(12, 15, 21, 0.98));
}

.hash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.hash-chip {
  display: inline-flex;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  font-size: 0.62rem;
}

.hash-copy-btn {
  appearance: none;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: 600 0.72rem/1 var(--sans);
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.hash-copy-btn:hover,
.hash-copy-btn:focus-visible {
  color: var(--text);
  border-color: rgba(97, 218, 251, 0.35);
  background: rgba(97, 218, 251, 0.08);
}

.hash-value {
  font: 0.82rem/1.55 var(--mono);
  word-break: break-all;
  color: #d8e6ff;
}

.url-structure {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 23, 31, 0.98), rgba(12, 15, 21, 0.98));
}

.url-structure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.url-structure-summary {
  min-width: 0;
  color: var(--muted);
  font: 0.72rem/1.45 var(--mono);
  word-break: break-all;
}

.url-structure-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.url-structure-node,
.url-structure-token {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 14px;
}

.url-structure-node {
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(250, 204, 21, 0.26);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.22), rgba(250, 204, 21, 0.14));
  color: #fde68a;
  min-width: 0;
}

.url-structure-node.is-primary {
  border-color: rgba(250, 204, 21, 0.4);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.3), rgba(250, 204, 21, 0.18));
  color: #fef3c7;
}

.url-structure-label {
  font-size: 0.74rem;
  text-transform: lowercase;
  opacity: 0.92;
}

.url-structure-node strong {
  color: #fff7cc;
  font: 600 0.92rem/1.35 var(--mono);
  word-break: break-all;
}

.url-structure-token {
  justify-content: center;
  min-width: 28px;
  padding: 0 8px;
  border: 1px solid rgba(164, 179, 202, 0.16);
  background: linear-gradient(180deg, rgba(164, 179, 202, 0.09), rgba(164, 179, 202, 0.04));
  color: rgba(214, 223, 238, 0.72);
  font: 700 0.88rem/1 var(--mono);
}

.url-structure-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  font: 0.78rem/1.55 var(--mono);
}

.url-param-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(164, 179, 202, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.url-param-table {
  width: 100%;
  border-collapse: collapse;
  font: 0.78rem/1.5 var(--mono);
}

.url-param-table th,
.url-param-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(164, 179, 202, 0.08);
  vertical-align: top;
}

.url-param-table thead th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.url-param-table tbody tr:last-child td {
  border-bottom: 0;
}

.url-param-table td:first-child {
  width: 56px;
  color: var(--muted);
}

.url-param-key {
  color: #7dd3fc;
  word-break: break-all;
}

.url-param-value {
  color: #86efac;
  word-break: break-all;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  appearance: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 9px 14px;
  font: 600 0.88rem/1 var(--sans);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-1px);
}

.primary-btn {
  color: #041017;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  box-shadow: 0 12px 28px rgba(97, 218, 251, 0.24);
}

.secondary-btn {
  color: var(--text);
  border: 1px solid rgba(124, 140, 255, 0.32);
  background: linear-gradient(135deg, rgba(124, 140, 255, 0.18), rgba(124, 140, 255, 0.08));
}

.secondary-btn.is-active {
  color: #041017;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  box-shadow: 0 10px 22px rgba(97, 218, 251, 0.18);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.status-line {
  min-height: 24px;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.status-line.is-error {
  color: var(--danger);
}

@media (min-width: 1440px) {
  .topbar {
    padding: 10px 16px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
  }

  .hero h1 {
    max-width: 13ch;
  }

  .hero-text {
    font-size: 0.84rem;
  }

  .home-layout .panel,
  .tool-layout .panel {
    padding: 18px 20px;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .tool-card {
    min-height: 0;
  }

  .editor-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
  }

  textarea {
    min-height: 320px;
    padding: 12px;
    font-size: 0.88rem;
  }

  .result-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  .hash-output-frame .result-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .url-structure {
    padding: 16px;
  }

}

@media (min-width: 1800px) {
  .page-shell {
    width: min(1760px, calc(100% - 64px));
  }

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

  .tool-layout .panel {
    padding: 18px 20px;
  }

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

  textarea {
    min-height: 360px;
  }

  .result-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .hash-output-frame .result-grid {
    grid-template-columns: 1fr;
  }

}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .topbar,
  .hero {
    padding: 20px;
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 20px;
  }

  .topbar,
  .hero,
  .section-head {
    align-items: start;
  }

  .topbar,
  .hero {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .hash-workspace {
    grid-template-columns: 1fr;
  }

  .hash-column-output {
    position: static;
  }

  .hero-side {
    flex-direction: column;
  }

  textarea {
    min-height: 240px;
  }

  .section-head {
    flex-direction: column;
  }

  .url-structure-head {
    flex-direction: column;
    align-items: start;
  }

  .url-structure-group {
    gap: 8px;
  }

  .url-structure-token {
    min-width: 24px;
  }

}
