:root {
    --bg: #08111f;
    --surface: rgba(10, 24, 42, .94);
    --surface-soft: rgba(14, 34, 58, .92);
    --border: rgba(143, 166, 194, .28);
    --text: #eef6ff;
    --muted: #9fb3cc;
    --primary: #4f8cff;
    --primary-dark: #78a9ff;
    --danger: #ff3b3b;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow: 0 22px 54px rgba(0, 0, 0, .30);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 12%, rgba(79, 140, 255, .22), transparent 34%),
        radial-gradient(circle at 88% 24%, rgba(34, 197, 94, .12), transparent 30%),
        linear-gradient(180deg, #07111f 0%, #0a1728 52%, #0c1320 100%);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, .9) 0 1px, transparent 1.7px),
        radial-gradient(circle, rgba(191, 219, 254, .65) 0 1px, transparent 1.7px);
    background-size: 160px 160px, 230px 230px;
    background-position: 0 0, 45px 70px;
    opacity: .34;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 28px;
    background: rgba(8, 17, 31, .92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .24);
}

.topbar strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
}

.topbar span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-links a,
.topbar-links span,
.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid rgba(127, 164, 212, .38);
    border-radius: 8px;
    color: var(--text);
    background: rgba(15, 36, 62, .92);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}

button,
.button {
    border-color: rgba(79, 140, 255, .75);
    background: linear-gradient(180deg, #5b94ff, #2f6fe9);
}

button:hover,
.button:hover,
.topbar-links a:hover {
    filter: brightness(1.07);
}

.shell {
    width: min(1280px, calc(100vw - 36px));
    margin: 26px auto 56px;
}

.shell.narrow {
    width: min(900px, calc(100vw - 36px));
}

.center {
    display: grid;
    align-content: center;
    min-height: calc(100vh - 40px);
}

.login-shell {
    display: grid;
    align-content: center;
    width: min(520px, calc(100vw - 36px));
    min-height: 100vh;
}

.panel {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero-panel,
.login-panel {
    text-align: left;
}

h1,
h2 {
    margin: 0 0 14px;
    line-height: 1.25;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 22px;
}

.muted {
    color: var(--muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

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

.form-grid.compact {
    margin-top: 12px;
}

label {
    display: grid;
    gap: 7px;
    color: #d7e5f7;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    color: var(--text);
    border: 1px solid rgba(143, 166, 194, .38);
    border-radius: 8px;
    background: rgba(6, 16, 30, .78);
    outline: none;
    font: inherit;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, .16);
}

.wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.notice.error {
    color: #ffd9d9;
    border-color: rgba(255, 59, 59, .46);
    background: rgba(255, 59, 59, .14);
}

.notice.success {
    color: #d9ffe7;
    border-color: rgba(34, 197, 94, .42);
    background: rgba(34, 197, 94, .12);
}

.grid.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(143, 166, 194, .18);
    text-align: left;
    vertical-align: top;
}

th {
    color: #cfe2ff;
    background: rgba(79, 140, 255, .12);
    font-weight: 900;
}

td {
    color: #e8f2ff;
}

.code,
.reply-box {
    overflow: auto;
    margin: 10px 0 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #dbeafe;
    background: rgba(5, 12, 24, .82);
    white-space: pre-wrap;
}

@media (max-width: 860px) {
    .topbar,
    .topbar-links {
        align-items: stretch;
        flex-direction: column;
    }

    .form-grid,
    .grid.two,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .shell {
        width: min(100vw - 24px, 1280px);
    }
}
