:root {
    color-scheme: dark;
    --ink: #eef7f1;
    --muted: #91a89d;
    --panel: rgba(18, 34, 29, 0.88);
    --panel-soft: rgba(23, 42, 35, 0.72);
    --line: rgba(186, 223, 202, 0.14);
    --accent: #84f5a8;
    --accent-deep: #46c87a;
    --danger: #ff7b72;
    --page: #09110f;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--page); }

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        linear-gradient(rgba(132, 245, 168, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(132, 245, 168, 0.025) 1px, transparent 1px),
        radial-gradient(circle at 16% 10%, rgba(37, 104, 71, 0.24), transparent 34rem),
        var(--page);
    background-size: 48px 48px, 48px 48px, auto, auto;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.ambient {
    position: fixed;
    z-index: 0;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.ambient-one {
    top: 13%;
    right: -13rem;
    width: 34rem;
    height: 34rem;
    background: radial-gradient(circle, rgba(79, 211, 123, 0.12), transparent 67%);
}

.ambient-two {
    bottom: -17rem;
    left: -12rem;
    width: 38rem;
    height: 38rem;
    border: 1px solid rgba(132, 245, 168, 0.08);
    box-shadow: 0 0 100px rgba(132, 245, 168, 0.04) inset;
}

.page-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(132, 245, 168, 0.34);
    border-radius: 10px;
    background: rgba(132, 245, 168, 0.08);
}

.brand-mark svg { width: 24px; height: 24px; }
.brand-mark path { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }

.privacy-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(7, 19, 14, 0.5);
    font-size: 12px;
}

.privacy-pill span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.testnet-link {
    padding: 8px 12px;
    border: 1px solid rgba(132, 245, 168, 0.2);
    border-radius: 999px;
    color: #b9ddc6;
    background: rgba(132, 245, 168, 0.045);
    font-size: 11px;
    text-decoration: none;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.testnet-link:hover { border-color: rgba(132, 245, 168, 0.5); color: var(--accent); background: rgba(132, 245, 168, 0.08); }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
    gap: clamp(54px, 8vw, 110px);
    align-items: center;
    flex: 1;
    padding: 72px 0 58px;
}

.intro-copy { min-width: 0; }

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.24em;
}

.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); }

h1 {
    max-width: 650px;
    margin: 0;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-size: clamp(50px, 6.2vw, 82px);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.055em;
}

h1 em { color: var(--accent); font-weight: inherit; }

.lead {
    max-width: 580px;
    margin: 28px 0 36px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.85;
}

.address-form label {
    display: block;
    margin: 0 0 10px;
    color: #c7d8cf;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
}

.input-wrap {
    display: flex;
    align-items: center;
    min-height: 60px;
    padding: 6px 6px 6px 17px;
    border: 1px solid rgba(195, 226, 207, 0.2);
    border-radius: 14px;
    background: rgba(20, 37, 31, 0.76);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.18);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-wrap:focus-within {
    border-color: rgba(132, 245, 168, 0.62);
    box-shadow: 0 0 0 3px rgba(132, 245, 168, 0.08), 0 20px 55px rgba(0, 0, 0, 0.18);
}

.input-wrap.has-error { border-color: rgba(255, 123, 114, 0.58); }
.input-wrap.is-locked { padding-right: 17px; }
.input-wrap.is-locked input { cursor: text; }

.input-icon {
    display: grid;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    color: #09140e;
    background: var(--accent);
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 800;
}

.input-wrap input {
    min-width: 0;
    flex: 1;
    padding: 0 13px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.input-wrap button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    color: #07120c;
    background: var(--accent);
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.input-wrap button:hover { background: #a1f8ba; transform: translateY(-1px); }
.input-wrap button:active { transform: translateY(0); }

.field-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    min-height: 22px;
    padding: 7px 2px 0;
    color: #60766c;
    font-size: 11px;
}

.field-meta p { margin: 0; }
.field-meta .error-message { color: var(--danger); }

.trust-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.trust-row > div { display: flex; align-items: center; gap: 10px; }
.trust-icon { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); font-size: 12px; }
.trust-row p { display: grid; gap: 3px; margin: 0; }
.trust-row strong { color: #cfddd5; font-size: 11px; font-weight: 650; }
.trust-row small { color: #60766c; font-size: 10px; }

.qr-card {
    position: relative;
    width: 100%;
    max-width: 448px;
    justify-self: end;
    padding: 24px;
    overflow: hidden;
    border: 1px solid rgba(186, 223, 202, 0.16);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(26, 48, 40, 0.96), rgba(13, 26, 21, 0.96));
    box-shadow: 0 38px 90px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.qr-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 80% 8%, rgba(132, 245, 168, 0.08), transparent 31%);
}

.card-topline {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #789085;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    letter-spacing: 0.17em;
}

.network-badge { display: inline-flex; align-items: center; gap: 7px; }
.network-badge i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.qr-frame {
    position: relative;
    display: grid;
    width: min(100%, 308px);
    aspect-ratio: 1;
    margin: 0 auto;
    padding: 18px;
    place-items: center;
    border-radius: 18px;
    background: #f7fff9;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

#qr-code { display: grid; width: 100%; height: 100%; place-items: center; overflow: hidden; }
#qr-code canvas, #qr-code img { display: block; width: 100% !important; height: auto !important; image-rendering: pixelated; }

.qr-empty {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 2px solid #d45252;
    border-radius: 50%;
    color: #d45252;
    font-size: 32px;
    font-weight: 800;
}

.corner { position: absolute; width: 17px; height: 17px; border-color: var(--accent-deep); border-style: solid; }
.corner-tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; border-radius: 5px 0 0; }
.corner-tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; border-radius: 0 5px 0 0; }
.corner-bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; border-radius: 0 0 0 5px; }
.corner-br { right: 8px; bottom: 8px; border-width: 0 2px 2px 0; border-radius: 0 0 5px; }

.address-preview {
    display: grid;
    gap: 8px;
    margin: 20px 0 16px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(6, 17, 13, 0.34);
}

.address-preview span { color: #6f887c; font-size: 10px; }
.address-preview code { overflow: hidden; color: #dbe9e0; font-size: 11px; letter-spacing: 0.015em; text-overflow: ellipsis; white-space: nowrap; }

.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 45px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.38; }
.button-primary { color: #07120c; background: var(--accent); }
.button-primary:hover:not(:disabled) { background: #a1f8ba; }
.button-secondary { border-color: var(--line); color: #d6e5dc; background: rgba(255, 255, 255, 0.025); }
.button-secondary:hover:not(:disabled) { border-color: rgba(132, 245, 168, 0.4); background: rgba(132, 245, 168, 0.055); }
.button-icon { color: inherit; font-size: 14px; }

.status-message { min-height: 16px; margin: 9px 0 -5px; color: var(--accent); text-align: center; font-size: 10px; }

.safety-note {
    margin: 16px -24px -24px;
    padding: 13px 20px;
    border-top: 1px solid rgba(186, 223, 202, 0.09);
    color: #6f887c;
    background: rgba(5, 14, 11, 0.26);
    text-align: center;
    font-size: 10px;
}

.safety-note span { margin-right: 5px; color: var(--accent); }

footer {
    display: flex;
    justify-content: space-between;
    padding: 20px 0 27px;
    border-top: 1px solid var(--line);
    color: #4f655b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    letter-spacing: 0.12em;
}

footer p { margin: 0; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 54px; padding-top: 56px; }
    .intro-copy { text-align: center; }
    .eyebrow { justify-content: center; }
    .lead { margin-right: auto; margin-left: auto; }
    .address-form, .trust-row { max-width: 650px; margin-right: auto; margin-left: auto; text-align: left; }
    .qr-card { justify-self: center; }
}

@media (max-width: 600px) {
    .page-shell { width: min(100% - 28px, 520px); }
    .site-header { padding: 19px 0; }
    .privacy-pill { padding: 7px 9px; font-size: 10px; }
    .header-actions { gap: 6px; }
    .testnet-link { padding: 7px 9px; font-size: 10px; }
    .hero { gap: 42px; padding: 45px 0 42px; }
    h1 { font-size: clamp(43px, 13.6vw, 61px); }
    .lead { margin-top: 22px; font-size: 14px; }
    .input-wrap { display: grid; grid-template-columns: auto 1fr; padding: 8px; }
    .input-wrap input { min-height: 43px; padding-right: 4px; font-size: 11px; }
    .input-wrap button { grid-column: 1 / -1; width: 100%; margin-top: 4px; }
    .trust-row { gap: 10px; }
    .trust-row > div { gap: 6px; }
    .trust-icon { width: 23px; height: 23px; }
    .trust-row small { display: none; }
    .qr-card { padding: 18px; border-radius: 20px; }
    .safety-note { margin: 16px -18px -18px; }
    footer { display: grid; justify-content: center; gap: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
