/* 新手引导系统样式 */

/* 遮罩层 */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    animation: tutorialFadeIn 0.3s ease-out;
    pointer-events: none; /* 默认不可点击，在需要时通过JS设置为auto */
}

@keyframes tutorialFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 高亮区域 */
.tutorial-highlight {
    position: fixed;
    border: 3px solid #FFD700;
    border-radius: 8px;
    box-shadow:
        0 0 0 4px rgba(255, 215, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.6),
        inset 0 0 20px rgba(255, 215, 0, 0.2);
    z-index: 10001;
    pointer-events: none;
    animation: tutorialPulse 1.5s ease-in-out infinite;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow:
            0 0 0 4px rgba(255, 215, 0, 0.3),
            0 0 20px rgba(255, 215, 0, 0.6),
            inset 0 0 20px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow:
            0 0 0 6px rgba(255, 215, 0, 0.5),
            0 0 30px rgba(255, 215, 0, 0.9),
            inset 0 0 30px rgba(255, 215, 0, 0.4);
    }
}

/* 提示框 */
.tutorial-tooltip {
    position: fixed;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    min-width: 320px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 215, 0, 0.2);
    z-index: 10002;
    pointer-events: auto; /* 提示框可以交互 */
    /* 移除动画，直接显示 */
}

/* 移除原有的 slideIn 动画 */
@keyframes tutorialSlideIn {
    from {
        opacity: 1;
    }
    to {
        opacity: 1;
    }
}

/* 进度指示器 */
.tutorial-progress {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.4);
}

/* 标题 */
.tutorial-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c4a45;
    margin-bottom: 16px;
    text-align: center;
    background: linear-gradient(135deg, #2c4a45 0%, #4a7872 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 内容 */
.tutorial-content {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.tutorial-content strong {
    color: #FF5722;
    font-weight: bold;
}

/* 特殊方块演示 */
.tutorial-special-demo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* 按钮组 */
.tutorial-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.tutorial-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.tutorial-btn-primary {
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.tutorial-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.tutorial-btn-secondary {
    background: linear-gradient(135deg, #90caf9 0%, #64b5f6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

.tutorial-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(100, 181, 246, 0.4);
}

.tutorial-btn-next {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.tutorial-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 172, 254, 0.4);
}

.tutorial-btn-skip {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    box-shadow: none;
}

.tutorial-btn-skip:hover {
    background: #f5f5f5;
    border-color: #999;
    transform: translateY(-1px);
}

.tutorial-btn:active {
    transform: translateY(0);
}

/* 箭头指示器（可选） */
.tutorial-arrow {
    position: fixed;
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 10001;
    animation: tutorialArrowBounce 1s ease-in-out infinite;
}

.tutorial-arrow-top {
    border-width: 0 15px 20px 15px;
    border-color: transparent transparent #FFD700 transparent;
}

.tutorial-arrow-bottom {
    border-width: 20px 15px 0 15px;
    border-color: #FFD700 transparent transparent transparent;
}

.tutorial-arrow-left {
    border-width: 15px 20px 15px 0;
    border-color: transparent #FFD700 transparent transparent;
}

.tutorial-arrow-right {
    border-width: 15px 0 15px 20px;
    border-color: transparent transparent transparent #FFD700;
}

@keyframes tutorialArrowBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tutorial-tooltip {
        max-width: 90%;
        min-width: 280px;
        padding: 20px;
    }

    .tutorial-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .tutorial-content {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .tutorial-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .tutorial-btn {
        width: 100%;
        padding: 10px 20px;
        font-size: 14px;
        min-width: auto;
    }

    .tutorial-progress {
        font-size: 11px;
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {
    .tutorial-tooltip {
        max-width: 95%;
        min-width: 260px;
        padding: 16px;
    }

    .tutorial-title {
        font-size: 18px;
    }

    .tutorial-content {
        font-size: 13px;
    }

    .tutorial-special-demo .special-block {
        width: 60px !important;
        height: 60px !important;
        font-size: 30px !important;
    }
}

/* 欢迎动画 */
.tutorial-welcome {
    animation: tutorialWelcome 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tutorialWelcome {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 完成动画 */
.tutorial-complete {
    animation: tutorialComplete 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tutorialComplete {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15) rotate(5deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 点击提示动画 */
.tutorial-click-hint {
    position: fixed;
    width: 60px;
    height: 60px;
    border: 3px solid #FFD700;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10003;
    animation: tutorialClickRipple 1.5s ease-out infinite;
}

@keyframes tutorialClickRipple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 交互演示高亮方块 */
.tutorial-demo-highlight {
    position: relative;
    z-index: 10002 !important;
    box-shadow: 0 0 0 4px #FFD700,
                0 0 20px rgba(255, 215, 0, 0.8),
                inset 0 0 20px rgba(255, 215, 0, 0.3) !important;
    animation: tutorialDemoGlow 1.2s ease-in-out infinite !important;
    border: 3px solid #FFD700 !important;
}

/* 教程中被禁用的方块 */
.tutorial-disabled {
    opacity: 0.3 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

@keyframes tutorialDemoGlow {
    0%, 100% {
        box-shadow: 0 0 0 4px #FFD700,
                    0 0 20px rgba(255, 215, 0, 0.8),
                    inset 0 0 20px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px #FFD700,
                    0 0 30px rgba(255, 215, 0, 1),
                    inset 0 0 30px rgba(255, 215, 0, 0.5);
        transform: scale(1.05);
    }
}
