:root {
  color-scheme: light;
  --canvas: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --ink: #26334d;
  --secondary: #65718a;
  --muted: #68758e;
  --line: #e6eaf2;
  --accent: #5266d8;
  --accent-hover: #4154c4;
  --accent-soft: #eff2ff;
  --success: #347569;
  --success-soft: #edf6f2;
  --error: #b2404e;
  --error-soft: #fff2f3;
  --radius: 16px;
  --font-body:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
summary {
  cursor: pointer;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}
button {
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button,
input,
textarea,
select {
  transition:
    border-color 0.16s,
    background-color 0.16s,
    box-shadow 0.16s;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
::selection {
  background: #dfe4ff;
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.shell {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
}
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.header-inner {
  height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font:
    700 28px/1 'Trebuchet MS',
    var(--font-body);
  letter-spacing: -1.5px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  color: var(--accent);
  stroke: none;
}
.brand-dot {
  color: var(--accent);
}
.brand-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin-inline: 9px 3px;
}
.brand-label {
  color: var(--secondary);
  font: 13px/1 var(--font-body);
  letter-spacing: 0.04em;
}
.help-link {
  min-height: 32px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--secondary);
  font-size: 12px;
}
.help-link svg {
  width: 17px;
  height: 17px;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 42px 0 29px;
}
h1 {
  font-size: 32px;
  line-height: 1.35;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.heading-dot {
  color: var(--accent);
  margin-left: 4px;
}
.page-heading p {
  color: var(--secondary);
  margin-top: 9px;
  font-size: 13px;
}
.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 3px;
  color: var(--secondary);
  font-size: 12px;
  white-space: nowrap;
}
.status-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 3px 12px #26334d03;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin-bottom: 21px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.step {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--secondary);
  font: 500 12px/1 var(--font-mono);
}
h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.section-note {
  font: 11px/1.5 var(--font-mono);
  color: var(--muted);
}
.source-card {
  display: flex;
  flex-direction: column;
}
.source-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface-soft);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 22px;
}
.source-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
  color: var(--secondary);
}
.source-tabs button[aria-selected='true'] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--accent);
  box-shadow: 0 2px 4px #26334d06;
  font-weight: 600;
}
.source-tabs svg {
  width: 17px;
  height: 17px;
}
.source-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 550;
}
.field-optional {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
textarea,
input[type='text'],
select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid #dfe4ee;
  border-radius: 8px;
  outline: none;
  font-size: 12px;
  line-height: 1.65;
}
textarea {
  display: block;
  resize: vertical;
}
textarea::placeholder,
input::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea:hover,
input[type='text']:hover,
select:hover {
  border-color: #b9c3d8;
}
textarea:focus,
input[type='text']:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
[aria-invalid='true'] {
  border-color: var(--error) !important;
}
.mono,
.source-editor,
.rename-editor {
  font-family: var(--font-mono);
}
textarea.source-editor {
  flex: 1;
  min-height: 256px;
  background: var(--surface-soft);
  line-height: 2;
  font-size: 12px;
  padding: 16px;
}
.field-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin-top: 7px;
}
.source-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: 22px;
}
.secondary-actions {
  display: flex;
  gap: 17px;
  align-items: center;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 5px 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.5;
}
.text-button:hover {
  color: var(--accent-hover);
}
.text-button--muted {
  color: var(--secondary);
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 17px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.button svg {
  width: 17px;
  height: 17px;
}
.button--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 3px 6px #5266d817;
}
.button--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.button--secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--secondary);
}
.button--secondary:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: #c6cff6;
  color: var(--accent);
}
.button--compact {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 11px;
  gap: 6px;
}
.format-fieldset {
  margin: 0 0 17px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.format-fieldset legend {
  width: 100%;
  padding: 0;
}
.format-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.format-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.format-option:has(input:checked) {
  border-color: #b1bdf2;
  background: var(--accent-soft);
}
.format-option:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.format-option > input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.format-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.format-copy strong {
  font-size: 12px;
  font-weight: 600;
}
.format-copy small {
  font-size: 10px;
  color: var(--secondary);
}
.radio-indicator {
  width: 13px;
  height: 13px;
  border: 1px solid #c7cfdd;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
input:checked ~ .radio-indicator {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent-soft);
}
.format-option:has(input:checked) strong {
  color: var(--accent);
}
.field {
  display: block;
  margin-top: 14px;
  min-width: 0;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rename-editor {
  min-height: 67px;
}
.core-field {
  margin-bottom: 14px;
}
.option-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.checkbox-label {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--secondary);
  font-size: 11px;
  cursor: pointer;
}
.checkbox-label input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin: 0;
}
.result-card {
  margin-top: 22px;
  padding-bottom: 20px;
}
.result-heading {
  margin-bottom: 0;
}
.result-badge {
  border-radius: 5px;
  background: var(--surface-soft);
  padding: 2px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
}
.result-badge[data-state='success'] {
  color: var(--success);
  background: var(--success-soft);
}
.result-badge[data-state='error'] {
  color: var(--error);
  background: var(--error-soft);
}
.empty-state {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 22px 0 12px;
}
.empty-state svg {
  width: 44px;
  height: 44px;
  color: #a1afcf;
  margin-bottom: 13px;
  stroke-width: 1.3;
}
.empty-state strong {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
}
.empty-state p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.notice {
  margin-top: 16px;
  padding: 11px 14px;
  color: var(--secondary);
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.notice--error {
  color: var(--error);
  background: var(--error-soft);
}
.subscription-output {
  margin-top: 22px;
}
.subscription-output input {
  color: var(--accent);
  background: var(--accent-soft);
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0 12px;
}
.result-summary {
  color: var(--secondary);
  font-size: 11px;
}
.view-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface-soft);
}
.view-switch button {
  padding: 4px 10px;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  color: var(--secondary);
  background: transparent;
}
.view-switch button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px #26334d12;
}
.node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.node-row {
  display: grid;
  grid-template-columns: 26px 90px minmax(0, 1fr) minmax(100px, 1fr);
  gap: 14px;
  padding: 12px 16px;
  align-items: center;
  font-size: 12px;
}
.node-row + .node-row {
  border-top: 1px solid var(--line);
}
.node-row:hover {
  background: var(--surface-soft);
}
.node-index {
  color: var(--muted);
  font: 10px/1.6 var(--font-mono);
}
.protocol-tag {
  justify-self: start;
  color: var(--accent);
  background: var(--accent-soft);
  font: 10px/1.6 var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-name {
  font-weight: 550;
  overflow-wrap: anywhere;
}
.node-address {
  justify-self: end;
  max-width: 100%;
  color: var(--muted);
  font: 11px/1.6 var(--font-mono);
  overflow-wrap: anywhere;
  text-align: right;
}
.node-detail {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 14px;
  border-radius: 9px;
  margin-bottom: 9px;
}
.node-detail h3 {
  font-size: 12px;
  font-weight: 550;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.node-detail pre {
  margin: 0;
  font: 11px/1.7 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--secondary);
}
.raw-output {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}
.raw-output summary {
  font-size: 11px;
  color: var(--secondary);
}
.raw-output summary span {
  float: right;
  color: var(--muted);
  font: 10px/1.8 var(--font-mono);
}
.raw-output textarea {
  margin-top: 12px;
  background: var(--surface-soft);
}
.help-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 22px;
  color: var(--secondary);
  scroll-margin-top: 20px;
}
.help-panel > summary {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  padding: 14px 20px;
  font-size: 12px;
}
.help-panel > summary::-webkit-details-marker {
  display: none;
}
.help-summary-note {
  font-size: 11px;
  color: var(--muted);
}
.disclosure-icon {
  margin-left: auto;
  font-size: 19px;
  line-height: 1;
}
.help-panel[open] .disclosure-icon {
  transform: rotate(45deg);
}
.help-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  border-top: 1px solid var(--line);
  padding: 22px;
  background: var(--surface);
  border-radius: 0 0 10px 10px;
}
.help-content h3 {
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--ink);
}
.help-content p {
  font-size: 11px;
  line-height: 1.9;
}
code {
  font-family: var(--font-mono);
  color: var(--accent);
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 25px 32px;
  color: var(--muted);
  font-size: 10px;
}
.site-footer b {
  color: var(--secondary);
  font:
    600 13px/1 'Trebuchet MS',
    var(--font-body);
  margin-right: 9px;
}
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  max-width: calc(100% - 32px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  padding: 11px 20px;
  box-shadow: 0 5px 20px #26334d20;
  font-size: 12px;
}
@media (min-width: 761px) {
  .workspace {
    animation: appear 0.35s ease both;
  }
  .result-card {
    animation: appear 0.35s 0.05s ease both;
  }
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 980px) {
  .shell {
    width: calc(100% - 48px);
  }
  .workspace {
    gap: 16px;
  }
  .card {
    padding: 20px;
  }
  .format-options {
    gap: 7px;
  }
  .format-option {
    padding: 10px;
  }
  .format-copy small {
    font-size: 9px;
  }
  .brand-divider {
    margin-left: 4px;
  }
}
@media (max-width: 760px) {
  .shell {
    width: calc(100% - 32px);
  }
  .header-inner {
    height: 66px;
  }
  .brand {
    font-size: 26px;
    gap: 9px;
  }
  .brand-label {
    font-size: 11px;
  }
  .page-heading {
    padding: 28px 0 23px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  h1 {
    font-size: 28px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .privacy-note {
    font-size: 11px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .section-heading {
    margin-bottom: 18px;
  }
  .source-tabs {
    margin-bottom: 18px;
  }
  textarea.source-editor {
    min-height: 205px;
  }
  .result-heading {
    margin-bottom: 0;
  }
  .result-card {
    margin-top: 16px;
  }
  textarea,
  textarea.source-editor,
  input[type='text'],
  select {
    font-size: 16px;
  }
  .format-copy small {
    font-size: 10px;
  }
  .node-row {
    grid-template-columns: 20px 76px minmax(0, 1fr);
    gap: 9px;
    padding: 12px;
  }
  .node-address {
    display: none;
  }
  .help-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .help-panel {
    margin-top: 16px;
  }
  .site-footer {
    padding-bottom: 24px;
  }
}
@media (max-width: 380px) {
  .shell {
    width: calc(100% - 24px);
  }
  .card {
    padding: 16px;
  }
  .brand-divider,
  .brand-label {
    display: none;
  }
  .format-copy small {
    font-size: 9px;
  }
  .secondary-actions {
    gap: 12px;
  }
  .button {
    padding-inline: 12px;
  }
  .help-summary-note {
    display: none;
  }
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .result-heading .section-title {
    gap: 7px;
  }
  .result-heading h2 {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
