/* 顶栏登录/注册（可选，不阻挡主功能） */
.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.auth-topbar--in-quiz {
    margin-bottom: 0;
    flex: 1;
    justify-content: flex-end;
}
.auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.auth-actions[hidden] { display: none !important; }
.auth-btn {
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    font-family: inherit;
    background: transparent;
}
.auth-btn-ghost {
    background: rgba(255, 252, 254, 0.92);
    border-color: rgba(251, 207, 232, 0.95);
    color: #9d174d;
}
.auth-btn-ghost:hover { background: #fce7f3; }
.auth-btn-primary {
    background: linear-gradient(135deg, #ec4899, #c026d3);
    color: #fff;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.28);
}
.auth-btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
a.auth-btn { text-decoration: none; display: inline-flex; align-items: center; }
.auth-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #8b6b7a;
    padding: 0 4px;
    font-variant-numeric: tabular-nums;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: rgba(61, 44, 54, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.auth-modal.show {
    opacity: 1;
    visibility: visible;
}
.auth-dialog {
    width: 100%;
    max-width: 400px;
    max-height: min(92vh, 640px);
    overflow-y: auto;
    background: #fffbfc;
    border-radius: 22px;
    border: 1px solid rgba(251, 207, 232, 0.95);
    box-shadow: 0 28px 64px rgba(157, 23, 77, 0.18);
    padding: 22px 20px 24px;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.22s ease;
}
.auth-modal.show .auth-dialog {
    transform: none;
}
.auth-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.auth-dialog-head h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #3d2c36;
    margin: 0;
}
.auth-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fce7f3;
    color: #9d174d;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.auth-tab {
    flex: 1;
    min-width: 72px;
    padding: 10px 8px;
    border: 1px solid rgba(251, 207, 232, 0.9);
    border-radius: 12px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    color: #8b6b7a;
    cursor: pointer;
    font-family: inherit;
}
.auth-tab.active {
    background: linear-gradient(135deg, #fdf2f8, #faf5ff);
    border-color: #f9a8d4;
    color: #9d174d;
}
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-field { margin-bottom: 14px; }
.auth-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #6b4d5a;
    margin-bottom: 6px;
}
.auth-field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 2px solid rgba(251, 207, 232, 0.85);
    font-size: 15px;
    background: #fff;
    font-family: inherit;
}
.auth-field input:focus,
.auth-field textarea:focus {
    outline: none;
    border-color: #f472b6;
    box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.16);
}
.auth-field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 2px solid rgba(251, 207, 232, 0.85);
    font-size: 15px;
    background: #fff;
    font-family: inherit;
    line-height: 1.55;
    resize: vertical;
    min-height: 120px;
}
.contact-char-count {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #b89ca8;
    margin-top: 4px;
}
.auth-row-code {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.auth-row-code input { flex: 1; min-width: 0; }
.auth-row-code .auth-btn { flex-shrink: 0; align-self: center; white-space: nowrap; }
.auth-submit {
    width: 100%;
    margin-top: 6px;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #ec4899, #d946ef 50%, #a855f7);
    box-shadow: 0 12px 28px rgba(236, 72, 153, 0.3);
    font-family: inherit;
}
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-msg {
    display: none;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}
.auth-msg.show { display: block; }
.auth-msg.err { background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; }
.auth-msg.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.auth-reset-hint {
    font-size: 12px;
    color: #8b6b7a;
    line-height: 1.55;
    margin-bottom: 12px;
}
.auth-hint {
    font-size: 12px;
    color: #b89ca8;
    margin-top: 12px;
    line-height: 1.55;
    text-align: center;
}

.auth-spam-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(61, 44, 54, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.auth-spam-overlay.show {
    opacity: 1;
    visibility: visible;
}
.auth-spam-overlay[hidden] { display: none !important; }
.auth-spam-overlay.show[hidden] { display: flex !important; }
.auth-spam-box {
    width: 100%;
    max-width: 380px;
    padding: 24px 22px;
    background: #fffbfc;
    border-radius: 20px;
    border: 1px solid rgba(251, 207, 232, 0.95);
    box-shadow: 0 24px 56px rgba(157, 23, 77, 0.2);
    text-align: center;
}
.auth-spam-box h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #9d174d;
    margin: 0 0 12px;
}
.auth-spam-box p {
    font-size: 14px;
    line-height: 1.65;
    color: #5c4450;
    margin: 0 0 18px;
    text-align: left;
}
.auth-spam-box .email-hint {
    font-weight: 700;
    color: #be185d;
    word-break: break-all;
}
.auth-spam-box .btn-ok {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #ec4899, #c026d3);
}
