/* Apple-style glass wizard */
body.wizard-page {
    background: transparent !important;
}

.wizard-page {
    --wiz-text: rgba(255, 255, 255, 0.95);
    --wiz-muted: rgba(255, 255, 255, 0.55);
    --wiz-glass: rgba(255, 255, 255, 0.12);
    --wiz-glass-border: rgba(255, 255, 255, 0.28);
    --wiz-accent: #0a84ff;
    --wiz-radius: 28px;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
    color: var(--wiz-text);
    -webkit-font-smoothing: antialiased;
}

.wizard-page .admin-header { display: none; }

.wizard-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 35%, #0f3460 65%, #533483 100%);
    overflow: hidden;
}

.wizard-bg::before,
.wizard-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: orbFloat 18s ease-in-out infinite;
}

.wizard-bg::before {
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, #5e60ce 0%, transparent 70%);
    top: -15%;
    left: -10%;
}

.wizard-bg::after {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, #48bfe3 0%, transparent 70%);
    bottom: -20%;
    right: -5%;
    animation-delay: -9s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(4%, 6%) scale(1.08); }
}

.wizard-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
}

.wizard-exit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 100px;
    background: var(--wiz-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--wiz-glass-border);
    color: var(--wiz-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s, box-shadow 0.25s;
}

.wizard-exit:hover {
    transform: scale(1.04);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #fff;
}

.wizard-exit:active { transform: scale(0.96); }

.wizard-step-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wiz-muted);
}

.wizard-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 88px 20px 56px;
    box-sizing: border-box;
}

.wizard-dots {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
}

.wizard-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-dot.active {
    width: 28px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.wizard-dot.done { background: rgba(255, 255, 255, 0.6); }

/* Main glass card + nav buttons on sides */
.wizard-card-wrap {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 36px;
    box-sizing: border-box;
}

.wizard-glass-card {
    position: relative;
    background: var(--wiz-glass);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--wiz-glass-border);
    border-radius: var(--wiz-radius);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    padding: 36px 40px;
    min-height: 400px;
    overflow: visible;
}

.wizard-content {
    position: relative;
    min-height: 320px;
    overflow: hidden;
}

.wizard-pane {
    display: none;
    animation: paneOut 0.35s ease forwards;
}

.wizard-pane.active {
    display: block;
    animation: paneIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wizard-pane.exit-left { animation: paneExitLeft 0.35s ease forwards; }
.wizard-pane.exit-right { animation: paneExitRight 0.35s ease forwards; }

@keyframes paneIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes paneOut {
    to { opacity: 0; }
}

@keyframes paneExitLeft {
    to { opacity: 0; transform: translateX(-30px); }
}

@keyframes paneExitRight {
    to { opacity: 0; transform: translateX(30px); }
}

.wizard-pane h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.wizard-pane .sub {
    color: var(--wiz-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Form fields - Apple style */
.wizard-field {
    margin-bottom: 18px;
}

.wizard-field:last-child {
    margin-bottom: 0;
}

.wizard-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wiz-muted);
    margin-bottom: 8px;
}

.wizard-field input[type="text"],
.wizard-field input[type="url"],
.wizard-field input[type="number"],
.wizard-field textarea,
.wizard-field select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    margin-bottom: 0;
}

.wizard-field input::placeholder,
.wizard-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.wizard-field input:focus,
.wizard-field textarea:focus,
.wizard-field select:focus {
    outline: none;
    border-color: rgba(10, 132, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.25);
    background: rgba(0, 0, 0, 0.22);
}

.wizard-field textarea {
    min-height: 88px;
    resize: vertical;
}

.wizard-field select option {
    background: #1a1a2e;
    color: #fff;
}

.wizard-hint {
    font-size: 0.8rem;
    color: var(--wiz-muted);
    margin-top: 6px;
}

/* Image preview + COS upload */
.img-field-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 16px;
    align-items: end;
}

.img-field-inputs {
    min-width: 0;
}

.img-field-inputs .img-url-input {
    width: 100%;
    margin-bottom: 0;
}

.img-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.img-preview-tag {
    font-size: 0.7rem;
    color: var(--wiz-muted);
    letter-spacing: 0.02em;
}

.img-upload-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.img-upload-btn {
    cursor: pointer;
    font-size: 0.85rem;
    padding: 8px 14px;
    margin: 0;
}

.img-upload-actions.uploading .img-upload-btn {
    opacity: 0.65;
    pointer-events: none;
}

.img-upload-status {
    font-size: 0.8rem;
    color: var(--wiz-muted);
}

@media (max-width: 640px) {
    .img-field-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .img-preview-wrap {
        align-items: flex-start;
        width: 100%;
    }
    #preview-bg-m,
    #preview-bg-d {
        max-width: 100% !important;
    }
    .wizard-card-wrap { padding: 0 28px; }
    .wizard-glass-card { padding: 28px 24px; }
    .wizard-nav-btn { width: 48px; height: 48px; right: 2px; }
    .wizard-back-fab { width: 40px; height: 40px; left: 2px; }
}

.img-preview {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

/* 头像：圆形 */
#preview-avatar,
.img-preview--avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
}

/* 手机背景：9:16 竖屏 */
#preview-bg-m,
.img-preview--phone {
    width: 108px;
    height: auto;
    aspect-ratio: 9 / 16;
    max-width: min(108px, 42vw);
    border-radius: 14px;
}

/* 电脑背景：16:9 横屏 */
#preview-bg-d,
.img-preview--desktop {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-width: min(280px, 100%);
    border-radius: 12px;
}

.img-preview.wide:not(#preview-bg-m):not(#preview-bg-d) {
    width: 100%;
    height: 120px;
    max-width: 200px;
}

.img-preview.has-image {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transform: scale(1);
}

.img-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.img-preview.loaded img { opacity: 1; }

.img-preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--wiz-muted);
    text-align: center;
    padding: 8px;
    line-height: 1.3;
    transition: opacity 0.3s;
}

.img-preview.loaded .img-preview-placeholder,
.img-preview.loading .img-preview-placeholder { opacity: 0; }

.img-preview.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.img-preview.error {
    border-color: rgba(255, 69, 58, 0.5);
}

.img-preview.error .img-preview-placeholder {
    opacity: 1;
    color: #ff6b6b;
    font-size: 0.6rem;
}

/* Right side next / submit circle */
.wizard-nav-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    opacity: 0;
    animation: navPulse 2.5s ease-out infinite;
}

@keyframes navPulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    70%, 100% { transform: scale(1.35); opacity: 0; }
}

.wizard-nav-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s,
        background 0.25s;
    z-index: 10;
}

.wizard-nav-btn:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 40px rgba(255, 255, 255, 0.35);
}

.wizard-nav-btn:active {
    transform: translateY(-50%) scale(0.94);
}

.wizard-nav-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(10, 132, 255, 0.35);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(2.5); opacity: 0; }
}

.wizard-nav-btn.is-submit {
    background: linear-gradient(135deg, #30d158, #34c759);
    color: #fff;
}

.wizard-nav-btn.is-submit:hover {
    box-shadow: 0 8px 40px rgba(48, 209, 88, 0.45);
}

.wizard-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.9);
}

.wizard-back-fab {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--wiz-glass-border);
    background: var(--wiz-glass);
    backdrop-filter: blur(20px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-back-fab.visible {
    opacity: 1;
    pointer-events: auto;
}

.wizard-back-fab:hover {
    transform: translateY(-50%) scale(1.06);
    background: rgba(255, 255, 255, 0.2);
}

.wizard-back-fab:active { transform: translateY(-50%) scale(0.92); }

/* Social items in wizard */
.wizard-social-list { max-height: 280px; overflow-y: auto; padding-right: 4px; }
.wizard-social-list::-webkit-scrollbar { width: 4px; }
.wizard-social-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.wizard-social-item {
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    animation: socialIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes socialIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.wizard-social-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.wizard-social-head span {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.8;
}

.wizard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 100px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, background 0.25s;
}

.wizard-btn:active { transform: scale(0.94); }

.wizard-btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wizard-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.wizard-btn-danger {
    background: rgba(255, 69, 58, 0.25);
    color: #ff6b6b;
    padding: 8px 14px;
    font-size: 0.8rem;
}

.wizard-btn-danger:hover {
    background: rgba(255, 69, 58, 0.4);
    transform: scale(1.05);
}

.wizard-btn-add {
    width: 100%;
    margin-top: 8px;
    background: rgba(10, 132, 255, 0.25);
    color: #64d2ff;
    border: 1px dashed rgba(100, 210, 255, 0.4);
}

.wizard-btn-add:hover {
    background: rgba(10, 132, 255, 0.4);
    transform: scale(1.02);
    box-shadow: 0 8px 28px rgba(10, 132, 255, 0.25);
}

.wizard-summary {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.wizard-summary p {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.wizard-summary strong { color: var(--wiz-muted); font-weight: 500; margin-right: 8px; }

.wizard-alert {
    max-width: 600px;
    margin: 72px auto 12px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 69, 58, 0.2);
    border: 1px solid rgba(255, 69, 58, 0.4);
    color: #ffb4b0;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.wizard-opacity-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wizard-opacity-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    border: none;
    padding: 0;
}

.wizard-opacity-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.wizard-opacity-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.wizard-opacity-val {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.wizard-page .toast {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Social wizard: platform picker */
.social-pick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0 8px;
}

@media (max-width: 520px) {
    .social-pick-grid { grid-template-columns: repeat(2, 1fr); }
}

.social-pick-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s, transform 0.2s;
    min-height: 96px;
    user-select: none;
}

.social-pick-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.social-pick-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.social-pick-mark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
    transition: all 0.2s;
}

.social-pick-check:checked + .social-pick-mark {
    background: linear-gradient(135deg, #30d158, #34c759);
    border-color: transparent;
    color: #fff;
}

.social-pick-check:checked ~ .social-pick-icon,
.social-pick-check:checked ~ .social-pick-label {
    opacity: 1;
}

.social-pick-card:has(.social-pick-check:checked) {
    border-color: rgba(48, 209, 88, 0.65);
    background: rgba(48, 209, 88, 0.12);
}

.social-pick-icon {
    font-size: 1.75rem;
    opacity: 0.85;
}

.social-pick-label {
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
}

.social-fill-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.social-fill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.3s;
}

.social-fill-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #fff;
}

.social-fill-dot.done {
    background: rgba(48, 209, 88, 0.85);
}

.social-wizard-pick h2,
.social-fill-pane h2 {
    margin-bottom: 6px;
}
