:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-subtle: #fbfbfd;
    --surface-muted: rgba(0, 0, 0, .045);
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --muted-light: #86868b;
    --line: rgba(0, 0, 0, .07);
    --line-strong: rgba(0, 0, 0, .11);
    --accent: #0071e3;
    --accent-dark: #0066cc;
    --accent-soft: rgba(0, 113, 227, .09);
    --radius-pill: 999px;
    --radius-sm: 12px;
    --radius-card: 18px;
    --radius-panel: 22px;
    --radius-hero: 26px;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
    --shadow-panel: 0 1px 3px rgba(0, 0, 0, .05), 0 14px 40px rgba(0, 0, 0, .05);
    --ease: cubic-bezier(.25, 1, .5, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-theme {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-subtle: #252527;
    --surface-muted: rgba(255, 255, 255, .07);
    --ink: #f5f5f7;
    --muted: #aeaeb2;
    --muted-light: #86868b;
    --line: rgba(255, 255, 255, .12);
    --line-strong: rgba(255, 255, 255, .18);
    --accent: #0a84ff;
    --accent-dark: #409cff;
    --accent-soft: rgba(10, 132, 255, .18);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .2);
    --shadow-panel: 0 1px 3px rgba(0, 0, 0, .34), 0 14px 40px rgba(0, 0, 0, .24);
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

button,
select,
input[type="checkbox"] {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(0, 113, 227, .26);
    outline-offset: 3px;
}

::selection {
    color: #ffffff;
    background: var(--accent);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid transparent;
    background: rgba(245, 245, 247, .72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}

body.dark-theme .site-header {
    background: rgba(0, 0, 0, .72);
}

.site-header.scrolled {
    border-color: var(--line);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1080px, calc(100% - 48px));
    min-height: 56px;
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-weight: 650;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    color: #ffffff;
    border-radius: 8px;
    background: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 113, 227, .25);
    font: 700 10px/1 "SFMono-Regular", Consolas, monospace;
}

.brand-copy {
    display: grid;
    gap: 0;
}

.brand-copy strong {
    font-size: 15px;
}

.brand-copy small {
    color: var(--muted-light);
    font-size: 10.5px;
    font-weight: 550;
    letter-spacing: .03em;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    min-width: 0;
}

.site-nav a {
    min-height: 36px;
    padding: 8px 9px;
    color: var(--muted);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    transition: color .2s var(--ease), background-color .2s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--accent-dark);
    background: var(--accent-soft);
    text-decoration: none;
}

.header-actions {
    display: flex;
    gap: 6px;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    transition: color .2s var(--ease), border-color .2s var(--ease), transform .1s ease-out;
}

body.dark-theme .icon-button {
    background: rgba(44, 44, 46, .82);
}

.icon-button:hover {
    color: var(--accent-dark);
    border-color: rgba(0, 113, 227, .32);
}

.icon-button:active,
.btn:active {
    transform: scale(.96);
}

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

.page-intro {
    display: grid;
    gap: 13px;
    max-width: 760px;
    padding: clamp(40px, 6vw, 66px) 0 clamp(23px, 3vw, 32px);
}

.eyebrow {
    color: var(--muted-light);
    font: 650 11px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .13em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--ink);
    letter-spacing: -.025em;
}

h1 {
    max-width: 760px;
    font-size: clamp(32px, 5vw, 46px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.035em;
}

h2 {
    font-size: clamp(22px, 3vw, 27px);
    font-weight: 700;
    line-height: 1.24;
}

h3 {
    font-size: 17px;
    font-weight: 650;
    line-height: 1.42;
}

.lead {
    max-width: 690px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.68;
}

.intent-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 5px;
}

.intent-links a,
.metric {
    min-height: 31px;
    padding: 6px 11px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .7);
    font-size: 12px;
    font-weight: 600;
    line-height: 17px;
    transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}

body.dark-theme .intent-links a,
body.dark-theme .metric {
    background: rgba(44, 44, 46, .7);
}

.intent-links a:hover {
    color: var(--accent-dark);
    border-color: rgba(0, 113, 227, .3);
    background: var(--accent-soft);
    text-decoration: none;
}

.tool-stage {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface);
    box-shadow: var(--shadow-panel);
}

.tool-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
}

.toolbar-group,
.toolbar-options,
.code-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-options,
.code-options {
    color: var(--muted);
    font-size: 12px;
}

.toolbar-options label,
.code-options label,
.option-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 650;
    line-height: 22px;
    transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease), transform .1s ease-out;
}

.btn-primary {
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 113, 227, .22);
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-secondary,
.btn-danger {
    color: var(--ink);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

body.dark-theme .btn-secondary,
body.dark-theme .btn-danger {
    background: rgba(44, 44, 46, .82);
}

.btn-secondary:hover,
.btn-danger:hover {
    color: var(--accent-dark);
    border-color: rgba(0, 113, 227, .32);
    background: var(--accent-soft);
}

.select-control,
.text-control {
    min-height: 40px;
    padding: 8px 12px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    outline: 0;
    background: var(--surface);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.select-control:focus,
.text-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, .16);
}

.text-control {
    min-width: 160px;
}

.status-line {
    min-height: 35px;
    padding: 8px 16px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 18px;
}

.status-line.success,
.status-line.warning {
    color: var(--accent-dark);
}

.status-line.error {
    color: var(--ink);
    background: var(--surface-muted);
}

.tool-grid,
.compare-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 580px;
}

.editor-pane,
.result-pane {
    min-width: 0;
}

.editor-pane,
.compare-grid .editor-pane:first-child {
    border-right: 1px solid var(--line);
}

.compare-grid .editor-pane:last-child {
    border-right: 0;
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 51px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
}

.pane-title {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.pane-meta {
    color: var(--muted-light);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.code-input,
.code-output {
    display: block;
    width: 100%;
    min-height: 529px;
    padding: 18px;
    color: var(--ink);
    border: 0;
    border-radius: 0;
    outline: 0;
    background: var(--surface);
    font: 13.5px/1.72 "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    tab-size: 2;
    white-space: pre;
    overflow: auto;
}

.code-input {
    resize: vertical;
}

.code-input::placeholder {
    color: var(--muted-light);
}

.code-input:focus {
    background: var(--surface-subtle);
    box-shadow: inset 3px 0 0 var(--accent);
}

.code-output {
    margin: 0;
}

.empty-output {
    display: grid;
    place-items: center;
    min-height: 529px;
    padding: 40px;
    color: var(--muted);
    background: var(--surface);
    text-align: center;
}

.tool-note {
    padding: 12px 16px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: var(--surface-subtle);
    font-size: 12px;
    line-height: 1.6;
}

.option-row,
.metric-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
    font-size: 12px;
}

.metric {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 5px 9px;
}

.metric strong {
    color: var(--ink);
}

.result-list {
    display: grid;
    align-content: start;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.result-list li {
    padding: 14px 18px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    font: 13px/1.58 "SFMono-Regular", Menlo, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.result-list li.added,
.result-list li.removed,
.result-list li.changed {
    background: var(--surface-subtle);
}

.jsonpath-result {
    padding: 0;
}

.jsonpath-match {
    display: grid;
    gap: 6px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.jsonpath-match code {
    color: var(--accent-dark);
    font: 12px "SFMono-Regular", Menlo, Consolas, monospace;
}

.jsonpath-match pre {
    padding: 0;
    margin: 0;
    color: var(--ink);
    font: 13px/1.58 "SFMono-Regular", Menlo, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 720px) minmax(230px, 1fr);
    align-items: start;
    justify-content: space-between;
    gap: clamp(32px, 6vw, 72px);
    padding: clamp(52px, 7vw, 80px) 0 84px;
}

.tool-directory {
    display: grid;
    gap: 18px;
    padding: 0 0 clamp(56px, 8vw, 92px);
}

.tool-directory-heading {
    display: grid;
    gap: 10px;
    max-width: 720px;
}

.tool-directory-heading p {
    max-width: 64ch;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.78;
}

.prose,
.quick-panel {
    min-width: 0;
}

.prose {
    display: grid;
    gap: 46px;
}

.prose section {
    display: grid;
    gap: 15px;
}

.prose p {
    max-width: 68ch;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.88;
}

.prose ol,
.prose ul {
    display: grid;
    gap: 11px;
    max-width: 66ch;
    padding-left: 23px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.78;
}

.prose li::marker {
    color: var(--accent);
    font-weight: 700;
}

.prose code {
    padding: .12em .34em;
    color: var(--ink);
    border-radius: 5px;
    background: var(--surface-muted);
    font: .88em "SFMono-Regular", Menlo, Consolas, monospace;
}

.rule-table-wrap,
.example-grid,
.related-grid,
.quick-links {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.rule-table-wrap {
    overflow-x: auto;
}

.rule-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 14px;
}

.rule-table th,
.rule-table td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.rule-table th {
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.rule-table tr:last-child td {
    border-bottom: 0;
}

.rule-table td {
    color: var(--muted);
    line-height: 1.65;
}

.rule-table code {
    padding: 0;
    background: transparent;
    font: 12px/1.45 "SFMono-Regular", Menlo, Consolas, monospace;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.example-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 18px;
    background: var(--surface);
}

.example-card:nth-child(even) {
    border-left: 1px solid var(--line);
}

.example-card:nth-child(n + 3) {
    border-top: 1px solid var(--line);
}

.example-card h3 {
    font-size: 16px;
}

.example-card p,
.example-card pre {
    max-width: none;
    margin: 0;
}

.example-card pre {
    overflow: auto;
    padding: 12px;
    color: var(--ink);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
    font: 12px/1.65 "SFMono-Regular", Menlo, Consolas, monospace;
    white-space: pre-wrap;
}

.content-warning,
.inline-callout {
    padding: 18px 20px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    font-size: 14px;
    line-height: 1.7;
}

.inline-callout strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ink);
}

.faq-list {
    display: grid;
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--line);
}

.faq-item {
    padding: 19px 0;
    border-bottom: 1px solid var(--line);
}

.faq-item dt {
    margin-bottom: 7px;
    color: var(--ink);
    font-weight: 650;
}

.faq-item dd {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.76;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-grid a {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 16px;
    color: var(--ink);
    background: var(--surface);
    font-size: 14px;
    font-weight: 650;
    transition: color .2s var(--ease), background-color .2s var(--ease);
}

.related-grid a:not(:nth-child(3n + 1)) {
    border-left: 1px solid var(--line);
}

.related-grid a:nth-child(n + 4) {
    border-top: 1px solid var(--line);
}

.related-grid a:hover {
    color: var(--accent-dark);
    background: var(--accent-soft);
    text-decoration: none;
}

.related-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
}

.quick-panel {
    position: sticky;
    top: 78px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.quick-panel h2 {
    font-size: 20px;
}

.quick-panel p {
    margin: 8px 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.quick-links {
    display: grid;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.quick-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 11px 13px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    transition: color .2s var(--ease), background-color .2s var(--ease);
}

.quick-links a + a {
    border-top: 1px solid var(--line);
}

.quick-links a::after {
    content: "›";
    color: var(--muted-light);
    font-size: 19px;
    font-weight: 400;
}

.quick-links a:hover {
    color: var(--accent-dark);
    background: var(--accent-soft);
    text-decoration: none;
}

.footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    width: min(1080px, calc(100% - 48px));
    padding: 27px 0;
    margin: 0 auto;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.footer-inner p {
    max-width: 58ch;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-content: start;
    justify-content: flex-end;
}

.footer-links a {
    color: var(--muted);
    white-space: nowrap;
}

.footer-links a:hover {
    color: var(--accent-dark);
}

@media (max-width: 980px) {
    .header-inner {
        align-items: center;
        flex-wrap: wrap;
        padding: 10px 0;
    }

    .site-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .site-nav::-webkit-scrollbar {
        display: none;
    }

    .site-nav a {
        flex: 0 0 auto;
    }

    .content-layout {
        grid-template-columns: minmax(0, 1fr) 248px;
        gap: 32px;
    }
}

@media (max-width: 760px) {
    .page-shell,
    .header-inner,
    .footer-inner {
        width: min(100% - 28px, 680px);
    }

    .page-intro {
        padding-top: 38px;
    }

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

    .toolbar-group,
    .toolbar-options {
        width: 100%;
    }

    .tool-grid,
    .compare-grid,
    .content-layout {
        grid-template-columns: 1fr;
    }

    .tool-grid,
    .compare-grid {
        min-height: 0;
    }

    .editor-pane,
    .compare-grid .editor-pane:first-child {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .code-input,
    .code-output,
    .empty-output {
        min-height: 365px;
    }

    .content-layout {
        gap: 38px;
        padding: 54px 0 64px;
    }

    .prose {
        gap: 38px;
    }

    .quick-panel {
        position: static;
    }

    .related-grid,
    .example-grid {
        grid-template-columns: 1fr;
    }

    .related-grid a,
    .related-grid a:not(:nth-child(3n + 1)),
    .example-card,
    .example-card:nth-child(even) {
        border-left: 0;
    }

    .related-grid a + a,
    .example-card + .example-card {
        border-top: 1px solid var(--line);
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
    }

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

@media (max-width: 520px) {
    .page-shell,
    .header-inner,
    .footer-inner {
        width: min(100% - 20px, 680px);
    }

    .header-inner {
        gap: 9px;
    }

    .brand-mark {
        width: 27px;
        height: 27px;
    }

    .brand-copy small {
        display: none;
    }

    .page-intro {
        padding: 31px 0 22px;
    }

    h1 {
        font-size: 33px;
    }

    .lead {
        font-size: 15px;
    }

    .tool-stage {
        border-radius: var(--radius-card);
    }

    .tool-toolbar,
    .pane-header,
    .status-line,
    .tool-note,
    .option-row,
    .metric-strip {
        padding-right: 13px;
        padding-left: 13px;
    }

    .code-input,
    .code-output,
    .empty-output {
        padding-right: 13px;
        padding-left: 13px;
    }

    .prose p {
        font-size: 16px;
        line-height: 1.84;
    }

    .prose ol,
    .prose ul {
        font-size: 15px;
    }

    .quick-panel {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
