/* ============================================================
   后台样式（与前台共用主题变量，来自 style.css）
   ============================================================ */

.admin-body {
    min-height: 100vh;
    background-image:
        radial-gradient(800px 480px at 50% -10%, var(--glow), transparent 60%);
}

/* ---------------- 登录 / 初始化 ---------------- */

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 18px;
}

.auth-card {
    width: min(100%, 420px);
    padding: 28px 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 10px 0 4px;
    font-size: 24px;
}

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

.auth-flash {
    margin: 16px 0;
    padding: 11px 13px;
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: 13px;
}

.auth-foot {
    margin: 18px 0 0;
    font-size: 12px;
}

.auth-foot a {
    color: var(--muted);
}

.auth-foot a:hover {
    color: var(--accent-2);
}

/* ---------------- 表单元素 ---------------- */

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

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12.5px;
}

input[type="text"],
input[type="password"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

input[type="file"] {
    padding: 8px 10px;
    font-size: 12px;
    width: auto;
    max-width: 100%;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* ---------------- 按钮 ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
    white-space: nowrap;
}

.btn:hover {
    background: rgba(255, 255, 255, .1);
}

.btn:active {
    transform: scale(.98);
}

.btn.primary {
    border-color: transparent;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    color: #1a1220;
}

.btn.primary:hover {
    filter: brightness(1.06);
}

.btn.ghost {
    background: transparent;
    color: var(--muted);
}

.btn.ghost:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* ---------------- 顶栏 ---------------- */

.admin-top {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(16, 12, 20, .88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.admin-top-inner {
    max-width: 880px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.admin-top h1 {
    margin: 2px 0 0;
    font-size: 16.5px;
    font-weight: 700;
}

.admin-top-actions {
    display: flex;
    gap: 8px;
}

/* ---------------- 主体 ---------------- */

.admin-main {
    max-width: 880px;
    margin: 0 auto;
    padding: 18px 16px 80px;
}

.admin-flash {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: 13px;
}

.panel {
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 15.5px;
    font-weight: 700;
}

.panel h2 small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

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

.grid-2,
.grid-3 {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.switch-label {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    display: flex;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    color: var(--muted);
}

.save-bar {
    position: sticky;
    bottom: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(20, 15, 26, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ---------------- 图片 ---------------- */

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-2);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb form {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
}

.thumb-del {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.thumb-del:hover {
    background: #d33;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.qr-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}

.qr-preview img {
    width: 92px;
    height: 92px;
    padding: 4px;
    border-radius: 12px;
    background: #fff;
    object-fit: cover;
}

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

.hint code,
.admin-foot code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .08);
    font-size: 11.5px;
}

.admin-foot {
    padding: 18px 4px 0;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.8;
}

.muted {
    color: var(--muted);
    font-size: 12.5px;
}

@media (min-width: 620px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .admin-main { padding-left: 22px; padding-right: 22px; }
    .panel { padding: 24px; }
}