* {
    box-sizing: border-box;
}

:root {
    --theme: #ff6ba5;
    --accent: #65d6ff;
    --ink: #22233d;
    --muted: #707491;
    --line: rgba(70, 70, 112, 0.14);
    --card: rgba(255, 255, 255, 0.82);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
    background:
        radial-gradient(circle at 12% 10%, rgba(101, 214, 255, 0.28), transparent 24%),
        radial-gradient(circle at 86% 8%, rgba(255, 107, 165, 0.24), transparent 25%),
        linear-gradient(135deg, #f9fbff, #fff7fb 52%, #fffaf0);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
    background-size: 34px 34px;
}

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

a {
    color: inherit;
}

.admin-layout {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 104px;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--theme);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
}

h2 {
    margin-bottom: 0;
    font-size: 1.16rem;
}

.muted {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

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

.admin-nav a,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
    gap: 18px;
}

.admin-card,
.login-card {
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 22px 65px rgba(75, 72, 112, 0.16);
    backdrop-filter: blur(18px);
}

.admin-card {
    padding: 18px;
}

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

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-heading span {
    color: var(--muted);
    font-weight: 800;
}

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

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

label {
    display: grid;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    outline: 0;
}

input,
select {
    min-height: 42px;
    padding: 0 12px;
}

input[type="color"] {
    padding: 4px;
}

textarea {
    min-height: 118px;
    padding: 12px;
    resize: vertical;
    line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
    border-color: color-mix(in srgb, var(--theme) 72%, white);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme) 16%, transparent);
}

.switches {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
}

.switch input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--theme);
}

.prize-editor {
    display: grid;
    gap: 12px;
}

.prize-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.5fr) 92px 78px 38px;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
}

button {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--theme), #7c7cff);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(255, 107, 165, 0.2);
}

button:hover {
    filter: saturate(1.07);
}

.ghost-button,
.icon-button {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    box-shadow: none;
}

.ghost-button {
    padding: 0 14px;
}

.icon-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
    color: #d83d70;
    font-size: 1.3rem;
}

.danger-button {
    background: linear-gradient(135deg, #ff5f6d, #c83b65);
    box-shadow: 0 14px 30px rgba(216, 61, 112, 0.22);
}

.sticky-actions {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 10;
    display: flex;
    gap: 10px;
    width: min(620px, calc(100% - 28px));
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 55px rgba(70, 70, 112, 0.22);
    backdrop-filter: blur(18px);
    transform: translateX(-50%);
}

.sticky-actions button {
    flex: 1;
}

.winner-admin-list {
    display: grid;
    gap: 10px;
    max-height: 310px;
    overflow: auto;
}

.winner-admin-list article,
.empty {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
}

.winner-admin-list strong {
    display: block;
}

.winner-admin-list span,
.empty {
    color: var(--muted);
    font-size: 0.92rem;
}

.alert {
    margin-bottom: 16px;
    padding: 13px 15px;
    border-radius: 8px;
    font-weight: 800;
}

.alert.success {
    border: 1px solid rgba(50, 181, 123, 0.26);
    background: rgba(214, 255, 236, 0.8);
    color: #217a54;
}

.alert.error {
    border: 1px solid rgba(216, 61, 112, 0.24);
    background: rgba(255, 229, 237, 0.85);
    color: #a82a54;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 18px;
}

.login-shell {
    width: min(460px, 100%);
}

.login-card {
    padding: 26px;
}

.form-stack {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.login-card .text-link {
    margin-top: 16px;
}

@media (max-width: 920px) {
    .admin-header,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
    }

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

    .icon-button {
        width: 100%;
    }
}

@media (max-width: 620px) {
    .form-grid,
    .prize-row,
    .sticky-actions {
        grid-template-columns: 1fr;
    }

    .sticky-actions {
        display: grid;
    }
}
