:root {
    color-scheme: light;
    --page: #f5f5f7;
    --page-warm: #fbfaf7;
    --ink: #111114;
    --ink-soft: #2a2a2d;
    --muted: #6e6e73;
    --faint: #9a9aa1;
    --line: rgba(17, 17, 20, 0.12);
    --line-strong: rgba(17, 17, 20, 0.2);
    --glass: rgba(255, 255, 255, 0.66);
    --glass-strong: rgba(255, 255, 255, 0.84);
    --accent: #0071e3;
    --accent-ink: #0057b8;
    --success: #16845f;
    --warning: #986b15;
    --danger: #c93a3a;
    --gold: #b6974f;
    --outer-radius: 30px;
    --inner-radius: 20px;
    --control-radius: 16px;
    --shadow: 0 30px 86px rgba(28, 31, 38, 0.13), 0 8px 24px rgba(28, 31, 38, 0.08);
    --shadow-hover: 0 22px 58px rgba(0, 113, 227, 0.18), 0 10px 24px rgba(28, 31, 38, 0.1);
    --font: "SF Pro Text", "SF Pro Display", "Inter", "Aptos", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
    --display-font: "SF Pro Display", "SF Pro Text", "Inter", "Aptos Display", "Segoe UI Variable Display", "PingFang SC", "Microsoft YaHei UI", sans-serif;
    --mono: "SF Mono", "Cascadia Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

*::selection {
    background: rgba(0, 113, 227, 0.16);
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--page);
}

body {
    min-height: 100svh;
    margin: 0;
    color: var(--ink);
    font-family: var(--font);
    letter-spacing: 0;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0%, rgba(244, 246, 250, 0.94) 38%, rgba(251, 250, 247, 0.98) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.026) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0, 0, 0, 0.022) 1px, transparent 1px);
    background-size: auto, 52px 52px, 52px 52px;
    overflow-x: hidden;
}

body::before,
body::after {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
}

body::before {
    background:
        linear-gradient(108deg, rgba(255, 255, 255, 0.76) 0 18%, rgba(255, 255, 255, 0) 42%),
        linear-gradient(248deg, rgba(182, 151, 79, 0.12), rgba(255, 255, 255, 0) 36%),
        linear-gradient(18deg, rgba(0, 113, 227, 0.08), rgba(255, 255, 255, 0) 34%);
    animation: atmosphere 18s ease-in-out infinite alternate;
}

body::after {
    opacity: 0.36;
    background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

h1,
h2,
h3,
p {
    margin: 0;
}

.shell {
    width: min(1040px, calc(100% - 64px));
    min-height: calc(100svh - 56px);
    display: flex;
    align-items: center;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 58px) 0 0;
}

.workspace {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    display: grid;
    gap: clamp(24px, 4vw, 42px);
    padding: clamp(26px, 4.4vw, 50px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--outer-radius);
    corner-shape: superellipse(0.72);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.56) 46%, rgba(250, 250, 252, 0.74)),
        linear-gradient(120deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.16));
    box-shadow: var(--shadow);
    backdrop-filter: blur(34px) saturate(1.26);
    -webkit-backdrop-filter: blur(34px) saturate(1.26);
    animation: panelIn 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.workspace::before {
    position: absolute;
    inset: 1px;
    z-index: -1;
    border-radius: calc(var(--outer-radius) - 1px);
    corner-shape: superellipse(0.72);
    background:
        linear-gradient(132deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 34%),
        linear-gradient(305deg, rgba(0, 113, 227, 0.08), rgba(255, 255, 255, 0) 38%),
        linear-gradient(22deg, rgba(182, 151, 79, 0.1), rgba(255, 255, 255, 0) 42%);
    content: "";
}

.workspace::after {
    position: absolute;
    top: -82px;
    right: -16px;
    z-index: -1;
    color: rgba(17, 17, 20, 0.035);
    content: "0";
    font-family: var(--display-font);
    font-size: clamp(210px, 30vw, 360px);
    font-weight: 760;
    line-height: 1;
    pointer-events: none;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.service-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.service-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border: 1px solid rgba(17, 17, 20, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.service-nav a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: var(--muted);
    padding: 0 13px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.service-nav a:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    box-shadow: 0 10px 24px rgba(28, 31, 38, 0.08);
}

.service-nav a[aria-current="page"] {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 12px 28px rgba(28, 31, 38, 0.14);
}

.mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(17, 17, 20, 0.14);
    border-radius: 13px;
    corner-shape: superellipse(0.72);
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.5)),
        linear-gradient(315deg, rgba(0, 113, 227, 0.1), rgba(182, 151, 79, 0.08));
    color: var(--accent-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 12px 26px rgba(28, 31, 38, 0.08);
    font-family: var(--display-font);
    font-size: 20px;
    font-weight: 760;
    line-height: 1;
}

.brand {
    color: var(--ink);
    font-size: 15px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: 0;
}

.mode {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 560;
    letter-spacing: 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 350px);
    gap: clamp(24px, 5.8vw, 66px);
    align-items: end;
    padding-bottom: clamp(24px, 4vw, 40px);
    border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-kicker {
    margin: 0 0 14px;
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    max-width: 650px;
    color: var(--ink);
    font-family: var(--display-font);
    font-size: clamp(50px, 7vw, 86px);
    font-weight: 760;
    line-height: 0.94;
    letter-spacing: 0;
}

.summary {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: clamp(15px, 1.65vw, 18px);
    font-weight: 460;
    line-height: 1.85;
}

.listener-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 156px;
    gap: 14px;
    align-items: end;
}

.field {
    position: relative;
    min-width: 0;
    display: grid;
    gap: 10px;
}

.field::before {
    position: absolute;
    inset: 27px -1px -1px;
    border-radius: calc(var(--control-radius) + 1px);
    corner-shape: superellipse(0.7);
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.86), rgba(0, 113, 227, 0.13), rgba(182, 151, 79, 0.08));
    content: "";
    opacity: 0;
    transition: opacity 220ms ease;
}

.field:focus-within::before {
    opacity: 1;
}

.field span {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 680;
}

.field input {
    position: relative;
    width: 100%;
    height: 58px;
    border: 1px solid rgba(17, 17, 20, 0.15);
    border-radius: var(--control-radius);
    corner-shape: superellipse(0.7);
    outline: none;
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    padding: 0 18px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.85), inset 0 -14px 34px rgba(28, 31, 38, 0.035);
    font-size: clamp(16px, 1.8vw, 20px);
    font-weight: 520;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.field input::placeholder {
    color: rgba(110, 110, 115, 0.7);
}

.field input:focus {
    border-color: rgba(0, 113, 227, 0.46);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.96), 0 0 0 5px rgba(0, 113, 227, 0.08);
}

.access-field {
    grid-column: 1 / 2;
}

.submit {
    position: relative;
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    min-width: 0;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 88, 184, 0.28);
    border-radius: var(--control-radius);
    corner-shape: superellipse(0.72);
    background:
        linear-gradient(180deg, rgba(45, 151, 255, 0.96), rgba(0, 113, 227, 1)),
        var(--accent);
    color: #fff;
    box-shadow: 0 18px 42px rgba(0, 113, 227, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.34);
    font-size: 15px;
    font-weight: 740;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, border-color 180ms ease;
}

.listener-form:has(.access-field[hidden]) .submit {
    grid-row: 1 / 2;
}

.submit::before {
    position: absolute;
    inset: 0;
    transform: translateX(-110%) skewX(-18deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
    content: "";
    transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.submit:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(0, 88, 184, 0.38);
    box-shadow: var(--shadow-hover);
    filter: saturate(1.08);
}

.submit:hover:not(:disabled)::before {
    transform: translateX(118%) skewX(-18deg);
}

.submit:active:not(:disabled) {
    transform: translateY(0) scale(0.992);
    box-shadow: 0 12px 30px rgba(0, 113, 227, 0.2);
}

.submit:disabled {
    cursor: progress;
    filter: grayscale(0.18) saturate(0.8);
    opacity: 0.86;
    box-shadow: 0 10px 26px rgba(28, 31, 38, 0.1);
}

.button-text,
.spinner {
    position: relative;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.36);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 760ms linear infinite;
}

.is-busy .spinner {
    display: inline-block;
}

.status-strip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 56px;
    color: var(--muted);
}

.pulse {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    margin-top: 8px;
    border-radius: 50%;
    background: var(--faint);
}

.status-strip[data-state="working"] .pulse {
    background: var(--accent);
    animation: pulse 1350ms ease-out infinite;
}

.status-strip[data-state="success"] .pulse {
    background: var(--success);
}

.status-strip[data-state="warn"] .pulse {
    background: var(--warning);
}

.status-strip[data-state="error"] .pulse {
    background: var(--danger);
}

.status-strip strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
    font-weight: 720;
}

.status-strip p {
    margin-top: 3px;
    font-size: 14px;
    line-height: 1.65;
}

.results {
    display: grid;
    gap: 20px;
    padding-top: clamp(4px, 1vw, 8px);
    animation: rise 240ms ease both;
}

.results-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding-top: clamp(24px, 4vw, 36px);
    border-top: 1px solid var(--line);
}

h2 {
    color: var(--ink);
    font-family: var(--display-font);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1;
    font-weight: 760;
}

.results-head p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.ghost {
    min-height: 42px;
    border: 1px solid rgba(0, 113, 227, 0.2);
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.08);
    color: var(--accent-ink);
    padding: 0 18px;
    font-size: 14px;
    font-weight: 760;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.ghost:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 113, 227, 0.3);
    background: rgba(0, 113, 227, 0.12);
    box-shadow: 0 12px 28px rgba(0, 113, 227, 0.1);
}

.ghost:disabled {
    cursor: progress;
    opacity: 0.56;
    transform: none;
    box-shadow: none;
}

.result-list {
    display: grid;
    overflow-wrap: anywhere;
    border-top: 1px solid var(--line);
}

.result-card,
.empty-result {
    position: relative;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
    animation: rise 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result-card::before {
    position: absolute;
    top: 26px;
    bottom: 26px;
    left: -18px;
    width: 3px;
    border-radius: 999px;
    background: var(--success);
    content: "";
}

.result-card.latest-code-card::before {
    width: 4px;
    background: var(--accent);
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.result-meta span {
    color: var(--ink);
    font-weight: 720;
}

.result-meta time {
    margin-left: auto;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid rgba(0, 113, 227, 0.2);
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.08);
    color: var(--accent-ink);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 760;
    line-height: 1;
}

.muted-tag {
    border-color: rgba(17, 17, 20, 0.12);
    background: rgba(17, 17, 20, 0.04);
    color: var(--muted);
}

h3 {
    max-width: 760px;
    color: var(--ink);
    font-family: var(--display-font);
    font-size: clamp(22px, 3.3vw, 34px);
    line-height: 1.18;
    font-weight: 720;
    overflow-wrap: anywhere;
}

.codes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 22px;
}

.code-token {
    position: relative;
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(0, 113, 227, 0.22);
    border-radius: var(--inner-radius);
    corner-shape: superellipse(0.72);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62)),
        rgba(0, 113, 227, 0.05);
    color: var(--accent-ink);
    padding: 6px 18px 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 12px 28px rgba(28, 31, 38, 0.07);
    font-family: var(--mono);
    font-size: clamp(30px, 4.8vw, 48px);
    font-weight: 720;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.code-token:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 113, 227, 0.38);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 34px rgba(0, 113, 227, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.code-token:active {
    transform: translateY(0) scale(0.994);
}

.code-token:focus-visible,
.ghost:focus-visible,
.submit:focus-visible,
.field input:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.18);
    outline-offset: 3px;
}

.code-value {
    transition: opacity 140ms ease, transform 140ms ease;
}

.copy-note {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--success);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 760;
    letter-spacing: 0;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.code-token.copied {
    border-color: rgba(22, 132, 95, 0.28);
    background: rgba(22, 132, 95, 0.06);
}

.code-token.copied .code-value {
    opacity: 0;
    transform: translateY(-4px);
}

.code-token.copied .copy-note {
    opacity: 1;
    transform: translateY(0);
}

.no-code {
    margin: 18px 0 22px;
    color: var(--warning);
    font-size: 14px;
    font-weight: 680;
}

dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
}

dl div {
    min-width: 0;
}

dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

dd {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.preview,
.empty-result p {
    max-width: 780px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

.empty-result strong {
    display: block;
    color: var(--ink);
    font-size: 22px;
    font-weight: 720;
}

footer {
    color: var(--faint);
    text-align: center;
    padding: 18px 0 24px;
    font-size: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.22);
    }
    72% {
        box-shadow: 0 0 0 10px rgba(0, 113, 227, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0);
    }
}

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

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes atmosphere {
    from {
        opacity: 0.86;
        transform: translate3d(0, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, -10px, 0);
    }
}

@media (max-width: 760px) {
    .shell {
        width: min(100% - 24px, 620px);
        min-height: auto;
        padding-top: 18px;
    }

    .workspace {
        padding: 24px 18px 26px;
        border-radius: 24px;
    }

    .brand-row {
        align-items: flex-start;
    }

    .service-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .service-nav {
        width: 100%;
        flex-wrap: wrap;
        border-radius: 20px;
    }

    .service-nav a {
        flex: 1 1 110px;
        justify-content: center;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 18px;
        padding-bottom: 30px;
    }

    h1 {
        font-size: clamp(42px, 14vw, 62px);
    }

    .summary {
        line-height: 1.72;
    }

    .listener-form {
        grid-template-columns: 1fr;
    }

    .access-field,
    .submit,
    .listener-form:has(.access-field[hidden]) .submit {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .submit {
        width: 100%;
    }

    .results-head,
    .result-meta {
        align-items: flex-start;
    }

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

    .result-actions {
        width: 100%;
        justify-content: stretch;
    }

    .result-actions .ghost {
        flex: 1 1 150px;
    }

    dl {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 460px) {
    .workspace {
        padding: 22px 16px 24px;
    }

    .mark {
        width: 38px;
        height: 38px;
    }

    .field input,
    .submit {
        height: 56px;
    }

    .code-token {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}
