/* ==================== 弹窗系统 · 柔和治愈风 ==================== */

:root {
    /* 须高于侧栏/顶栏（见 style.css --z-sidebar / --z-topbar），且高于 --z-max 的旧 toast */
    --z-modal-backdrop: calc(var(--z-max, 9999) + 50);
    --z-modal-drawer: calc(var(--z-max, 9999) + 51);
    /* 高于业务弹窗（含解析管理、续费、ConfirmDialog），成功/失败 Toast 始终在最前 */
    --z-toast: calc(var(--z-modal-backdrop) + 500);
    --modal-radius: 18px;
    --modal-radius-inner: 14px;
    --modal-backdrop-blur: 28px;
    --modal-backdrop-saturate: 112%;
    /* 遮罩：略冷灰 + 轻渐变，叠在 blur 上更自然 */
    --modal-backdrop-tint: linear-gradient(165deg, rgba(15, 23, 42, 0.46) 0%, rgba(30, 41, 59, 0.38) 48%, rgba(15, 23, 42, 0.5) 100%);
    --modal-candy-lavender: linear-gradient(135deg, #fae8ff 0%, #e9d5ff 40%, #fce7f3 100%);
    --modal-candy-mint: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #ecfccb 100%);
    --modal-candy-peach: linear-gradient(135deg, #ffedd5 0%, #fed7aa 50%, #fecaca 100%);
    --modal-candy-sky: linear-gradient(135deg, #dbeafe 0%, #bae6fd 50%, #e0e7ff 100%);
    --modal-candy-rose: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 45%, #ede9fe 100%);
    --modal-shadow-soft: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 24px 48px -12px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.55) inset;
    --modal-shadow-hover: 0 12px 28px -6px rgba(15, 23, 42, 0.12), 0 32px 64px -18px rgba(15, 23, 42, 0.16);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-backdrop-tint);
    backdrop-filter: blur(var(--modal-backdrop-blur)) saturate(var(--modal-backdrop-saturate));
    -webkit-backdrop-filter: blur(var(--modal-backdrop-blur)) saturate(var(--modal-backdrop-saturate));
    z-index: var(--z-modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.32s cubic-bezier(0.33, 1, 0.68, 1);
    overflow: visible;
    padding: 88px 16px 28px;
    box-sizing: border-box;
}

.modal-overlay.modal-fullscreen {
    padding: 0;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.93) 100%);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow: var(--modal-shadow-soft);
    border-radius: var(--modal-radius);
    max-width: 440px;
    width: 92%;
    max-height: 85vh;
    overflow: visible;
    transform: scale(0.88) translateY(28px);
    opacity: 0;
    transition: transform 0.42s cubic-bezier(0.34, 1.45, 0.64, 1), opacity 0.35s ease, box-shadow 0.35s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
    box-shadow: var(--modal-shadow-soft), var(--modal-shadow-hover);
}

.modal-full .modal-container,
.modal-fullscreen .modal-container {
    overflow: hidden;
}

.modal-full .ui-mascot-root,
.modal-fullscreen .ui-mascot-root {
    display: none !important;
}

/* 小猫走在框顶：脚掌贴近左上沿；轻 3D + 迈步感（transform-origin 左下） */
.ui-mascot-root {
    position: absolute;
    z-index: 50;
    left: -6px;
    top: 0;
    width: 128px;
    height: 76px;
    margin-top: -62px;
    pointer-events: none;
    line-height: 0;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    filter:
        drop-shadow(4px 10px 0 rgba(51, 65, 85, 0.12))
        drop-shadow(0 16px 28px rgba(30, 41, 59, 0.26))
        drop-shadow(0 6px 14px rgba(100, 116, 139, 0.28));
    animation: modalMascotCatWalk 2.5s ease-in-out infinite;
    transform-origin: 0 100%;
}

.ui-mascot-root svg {
    width: 100%;
    height: 100%;
    display: block;
    transform: translateZ(8px);
}

.ui-mascot-root--loading {
    left: -6px;
    margin-left: 0;
    top: 0;
    margin-top: -58px;
    width: 114px;
    height: 68px;
    animation-duration: 2.2s;
}

.ui-mascot-root--toast {
    left: -6px;
    top: 0;
    margin-top: -54px;
    width: 102px;
    height: 60px;
    animation-duration: 2.4s;
    filter:
        drop-shadow(3px 8px 0 rgba(51, 65, 85, 0.1))
        drop-shadow(0 12px 22px rgba(30, 41, 59, 0.22))
        drop-shadow(0 4px 12px rgba(100, 116, 139, 0.22));
}

@keyframes modalMascotCatWalk {
    0%, 100% {
        transform: perspective(400px) rotateY(-14deg) rotateX(7deg) translateX(0) translateY(0) translateZ(0);
    }
    33% {
        transform: perspective(400px) rotateY(-11deg) rotateX(8deg) translateX(6px) translateY(-5px) translateZ(4px);
    }
    66% {
        transform: perspective(400px) rotateY(-15deg) rotateX(6deg) translateX(3px) translateY(-2px) translateZ(2px);
    }
}

.cr-dmodal,
.cr-rectify-modal {
    position: relative;
    overflow: visible;
    border-radius: var(--modal-radius);
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.93) 100%);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.05),
        0 24px 48px -12px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.72) inset;
}

.modal-sm { max-width: 360px; }
.modal-md { max-width: 480px; }
.modal-lg { max-width: 600px; }
.modal-xl { max-width: 800px; }
.modal-full {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
}

.modal-header {
    padding: 18px 20px 14px 22px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.78);
    border-radius: var(--modal-radius) var(--modal-radius) 0 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--modal-candy-lavender);
    color: #5b21b6;
    box-shadow: 0 4px 14px rgba(167, 139, 250, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(145deg, #f3e8ff, #fdf2f8);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.45, 0.64, 1);
    color: #a78bfa;
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(167, 139, 250, 0.2);
}

.modal-close:hover {
    background: linear-gradient(145deg, #fce7f3, #e9d5ff);
    color: #7c3aed;
    transform: rotate(90deg) scale(1.08);
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.35);
}

.modal-body {
    padding: 22px 24px 24px;
    font-size: 15px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.75;
    max-height: calc(85vh - 160px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(249, 250, 251, 0.9);
    border-radius: 0 0 var(--modal-radius) var(--modal-radius);
}

.modal-footer .btn,
.btn-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.34, 1.45, 0.64, 1);
    white-space: nowrap;
    min-width: 92px;
    flex: 0 0 auto;
}

.modal-footer .btn:hover,
.btn-modal:hover {
    transform: translateY(-2px);
}

.modal-footer .btn:active,
.btn-modal:active {
    transform: translateY(0);
}

.modal-footer .btn-primary,
.btn-modal-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #ec4899 100%);
    color: white;
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.38);
}

.modal-footer .btn-primary:hover,
.btn-modal-primary:hover {
    box-shadow: 0 10px 26px rgba(236, 72, 153, 0.42);
}

.modal-footer .btn-secondary,
.btn-modal-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-secondary, #64748b);
    border: 1px solid rgba(199, 210, 254, 0.85);
    box-shadow: 0 2px 10px rgba(148, 163, 184, 0.12);
}

.modal-footer .btn-secondary:hover,
.btn-modal-secondary:hover {
    background: linear-gradient(145deg, #faf5ff, #fefce8);
    color: var(--text-primary, #334155);
    border-color: #c4b5fd;
    box-shadow: 0 6px 18px rgba(167, 139, 250, 0.2);
}

.modal-footer .btn-success {
    background: linear-gradient(135deg, #34d399, #059669);
    color: white;
    box-shadow: 0 6px 18px rgba(52, 211, 153, 0.38);
}

.modal-footer .btn-success:hover {
    box-shadow: 0 10px 26px rgba(16, 185, 129, 0.45);
}

.modal-footer .btn-warning {
    background: linear-gradient(135deg, #fbbf24, #fb923c);
    color: white;
    box-shadow: 0 6px 18px rgba(251, 191, 36, 0.38);
}

.modal-footer .btn-warning:hover {
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.45);
}

.modal-footer .btn-danger {
    background: linear-gradient(135deg, #fb7185, #f43f5e);
    color: white;
    box-shadow: 0 6px 18px rgba(251, 113, 133, 0.38);
}

.modal-footer .btn-danger:hover {
    box-shadow: 0 10px 26px rgba(244, 63, 94, 0.45);
}

/* 须高于页面内叠放的二层弹窗（如域名页 #dns-renew-modal 使用 backdrop+24） */
.modal-overlay.confirm-modal {
    z-index: calc(var(--z-modal-backdrop) + 120);
}

.confirm-modal .modal-body {
    text-align: center;
    padding: 36px 26px 28px;
}

.confirm-icon-wrapper {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    color: white;
    border: 4px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.28), 0 0 0 6px rgba(237, 233, 254, 0.65);
    animation: iconPop 0.65s cubic-bezier(0.34, 1.55, 0.64, 1);
}

.confirm-icon-wrapper svg {
    width: 36px;
    height: 36px;
    stroke-width: 2.25;
}

.confirm-icon-wrapper.success {
    background: var(--modal-candy-mint);
    color: #047857;
    box-shadow: 0 12px 32px rgba(52, 211, 153, 0.35), 0 0 0 6px rgba(209, 250, 229, 0.75);
}

.confirm-icon-wrapper.warning {
    background: var(--modal-candy-peach);
    color: #c2410c;
    box-shadow: 0 12px 32px rgba(251, 191, 36, 0.35), 0 0 0 6px rgba(254, 243, 199, 0.75);
}

.confirm-icon-wrapper.error {
    background: linear-gradient(145deg, #fecdd3 0%, #fda4af 50%, #fb7185 100%);
    color: #9f1239;
    box-shadow: 0 12px 32px rgba(251, 113, 133, 0.38), 0 0 0 6px rgba(254, 226, 226, 0.9);
}

.confirm-icon-wrapper.info {
    background: var(--modal-candy-sky);
    color: #1d4ed8;
    box-shadow: 0 12px 32px rgba(125, 211, 252, 0.38), 0 0 0 6px rgba(224, 242, 254, 0.85);
}

.confirm-modal.modal-info .confirm-icon-wrapper:not(.success):not(.warning):not(.error),
.confirm-icon-wrapper:not(.success):not(.warning):not(.error):not(.info) {
    background: var(--modal-candy-lavender);
    color: #6d28d9;
}

.confirm-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary, #111827);
    margin-bottom: 10px;
}

.confirm-message {
    font-size: 15px;
    color: var(--text-secondary, #64748b);
    line-height: 1.65;
    max-width: 320px;
    margin: 0 auto;
}

@keyframes iconPop {
    0% {
        transform: scale(0) rotate(-18deg);
        opacity: 0;
    }
    65% {
        transform: scale(1.08) rotate(4deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.modal-form-group {
    margin-bottom: 20px;
}

.modal-form-group:last-child {
    margin-bottom: 0;
}

.modal-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
}

.modal-form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid rgba(199, 210, 254, 0.65);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(250, 245, 255, 0.5), rgba(248, 250, 252, 0.95));
    color: var(--text-primary, #111827);
    font-size: 15px;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

select.modal-form-control {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 12px) center !important;
    background-size: 12px !important;
    padding-right: 36px !important;
}

select.modal-form-control:disabled {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
}

select.modal-form-control:focus,
select.modal-form-control:active,
select.modal-form-control:hover {
    background-position: calc(100% - 12px) center !important;
}

select.modal-form-control:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233b82f6' d='M6 4l5 5H1z'/%3E%3C/svg%3E") !important;
}

select.modal-form-control option {
    padding: 8px 12px;
    font-size: 14px;
}

.modal-form-control:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.18), 0 6px 16px rgba(139, 92, 246, 0.08);
    background: var(--bg-card, #ffffff);
}

.modal-form-control::placeholder {
    color: var(--text-muted, #9ca3af);
}

[data-theme="dark"] .modal-form-control {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.modal-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 0 20px;
}

.modal-step {
    display: flex;
    align-items: center;
    position: relative;
}

.modal-step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    border: 2px solid rgba(199, 210, 254, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    color: var(--text-tertiary, #94a3b8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-step.active .modal-step-number {
    background: linear-gradient(135deg, #a78bfa, #6366f1);
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 22px rgba(139, 92, 246, 0.45);
    transform: scale(1.08);
}

.modal-step.completed .modal-step-number {
    background: linear-gradient(135deg, #34d399, #059669);
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 22px rgba(52, 211, 153, 0.42);
}

.modal-step-title {
    margin-left: 12px;
    font-size: 14px;
    color: var(--text-tertiary, #9ca3af);
    font-weight: 500;
}

.modal-step.active .modal-step-title {
    color: var(--text-primary, #111827);
    font-weight: 700;
}

.modal-step-line {
    width: 60px;
    height: 3px;
    background: var(--border-glass, #e5e7eb);
    margin: 0 12px;
    border-radius: 2px;
}

.modal-step.completed .modal-step-line {
    background: var(--gradient-success);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.modal-image-preview {
    text-align: center;
}

.modal-image-container {
    width: 100%;
    max-width: 400px;
    height: 280px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 50%, var(--accent-pink) 100%);
    border-radius: var(--radius-xl);
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: white;
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
}

.modal-image-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.modal-image-info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: var(--bg-glass, #f3f4f6);
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--border-glass, #e5e7eb);
}

.modal-image-info-label {
    font-size: 12px;
    color: var(--text-tertiary, #9ca3af);
    font-weight: 500;
}

.modal-image-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.demo-modal-content {
    text-align: center;
    padding: 20px 0;
}

.demo-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    background: var(--modal-candy-lavender);
    color: #6d28d9;
    border: 4px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 32px rgba(167, 139, 250, 0.35), 0 0 0 6px rgba(237, 233, 254, 0.7);
    animation: iconPop 0.6s cubic-bezier(0.34, 1.55, 0.64, 1);
}

.modal-success .demo-modal-icon {
    background: var(--modal-candy-mint);
    color: #047857;
    box-shadow: 0 12px 32px rgba(52, 211, 153, 0.35), 0 0 0 6px rgba(209, 250, 229, 0.75);
}

.modal-warning .demo-modal-icon {
    background: var(--modal-candy-peach);
    color: #c2410c;
    box-shadow: 0 12px 32px rgba(251, 191, 36, 0.35), 0 0 0 6px rgba(254, 243, 199, 0.75);
}

.modal-error .demo-modal-icon {
    background: linear-gradient(145deg, #fecdd3 0%, #fda4af 50%, #fb7185 100%);
    color: #9f1239;
    box-shadow: 0 12px 32px rgba(251, 113, 133, 0.38), 0 0 0 6px rgba(254, 226, 226, 0.85);
}

.modal-info .demo-modal-icon {
    background: var(--modal-candy-sky);
    color: #1d4ed8;
    box-shadow: 0 12px 32px rgba(125, 211, 252, 0.38), 0 0 0 6px rgba(224, 242, 254, 0.85);
}

.demo-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 12px;
}

.demo-modal-text {
    font-size: 15px;
    color: var(--text-tertiary, #9ca3af);
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

.modal-fullscreen .modal-container {
    max-width: 90vw;
    width: 90vw;
    height: 85vh;
    max-height: 85vh;
    border-radius: 26px;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary, #ffffff);
    border: 1px solid rgba(199, 210, 254, 0.45);
    box-shadow: var(--modal-shadow-soft), 0 40px 80px rgba(99, 102, 241, 0.12);
}

.modal-fullscreen .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.fullscreen-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.fullscreen-content {
    text-align: center;
    padding: 60px 40px;
}

.fullscreen-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 50%, var(--accent-pink) 100%);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    margin: 0 auto 32px;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: fullscreenIconPulse 3s ease-in-out infinite;
}

@keyframes fullscreenIconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 20px 60px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 25px 70px rgba(139, 92, 246, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    }
}

.fullscreen-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 16px;
}

.fullscreen-text {
    font-size: 18px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.8;
    max-width: 500px;
    margin: 0 auto;
}

.fullscreen-close-btn {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: var(--radius-md) !important;
    background: var(--accent-red) !important;
    color: #fff !important;
    border: none !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    z-index: 10 !important;
}

.fullscreen-close-btn:hover {
    transform: scale(1.05);
    background: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.fullscreen-close-btn:active {
    transform: scale(0.98);
}

.loading-modal .modal-container {
    max-width: 280px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.93) 100%);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: var(--modal-radius);
    box-shadow: var(--modal-shadow-soft);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.loading-modal .modal-body {
    padding: 36px 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: transparent;
}

.loading-anime {
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-anime-ring {
    position: absolute;
    border: 3px solid transparent;
    border-top-color: #ff6b9d;
    border-radius: 50%;
    animation: animeSpin 2s linear infinite;
}

.loading-anime-ring:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 0;
    left: 0;
    border-top-color: #ff6b9d;
    border-right-color: #ff6b9d;
}

.loading-anime-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: #4ecdc4;
    border-left-color: #4ecdc4;
    animation: animeSpin 1.5s linear infinite reverse;
}

.loading-anime-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: #ffe66d;
    border-bottom-color: #ffe66d;
    animation: animeSpin 1s linear infinite;
}

.loading-anime-center {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 30px;
    left: 30px;
    background: linear-gradient(135deg, #ff6b9d, #4ecdc4);
    border-radius: 50%;
    animation: animePulse 1s ease-in-out infinite;
}

@keyframes animeSpin {
    to { transform: rotate(360deg); }
}

@keyframes animePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.8); opacity: 0.7; }
}

.loading-text {
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.loading-subtext {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-backdrop-tint);
    backdrop-filter: blur(var(--modal-backdrop-blur)) saturate(var(--modal-backdrop-saturate));
    -webkit-backdrop-filter: blur(var(--modal-backdrop-blur)) saturate(var(--modal-backdrop-saturate));
    z-index: var(--z-modal-backdrop);
    display: none;
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
}

.drawer {
    position: fixed;
    top: 0;
    width: 400px;
    max-width: 90%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 245, 255, 0.96) 50%, rgba(255, 255, 255, 0.98) 100%);
    border-right: 1px solid rgba(199, 210, 254, 0.45);
    box-shadow: 16px 0 48px rgba(139, 92, 246, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    border-radius: 0 24px 24px 0;
    transform: translateX(-100%);
    transition: transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1);
    z-index: var(--z-modal-drawer);
    display: flex;
    flex-direction: column;
}

.drawer-overlay.active .drawer {
    transform: translateX(0);
}

.drawer-left { left: 0; }

.drawer-right {
    right: 0;
    transform: translateX(100%);
    border-right: none;
    border-left: 1px solid rgba(199, 210, 254, 0.45);
    border-radius: 24px 0 0 24px;
    box-shadow: -16px 0 48px rgba(236, 72, 153, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

.drawer-overlay.active .drawer-right {
    transform: translateX(0);
}

.drawer-header {
    padding: 22px 24px;
    border-bottom: 1px solid rgba(199, 210, 254, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(250, 245, 255, 0.85), transparent);
}

.drawer-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary, #111827);
}

.drawer-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    font-size: 15px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.7;
}

.drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass, #e5e7eb);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    /* !important：覆盖旧版 modal.js 内联 z-index，保证任意弹窗开启时提示仍可见 */
    z-index: var(--z-toast) !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
    pointer-events: none;
    padding-top: 52px;
    box-sizing: border-box;
}

.toast-container .toast {
    pointer-events: auto;
}

.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 14px 16px;
    /* 默认 info：冷蓝灰底，各类型在下面覆盖 */
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 42%, #f5f3ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.38);
    border-radius: 18px;
    box-shadow:
        0 10px 32px rgba(37, 99, 235, 0.12),
        0 4px 14px rgba(59, 130, 246, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.88) inset;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseInfo 2.8s ease-in-out infinite;
    max-width: 400px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: visible;
}

.toast::after {
    content: '';
    position: absolute;
    top: -35%;
    right: -12%;
    width: 110px;
    height: 110px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 66%);
    pointer-events: none;
    z-index: 0;
}

.toast > * {
    position: relative;
    z-index: 1;
}

@keyframes toastPulseInfo {
    0%, 100% {
        box-shadow:
            0 10px 32px rgba(37, 99, 235, 0.12),
            0 4px 14px rgba(59, 130, 246, 0.1),
            0 0 0 1px rgba(255, 255, 255, 0.88) inset;
    }
    50% {
        box-shadow:
            0 14px 40px rgba(37, 99, 235, 0.18),
            0 6px 18px rgba(99, 102, 241, 0.14),
            0 0 0 1px rgba(255, 255, 255, 0.95) inset;
    }
}

@keyframes toastPulseSuccess {
    0%, 100% {
        box-shadow:
            0 10px 36px rgba(16, 185, 129, 0.22),
            0 4px 14px rgba(52, 211, 153, 0.14),
            0 0 0 1px rgba(255, 255, 255, 0.9) inset;
    }
    50% {
        box-shadow:
            0 16px 44px rgba(16, 185, 129, 0.3),
            0 6px 18px rgba(5, 150, 105, 0.16),
            0 0 0 1px rgba(255, 255, 255, 0.96) inset;
    }
}

@keyframes toastPulseWarning {
    0%, 100% {
        box-shadow:
            0 10px 34px rgba(245, 158, 11, 0.24),
            0 4px 14px rgba(251, 191, 36, 0.16),
            0 0 0 1px rgba(255, 255, 255, 0.9) inset;
    }
    50% {
        box-shadow:
            0 16px 42px rgba(245, 158, 11, 0.32),
            0 6px 18px rgba(217, 119, 6, 0.18),
            0 0 0 1px rgba(255, 255, 255, 0.96) inset;
    }
}

@keyframes toastPulseError {
    0%, 100% {
        box-shadow:
            0 10px 36px rgba(244, 63, 94, 0.22),
            0 4px 14px rgba(251, 113, 133, 0.16),
            0 0 0 1px rgba(255, 255, 255, 0.88) inset;
    }
    50% {
        box-shadow:
            0 16px 46px rgba(225, 29, 72, 0.28),
            0 6px 18px rgba(244, 63, 94, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.94) inset;
    }
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastBounceIn {
    from {
        transform: translateX(110%) rotate(2deg);
        opacity: 0;
    }
    70% {
        transform: translateX(-6px) rotate(-1deg);
        opacity: 1;
    }
    to {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(237, 233, 254, 0.85);
}

.toast-success .toast-icon {
    color: #059669;
    background: linear-gradient(145deg, #d1fae5, #a7f3d0);
}

.toast-warning .toast-icon {
    color: #d97706;
    background: linear-gradient(145deg, #fef3c7, #fde68a);
}

.toast-error .toast-icon {
    color: #e11d48;
    background: linear-gradient(145deg, #fecdd3, #fda4af);
}

.toast-info .toast-icon {
    color: #2563eb;
    background: linear-gradient(145deg, #dbeafe, #bae6fd);
}

.toast-icon svg {
    display: block;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
}

.toast-close {
    background: rgba(241, 245, 249, 0.9);
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 15px;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
    background: rgba(237, 233, 254, 0.95);
    transform: scale(1.06);
}

.toast-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 38%, #f0fdf4 100%);
    border-color: rgba(52, 211, 153, 0.65);
    color: #065f46;
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseSuccess 2.7s ease-in-out infinite;
}

.toast-success::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.28) 0%, transparent 65%);
}

.toast-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 40%, #fff7ed 100%);
    border-color: rgba(245, 158, 11, 0.65);
    color: #92400e;
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseWarning 2.7s ease-in-out infinite;
}

.toast-warning::after {
    background: radial-gradient(circle, rgba(251, 191, 36, 0.32) 0%, transparent 64%);
    top: -30%;
    right: -10%;
}

.toast-error {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 38%, #fdf2f8 100%);
    border-color: rgba(244, 63, 94, 0.55);
    color: #9f1239;
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseError 2.6s ease-in-out infinite;
}

.toast-error::after {
    background: radial-gradient(circle, rgba(244, 63, 94, 0.26) 0%, transparent 64%);
}

.toast-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 45%, #eef2ff 100%);
    border-color: rgba(59, 130, 246, 0.45);
    color: #1e3a8a;
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseInfo 2.8s ease-in-out infinite;
}

.toast-info::after {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 66%);
}

[data-theme="dark"] .toast {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .toast-success {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.55) 0%, rgba(15, 23, 42, 0.92) 55%, rgba(6, 78, 59, 0.35) 100%);
    border-color: rgba(52, 211, 153, 0.45);
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseSuccess 2.7s ease-in-out infinite;
}

[data-theme="dark"] .toast-warning {
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.45) 0%, rgba(15, 23, 42, 0.92) 50%, rgba(69, 26, 3, 0.3) 100%);
    border-color: rgba(251, 191, 36, 0.42);
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseWarning 2.7s ease-in-out infinite;
}

[data-theme="dark"] .toast-error {
    background: linear-gradient(135deg, rgba(136, 19, 55, 0.45) 0%, rgba(15, 23, 42, 0.94) 52%, rgba(76, 5, 25, 0.35) 100%);
    border-color: rgba(251, 113, 133, 0.45);
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseError 2.6s ease-in-out infinite;
}

[data-theme="dark"] .toast-info {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.42) 0%, rgba(15, 23, 42, 0.94) 52%, rgba(49, 46, 129, 0.32) 100%);
    border-color: rgba(96, 165, 250, 0.4);
    animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1), toastPulseInfo 2.8s ease-in-out infinite;
}

[data-theme="dark"] .ui-mascot-root {
    filter:
        drop-shadow(4px 10px 0 rgba(0, 0, 0, 0.35))
        drop-shadow(0 18px 32px rgba(0, 0, 0, 0.55))
        drop-shadow(0 6px 14px rgba(99, 102, 241, 0.25))
        brightness(1.1) saturate(1.08);
}

[data-theme="dark"] .ui-mascot-root--toast {
    filter:
        drop-shadow(3px 8px 0 rgba(0, 0, 0, 0.3))
        drop-shadow(0 14px 24px rgba(0, 0, 0, 0.5))
        brightness(1.08);
}

[data-theme="dark"] .drawer {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 16px 0 48px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .drawer-right {
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] {
    --modal-backdrop-tint: linear-gradient(165deg, rgba(0, 0, 0, 0.72) 0%, rgba(15, 23, 42, 0.55) 50%, rgba(0, 0, 0, 0.68) 100%);
    --modal-backdrop-blur: 32px;
    --modal-backdrop-saturate: 108%;
}

[data-theme="dark"] .modal-overlay {
    background: var(--modal-backdrop-tint);
}

[data-theme="dark"] .modal-container {
    background: rgba(30, 41, 59, 0.86);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.2),
        0 28px 56px -12px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    backdrop-filter: blur(28px) saturate(1.08);
    -webkit-backdrop-filter: blur(28px) saturate(1.08);
}

[data-theme="dark"] .modal-header {
    background: rgba(15, 23, 42, 0.55);
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .cr-dmodal,
[data-theme="dark"] .cr-rectify-modal {
    background: rgba(30, 41, 59, 0.86);
    border-color: rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(28px) saturate(1.08);
    -webkit-backdrop-filter: blur(28px) saturate(1.08);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.2),
        0 24px 48px -12px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

[data-theme="dark"] .loading-modal .modal-container {
    background: rgba(30, 41, 59, 0.86);
    border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .modal-footer {
    background: rgba(15, 23, 42, 0.58);
    border-top-color: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .drawer-overlay {
    background: var(--modal-backdrop-tint);
}

[data-theme="dark"] .modal-close {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-tertiary, #9ca3af);
}

[data-theme="dark"] .modal-close:hover {
    background: var(--gradient-danger);
    color: white;
}

[data-theme="dark"] .confirm-title,
[data-theme="dark"] .demo-modal-title {
    color: var(--text-primary, #e5e7eb);
}

[data-theme="dark"] .confirm-message,
[data-theme="dark"] .demo-modal-text {
    color: var(--text-tertiary, #9ca3af);
}

[data-theme="dark"] .modal-form-label {
    color: var(--text-secondary, #9ca3af);
}

[data-theme="dark"] .modal-image-info-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-glass);
}

[data-theme="dark"] .modal-image-info-value {
    color: var(--text-primary, #e5e7eb);
}

[data-theme="dark"] .modal-step-title {
    color: var(--text-tertiary, #9ca3af);
}

[data-theme="dark"] .modal-step.active .modal-step-title {
    color: var(--text-primary, #e5e7eb);
}

[data-theme="dark"] .modal-footer .btn-secondary,
[data-theme="dark"] .btn-modal-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary, #9ca3af);
    border-color: var(--border-glass);
}

[data-theme="dark"] .modal-footer .btn-secondary:hover,
[data-theme="dark"] .btn-modal-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #e5e7eb);
}

@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 16px 20px 12px;
    }

    .modal-body {
        padding: 20px;
        max-height: calc(90vh - 140px);
    }

    .modal-footer {
        padding: 12px 20px;
    }

    .modal-footer .btn,
    .btn-modal {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 80px;
    }

    .drawer {
        width: 85%;
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 78px 12px 22px;
    }

    .modal-container {
        width: 98%;
        border-radius: var(--radius-lg);
    }

    .ui-mascot-root {
        width: 104px;
        height: 62px;
        margin-top: -50px;
        left: -4px;
    }

    .cr-dmodal .ui-mascot-root,
    .cr-rectify-modal .ui-mascot-root {
        width: 100px;
        height: 60px;
        margin-top: -48px;
        left: -4px;
    }

    .ui-mascot-root--toast {
        width: 88px;
        height: 52px;
        margin-top: -46px;
        left: -3px;
    }

    .modal-title {
        font-size: 16px;
    }

    .modal-footer {
        flex-direction: row;
        gap: 12px;
    }

    .modal-footer .btn,
    .btn-modal {
        flex: 1;
        justify-content: center;
    }

    .confirm-icon-wrapper,
    .demo-modal-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
        border-radius: var(--radius-lg);
    }

    .confirm-title,
    .demo-modal-title {
        font-size: 18px;
    }

    .modal-steps {
        margin-bottom: 24px;
        padding: 0 10px;
    }

    .modal-step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .modal-step-title {
        font-size: 12px;
    }

    .modal-step-line {
        width: 30px;
    }

    .fullscreen-icon {
        width: 80px;
        height: 80px;
        font-size: 40px;
        border-radius: var(--radius-xl);
    }

    .fullscreen-title {
        font-size: 28px;
    }

    .fullscreen-text {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ui-mascot-root {
        animation: none !important;
        transform: perspective(400px) rotateY(-14deg) rotateX(7deg) translateZ(0);
    }

    .toast-container .toast {
        animation: toastBounceIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1) !important;
    }
}
