@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
    color-scheme: light;
    --font-ui: "Plus Jakarta Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Plus Jakarta Sans", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Consolas, monospace;
    --bg: #f5f6f8;
    --panel: #ffffff;
    --text: #1d2430;
    --muted: #697386;
    --line: #e7eaf0;
    --accent: #1867e8;
    --accent-dark: #1256c4;
    --danger: #c93535;
    --ok: #0a7a4b;
    --shadow: 0 18px 50px rgba(28, 38, 58, .09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    background: var(--bg);
    color: var(--text);
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
    font-family: inherit;
}

a {
    color: inherit;
}

.redeem-bg {
    background-color: #eef1f5;
    background-image:
        linear-gradient(rgba(246, 248, 251, .78), rgba(246, 248, 251, .78)),
        var(--redeem-bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.redeem-bg.no-bg-overlay {
    background-image: var(--redeem-bg-image);
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
    background: #f4f6f9;
}

.login-card {
    width: min(400px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
    padding: 30px;
}

.login-head {
    margin-bottom: 22px;
}

.card {
    position: relative;
    width: min(440px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.redeem-bg .card {
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .52));
    border-color: rgba(255, 255, 255, .46);
    box-shadow:
        0 24px 72px rgba(18, 27, 43, .24),
        inset 0 1px 0 rgba(255, 255, 255, .58);
    backdrop-filter: blur(24px) saturate(1.18);
    -webkit-backdrop-filter: blur(24px) saturate(1.18);
}

.redeem-bg .card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .08)),
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .34), transparent 42%);
}

.redeem-bg .card > * {
    position: relative;
    z-index: 1;
}

.redeem-bg.no-card-blur .card {
    background: rgba(255, 255, 255, .94);
    border-color: var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.redeem-bg.no-card-blur .card::before {
    display: none;
}

.topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.eyebrow {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 6px;
}

h1, h2 {
    margin: 0;
    font-family: var(--font-ui);
    letter-spacing: 0;
    line-height: 1.18;
}

h1 {
    font-size: 25px;
    font-weight: 800;
}

h2 {
    font-size: 20px;
    font-weight: 700;
}

.hint {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    margin: 10px 0 0;
}

.form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

label {
    font-family: var(--font-ui);
    color: #303846;
    font-size: 14px;
    font-weight: 600;
}

input, textarea, select {
    width: 100%;
    border: 1px solid #d8dde7;
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    padding: 11px 12px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.45;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24, 103, 232, .12);
}

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    padding: 0 15px;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .button:hover {
    background: var(--accent-dark);
}

.button.secondary {
    background: #eef2f7;
    color: #253042;
}

.button.secondary:hover {
    background: #e3e8f0;
}

.button.danger, button.danger {
    border-color: #d5d9e2;
    background: #fff;
    color: #8a2430;
}

.button.danger:hover, button.danger:hover {
    border-color: #c7ccd6;
    background: #f6f7f9;
    color: #751d27;
}

.compact-button {
    min-height: 24px;
    padding: 0 8px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: none;
}

.button.secondary.compact-button,
.button.danger.compact-button,
button.danger.compact-button {
    border-color: #d5d9e2;
    background: #fff;
    color: #344054;
}

.button.secondary.compact-button:hover,
.button.danger.compact-button:hover,
button.danger.compact-button:hover {
    border-color: #c7ccd6;
    background: #f6f7f9;
    color: #1f2937;
}

.button.danger.compact-button,
button.danger.compact-button {
    color: #8a2430;
}

.button.danger.compact-button:hover,
button.danger.compact-button:hover {
    color: #751d27;
}

.alert {
    border-radius: 7px;
    padding: 11px 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid;
}

.alert.error {
    color: var(--danger);
    background: #fff6f6;
    border-color: #f1c8c8;
}

.alert.ok {
    color: var(--ok);
    background: #f2fbf6;
    border-color: #bfe8d1;
}

.secret-box {
    position: relative;
    margin-top: 14px;
    padding: 44px 14px 14px;
    border: 1px dashed #b6c0d1;
    border-radius: 7px;
    background: #fbfcff;
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 15px;
}

.secret-text {
    white-space: pre-wrap;
}

.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #d5d9e2;
    border-radius: 2px;
    background: #fff;
    color: #344054;
    font-size: 12px;
    font-weight: 650;
}

.copy-button:hover {
    border-color: #c7ccd6;
    background: #f6f7f9;
    color: #1f2937;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    background: #f5f6f8;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #111827;
    color: #fff;
    padding: 20px 14px;
    overflow-y: auto;
}

.brand {
    display: grid;
    gap: 4px;
    margin-bottom: 22px;
    padding: 0 6px;
}

.brand span {
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0;
}

.nav {
    display: grid;
    gap: 5px;
}

.nav-group {
    font-family: var(--font-ui);
    color: #8b95a7;
    font-size: 12px;
    font-weight: 750;
    margin: 14px 8px 5px;
}

.nav a, .nav-button {
    font-family: var(--font-ui);
    padding: 10px 11px;
    border-radius: 7px;
    text-decoration: none;
    color: #d6dbe6;
    font-size: 14px;
    width: 100%;
    min-height: auto;
    justify-content: flex-start;
    background: transparent;
    font-weight: 400;
}

.nav a:hover, .nav a.active, .nav-button:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.main {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 78px;
    padding: 18px 28px;
    background: rgba(245, 246, 248, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.admin-user {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-ui);
}

.content-wrap {
    width: min(1180px, 100%);
    padding: 22px 28px 32px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat, .panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.stat strong {
    display: block;
    font-size: 25px;
    margin-top: 7px;
}

.panel {
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

th {
    font-family: var(--font-ui);
    color: #4a5568;
    background: #fafbfc;
    font-weight: 750;
}

tr:last-child td {
    border-bottom: 0;
}

.mono {
    font-family: var(--font-mono);
    word-break: break-all;
}

.status {
    font-family: var(--font-ui);
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border: 1px solid #d5d9e2;
    border-radius: 2px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 650;
    background: #fff;
    color: #344054;
}

.status.used {
    border-color: #d5d9e2;
    background: #f7f8fa;
    color: #475467;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.copy-inline {
    min-width: 38px;
    height: 24px;
    line-height: 1;
}

.action-cell {
    width: 86px;
    white-space: nowrap;
}

@media (max-width: 780px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

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

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

    .main {
        padding: 0;
    }

    .admin-topbar {
        position: static;
        padding: 16px 14px;
        align-items: flex-start;
        flex-direction: column;
    }

    .content-wrap {
        padding: 16px 14px 24px;
    }
}
