:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(8, 18, 38, 0.78);
    --panel-strong: rgba(11, 26, 53, 0.92);
    --text: #e5f6ff;
    --muted: #8aa4bd;
    --primary: #22d3ee;
    --secondary: #7c3aed;
    --accent: #00ffb2;
    --border: rgba(34, 211, 238, 0.24);
    --danger-bg: rgba(127, 29, 29, 0.28);
    --danger: #fca5a5;
    --success-bg: rgba(6, 95, 70, 0.28);
    --success: #6ee7b7;
    --code-bg: rgba(2, 6, 23, 0.9);
    --code-text: #c7f9ff;
    --glow: 0 0 30px rgba(34, 211, 238, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 12% 10%, rgba(34, 211, 238, 0.2), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(124, 58, 237, 0.22), transparent 30%),
        radial-gradient(circle at 50% 100%, rgba(0, 255, 178, 0.12), transparent 28%),
        linear-gradient(135deg, #020617 0%, #07111f 48%, #020617 100%);
    color: var(--text);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background-image:
        linear-gradient(rgba(34, 211, 238, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 82%);
}

.page {
    width: min(980px, calc(100% - 28px));
    margin: 0 auto;
    padding: 34px 0 52px;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(8, 18, 38, 0.84), rgba(15, 23, 42, 0.58));
    box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
}

h1 {
    margin: 0;
    font-size: clamp(25px, 4vw, 36px);
    letter-spacing: 0.06em;
    text-shadow: 0 0 22px rgba(34, 211, 238, 0.45);
}

h1::before {
    color: var(--accent);
    content: "// ";
}

.nav {
    display: flex;
    gap: 10px;
    padding: 5px;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.6);
}

.nav a {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 18px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.04em;
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.nav a:hover,
.nav a.active {
    border-color: rgba(34, 211, 238, 0.55);
    color: #ecfeff;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(124, 58, 237, 0.28));
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.2);
}

.card {
    position: relative;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    background: linear-gradient(145deg, var(--panel), rgba(2, 6, 23, 0.86));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
}

section.card {
    height: calc(100vh - 156px);
    min-height: 520px;
    overflow: auto;
}

label {
    display: block;
    margin: 16px 0 8px;
    color: #dffaff;
    font-weight: 800;
    letter-spacing: 0.04em;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    color: var(--text);
    background: rgba(2, 6, 23, 0.72);
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder,
textarea::placeholder {
    color: rgba(138, 164, 189, 0.72);
}

select {
    cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    background: rgba(2, 6, 23, 0.9);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14), 0 0 24px rgba(34, 211, 238, 0.16);
}

textarea {
    min-height: 132px;
    resize: vertical;
    font-family: Consolas, Monaco, "Courier New", monospace;
    line-height: 1.55;
}

.submit-button {
    width: 100%;
    margin-top: 20px;
    border: 1px solid rgba(34, 211, 238, 0.58);
    border-radius: 14px;
    padding: 13px 16px;
    color: #031016;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font: inherit;
    font-weight: 900;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 0 26px rgba(34, 211, 238, 0.32);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.submit-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 0 34px rgba(0, 255, 178, 0.36);
}

.message {
    margin-bottom: 16px;
    border-radius: 14px;
    padding: 12px 14px;
    line-height: 1.6;
}

.message.success {
    border: 1px solid rgba(110, 231, 183, 0.36);
    background: var(--success-bg);
    color: var(--success);
}

.message.error {
    border: 1px solid rgba(252, 165, 165, 0.36);
    background: var(--danger-bg);
    color: var(--danger);
}

.empty {
    border: 1px dashed rgba(34, 211, 238, 0.36);
    border-radius: 18px;
    padding: 34px;
    text-align: center;
    color: var(--muted);
    background: rgba(2, 6, 23, 0.35);
}

.person {
    margin-top: 16px;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.48);
    overflow: hidden;
}

.person:first-of-type {
    margin-top: 0;
}

.person > summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: #ecfeff;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(124, 58, 237, 0.12));
}

.person > summary::-webkit-details-marker,
.detail > summary::-webkit-details-marker {
    display: none;
}

.count {
    border: 1px solid rgba(0, 255, 178, 0.24);
    border-radius: 999px;
    padding: 3px 10px;
    color: var(--accent);
    background: rgba(0, 255, 178, 0.08);
    font-size: 13px;
    font-weight: 800;
}

.filter-form {
    margin-bottom: 18px;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 18px;
    padding: 16px;
    background: rgba(2, 6, 23, 0.36);
}

.filter-form label {
    margin-top: 0;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-row select {
    flex: 1;
}

.filter-button,
.delete-button {
    width: auto;
    margin-top: 0;
    white-space: nowrap;
}

.reset-filter {
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 14px;
    padding: 12px 14px;
    color: #a5f3fc;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
    background: rgba(34, 211, 238, 0.08);
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.reset-filter:hover {
    border-color: rgba(34, 211, 238, 0.56);
    color: #ecfeff;
    background: rgba(34, 211, 238, 0.16);
}

.record {
    position: relative;
    border-top: 1px solid rgba(34, 211, 238, 0.18);
    padding: 16px 18px;
}

.record-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 190px 12px 0;
    color: var(--muted);
    font-size: 13px;
}

.record-actions {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.record-actions:has(.request-popover[open]) {
    z-index: 2147482999;
}

.field-title {
    margin: 13px 0 7px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.field-title::before {
    color: var(--accent);
    content: "▸ ";
}

.request-content-list {
    display: grid;
    gap: 10px;
}

.request-content-item {
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    color: #e2e8f0;
    line-height: 1.7;
    overflow-wrap: anywhere;
    background: rgba(15, 23, 42, 0.42);
}

.request-popover > summary {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(124, 58, 237, 0.34);
    border-radius: 999px;
    padding: 8px 12px;
    color: #ddd6fe;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
    background: rgba(124, 58, 237, 0.14);
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.request-popover > summary:hover,
.request-popover[open] > summary {
    border-color: rgba(167, 139, 250, 0.62);
    color: #f5f3ff;
    background: rgba(124, 58, 237, 0.24);
}

.request-popover > summary::-webkit-details-marker {
    display: none;
}

.request-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    width: 100vw;
    height: 100vh;
    place-items: center;
    padding: 20px;
    isolation: isolate;
}

.request-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(2, 6, 23, 0.72);
    box-shadow: none;
    cursor: default;
    backdrop-filter: blur(7px);
}

.request-backdrop:hover {
    transform: none;
    filter: none;
    box-shadow: none;
}

.request-card {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100vw - 40px));
    height: calc(100vh - 40px);
    max-height: 720px;
    overflow: auto;
    border: 1px solid rgba(34, 211, 238, 0.38);
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.97));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62), 0 0 38px rgba(34, 211, 238, 0.26);
}

.request-card-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(34, 211, 238, 0.18);
    padding-bottom: 12px;
}

.request-card-head strong {
    color: #ecfeff;
    font-size: 16px;
    letter-spacing: 0.04em;
}

.request-close {
    width: auto;
    margin: 0;
    border: 1px solid rgba(34, 211, 238, 0.34);
    border-radius: 999px;
    padding: 7px 12px;
    color: #cffafe;
    background: rgba(34, 211, 238, 0.1);
    font-size: 13px;
    font-weight: 900;
    box-shadow: none;
}

.request-close:hover {
    color: #ecfeff;
    background: rgba(34, 211, 238, 0.2);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.2);
}

.delete-form {
    margin: 0;
}

.delete-button {
    border-color: rgba(252, 165, 165, 0.42);
    padding: 8px 12px;
    color: #fee2e2;
    font-size: 13px;
    background: rgba(127, 29, 29, 0.36);
    box-shadow: none;
}

.delete-button:hover {
    color: #fff1f2;
    background: rgba(185, 28, 28, 0.58);
    box-shadow: 0 0 22px rgba(248, 113, 113, 0.26);
}

.url {
    overflow-wrap: anywhere;
    color: #67e8f9;
    font-weight: 800;
}

.request-content-list {
    display: grid;
    gap: 8px;
}

.request-content-item {
    overflow-wrap: anywhere;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 14px;
    padding: 10px 12px;
    color: #cffafe;
    background: rgba(15, 23, 42, 0.58);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.55;
}

pre {
    overflow: auto;
    max-height: 340px;
    margin: 0;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 14px;
    padding: 13px;
    background: var(--code-bg);
    color: var(--code-text);
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: inset 0 0 28px rgba(34, 211, 238, 0.06);
}

@media (max-width: 640px) {
    .topbar,
    .person > summary,
    .filter-row {
        align-items: stretch;
        flex-direction: column;
    }

    .nav {
        width: 100%;
    }

    .nav a {
        flex: 1;
        text-align: center;
    }

    .filter-button,
    .reset-filter {
        width: 100%;
        text-align: center;
    }

    .submit-button {
        margin-top: 20px;
    }

    .record {
        padding-top: 62px;
    }

    .record-head {
        margin-right: 0;
    }

    .record-actions {
        left: 18px;
        right: 18px;
    }

    .request-card {
        width: calc(100vw - 32px);
        height: calc(100vh - 32px);
        max-height: none;
    }
}
