:root {
    color-scheme: dark;
    --bg: #080b10;
    --panel: rgba(18, 23, 31, 0.84);
    --panel-strong: #141a23;
    --line: rgba(255,255,255,0.09);
    --text: #f2f5f8;
    --muted: #95a0af;
    --accent: #79f2bf;
    --accent-strong: #36d99a;
    --danger: #ff7e8a;
    --shadow: 0 24px 80px rgba(0,0,0,0.35);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(54,217,154,0.13), transparent 28rem),
        radial-gradient(circle at 92% 15%, rgba(80,126,255,0.10), transparent 25rem),
        var(--bg);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.background-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding: 12px max(24px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid var(--line);
    background: rgba(8,11,16,.72);
    backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #07120d;
    font-weight: 900;
    background: linear-gradient(135deg, #a3ffd8, #45d99d);
    box-shadow: 0 0 28px rgba(69,217,157,.22);
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #cbd4df;
    font-size: 13px;
    background: rgba(255,255,255,.03);
}
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.header-actions { display: flex; align-items: center; gap: 9px; }
.relay-entry {
    padding: 8px 12px;
    border: 1px solid rgba(121,242,191,.2);
    border-radius: 999px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    background: rgba(121,242,191,.05);
}
.relay-entry:hover { border-color: rgba(121,242,191,.42); background: rgba(121,242,191,.09); }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0 40px; }
.hero { max-width: 820px; margin-bottom: 38px; }
.eyebrow, .card-kicker { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.hero h1 { margin: 0; font-size: clamp(34px, 5.5vw, 66px); line-height: 1.06; letter-spacing: -.045em; }
.hero > p:last-child { max-width: 680px; margin: 20px 0 0; color: var(--muted); font-size: 17px; line-height: 1.7; }

.module-tabs { display: inline-flex; gap: 6px; margin-bottom: 24px; padding: 6px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.03); }
.tab-button { min-width: 140px; padding: 11px 18px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; transition: .2s ease; }
.tab-button:hover { color: var(--text); }
.tab-button.active { color: #07120d; font-weight: 800; background: var(--accent); box-shadow: 0 7px 24px rgba(54,217,154,.18); }
.module-panel { display: none; }
.module-panel.active { display: block; animation: panel-in .24s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.public-layout { grid-template-columns: minmax(300px, .82fr) minmax(420px, 1.18fr); }
.card {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 26px;
    background: linear-gradient(145deg, rgba(24,30,40,.92), rgba(14,18,25,.88));
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.card-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.icon-box { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--accent); background: rgba(121,242,191,.05); }

form { display: grid; gap: 12px; }
label { color: #cbd4df; font-size: 13px; font-weight: 700; }
input, textarea, select {
    width: 100%;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: rgba(5,8,12,.62);
    transition: border-color .18s ease, box-shadow .18s ease;
}
input, select { min-height: 46px; padding: 0 13px; }
textarea { min-height: 160px; padding: 13px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: rgba(121,242,191,.65); box-shadow: 0 0 0 3px rgba(121,242,191,.09); }
input::placeholder, textarea::placeholder { color: #606b79; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label-row span { color: #717d8c; font-size: 12px; }
.field-note { margin: -3px 0 5px; color: #727e8d; font-size: 12px; line-height: 1.5; }
.primary-button {
    min-height: 48px;
    margin-top: 5px;
    border: 0;
    border-radius: 12px;
    color: #07120d;
    font-weight: 900;
    background: linear-gradient(135deg, #9dffd5, #48d99f);
    box-shadow: 0 10px 30px rgba(54,217,154,.17);
}
.primary-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.ghost-button, .inline-button, .toggle-password, .copy-button {
    border: 1px solid var(--line);
    border-radius: 10px;
    color: #cbd4df;
    background: rgba(255,255,255,.035);
}
.ghost-button { padding: 8px 12px; }
.inline-button { min-width: 94px; padding: 0 12px; }
.input-action-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.toggle-password { position: absolute; right: 7px; top: 7px; height: 32px; padding: 0 9px; font-size: 12px; }

.message-list { display: grid; gap: 12px; max-height: 600px; overflow: auto; padding-right: 3px; }
.message-item { padding: 16px; border: 1px solid rgba(255,255,255,.075); border-radius: 14px; background: rgba(0,0,0,.16); }
.message-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.message-meta strong { font-size: 14px; }
.message-meta time { color: #697584; font-size: 12px; white-space: nowrap; }
.message-content { margin: 0; color: #dbe2e9; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.empty-state { padding: 48px 16px; border: 1px dashed var(--line); border-radius: 14px; color: #6e7987; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.page-numbers { display: flex; gap: 6px; }
.page-control, .page-number { min-width: 38px; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: #cbd4df; background: rgba(255,255,255,.035); }
.page-number.active { color: #07120d; border-color: var(--accent); background: var(--accent); }
.page-control:disabled, .page-number:disabled { opacity: .4; cursor: not-allowed; }
.page-info { color: var(--muted); font-size: 12px; }

.security-banner { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid rgba(121,242,191,.18); border-radius: 16px; background: rgba(121,242,191,.055); }
.security-banner .shield { color: var(--accent); }
.security-banner strong { display: block; margin-bottom: 3px; }
.security-banner p { margin: 0; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 12px; align-items: end; }
.form-grid > div { display: grid; gap: 12px; }
.check-card { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); cursor: pointer; }
.check-card input { width: 18px; min-height: 18px; accent-color: var(--accent-strong); }
.check-card strong, .check-card small { display: block; }
.check-card small { margin-top: 3px; color: #778392; font-weight: 400; }
.result-box { margin-top: 18px; padding: 16px; border: 1px solid rgba(121,242,191,.17); border-radius: 14px; background: rgba(121,242,191,.045); }
.result-box.error { border-color: rgba(255,126,138,.25); background: rgba(255,126,138,.055); }
.result-box h3 { margin: 0 0 10px; font-size: 16px; }
.result-box p { margin: 7px 0; color: #c4ced8; line-height: 1.6; }
.result-box pre { max-height: 370px; margin: 12px 0 0; padding: 15px; overflow: auto; border-radius: 11px; color: #f2f5f8; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.65; background: rgba(0,0,0,.24); }
.receipt-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; padding: 12px; border-radius: 10px; background: rgba(0,0,0,.22); }
.receipt-code code { color: var(--accent); font-size: 17px; font-weight: 800; word-break: break-all; }
.copy-button { padding: 7px 10px; white-space: nowrap; }
.hidden { display: none !important; }

footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 10px 0 36px; color: #66717f; font-size: 12px; line-height: 1.6; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: min(380px, calc(100vw - 40px)); padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #18202a; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: rgba(255,126,138,.35); }

@media (max-width: 850px) {
    .page-shell { padding-top: 42px; }
    .two-column, .public-layout { grid-template-columns: 1fr; }
    .board-card { order: 2; }
    .hero h1 { font-size: clamp(34px, 10vw, 52px); }
}
@media (max-width: 560px) {
    .site-header { padding-inline: 16px; }
    .status-pill { display: none; }
    .relay-entry { padding-inline: 10px; }
    .page-shell { width: min(100% - 22px, 1180px); }
    .card { padding: 19px; border-radius: 18px; }
    .module-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .tab-button { min-width: 0; padding-inline: 8px; }
    .form-grid { grid-template-columns: 1fr; }
    .input-action-row { grid-template-columns: 1fr; }
    .inline-button { min-height: 42px; }
    .message-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
    .pagination { justify-content: stretch; }
    .page-numbers { order: 3; width: 100%; justify-content: center; }
    .page-control { flex: 1; }
    .page-info { flex: 1 0 100%; text-align: center; }
}
